How to Rtrk Double Ratios


One way to asses systematic uncertainties of jet substructure variables is the Rtrk methodology. The following is a brief instruction for the steps necessary to produce double ratios that serve as input for the final estimate of these uncertainties.

Running over DxAODs

First Setup

Download the DeriveJMSR tool from git:

git clone ssh://

Setup the newest release:

cd rtrk
showVersions|grep AthAnalysisBase
lsetup 'rcsetup Base,2.4.19'

Compile everything:

rc find_packages
rc compile

Check that the GRL, the PRW config files and the lumicalc files are available in the data directory

Now you can run the code:

doJMSUncertainties OutputFolderName ConfigFiles/basicSettings.config inputFile.list [mode] [gridOutputName]

OutputFolderName: all histograms and root files with trees will be saved here
data/basicSettings.config : configFile containing e.g. the jet collections you want to run over and other variables you might want to set
inputFile.list: list with input files to run over e.g. /pnfs/
[mode]: default is "local", optional "grid"
[gridOutputName]: e.g. user.jdoe.my_run_p0001.root (see naming convention)

Available Variables

Moment xAOD Jet attribute names
N-subjettiness Tau1, Tau2, Tau3, Tau21, Tau32, Tau1_wta, Tau2_wta, Tau3_wta, Tau21_wta, Tau32_wta
kT splitting scale Split12, Split23, Split34
zCut ZCut12, ZCut23, ZCut34
Dipolarity Dip12, Dip13, Dip23, DipExcl12
Angularity Angularity
kT Delta R KtDR
kT Mass drop Mu12
Planar flow PlanarFlow
Energy correlations ECF1, ECF2, ECF3, C2, D2
Thrust ThrustMin, ThrustMaj
FoxWolfram FoxWolfram0, FoxWolfram1, FoxWolfram2, FoxWolfram3, FoxWolfram4
Sphericity Sphericity, Aplanarity
Shower deconstruction ShowerDeconstructionW, ShowerDeconstructionTop
In case you add other variables please do not use underscores.


ParameterSorted descending Explanation
TrackJetAlgos name of the track jet container
skipEvents Skips the first n events of a run. (only for debugging)
prwConfig Prefix to identify PRW config files.
Jets Type of the evaluated jet.
JetAlgos name of the calo jet container
ghost-matching If false track jets and calo jets are matched with the dR criterion.
dRCone The dR parameter that is used in case ghost-matching is set to false.
configDataPath Directory where all PRW config files, lumicalc files and the GRL are.
CalibSmallRConfig Config file for jet calibration of smallR jets that are used for cleaning only, since no jet cleaning was available for largeR jets at that time.
CalibJetConfig Config file for jet calibration of jets that are evaluated.
This should produce several .root files with a TTree. The Tree holds all activated variables for the leading and the sub leading jet with 5 prefixes c, t, tc1, tc2 and tc3.
These are referring to calo jet, track jet and the three variations that are applied to MC only.
tc1 covers the track reconstruction efficiency (global, PP0 and IBL), efficiency for dense environment and impact parameter resolution ( including dead modules).
tc2 covers the fake rate.
tc3 covers the sagitta bias. (negligible)


After you have retrieved your outputs. You will most likely need to merge it in order to have one .root file per sample and one for data.
In DeriveJMSR/ you should see a directory plotting/ with:, atlasStyleMacro.pyc,, functions.pyc,,,, and calls with the specified cuts. Usually you bin these double ratios in pT and m/pT. The binning in pT comes for free, while for each m/pT bin an additional output file is generated. produces for each variable a 2D histogram with the simple ratio X_Calo/X_Track. As well as some 1D histograms to check the continuity of the pT spectrum. merges the output of for the leading and sub leading jet if you run inclusive in m/pT. merges the output of for the leading and sub leading jet. calculates the mean of the simple ratio per bin and produces the 1D histograms as control plots and the 2D maps, that are used as input for the calculation of uncertainties.

To run everything:

lsetup root

( will take quite some time though.)


Choose if you like to run inclusive or binned in m/pT.
To set the normalization (sliceWeight_...) you need to look up the cross section and the filter efficiency on ami.
The product is then divided by the total number of processed events for JZXW samples or by the sum of weights for JZX samples.
To add another generator put it in types. You need to add it as well in QCD_weights and in files_dic to avoid key errors.
New Variables can be added in variables. Here you specify the axis of the 2D histograms separated by a colon. (y-axis:x-axis)
In bin_dic you specify the binning of these histograms (#bins x-axis, start, end, #bins y-axis, start, end)
The binning of the x-axis for histograms ending with /1e3 will be overwritten with values that are set in binLowE (bin edges).
In filDic you specify the input files. In m_pt_s you set the variables for which you would like produce maps.
With pt_mass_vectors_nBins you ensure that the inputs are filled in the right bins.
In variables you specify the variables for which you would like to see the control plots.
Other dictionaries specify layout and labeling of the plots.

This topic: Sandbox > TWikiUsers > AlexanderMelzer > AlexanderMelzerSandbox
Topic revision: r6 - 2016-10-26 - AlexanderMelzer
This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback