Skip to content

Comparisons and Checks

Thomas Müller 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

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