JetResponseAnalyzer

Breaking News

March 21st 2011: Starting from release V01-01-01, the flavor identififcation of references (GenJets) has been changed to the procedure employed e.g. by PAT. The flavor is now assigned using the standard tools based on the algorithm-definition.

March 14th 2011: With the release of version V01-00-00 of JetMETAnalysis/JetAnalyzers, JRA does not support the doHistos mode anymore, meaning that the CMSSW plugin will always create a tree which can then be transformed into histograms using the tools documented on this page. The assumption is that nobody was doing anything else ever before anyway. The documentation below was adjusted accordingly, expect for places which were overlooked, please report, thanks.

Overview

JetResponseAnalyzer is a CMSSW framework analyzer module which records the information necessary for jet response and resolution measurements based on matching (to MC truth information) or balancing (applicable to data, e.g. Z+jet). The information is saved in a ROOT tree, and can later be turned into a set of histograms using the jet_response_analyzer_x standalone program. JetResponseAnalyzer and all related tools can be found in the CVS package JetMETAnalysis/JetAnalyzers (ChangeLog). Many of the provided tools rely on additional utilities provided by JetMETAnalysis/JetUtilities (ChangeLog). All related tools and utilities are described in this TWIKI.

Install & Run

Besides the standard installation using scram, the parts necessary to run the executables (in JetMETAnalysis/JetAnalyzers/bin) to evaluate the output of the analyzer can also be compiled standalone on any PC or Mac with a ROOT installation.

Standard

The standard way to build the plugins, libraries, and executable programs provided by JetMETAnalysis/JetAnalyzers and JetMETAnalysis/JetUtilities is using scram, which was last tested to work with CMSSW_3_8_7, CMSSW_3_9_8_patch2, CMSSW_3_11_3 and CMSSW_4_2_1_patch1:

setenv SCRAM_ARCH slc5_amd64_gcc434
cmsrel CMSSW_3_11_3 # or cmsrel CMSSW_4_1_2_patch1
cd CMSSW_3_11_3/src
cmsenv
cvs co -r V00-09-01 JetMETAnalysis/JetUtilities
cvs co -r V01-01-01 JetMETAnalysis/JetAnalyzers
scram b -j4

cmsrel CMSSW_3_8_7 # or cmsrel CMSSW_3_9_8_patch2
cd CMSSW_3_8_7/src
cmsenv
cvs co -r V00-08-08    JetMETAnalysis/JetUtilities
cvs co -r V00-11-01    JetMETAnalysis/JetAnalyzers
# THE FOLLOWING TAGS ARE NEEDED ONLY TO RUN TAU ALGORITHMS
# (TAU INTEGRATION KINDLY CONTRIBUTED BY MATTHIAS EDELHOFF)
cvs co -r V01-00-01 DataFormats/TauReco
cvs co -r V01-00-11 RecoTauTag/Configuration
cvs co -r V01-00-19 RecoTauTag/RecoTau
cvs co -r V01-00-03 RecoTauTag/TauTagTools
scram b -j4

To test your installation, run the standard configuration to produce and trees respectively, than create another file with histograms using jet_response_analyzer_x, then inspect for both the relative response as a function of reference (GenJet) pT:

# run CMSSW job to create one tree per algorithm (NOTE: adjust global tag appropriately!!)
cmsRun JetMETAnalysis/JetAnalyzers/test/run_JRA_cfg.py

# make histograms from trees
jet_response_analyzer_x JetMETAnalysis/JetAnalyzers/config/jra_dr.config -input JRA.root

# inspect histograms created with jet_response_analyzer_x
jet_inspect_histos_x -input jra.root

Standalone

Many of the tools to analyze the output of the JetResponseAnalyzer module - a ROOT file containing a tree for each analyzed jet collection - do not depend on CMSSW but only on ROOT. It is therefore possible to install, compile, and run the executable applications on any PC or Mac with a current ROOT installation (without CMSSW or SCRAM installed):

cd /path/to/work
mkdir STANDALONE; cd STANDALONE
setenv STANDALONE_DIR ${PWD}
setenv ROOTSYS /path/to/your/root
setenv PATH $ROOTSYS/bin:$STANDALONE_DIR/bin:${PATH}
setenv LD_LIBRARY_PATH $ROOTSYS/lib:$STANDALONE_DIR/lib
setenv CVSROOT user@cmscvs.cern.ch:/cvs_server/repositories/CMSSW
# these tags should be the same as above under 'Standard', if not I probably forgot to adjust
cvs co -r V00-13-00 -d JetAnalyzers CMSSW/JetMETAnalysis/JetAnalyzers
cvs co -r V01-01-01 -d JetUtilities CMSSW/JetMETAnalysis/JetUtilities
cd JetUtilities; make; cd ..
cd JetAnalyzers; make; cd ..
rehash
jet_inspect_histos_x -input /path/to/jra.root

Configuration

Note that all of the details described below are handled by the addAlgorithm.py function, see test/run_JRA_cfg.py for the one line (!) necessary to add a specific algorithm, corrected to a specific level, to your configuration.

To configure the JetResponseAnalyzer, you need to pick the input references and the input match-map associating these references with jets. You can run the analyzer in matching mode, requiring several references to be matched according to a deltaR requirement to several jets, or in balancing mode, requiring one reference per event to be back-to-back to one jet. The matching maps need to be constructed accordingly, and the respective mode is chosen by either providing the parameter deltaRMax (matching) or deltaPhiMin (balancing). The maps can be created with the plugins MatchRecToGen (matching) and MatchBackToBack (balancing) in the JetMETAnalysis/JetUtilities package.

The flag doFlavor allows you to steer whether flavor should be considered. Some options only need to be provided if other parameters are set, see below.

Setting Configuration Options for JetResponseAnalyzer Modules

JetMETAnalysis/JetAnalyzers/python provides an example configuration, run_JRA_cfg.py, which reads RelVal files from castor at CERN, so it can be run out-of-the box e.g. on lxplus.

You override individual options towards the top of the run_JRA_cfg.py configuration file, these changes will then apply to all JRA configurations added below! Example:

Defaults.JetResponseParameters.doFlavor = False

will disable the parton matching.

The following table documents all available configuration options and their relations:

Parameter Type Description
srcRef InputTag Input collection containing the reference objects. Anything compatible with edm::View< reco::Candidate>.
srcRefToJetMap InputTag Match map associating references to jets. It is up to the plugin creating this map how references are associated to jets: by matching or back-to-back balancing. For balancing, the map must only contain one entry per event, otherwise the event is skipped.
nRefMax uint32 By default (nRefMax=0), all references which are associated to jets via the map are considered. For nRefMax>0, only the nRefMax highest pT references are considered.
deltaRMax double Maximum deltaR separation of reference-jet pairs to be considered matched. Provide this parameter only for MATCHING mode, don't provide deltaPhiMin!
deltaPhiMin double Minimum deltaPhi separation of the reference-jet pair to be considered back-to-back. Provide this parameter only for BALANCING mode, don't provide deltaRMax
etaBarrelMin double Minimum eta for the barrel (central) calorimeter. Provide only if doHistos=true!
etaBarrelMax double Maximum eta for the barrel (central) calorimeter. Provide only if doHistos=true!
doFlavor bool Identify the flavor of references and create and additional set of histograms for uds, c, b, g each. Add refpdgid branch to the tree.
srcRefToPartonMap InputTag By omitting / providing this parameter, the pdgId of the reference itself / the pdgId of the object (parton) associated with the reference via this map are considered to determine the reference flavor. Only provide if doFlavor=true!
deltaRPartonMax double Maximum separation in deltaR between the reference and the associated parton to consider the flavor of the reference. Only provide if doFlavor=true AND srcRefToPartonMap is specified!
doJetPt bool Distributions are only recorded in bins of pT(jet) if set to true.
doRefPt bool Distributions are only recorded in bins of pT(reference) if set to true.

Adding Several Jet Definitions to your Configuration

You can add different jet definitions (e.g. different jet algorithms like AntiKt or kT, different reco types like CaloJets or PFJets, different jet correction levels like L2Absolute or L3Relative, etc.) by adding the line

addAlgorithm(process,'JETDEF',doReco)

to your configuration file, as demonstrated in test/run_JRA_cfg.py. 'doReco' is a boolean flag and indicates whether you would like to reconstruct (Gen)Jets yourself (True) or take them from the input file provided (False). It is recommended to set this to True, since e.g. PF particles will be appropriately preselected for PFJet reconstruction and MC particles will be appropriately filtered for e.g. neutrinos for GenJet reconstruction. If you want JPT jets, you have to provide True. The JETDEF string should be of the form AlgSizeType[Jec], where the following values are currently supported (perhaps not in all combinations):

  • Alg: ak (AntiKt), sc (SISCone), kt (kT), ca (Cambridge/Aachen), ic (IterativeCone)
  • Size: 4, 5, 6, 7
  • Type: calo, pf, jpt, trk, tau
  • Jec: l1, l2l3, l1l2l3

addAlgorithm.py will create the entire sequence (and the corresponding path) for each algorithm and add it to the process. You can inspect this sequence as follows (assuming that ak5calo is one of the jet definitions in your configuration):

python -i run_JRA_cfg.py
>>> process.ak5caloSequence

You can inspect every single component and its configuration that way using the python command line (don't forget to prepend process. every time!)

Output

JetResponseAnalyzer uses TFileService to output a ROOT tree per algorithm. The name of the directory is the name of the module, e.g. 'ak5pfl2l3'.

The branches of the TTree defined by JetResponseAnalyzer are sufficient to create all necessary response histograms (using the tools described below) and are given in the following table:

Branch Definition Type Description Requirement
npus NEW &npus_ vector‹int› true number of admixed PU events only for MC
bxns NEW &bxns_ vector‹int› bunch crossing numbers only for MC
sumpt_lowpt NEW &sumpt_lowpt_ vector‹float› pileup pt sum with a lower pt threshold only for MC
sumpt_highpt NEW &sumpt_highpt_ vector‹float› pileup pt sum with a higher pt threshold only for MC
ntrks_lowpt NEW &ntrks_lowpt_ vector‹float› number of tracks with a lower pt threshold only for MC
ntrks_highpt NEW &ntrks_highpt_ vector‹float› number of tracks with a higher pt threshold only for MC
rho NEW rho/F float event rho -
weight weight/F float individual event weight only for MC
pthat pthat/F float pThat from MC only for MC
nref nref/b unsigned char Number of reference-jet pairs -
refrank refrank[nref]/b unsigned char[] rank of the reference -
refpdgid refpdgid[nref]/I int[] particle id of the reference doFlavor=true
refe refe[nref]/F float[] reference energy -
refpt refpt[nref]/F float[] reference pT -
refeta refeta[nref]/F float[] reference pseudo-rapidity eta -
refphi refphi[nref]/F float[] reference azimuth phi -
refy refy[nref]/F float[] reference rapidity y -
refdphijt refdphijt[nref]/F float[] deltaPhi(reference,jet) balancing mode (deltaPhiMin provided)
refdrjt refdrjt[nref]/F float[] deltaR(reference,jet) matching mode (deltaRMax provided)
jte jte[nref]/F float[] jet energy -
jtpt jtpt[nref]/F float[] jet pT -
jteta jteta[nref]/F float[] jet pseudo-rapidty eta -
jtphi jtphi[nref]/F float[] jet azimuth phi -
jty jty[nref]/F float[] jet rapidity y -
jtjec NEW jtjec[nref]/F float[] jet energy correction factor -
jtemf NEW jtemf[nref]/F float[] electromagnetic energy fraction only for CaloJets and doComposition=True
jtchf NEW jtchf[nref]/F float[] charged hadron energy fraction only for PFJets and doComposition=True
jtnhf NEW jtnhf[nref]/F float[] neutral hadron energy fraction only for PFJets and doComposition=True
jtnef NEW jtnef[nref]/F float[] photon energy fraction only for PFJets and doComposition=True
jtcef NEW jtcef[nref]/F float[] electron energy fraction only for PFJets and doComposition=True
jtmuf NEW jtmuf[nref]/F float[] muon energy fraction only for PFJets and doComposition=True
jthfhf NEW jthfhf[nref]/F float[] HF hadronic energy fraction only for PFJets and doComposition=True
jthfef NEW jthfef[nref]/F float[] HF electromagnetic energy fraction only for PFJets and doComposition=True

Tools to evaluate JetResponseAnalyzer output

Information about the provided executables can also be found in the README file in JetMETAnalysis/JetAnalyzers/bin.

Configuration

NEW The elements passed to a vector-type parameter must be separated by blanks, not commas!

All of the following tools use the CommandLine utility (JetMETAnalysis/JetUtilities) to be configured. All declared parameters can be passed via the command line via tool_x -param value. Values in a vector must be separated by blanks: tool_x -vector 10 20 30. Parameters can also be declared in a configuration file, which must then be passed to the tool as the first parameter: tool_x params.config where params.config could look like this:

$ comment
param = value $ another comment
str = "This is a string with blanks in it" $ that wasn't so hard
vector = 10 20 30 $ no reason why this couldn't go on for lines and lines
40 50 60
Additional parameters can be passed via the command line, if they appear in the file, the value passed via the command-line will overwrite the value in the file:
tool_x params.config -input file.root -param othervalue

jet_response_analyzer_x

The jet_response_analyzer_x executable takes trees produced with JetResponseAnalyzer as input and creates a set of response histograms. This allows you to only later decide on exact cuts or binning parameters. All other tools are based on histograms.

The following table summarizes the available options and their defaults. If a parameter has no default, it is mandatory.

Parameter Type Default Description
input string   Name of the input file, containing a directory for each algorithm with a tree in it
binspt vector<float> "" pT bin boundaries
binseta vector<float> "" eta bin boundaries
binsphi vector<float> "" phi bin boundaries
treename string "t" name of the ROOT tree
xsection float 0.0 if set >0.0, histogram entries will be filled with weight xsection/tree->GetEntries()
useweight bool true per-event weight from tree (branch: 'weight') will be considered unless xsection>0.0 (or branch not found)
output string "jra.root" Name of the output file, containing a directory for each algorithm with histograms in it
nrefmax int 0 if not set to 0, only the leading nrefmax references are considered
nbinspt int 50 number of bins for pT distributions
nbinseta int 25 number of bins for eta distributions
nbinsphi int 25 number of bins for phi distributions
etabarrelmin float -1.3 minimum eta for barrel (central) calorimeters
etabarrelmax float +1.3 maximum eta for barrel (central) calorimeters
dobalance bool false flag indicating balancing / matching mode
doflavor bool false flag indicating if additional histograms should be booked/filled for references with flavor uds/c/b/g
drmax float 0.3 deltaR(ref,jet) requirement in matching mode
dphimin float 2.7 deltaPhi(ref,jet) requirement in balancing mode
dojetpt bool false flag indicating if histograms related to pT(jet) are booked/filled
dorefpt bool true flag indicating if histograms related to pT(ref) are booked/filled
nbinsrelrsp int 50 number of bins for relative response (pT(jet)/pT(ref)) distributions
relrspmin float 0.0 xmin for relative response distributions
relrspmax float 2.0 xmax for relative response distributions
nbinsabsrsp int 150 number of bins for absolute response (pT(jet)-pT(ref)) distributions
absrspmin float -400.0 xmin for absolute response distributions
absrspmax float 150.0 xmax for absolute response distributions
nbinsetarsp int 100 number of bins for eta response (abs(eta(jet))-abs(eta(ref))) distributions
etarspmin float -1.0 xmin for eta response distributions
etarspmax float 1.0 xmax for eta response distributions
nbinsphirsp int 100 number of bins for phi response (phi(jet)-phi(ref)) distributions
phirspmin float -1.0 xmin for phi response distributions
phirspmax float 1.0 xmax for phi response distributions
algs vstring "" list of algorithms to consider ("" -> all)
presel vstring "" list of preselection cuts to print
itlow int 0 minimum number of in-time pileup collisions (per event)
ithigh int 1000 maximum number of in-time pileup collisions (per event)
earlyootlow int 0 minimum number of out-of-time pileup collisions occurring before the current event (per event)
earlyoothigh int 1000 maximum number of out-of-time pileup collisions occurring before the current event (per event)
lateootlow int 0 minimum number of out-of-time pileup collisions occurring after the current event (per event)
lateoothgih int 1000 maximum number of out-of-time pileup collisions occurring after the current event (per event)
totalootlow int 0 minimum number of out-of-time pileup collisions occurring before and after the current event (per event)
totaloothigh int 1000 maximum number of out-of-time pileup collisions occurring before and after the current event (per event)
weightfile string "" filename containing a histogram of weights to be applied to each distribution

Examples: (jra.config and fine_binning.config are provided in JetMETAnalysis/JetAnalyzers/config)

jet_response_analyzer -input JRA.root -binspt 10 20 30 50 100 -binseta -2 -1 0 1 2
jet_response_analyzer fine_binning.config -input JRA.root
jet_response_analyzer jra.config -input JRA.root -doflavor true -algs kt4calo kt6calo -output jra_ktcalo_flv.root 

jet_response_fitter_x

This application processes the histograms produced with either JetResponseAnalyzer or jet_response_analyzer_x, finds the ones which contain (absolute or relative) response, and uses an iterative procedure to fit a Gaussian to it. The histograms are stored together with the fitted functions in the output file. If the NDF comes out to be less or equal to five in the fit, no function is stored, and downstream algorithms are expected to consider mean and rms instead of the Gaussian fit parameters. These are the available options:

Parameter Type Default Description
input string   name of the ROOT input file, one directory per algorithm
output string "input_f.root" name of the ROOT output file, one directory per algorithm
nsigma double 1.5 the fit range for each fit iteration is chosen to be mean +/- nsigma * sigma
jtptmin float 1.0 minimum jet pt for fits
niter int 3 number of fit iterations. In each iteration, the result from the last fit are used as seeds. Mean/rms from the histo are used as seeds in the first iteration.
ndfmin int 5 minimum ndf required for the fits
algs vstring   list of algorithms to be fitted. Per default, all algorithms found in the file are fitted.
verbose int 0 the program will print more information to the screen if verbose>0
fittype int 0 type of fit to perform. 0 for Gaussian and 1 for DSCB.

Examples:

jet_response_fitter_x -input jra.root

jet_response_and_resolution_x

this application evaluates the response histograms for each algorithms over several bins of the specified list of variables and produces graphs, written to a ROOT file with the same directory structure as the input file (one directory per algorithm). It also fits the graphs if they correspond to resolutions. Useful variables are RelRsp, AbsRsp, EtaRsp, and PhiRsp. The following table summarizes all application parameters:

Parameter Type Default Description
input string   name of the ROOT input file, one directory per algorithm
output string "input_g.root" name of the output ROOT file, one directory per algorithm
dorelrsp bool true indicate wether relative response distributions are to be turned into graphs
doabsrsp bool false indicate wether absolute response distributions are to be turned into graphs
doetarsp bool false indicate wether eta response distributions are to be turned into graphs
dophirsp bool false indicate wether phi response distributions are to be turned into graphs
flavors vstring - indicate wether dedicated graphs for flavors are requested. Possible values: all, uds, c, b, g, slc, slb
algs vstring   list of algorithms to be considered. By default, all algorithms found in the input file are considered
fitres bool true Specify wether or not the resolution graph(s) should be fitted (with a function which is probably suited for the resolution as a function of pT only)

If e.g. dorelrsp is true, graphs RelRspVsRefPt, RelRspVsJetEta, RelRspVsJetPhi, RelRspVsRefPt_JetEta*, RelRspVsJetEta_RefPt* will be created for each algorithm. You need to know this naming convention in order to look at them using jet_inspect_graphs_x (see above), for which you need to set its variables parameter accordingly!

Examples:

jet_response_and_resolution_x -input JRAh.root

jet_mass_analyzer_x

This tool allows to easily create mass distributions based on the particle pdgids of the mass resonance decay products. The tool accepts the following parameters:

Parameter Type Default Description
input string   input ROOT file, containg JRA tree(s)
particle string "Z" name of the mass resonance (for x-axis labeling, might be auto-adjusted depending on 'legs' parameter below!)
output string "jma.root" name of the output root file containing the created histograms
useweight bool false wether to use (individual event) weights or not
xsection float 0.0 if >0.0, each (!) event will be weighted by xsecion / number of events
drmax float 0.3 maximum DeltaR between reference and jet
nbinsmass int 50 number of bins for mass histograms
massmin float 50.0 minimum x-value for mass histograms (might be auto-adjusted depending on 'legs' parameter below!)
massmax float 150.0 maximum x-value for mass histograms (might be auto-adjusted depending on 'legs' parameter below!)
jtptmin float 1.0 minimum jet pT
algs vstring "" algorithms (= directory names within ROOT file) to be considered ("" means all)
legs vstring "5:-5" pdgids of mass resonance decay products (see below)

The key to the tool is the legs parameter: if you e.g. provide "5:-5", it will in each event look for two references, one with pdgid -5 and one with pdgid +5. If both are found, the mass of the sum of the corresponding reference and jet four vectors wil be entered in the reference ("RefMass") and jet ("JetMass") mass histograms respectively. several leg configurations can be provided, e.g. "1:-2,3:-4" in order to catch the corresponding W decays (the charge conjugates are taken into account automatically). There are some predefined string values which you can provide instead, the pdgids are then going to be filled in automatically. Currently these values are: "zbb", "zbb_oneslb", "zbb_bothslb", "wqq", "tbqq", "tbqq_nosl", "tbqq_slb".

jet_inspect_profiles_x

Make profiles with this tool, e.g. of the response vs eta/pT. Useful for quick closure tests. You can supply different inputs, algorithms, and/or selections. E.g. you can compare different samples, different algorithms, or different kinematic regions. The complete list of parameters is the following:

Parameter Type Default Description
inputs vstring   list of ROOT input files
algs vstring "ak5pf" list of algorithms (e.g. 'ak5jptl2l3')
selections vstring "" list of selections (e.g. 'refpt>20.')
varexpr string "jtpt/refpt:jteta" variable expression describing 2D histo grom which profile is derived.
treename string "t" name of the ROOT tree.
nbinsx int 50 number of bins in x.
xmin double -5.0 minimum value on x-axis.
xmax double 5.0 maximum value on x-axis.
nbinsy int 50 number of bins in y.
ymin double 0.0 minimum value on y-axis.
ymax double 1.2 maximum value on y-axis.
logx bool false whether the x-axis should be displayed in log scale.
logy bool false whether the y-axis should be displayed in log scale.
xtitle string "jet #eta" x-axis title
ytitle string "p_{T}/p_{T}^{REF}" y-axis title
colors vint "" line colors for each of the profiles.
labels vstring "" legend labels for each of the profiles.
hlines vstring "" where to draw horizontal lines, specify [:], e.g. "1.01:2"
output = string= "profile" name of canvas / output file(s).
batch bool 0 execute in batch mode (no graphics are being displayed, but plot files are created)
formats vstring - indicate for which formats (ps, eps, pdf, png, jpg) each canvas should be saved. (if empty and batch is true, add pdf automatically!)

Examples:

jet_inspect_profiles_x -inputs JRA.root
jet_inspect_profiles_x -inputs JRA.root -selections "refpt>20.&&refpt<50." "refpt>100.&refpt<300." -labels "20<p_{T}<50" "100<p_{T}<300"
jet_inspect_profiles_x config/jip_vseta.config config/jip_ptrsp.config -inputs JRA.root

jet_inspect_histos_x

This simple yet powerful tool allows you to plot histograms created by jet_response_analyzer_x or jet_mass_analyzer_x. The response for different files & algorithms can also be compared (will look good for maximum two though!). The options are summarized in the following table:

Parameter Type Default Description
inputs vstring   list of ROOT input files
algs vstring "ktcalo" list of algorithms
variables vstring "AbsRsp:RefPt" variables to be plotted, in the format quantity:var1[:...[:varN]]
npercanvas int 0 number of histograms per canvas, 0=all
norm bool 0 normalize all histograms to 1.0 if set to true
mean bool 0 draw a line for the histogram mean if set to true
median bool 0 draw a line for the histogram median if set to true
peak bool 0 draw a line for the histogram fit peak if set to true (and if the histogram has been fit)
logx bool 0 display x-axis logarithmically if set to true
logy bool 0 display y-axis logarithmically if set to true
prefix string "" prefix for the canvas / created plot file (constructed automatically if "")
batch bool 0 execute in batch mode (no graphics are being displayed, but plot files are created!)
formats vstring - indicate for which formats (ps, eps, pdf, png, jpg) each canvas should be saved. (if empty and batch is true, add pdf automatically!)

Examples:

jet_inspect_histos_x -inputs JRAh.root
jet_inspect_histos_x -inputs jra.root -algs sc5pf
jet_inspect_histos_x -inputs JRAh.root -variables "RelRsp:JetPt"
jet_inspect_histos_x -inputs JRAh.root -variables "RelRsp:JetEta:RefPt" -npercanvas 9

jet_inspect_graphs_x

The tool allows you to plot graphs created by jet_response_and_resolution_x (actually, any application which is conform with the expected naming convention of the TGraphError objects!). The options are summarized in the following table:

Parameter Type Default Description
inputs vstring   list of ROOT input files
algs vstring "ak5calo" list of algorithms
variables vstring "RelRspVsRefPt" variables to be plotted, in the format quantityVsVar1[:...[:VarN]]
labels vstring - Provide legend labels (constructed automatically if empty)
text string "" place text somwhere in the pad, format: "[x:y:]text"
logx bool 0 display x-axis logarithmically if set to true
logy bool 0 display y-axis logarithmically if set to true
ymin float -1.0 y-axis minimum if larger than 0.0, 0.0/0.01 otherwise, based on logy=false/true
ymax float -1.0 y-axis maximum if larger than 0.0, as determined by ROOT otherwise
nocolor bool false request plots to be drawn in black and white only (with adjusted marker styles)
overlay bool true indicate wether all graphs should be overlayed (default) or if each should be drawn in its own pad
prefix string "" prefix for the canvas / created plot file (constructed automatically if "")
batch bool 0 execute in batch mode (no graphics are being displayed, but plot files are created!)
formats vstring - indicate for which formats (ps, eps, pdf, png, jpg) each canvas should be saved. (if empty and batch is true, add pdf automatically!)

Examples:

jet_inspect_graphs_x -inputs JRA_g.root -algs sc5pf sc5calo
jet_inspect_graphs_x -inputs JRA_f_g.root -algs sc5pf sc7pf
jet_inspect_graphs_x -inputs JRA_g.root,JRA_fastsim_g.root -algs ak5pf -variables AbsRspVsRefPt:JetEta@0
jet_inspect_graphs_x -inputs JRA_f_g.root -variables RelRspVsRefPt:JetEta@0 RelRsVsRefPt:JetEta@2

jet_weighted_spectrum_x

In case you deal with several samples which need to be properly weighted in order to correspond to the same integrated luminosity, this tool provides a quick and simple check of the weights you are using: it plots the combined pT spectrum of all reference jets before and after taking the weights into account. Each sample needs to be provided as part of a list, where each element has the format sample:weight, with filename=sample+".root".

Parameter Type Default Description
inputs vstring   list of samples WITH weights, in the format sample:weight. The sample is the name of the file, without ".root" at the end.
datapath string "" path to the files referenced via the inputs parameter.
algorithm string "ktcalo" name of the algorithm
logx bool false log-scale for the x-axis
logy bool true log-scale for the y-axis
batch bool false Run the program in batch mode: no graphics to the screen, makes most sense if plots are saved via formats parameter.
formats vstring "" List of formats in which each plot should be saved. example: pdf,gif,png

Examples:

jet_weighted_spectrum_x config/weighted_spectrum.config
jet_weighted_spectrum_x -datapath /path/to/my/files -inputs QCD0to15:10e10 QCD15to20:10E09 QCD20to30:10E08 

jet_l3_correction_x

this application processes the response histograms created as described above and computes the absolute (l3) response (vs refpt) and correction (vs jetpt) in the 'barrel'. barrel hereby refers to the central eta region as configured in jet_response_analyzer_x. The resulting graphs and fits are stored in an output file, and the parameters of the response fit are stored in a text file. The application parameters are:

Parameter Type Default Description
input string   name of the ROOT input file, one directory per algorithm
era string   prefix for the output text file names (e.g. Jec11_V11 for Jec11_V11_L3Absolute_AK5Calo.txt)
output string "l3.root" name of the output ROOT file, one directory per algorithm
formats vstring   specify a list of formats (e.g. pdf,jpg) to create one file per canvas and format
algs vstring   list of algorithms to be considered. By default, all algorithms found in the input file are considered
logx bool false Specify that all grapsh/histograms be displayed with logarithmic x axis
logy bool false Specify that all grapsh/histograms be displayed with logarithmic y axis
batch bool false Running in batch mode means that no plots are displayed on the screen, while all root and graphic files are still being produced.
flavor string   Specifies which flavor (if any) to examine from the input file (only one flavor can be specified)
tpeak int 1 Specifies how the program chooses the peak of the histogram (1=fit mean, 2=average of the fit and histogram means, other=histogram mean)

Examples:

jet_l3_correction_x -input jra.root

jet_l2_correction_x

this application calculates the relative energy correction (w.r.t. the barrel) as a function of jetpt in each etabin, and produces a text file with the results (parameters of the fits in each etabin). Needs the absolute response in the barrel as additional input, see above! (NOTE: This program can now derive the L2 and L3 corrections in one step.)

Parameter Type Default Description
input string   name of the ROOT input file, one directory per algorithm
era string   prefix for the output text file names (e.g. Jec11_V11 for Jec11_V11_L2Relative_AK5Calo.txt)
l3input string "l3.root" name of the file containing the absolute response in the barrel (central) of the detector, see above.
output string "l2.root" name of the output ROOT file, one directory per algorithm
outputDir TString "./" path to the directory where the output files will be located
formats vstring   specify a list of formats (e.g. pdf,jpg) to create one file per canvas and format
algs vstring   list of algorithms to be considered. By default, all algorithms found in the input file are considered
batch bool false Running in batch mode means that no plots are displayed on the screen, while all root and graphic files are still being produced.
l2l3 bool false if set to true, the option tells the program to derive the L2Relative and L3Absolute corrections together in one step, making the L3Absolute corrections unnecessary
mpv bool false if false, the program uses the mean from the input histograms, rather than the mean of the fits, for the relative responses

Examples:

jet_l2_correction_x -input jra_f.root

jet_l5_correction_x

input string   name of the ROOT input file, one directory per algorithm
output string "l5.root" name of the output ROOT file, one directory per algorithm
outputDir TString "./" path to the directory where the output files will be located
algs vstring   list of algorithms to be considered. By default, all algorithms found in the input file are considered
batch bool false Running in batch mode means that no plots are displayed on the screen, while all root and graphic files are still being produced.
flavors vTString   list of flavors to be considered. By default all of the flavors found in the input file are considered
era string   prefix for the output text file names (e.g. Jec11_V11 for Jec11_V11_L5Flavor_qJ_AK5Calo.txt)
mpv bool false if false, the program uses the mean from the input histograms, rather than the mean of the fits, for the relative responses

Examples:

jet_l5_correction_x -input jra_f.root -era Jec11_V11

jet_apply_jec_x

This tool allows you to apply a set of jet energy corrections (JEC) in situ, without reprocessing the dataset. Every uncorrected jet collection in the input tree(s) will be corrected according to the levels parameter, while corrected jet collections will be skipped. The location of the text files specifying the JEC parameters can be passed via the jecpath option. If this parameter is not specified, the path is assumed to be $CMSSW_BASE/src/CondFormats/JetMETObjects/data. If that directory does not exist it is assumed to be $CMSSW_RELEASE_BASE/src/CondFormats/JetMETObjects/data. If that path doesn't exist either, the program will abort.

Parameter Type Default Description
input string   name of the ROOT input file, one directory per algorithm
era string   name of the JEC era (prefix of the paramter text files).
output string "" name of the output ROOT file, one directory per algorithm. [input]_jec.root if not specified.
jecpath string "" path to the parameter text files specifying the corrections. Will look in $CMSSW_BASE and $CMSSW_RELEASE_BASE if omitted.
algs vstring   list of algorithms to be considered. By default, all uncorrected algorithms found in the input file are considered, all corrected are skipped.
levels vint32 2,3 list of correction levels to be applied, L2(Relative) and L3(Absolute) by default.
useTags bool true if true, the program will use properly formatted tags to set the FactorizedJetCorrector, rather than using a vector of JetCorrectorParameters

Examples:

jet_apply_jec_x -input JRA.root -era Spring10 -levels 2,3 -output JRA_jec.root

Presentations

Related Links

Responsible: AlexxPerloff

-- PhilippSchieferdecker - 14-Mar-2011

Edit | Attach | Watch | Print version | History: r64 < r63 < r62 < r61 < r60 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r64 - 2014-01-24 - AlexxPerloff
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    CMSPublic All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback