Description of the executables provided in JetMETAnalysis/JetAnalyzers
- Introduction
- jet_response_analyzer_x
- jet_response_fitter_x
- jet_response_and_resolution_x
- jet_synchtest_x
- jet_synchfit_x
- jet_synchplot_x
- jet_l1_correction_x
- jet_l3_correction_x
- jet_l2_correction_x
- jet_l5_correction_x
- jet_correction_analyzer_x
- jet_draw_closure_x
- jet_apply_jec_x
- jet_mass_analyzer_x
- jet_weighted_spectrum_x
This README will introduce you to the tools used to evaluate the JetResponseAnalyzer output. Due to the complexity of the software package it might not be possible to list every tool or option available to the user. We will, however, try our best to list the most commonly used tools and options.
🆕 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
This application processes the (ROOT) tree produced by the JetResponseAnalyzer (CMSSW fwk analyzer) and produces another file with the respective histograms. This allows you to only later decide on exact cuts or binning parameters. All other tools are based on histograms. Output and input files store the tree/histograms in one directory per jet algorithm.
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 |
jet_resonse_analyzer_x config/binning.config -input JRA.root
jet_response_analyzer -input JRA.root -binspt 10 20 30 50 100 -binseta -2 -1 0 1 2
jet_response_analyzer jra.config -input JRA.root -doflavor true -algs kt4calo kt6calo -output jra_ktcalo_flv.root
- open input (read) and output (recreate) files
- loop over directories found in the input file
- load the tree (default name: 't', parameter 'treename') from the current directory / jet algorithm, set branch addresses
- create directory in output file and book histograms
- loop over events in tree and fill histograms
- write and close output file, close input file
This application processes a file, produced by jet_response_analyzer_x, containing (absolute or relative) response histograms for each jet algorithm (see above). The response histograms in the input file are fitted with a Gaussian (default) or a double-sided crystal ball function, applying an iterative procedure developed by Kostas Kousouris. The resulting fits are stored in the output file together with the histograms. 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. Only those jet algorithms considered for fitting (option -algs) are transferred to the output. Algorithms which are omitted can be added later. Algorithms which are fitter already can not be overwritten for now, but are skipped.
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. |
jet_response_fitter_x -input jra.root
- open input (read) and output (update!) files
- loop over directories found in the input file
- loop over all histograms and identify response histograms by their name, which must either begin with 'RelRsp' or 'AbsRsp'
- fit the response histogram three times with a Gaussian, adjusting the starting parameters each time from the result of the last fit. Integral, mean, and rms are used as seed parameters for the first iteration.
- if the histograms has no entries or the NDF comes out smaller or equal to five, no fit is stored, indicating downstream applications to consider mean and rms instead of the fit parameters of the Gaussian
- save output, close input & output files
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 , for which you need to set its variables parameter accordingly!
jet_response_and_resolution_x -input JRA_f.root jet_response_and_resolution_x -input jra.root -algs sc5calo,sc7calo
- open the input (read) and output (recreate) ROOT files
- loop over all directories in the input file, which correspond to the different jet algorithms
- load the histograms relevant for the response plots according to the value of 'variable'
- loop over the relevant response histograms for each algorithm and create response and resolution graphs. Query each histogram for its fit function and consider the Gaussian parameters. If a histogram does not have a fit function stored, use histogram mean and rms
- fit the resolution if not otherwise requested
- write the graphs to the output file (same directory structure: one dir per algorithm)
- create canvas for each algorithm for response and resolution. If there is more than one variable, e.g. JetEta and RefPt, all JetEta graphs are overlaid in the same canvas. Create one file per 'formats' and canvas.
- close input and output files
Technically this is the first step in deriving the MC truth corrections after making an ntuple. The program matches events between two samples (originally envisioned to be samples with and without pileup) and then matches the reconstructed jets between those two samples. The primary reason for this is to calcualte the difference in pT between a jet that is in an environment where pileup was simulated and the same exact jet when there is no pileup. This then tells us the exact amount of pileup that would be added to this jet. The rest of the program is responsible for making other validation histograms.
Like previously said, the program was initially envisioned to be used with two samples with and without pileup and with a single jet algorithm. However, there is nothing stopping someone from varying a different quantity during the sample generation. Furthemore, one could envision matching jets using two different algorithms.
Yes, I know the name of this programs is not very descriptive and the naming scheme of the histograms inside the program is also pretty bad. Some day this will be fixed, but it is not the highest priority.
Parameter | Type | Default | Description |
---|---|---|---|
samplePU | string | path/name of the sample which was simulated with pileup | |
sampleNoPU | string | path/name of the sample which was simulated without pileup | |
basepath | string | "/fdata/hepx/store/user/aperloff/" | path in common between the two samples |
algo1 | string | "ak5pf" | algorithm name to use from the sample with pileup |
algo2 | string | "ak5pf" | algorithm name to use from the sample without pileup |
iftest | bool | false | shortens the runtime by activating the maxEvts variable |
maxEvts | int | 40000 | the number of entries in the ROOT trees to loop over (still must map all events) |
nrefmax | int | -1 | the maximum number of jets to use from each event |
useweight | bool | false | per-event weight from tree (branch: 'weight') |
pThatReweight | bool | false | reweight the event based on a different pThat weighting scheme |
bias2SelectionRef | double | 15 | if pThatReweight is true, then use this value as the reference pThat |
bias2SelectionPow | double | 6.0 | if pThatReweight is true, then use this as the reweighting power |
MCPUReWeighting | string | "" | the file which contains the pileup distribution for the MC |
MCPUHistoName | string | "pileup" | the histogram name for the MC based pileup distribution used for pileup reweighting |
DataPUReWeighting | string | "" | the file which contains the pileup distribution for the data |
DataPUHistoName | string | "pileup" | the histogram name for the data based pileup distribution used for pileup reweighting |
ApplyJEC | bool | false | apply the L1FastJet JEC on-the-fly in order to check the resulting residual pileup |
JECpar | string | "parameters_ak5pf.txt" | the filename of the JEC to apply |
outputPath | string | "./" | the path to the output ROOT file |
readEvtMaps | string | "" | the path to a file which contains pre-saved event-by-event mappings and jet-by-jet mappings |
doNotSave | bool | false | tells the program to not save the event-by-event and jet-by-jet mappings |
treeName | string | "t" | name of the input TTrees |
npvRhoNpuBinWidth | int | 5 | the bin width of the NPV/Rrho/NPU/TNPU bins |
NBinsNpvRhoNpu | int | 6 | the number of bins of NPV/Rrho/NPU/TNPU |
vptBins | int | "14:::18:::20:::24:::28:::30" | (depricated) no longer used in the code |
reduceHistograms | bool | true | reduces the number of histograms filled in each loop in order to save time |
verbose | bool | false | print additional messages to the screen |
help | bool | false | print a list of these options to the screen and exit the program |
jet_synchtest_x -samplePU JRA_PU.root -sampleNoPU JRA_NoPU.root -algo1 ak4pf -algo2 ak4pf
This code takes as input the output ROOT files from jet_synctest_x and outputs the L1FastJet JEC text files. The code takes three TProfile3D histograms whose binned coordinates are eta, refpt, and (t)npus and whose averaged values are OffsetOArea (the offset divided by the area of the jet), rho, and jtpt. From this the code constructs one TGraph2D per slice in eta where the coordinates are (jtpt, rho, OffsetOA) and the number of markers is determined by the number of filled (refpt,tnpu) bins. Then a function is fit to this graph and that becomes a single line in the text file. In other wods we are determining how Offset over area changes with jtpt and rho, which is the goal of the L1FastJet JEC.
Parameter | Type | Default | Description |
---|---|---|---|
inputDir | string | "./" | directory containing the ouput of jet_synchtest_x |
outputDir | string | "./" | directory where the output files will be written |
aalgo1 | string | "ak5pf" | algorithm name to use from the sample with pileup |
aalgo2 | string | "ak5pf" | algorithm name to use from the sample without pileup |
highPU | bool | false | increases the rho range in the graphs to be fit (from 50 to 200) |
useNPU | bool | false | uses the graphs containing NPU rather than TNPU (useful for PhaseII samples) |
functionType | string | "standard" | the type of function to be used for the fit (i.e. standard, standard+taylorExpansion, puppi, other, modifiedHandkerchief, modifiedHandkerchief+rho, modifiedMonkeySaddle) |
era | string | "" | the era to be prepended to the L1FastJet text files |
jet_synchfit_x -inputDir ./ -outputDir ./ -algo1 ak4pfchs -algo2 ak4pfchs -highPU false -useNPU false -functionType standard
This code formats, plots, and saves the histograms that were filled in jet_synchtest_x.
Parameter | Type | Default | Description |
---|---|---|---|
inputDir | string | "./" | directory of the input ROOT file (output of jet_synchtest_x) |
algo1 | string | "ak5pf" | algorithm name to use from the sample with pileup |
algo2 | string | "ak5pf" | algorithm name to use from the sample without pileup |
outDir | string | "./images" | directory to save the output files |
outputFormat | VTString | ".eps" | list of formats used to save the canvases |
fixedRange | bool | true | fix the range of the residual offset plots to (-3,3) or let the range float |
tdr | bool | false | use the TDR format |
npvRhoNpuBinWidth | int | 5 | the bin width of the NPV/Rrho/NPU/TNPU bins (same as jet_synchtest_x) |
NBinsNpvRhoNpu | int | 6 | the number of bins of NPV/Rrho/NPU/TNPU (same as jet_synchtest_x) |
binOffset | int | 0 | the number of bins to skip if you know some of them will be empty |
minNpvRhoNpu | int | 0 | mainly used for the legend, the minimum value of NPV/Rho/NPU/TNPU to plot |
maxNpvRhoNpu | int | 159 | mainly used for the legend, the maximum value of NPV/Rho/NPU/TNPU to plot |
jet_synchplot_x -inputDir ./ -algo1 ak4pfchs -algo2 ak4pfchs -outDir ./ -outputFormat .eps .png -fixedRange false -tdr true -npvRhoNpuBinWidth 10 -NBinsNpvRhoNpu 6
This is a new piece of code under development which would replace jet_synchfit_x. Instead of fitting a TF2D to a TGraph2D (3D problem) this code would take in four THnSparse histograms filled using jet_synchtest_x and make many, many 1D histograms (one for each eta and rho bin). Then it would use an Akima spline to "fit" the offset over area vs jtpt points. This will produce a much large L1FastJet text file, but will also reduce the complexity of the problem and should make for a more accurate pileup reduction. This code has been tested and the code CMSSW JEC code has been significantly improved to allow for these much larger text files. The next step is to test whether or not this scheme actually improves the pileup mitigation.
Parameter | Type | Default | Description |
---|---|---|---|
inputDir | string | "./" | directory of the input ROOT file (output of jet_synchtest_x) |
outputDir | string | "./" | directory to save the output files |
algo1 | string | "ak5pf" | algorithm name to use from the sample with pileup |
algo2 | string | "ak5pf" | algorithm name to use from the sample without pileup |
useNPU | bool | false | uses the graphs containing NPU rather than TNPU (useful for PhaseII samples) |
rebinEta | int | 1 | rebin the eta dimension before looping |
rebinRho | int | 1 | rebin the rho dimension before looping |
era | string | "" | the era to be prepended to the L1FastJet text files |
formats | vstring | "" | list of formats used to save the validation canvases |
drawParaCoord | bool | false | draw the parallel coordinate chart to check THnSparse histograms |
projThenDiv | bool | true | project the histograms to select a single slice in eta/rho space and then divide by the entries saved in a separate THnSparse (setting this to false works, but is not recommended) |
forTesting | bool | false | make a text file of reduced complexity and size for testing purposes |
debug | bool | false | run the code over a muched reduces region of phase space in order to test its functionality quickly |
jet_l1_correction_x -inputDir ./ -outputDir ./ -algo1 ak4pfchs -algo2 ak4pfchs -useNPU false -era THnSparseTest_25nsV1_MC -rebinRho 1
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 either JetResponseAnalyzer or 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) |
jet_l3_correction_x -input jra.root
- instantiate a TApplication if not in batch mode (-batch 1), such that drawn canvases are being displayed
- open input (read) and output (recreate) files
- iterate over all directories in input file, each corresponding to a different jet algorithm
- create graphs for absolute response as a function of reference pT and correction as a function of jet pT
- loop over the relevant response histograms, extract mean/sigma and fill graphs
- fit both response and correction, draw a canvas each and create a file for each specified 'formats'
- write the parameters of the response fit to a text file "l3_.jer" (not needed, is it?)
- close input and output file
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). It may seem off that the L2Relative corrections are derived after the L3Absolute corrections, but this software needs the absolute response in the barrel as an 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 |
jet_l2_correction_x -input jra.root
- instantiate a TApplication if not in batch mode (-batch 1), such that drawn canvases are being displayed
- open input (read) and output (recreate) files, as well as the corresponding file with the absolute (l3) response (default: l3.root)
- loop over the directories in the input file, each corresponding to a different jet algorithm
- load and loop over histograms with absolute response, refpt, and jetpt as a function of eta and refpt
- for each eta bin, create graphs for absolute response and correction as a function of refpt. Fit absolute correction with a function in each eta bin.
- loop over all eta/pT bins again to calculate the relative response in each bin w.r.t. the response in the barrel in each etabin (-> graph&fit in each etabin)
- write the parameters of the fit to the relative (l2) correction to a text file, one line per etabin
- close input and output files
The code creates the L5Flavor JEC.
Parameter | Type | Default | Description |
---|---|---|---|
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 |
jet_l5_correction_x -input jra_f.root -era Jec11_V11
This code produces the histograms necessary to plot the TDR style response/closure histograms. This code was originally developed in order to apply the JEC on-the-fly befor producing the closure histograms. However, it shares much of the same features as the combination of jet_response_aanalyzer_x, jet_response_and_resolution_x, and jet_apply_jec_x.
Parameter | Type | Default | Description |
---|---|---|---|
algs | vstring | list of algorithms to be considered. By default, all algorithms found in the input file are considered | |
path | string | path to the JEC text files | |
era | string | prefix for the input JEC text files (e.g. Jec11_V11 for Jec11_V11_L5Flavor_qJ_AK5Calo.txt) | |
inputFilename | string | name of the input ROOT file | |
inputFilePath | string | "" | path to the input ROOT file |
fileList | string | "" | the name of a text file containing a list of ROOT files to use as input |
url_string | string | "" | the xrootd url pointing to the server containing the input files |
outputDir | TString | "" | path to the directory where the output files will be located |
suffix | TString | "" | suffix to append to the output ROOT filename |
levels | int | "" | the JEC levels to apply (i.e. 1 2 3) |
useTags | bool | true | use tags to find the JEC files as opposed to making the filenames on the fly |
L1FastJet | bool | true | use the L1FastJet files as opposed to the L1Offset files (for historical reasons) |
postfix | string | "" | a postfix appended to a JEC text filename |
doflavor | bool | false | make the response plots for a given flavor (one at a time) |
doTProfileMDF | bool | false | if false, the code will not fill the TProfileMDF in order to save time |
reduceHistograms | bool | true | if true, fewer histograms will be filled in order to save time |
useweight | bool | false | per-event weight from tree (branch: 'weight') will be considered unless xsection>0.0 (or branch not found) |
pThatReweight | float | -9999 | the power with which to reweight the pThat spectrum |
xsection | float | 0.0 | if >0.0, each (!) event will be weighted by xsecion / number of events |
luminosity | float | 1.0 | the luminosity to which the histograms will be normalized |
pdgid | int | 0 | the flavor of the jets used to draw the response (use 123 to use all light flavor jets) |
drmax | vdouble | "" | deltaR(ref,jet) requirement in matching mode |
ptmin | double | 0 | the minimum pT of a jet |
ptgenmin | double | 0 | the minimum pTgen of a jet |
ptrawmin | double | 0 | the minimum uncorrected pT of a jet |
pthatmin | float | 0.0 | the minimum pThat to use |
pthatmax | float | -1.0 | the maximum pThat to use |
etamax | double | 0 | the maximum eta allowed for a jet |
dphimin | double | 0 | deltaPhi(ref,jet) requirement in balancing mode |
nrefmax | unsigned int | 0 | if not set to 0, only the leading nrefmax references are considered |
nbinsrelrsp | int | 200 | 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 |
evtmax | unsigned int | 0 | the maximum number of events to process |
printnpu | bool | false | print the number of pileup events found in each event |
itlow | int | 0 | the lowest allowed value of in-time pileup |
ithigh | int | 100000 | the maximum allowed value of in-time pileup |
earlyootlow | int | 0 | the lowest allowed value of early out-of-time pileup |
earlyoothigh | int | 100000 | the maximum allowed value of early out-of-time pileup |
lateootlow | int | 0 | the lowest allowed value of late out-of-time pileup |
lateoothigh | int | 100000 | the maximum allowed value of laet out-of-time pileup |
totalootlow | int | 0 | the lowest allowed value of out-of-time pileup (early+late) |
totaloothigh | int | 100000 | the maximum allowed value of early-out-of-time pileup (early+late) |
totallow | int | 0 | the lowest allowed value of pileup (in-time+early+late) |
totalhigh | int | 100000 | the maximum allowed value of pileup (in-time+early+late) |
weightfilename | TString | "" | the filename containing a histogram used to weight each entry based on the pT/eta or the jet |
MCPUReWeighting | TString | "" | the file which contains the pileup distribution for the MC |
DataPUReWeighting | TString | "" | the file which contains the pileup distribution for the data |
mpv | bool | false | use the mean of a Gaussian fit to the response distribution as the response as opposed to the mean of the histogram itself (used to make resolution histograms) |
readRespVsPileup | TString | "" | Read in the TProfileMDF histograms which were already made in a previous pass of this program |
verbose | bool | false | increase the verbosity of the printouts |
debug | bool | false | print out additional debugging information, other than the normal increased level of verbosity |
jet_correction_analyzer_x -inputFilename JRA.root -outputDir ./ -path ./ -era Summer16_25nsV5_MC -levels 2 3 -algs ak4pfchsl1 -drmax 0.2 -MCPUReWeighting MyMCPileupHistogram.root -DataPUReWeighting MyDataPileupHistogram.root
This program takes the output from jet_correction_analyzer_x and makes a properly formated response/closure plot. The program is able to make response vs pT and response vs eta plots as well as to do the ratio between the closure from multiple eras/files. Additionally, it is able to produce a plot of the flavor responses, though the format of this is still up for debate. The utility of this program is that it is compliant with the TDR style. However, the same basic functionality (drawing a response vs pT/eta) histogram can be reporoduced by jet_response_and_resolution_x and jet_inspect_graphs_x.
This is a complete list of the options available. However, not all options will be used depending upon the type of response canvases being produced (depends on which "do" options are chosen).
Parameter | Type | Default | Description |
---|---|---|---|
help | bool | false | print the options and then exit the program |
doPt | bool | false | draw response vs pT |
doEta | bool | false | draw response vs eta |
doRatioPt | bool | false | draw the ratio of response vs pT |
doRatioEta | bool | false | draw the ratio of response vs eta |
doFlavorDifference | bool | false | draw the difference in response for various jet flavors |
ptcl | bool | false | use the abbreviation ptcl rather than pT^{GEN} |
algs | VTString | "" | list of algorithms to be considered. By default, all algorithms found in the input file are considered |
path | TString | "" | path to the input files |
filename | TString | "Closure" | input filename prefix (rest of the filename combin from the algroithms chosen) |
outputDir | TString | "./" | directory in which to save the output files |
outputFilename | TString | "" | overrides the filename of the output file |
outputFormat | VTString | ".png:::.eps" | list of formats used to save the ouput canvases |
flavor | TString | "" | used as a suffix to the input and output files |
nsigma | double | 1.5 | the number of sigma to be using in a Gaussian fit of the response histograms (if the histogram metric is chosen to be the mode) |
draw_guidelines | bool | true | draw the +/-1% guidelines |
CMEnergy | double | 13000 | center of mass energy used to calcualate the maximum range in eta for a given pT |
histMet | TString | "mu_h" | the histogram metric used to calculate the response (options are mu_h, mu_f, mpv, and median) |
filepath1 | string | input file containing the histograms used as the numerator for the ratio plots | |
filepath2 | string | input file containing the histograms used as the denominator for the ratio plots | |
algo | string | "algo" | the algorithm used when making the ratio plots |
numerator | string | "53X" | label for the numerator of the ratio plot |
denominator | string | "52X" | label for the denominator of the ratio plot |
eta_max | double | 4.7 | maximum eta value for the ratio plot |
doflavor | bool | false | do the ratio by flavor (not fully implemented yet) |
draw_residual | bool | true | draw a separate residual pad |
basepath | TString | path to the input ROOT file | |
filenames | VTString | "l5.root" | name of the input ROOT file |
object | TString | AbsRspVsRefPt:JetEta" | the base name of the histograms to be read in |
flavorDiff | bool | true | plot the difference in flavor response as opposed to the absolute response |
flavor1 | VTString | "ud" | the variable flavor |
flavor2 | VTString | "g" | the reference flavor whose response will be subtracted off the variable flavor |
jet_draw_closure_x -doPt true -doEta false -doRatioPt false -doRatioEta false -doFlavorDifference false -ptcl false -algs ak4pfchsl1 -path ./ -histMet median -outputDir ./
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 |
jet_apply_jec_x -input JRA.root -era Spring10 -levels 2,3 -output JRA_jec.root
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".
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 |
jet_weighted_spectrum_x config/weighted_spectrum.config
jet_weighted_spectrum_x -datapath /path/to/my/files -inputs QCD0to15:10e10 QCD15to20:10E09 QCD20to30:10E08