Skip to content

Comparisons and Checks

anehrkor edited this page Jun 28, 2016 · 11 revisions

Compare general ROOT files

In order to comare the content of two ROOT files, you could use the Artus tool

compareRootFiles.py [-a] <file1.root> <file2.root>

CMSSW/Kappa Level

Look into EDM Files

CMSSW provides the tool

edmDumpEventContent <file.root>

to list the content of EDM files (e.g. AOD or miniAOD).

Comparing skims -- Synchronisation

We regularly synchronize our ntuples with those of other groups in order to make sure we are all talking about the same events and reconstructed objects when performing an analysis. To that end, a common set of variables is defined (e.g., here) and one particular MC sample is chosen (SUSYGluGluToHToTauTauM160). The ntuples produced from it are compared to those of other groups (stored e.g., here).

The config Sync13TeV.cfg and the ones included therein are designed to produce these sync ntuples using Artus.

Once the ntuple is produced, you can use the makePlots_syncPlots2.py script to produce the comparison plots. The script expects the path to the two ntuples you want to compare as well as the corresponding tree names. The option -e compares each variable on an event-by-event basis and produces entries for events common to both ntuples and for events existing only in either of the two. The synchronization should be performed preferably in all available channels. In case there are discrepancies between the ntuples you need to start investigating to understand the cause and fix any bugs found and/or let other groups know they may have a bug in their code.

Artus Level

Comparing Artus configurations

Artus configurations are JSON dictionaries. The can be either JSON files like the one that the Artus Wrapper constructs, the TObjString config in an Artus output file or just strings containing the content "{\"key" : \"value\"}". Every script in Artus, which takes a JSON configuration as input, accepts these three kinds of configurations.

Artus Configurations can be compared with the script

artusConfigDiff.py [-h]

To compare just two files, do

artusConfigDiff.py <output1.root> <output2.root>

Two pipelines in the same file are compared with

artusConfigDiff.py <output.root> <output.root> -1 <pipeline 1> -2 <pipeline 2>

The script outputs the differences in a way similar to diff, but it might be convenient to use the printed meld command to see the differences side-by-side.

Comparing code revisions used for Artus runs

Artus saves the current revisions of all important repositories into the configuration, which is also written to every ROOT output file. This way, it is clear, which code version has been used to result in a given output file (excluding local changes, which is also a motivation to commit changes before running Artus on a batch system).

Based on two Artus output files, you can retrieve the changes in the related code by doing

cd $CMSSW_BASE/src/<repository>
artusRepositoryDiff.py <output1.root> <output2.root>

The output is optimised for git and GitHub and will print both a git diff command and also a link to a GitHub page showing the differences.

HarryPlotter Level

Reproduce HarryPlotter plots

HarryPlotter saves the (full) JSON configuration, which is needed to reproduce a plot, together with the plot (file ending with .json in the same directory). The plot can be reproduced with

higgsplot.py -j <json config> [other options]

(In case no Higgs-related features have been used, you can also use harry.py instead of higgsplot.py.)

Clone this wiki locally