To fit the dijet mass and the plot the result in the final style use the macro fit/SimpleDiJetFit.py (the other macros in the fit directory are old versions).
Example of use:
python fit/SimpleDiJetFit.py
The input files, output directory and the text ofthe labels are hard-coded and have to be modified in the code.
The code is in scripts/doTriggerCurves_data.py
It runs on the output of the main tree analyzer ( rootfile_*_reduced_skim.root, that contains the histograms for trigger studies).
The main trigger is PFHT800 and the reference is PFHT475.
Example of use:
python doTriggerCurves_data.py -i list_for_trigger_Run2015B_plus_Run2015C_50ns_goldenJson_29Aug2015_JEC-Summer15_50nsV4.txt -o plots_trigger_Run2015B_plus_Run2015C_50ns_goldenJson_29Aug2015/ --lumi 65
Input
-
-i (--inputList) <list.txt>
list of files with weight for the combination (of course for data weight=1) -
-o (--outputDir) <output>
output directory -
--lumi <lumi>
luminosity, used just for the label -
--mode <mode=0,1>
default="1", mode for asymmetric error intervals. The default is Wilson confidence interval for binomial ( https://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval )
Output
-
trigger turn on curve plot (also zoomed)
-
trigger inefficiency/rel_stat_uncertainty
-
rootfile with the TGraph objects
Can be generalized to choose the reference trigger. At the moment there is another macro to do the trigger curves with a different denominator (for trigger studies in lepton datasets).
The code to produce trigger curves using Single Lepton datasets is scripts/doTriggerCurves_data_unbiasedDataset.py
The functioning is the same of doTriggerCurves_data.py
The only difference is that the denominator here is the mjj spectrum without trigger request.
The code is scripts/doTestBackgoundFit.py
The input files are hard-coded and have to be changed in the macro https://github.com/CMSDIJET/DijetRootTreeAnalyzer/blob/master/scripts/doTestBackgoundFit.py#L73-L80
This script performs an iterative Fisher test starting from a function with 2 free parameters to 6 free parameters with chi2 (used for example here: http://cms.cern.ch/iCMS/jsp/openfile.jsp?tp=draft&files=AN2013_045_v8.pdf ) It also performs a Wald-Wolfowitz run test for each fit and the MC (see: https://en.wikipedia.org/wiki/Wald%E2%80%93Wolfowitz_runs_test ).
Example of use:
python doTestBackgoundFit.py
Output: The plots of the fits + residuals are saved in the local directory. The results of the tests are printed on screen:
-
fit result and chi2 with and without zero bins
-
F-statistics and CL
-
N runs, N+, N-, mu and sigma, CL of Wald test