1 |
buchmann |
1.1 |
#include <iostream>
|
2 |
|
|
#include <vector>
|
3 |
|
|
#include <sys/stat.h>
|
4 |
|
|
#include <getopt.h>
|
5 |
|
|
#include <stdio.h>
|
6 |
|
|
#include <stdlib.h>
|
7 |
|
|
|
8 |
|
|
#ifndef Verbosity
|
9 |
|
|
#define Verbosity 0
|
10 |
|
|
#endif
|
11 |
|
|
#ifndef HUSH
|
12 |
|
|
#define HUSH 1
|
13 |
|
|
#endif
|
14 |
|
|
|
15 |
|
|
#include "../Plotting/Modules/GeneralToolBox.C"
|
16 |
|
|
#include "../Plotting/Modules/SampleClass.C"
|
17 |
|
|
#include "../Plotting/Modules/setTDRStyle.C"
|
18 |
|
|
#include "../Plotting/Modules/Setup.C"
|
19 |
|
|
#include "../Plotting/Modules/Poisson_Calculator.C"
|
20 |
|
|
#include "../Plotting/Modules/JSON/JSONSampleLoader.C"
|
21 |
|
|
#include "../Plotting/Modules/ActiveSamples.C"
|
22 |
|
|
#include "../Plotting/Modules/PeakFinder.C"
|
23 |
|
|
#include "../Plotting/Modules/UpperLimitsWithShape.C"
|
24 |
|
|
#include "../Plotting/Modules/Plotting_Functions.C"
|
25 |
|
|
#include "../Plotting/Modules/LimitCalculation.C"
|
26 |
|
|
#include "../Plotting/Modules/ResultModule.C"
|
27 |
|
|
#include "../Plotting/Modules/CrossSectionReader.C"
|
28 |
|
|
#include "../Plotting/Modules/Systematics.C"
|
29 |
|
|
#include "../Plotting/Modules/SugarCoating.C"
|
30 |
|
|
#include "../Plotting/Modules/ExclusionPlot.C"
|
31 |
|
|
#include "../Plotting/Modules/SUSYScan.C"
|
32 |
|
|
#include "../Plotting/Modules/AachenCompatibility.C"
|
33 |
|
|
#include "../Plotting/Modules/MetPlotting.C"
|
34 |
|
|
#include "../Plotting/Modules/WZStudy.C"
|
35 |
|
|
//#include "../Plotting/Modules/FSRStudy.C"
|
36 |
|
|
#include "../Plotting/Modules/TTbarAnalysis.C"
|
37 |
|
|
#include "../Plotting/Modules/OverlapStudy.C"
|
38 |
|
|
#include "../Plotting/Modules/EdgeLimit.C"
|
39 |
|
|
|
40 |
|
|
#include <TCut.h>
|
41 |
|
|
#include <TROOT.h>
|
42 |
|
|
#include <TCanvas.h>
|
43 |
|
|
#include <TMath.h>
|
44 |
|
|
#include <TColor.h>
|
45 |
|
|
#include <TPaveText.h>
|
46 |
|
|
#include <TRandom.h>
|
47 |
|
|
#include <TH1.h>
|
48 |
|
|
#include <TH2.h>
|
49 |
|
|
#include <TF1.h>
|
50 |
|
|
#include <TSQLResult.h>
|
51 |
|
|
|
52 |
|
|
using namespace PlottingSetup;
|
53 |
|
|
|
54 |
|
|
void usage(int passed=0 ) {
|
55 |
buchmann |
1.2 |
cout << "USAGE : " << endl;
|
56 |
|
|
cout << "You can use different options when running this program : " << endl;
|
57 |
|
|
cout << endl;
|
58 |
|
|
|
59 |
|
|
|
60 |
|
|
cout << "\033[1;34m ofsf\033[0m \t\t OF vs SF comparison" << endl;
|
61 |
buchmann |
1.1 |
|
62 |
|
|
|
63 |
|
|
|
64 |
|
|
|
65 |
|
|
|
66 |
|
|
|
67 |
buchmann |
1.2 |
cout << "\033[1;34m all\033[0m \t\t All processes of the standard workflow" << endl;
|
68 |
|
|
cout << "\033[1;34m peak\033[0m \t\t Peak finding" << endl;
|
69 |
|
|
cout << "\033[1;34m pileup\033[0m\t\t Pileup correction determination" << endl;
|
70 |
|
|
cout << "\033[1;34m kin\033[0m \t\t Kinematic plots" << endl;
|
71 |
|
|
cout << "\033[1;34m pfkin\033[0m \t Kinematic plots for PF variables" << endl;
|
72 |
|
|
cout << "\033[1;34m region\033[0m \t Region comparison plots" << endl;
|
73 |
|
|
cout << "\033[1;34m lepton\033[0m \t Lepton comparison plots" << endl;
|
74 |
|
|
cout << "\033[1;34m jzb\033[0m \t\t JZB plots" << endl;
|
75 |
|
|
cout << "\033[1;34m pred\033[0m \t\t Prediction plots" << endl;
|
76 |
|
|
cout << "\033[1;34m signalbg\033[0m \t Signal vs. background plots (shape comparison)" << endl;
|
77 |
|
|
cout << "\033[1;34m ttbar\033[0m \t TTbar sideband comparison" << endl;
|
78 |
|
|
cout << "\033[1;34m ttbaranalysis\033[0m \t TTbar analysis. To prove we can." << endl;
|
79 |
|
|
cout << "\033[1;34m ttbartest\033[0m \t TTbar prediction tests (peak, response)" << endl;
|
80 |
|
|
cout << "\033[1;34m zjets\033[0m \t ZJets plots" << endl;
|
81 |
|
|
cout << "\033[1;34m diboson\033[0m \t Diboson plots" << endl;
|
82 |
|
|
cout << "\033[1;34m results\033[0m \t Compute results (JZB>X)" << endl;
|
83 |
|
|
cout << "\033[1;34m syst\033[0m \t\t Compute systematics" << endl;
|
84 |
|
|
cout << "\033[1;34m eff\033[0m \t\t Compute all (partial) efficiencies" << endl;
|
85 |
|
|
cout << "\033[1;34m shapes\033[0m \t Prepare ROOT files for computing limits using shapes" << endl;
|
86 |
|
|
cout << "\033[1;34m counting\033[0m \t Establish limits with counting experiment" << endl;
|
87 |
|
|
cout << "\033[1;34m shapelimit\033[0m \t Establish limits with shapes" << endl;
|
88 |
|
|
cout << "\033[1;34m qcd\033[0m \t\t Show that QCD is negligible" << endl;
|
89 |
|
|
cout << "\033[1;34m response\033[0m \t Compute response correction" << endl;
|
90 |
|
|
cout << "\033[1;34m pickup\033[0m \t Pick up interesting events" << endl;
|
91 |
|
|
cout << "\033[1;34m yields\033[0m \t Compute MC yields for this lumi" << endl;
|
92 |
|
|
cout << "\033[1;34m sideassess\033[0m\t Assessment of the mass sidebands definition in the data" << endl;
|
93 |
|
|
cout << "\033[1;34m jes\033[0m \t\t Make Jet Energy Scale (JES) plot" << endl;
|
94 |
|
|
cout << "\033[1;34m nosidebands\033[0m \t\t Switch off sidebands for cJZB" << endl;
|
95 |
|
|
cout << "\033[1;34m effcurve\033[0m \t\t Make JZB efficiency plot" << endl;
|
96 |
|
|
cout << "\033[1;34m save\033[0m \t\t Save results in a template file (for reuse when establishing limits for scans)" << endl;
|
97 |
|
|
cout << "\033[1;34m png\033[0m \t\t Save all plots as pngs (also available: --pdf, --root, --eps, --C) standard: png&pdf" << endl;
|
98 |
|
|
cout << "\033[1;34m offpeak\033[0m \t Sets offpeak to true (i.e. carry out off-peak analysis!)" << endl;
|
99 |
|
|
cout << "\033[1;34m onpeak\033[0m \t Sets onpeak to true (i.e. carry out standard on-peak analysis!)" << endl;
|
100 |
|
|
cout << "\033[1;34m btagged (b)\033[0m \t Sets DoBTag to true (i.e. carry out b tagged analysis)" << endl;
|
101 |
|
|
cout << "\033[1;34m jzbcuts\033[0m \t Sets the jzb cuts (please provide them in the format 50,100,150,200 and so on (comma separated)" << endl;
|
102 |
|
|
cout << "\033[1;34m ptsanity\033[0m \t Checks whether all samples have the correct pt range (additional canvas for you to check)" << endl;
|
103 |
|
|
cout << "\033[1;34m mlls\033[0m \t Draw dilepton invariant mass for all signals" << endl;
|
104 |
|
|
cout << "\033[1;34m rmue\033[0m \t Compute rmu" << endl;
|
105 |
|
|
cout << "\033[1;34m overlap\033[0m \t Study overlap between iJZB and METJZB" << endl;
|
106 |
|
|
// cout << "\033[1;34m edge\033[0m \t Be on the edge of development and try out the new edge fitter :-)" << endl;
|
107 |
|
|
cout << "\033[1;34m wz \033[0m \t WZ" << endl;
|
108 |
|
|
cout << "\033[1;34m ittbar\033[0m\t ttbar closure test for iJZB" << endl;
|
109 |
|
|
// cout << "\033[1;34m fsr \033[0m \t Carry out all FSR studies (you can switch off the ones you don't want in FSRStudy.C)" << endl;
|
110 |
|
|
cout << endl;
|
111 |
|
|
cout << "\033[1;34m ijzb \033[om\t This is iJZB. Rerun peak positions and everything" << endl;
|
112 |
|
|
cout << "\033[1;34m dir (d)\033[0m\t Directory where all plots will be saved" << endl;
|
113 |
|
|
cout << "\033[1;34m public \033[0m\t Switch to be activated when using the algorithm in public (no branding etc.)" << endl;
|
114 |
|
|
cout << endl;
|
115 |
|
|
cout << endl;
|
116 |
|
|
cout << "\033[1;34m met\033[0m \t\t Compute obs/pred for met cut vs jzb cut (in data, lm4 and lm8)" << endl;
|
117 |
|
|
cout << "\033[1;34m metplots\033[0m \t\t Produce the MET plots (i.e. mll plots with MET cut etc.)" << endl;
|
118 |
|
|
cout << "\033[1;34m metvsjzb\033[0m \t\t Produce MET:JZB plots" << endl;
|
119 |
|
|
cout << "\033[1;34m metpred\033[0m \t\t Experimental JZB prediction for MET signal region" << endl;
|
120 |
|
|
cout << "\033[1;34m aachen\033[0m \t\t Produce Aachen root file (please provide source root file)" << endl;
|
121 |
|
|
cout << endl;
|
122 |
|
|
cout << endl;
|
123 |
|
|
cout << "\033[1;34m paper\033[0m \t\t Switch paper mode on (no \" Preliminary \" on plots)" << endl;
|
124 |
|
|
cout << "\033[1;34m approved\033[0m \t\t Only approved plots" << endl;
|
125 |
|
|
cout << endl << endl;
|
126 |
|
|
cout << "\033[1;34m cc \033[0m \t\t clean cache: Overwrite edge cache (use with caution!) " << endl;
|
127 |
buchmann |
1.1 |
exit(-1);
|
128 |
|
|
}
|
129 |
|
|
|
130 |
|
|
int main (int argc, char ** argv)
|
131 |
|
|
{
|
132 |
|
|
|
133 |
|
|
|
134 |
|
|
PlottingSetup::IsIJZBAnalysis=true;
|
135 |
|
|
int do_all = false;/// DONE
|
136 |
|
|
int do_global_significance = false; /// DONE
|
137 |
|
|
int do_peak_finding = false; /// DONE
|
138 |
|
|
int do_pileup = false;
|
139 |
|
|
int do_kinematic_variables = false; ///DONE
|
140 |
|
|
int do_kinematic_PF_variables = false; ///DONE
|
141 |
|
|
int do_region_comparison = false; /// Comparison between signal and control regions
|
142 |
|
|
int do_lepton_comparison = false; ///DONE
|
143 |
|
|
int do_jzb_plots = false; /// DONE
|
144 |
|
|
int do_pred = false; /// DONE
|
145 |
|
|
bool overlay_signal = false; /// Overlay LM4 signal to predictions
|
146 |
|
|
int do_signal_bg_comparison_plot = false; /// DONE
|
147 |
|
|
int do_ttbar_comparison = false; /// DONE
|
148 |
|
|
int do_ttbaranalysis = false;
|
149 |
|
|
int do_ofsf = false;
|
150 |
|
|
int do_overlap = false;
|
151 |
|
|
int do_ttbartest = false; /// DONE
|
152 |
|
|
int do_jzb_efficiency_curve = false; /// DONE
|
153 |
|
|
int do_zjets_comparison = false; /// DONE
|
154 |
|
|
int do_diboson_plots = false;
|
155 |
|
|
// int calculate_pred_and_observed = false; /// DONE -- now rerouted to the new way of computing results
|
156 |
|
|
// int calculate_yields = false; ///DONE /// superfluous (replaced by get_new_results)
|
157 |
|
|
int get_new_results = false; ///DONE
|
158 |
|
|
bool dopoisson = false;//should we calculate stat err with poisson? ///DONE
|
159 |
|
|
bool verbose = false;//prints out a lot more information ... ///DONE
|
160 |
|
|
//--------------------------------------------
|
161 |
|
|
// Systematics and limits
|
162 |
|
|
int do_compute_systematics=false; /// DONE (might want to add something related to the peak?)
|
163 |
|
|
bool requireZ=true; // should we require a Z for MC efficiency?
|
164 |
|
|
int do_compute_efficiency=false; /// DONE (might want to add something related to the peak?)
|
165 |
|
|
int do_prepare_limits_using_shapes=false; /// ALMOST DONE **************************************
|
166 |
|
|
int do_compute_upper_limits_from_counting_experiment=false; /// DONE
|
167 |
|
|
bool doobserved=false; // want to get the observed limit as well?
|
168 |
|
|
int doquick=1; // this will cause the number of predicted/observed events to hurry up (0 = do mc and all results, 1 = all results but no mc, 2 = don't save results in library and don't compute mc stuff)
|
169 |
|
|
int do_compute_upper_limits_from_shapes=false;
|
170 |
|
|
|
171 |
|
|
//--------------------------------------------
|
172 |
|
|
// More not-so-standard stuff
|
173 |
|
|
int do_model_scan=false; // this can take days - use the grid version!
|
174 |
|
|
int do_zjet_ttbar_shapes=false; /// DONE
|
175 |
|
|
int do_test=false;/// DONE (just any test you wish)
|
176 |
|
|
int do_pick_up_events=false; ///DONE
|
177 |
|
|
|
178 |
|
|
//--------------------------------------------
|
179 |
|
|
// To be run manually !
|
180 |
|
|
int do_response_correction=false; ///DONE
|
181 |
|
|
//use this to find out the correction factor; originally this was done automatically but now you should do this separately and update ../Plotting/Modules/Setup.C
|
182 |
|
|
|
183 |
|
|
int do_sideband_assessment=false;
|
184 |
|
|
int do_qcd=false;
|
185 |
|
|
|
186 |
|
|
int do_save_template=false;
|
187 |
|
|
int do_mc_yields=false; // compute MC yields
|
188 |
|
|
int do_metjzb=false;
|
189 |
|
|
|
190 |
|
|
int savepdf=true;
|
191 |
|
|
int saveC=true;
|
192 |
|
|
int saveRoot=true;
|
193 |
|
|
int savepng=true;
|
194 |
|
|
int saveeps=false;
|
195 |
|
|
|
196 |
|
|
int dooffpeak=true;
|
197 |
|
|
int doonpeak=false;
|
198 |
|
|
int dobtag=false;
|
199 |
|
|
|
200 |
|
|
int do_JES=false;
|
201 |
|
|
int do_ptsanity=false;
|
202 |
|
|
int do_mlls=false;
|
203 |
|
|
int do_rmue=false;
|
204 |
|
|
int do_medge=false;
|
205 |
|
|
int do_jedge=false;
|
206 |
|
|
int do_wz=false;
|
207 |
|
|
int do_ittbar=false;
|
208 |
|
|
int do_ijzb=false;
|
209 |
|
|
int do_fsr=false;
|
210 |
|
|
int do_met_vs_jzb=false;
|
211 |
|
|
int do_aachen=false;
|
212 |
|
|
int do_metplots=false;
|
213 |
|
|
int do_metpred=false;
|
214 |
|
|
string AachenFileName="";
|
215 |
buchmann |
1.2 |
|
216 |
buchmann |
1.1 |
std::string directory="";
|
217 |
|
|
int option_iterator;
|
218 |
|
|
int option_counter=0;
|
219 |
|
|
bool moreoptions=true;
|
220 |
|
|
|
221 |
|
|
int SwitchOffSidebands=0;
|
222 |
|
|
|
223 |
|
|
string jzbcuts_string="";
|
224 |
|
|
float local_signif=0.0;
|
225 |
|
|
|
226 |
|
|
while(moreoptions) {
|
227 |
|
|
static struct option long_options[] =
|
228 |
|
|
{
|
229 |
|
|
/* These options set a flag. */
|
230 |
|
|
{"all", no_argument, &do_all, 1},
|
231 |
|
|
{"peak", no_argument, &do_peak_finding, 1},
|
232 |
|
|
{"ofsf", no_argument, &do_ofsf, 1},
|
233 |
buchmann |
1.2 |
{"pileup", no_argument, &do_pileup, 1},
|
234 |
|
|
{"test", no_argument, &do_test, 1},
|
235 |
buchmann |
1.1 |
{"kin", no_argument, &do_kinematic_variables, 1},
|
236 |
|
|
{"pfkin", no_argument, &do_kinematic_PF_variables, 1},
|
237 |
|
|
{"region", no_argument, &do_region_comparison, 1},
|
238 |
|
|
{"lepton", no_argument, &do_lepton_comparison, 1},
|
239 |
|
|
{"jzb", no_argument, &do_jzb_plots, 1},
|
240 |
|
|
{"pred", no_argument, &do_pred, 1},
|
241 |
|
|
{"signalbg", no_argument, &do_signal_bg_comparison_plot, 1},
|
242 |
|
|
{"ttbar", no_argument, &do_ttbar_comparison, 1},
|
243 |
|
|
{"ttbaranalysis", no_argument, &do_ttbaranalysis, 1},
|
244 |
|
|
{"ttbartest",no_argument, &do_ttbartest, 1},
|
245 |
buchmann |
1.2 |
{"overlap" ,no_argument, &do_overlap, 1},
|
246 |
buchmann |
1.1 |
{"zjets", no_argument, &do_zjets_comparison, 1},
|
247 |
buchmann |
1.2 |
{"diboson", no_argument, &do_diboson_plots, 1},
|
248 |
buchmann |
1.1 |
{"results", no_argument, &get_new_results, 1},
|
249 |
|
|
{"syst", no_argument, &do_compute_systematics, 1},
|
250 |
|
|
{"eff", no_argument, &do_compute_efficiency, 1},
|
251 |
|
|
{"shapes", no_argument, &do_prepare_limits_using_shapes, 1},
|
252 |
|
|
{"counting", no_argument, &do_compute_upper_limits_from_counting_experiment, 1},
|
253 |
|
|
{"shapelimit",no_argument, &do_compute_upper_limits_from_shapes, 1},
|
254 |
|
|
{"ptsanity", no_argument, &do_ptsanity, 1},
|
255 |
|
|
{"response", no_argument, &do_response_correction, 1},
|
256 |
|
|
{"pickup", no_argument, &do_pick_up_events, 1},
|
257 |
|
|
{"yields", no_argument, &do_mc_yields, 1},
|
258 |
|
|
{"sideassess",no_argument, &do_sideband_assessment, 1},
|
259 |
buchmann |
1.2 |
{"metvsjzb", no_argument, &do_met_vs_jzb, 1},
|
260 |
buchmann |
1.1 |
{"qcd", no_argument, &do_qcd, 1},
|
261 |
|
|
{"save", no_argument, &do_save_template,1},
|
262 |
|
|
{"png", no_argument, &savepng,1},
|
263 |
|
|
{"eps", no_argument, &saveeps,1},
|
264 |
|
|
{"pdf", no_argument, &savepdf,1},
|
265 |
|
|
{"root", no_argument, &saveRoot,1},
|
266 |
|
|
{"C", no_argument, &saveC,1},
|
267 |
|
|
{"offpeak", no_argument, &dooffpeak,1},
|
268 |
|
|
{"onpeak", no_argument, &doonpeak,1},
|
269 |
|
|
{"btagged", no_argument, &dobtag,1},
|
270 |
|
|
{"met", no_argument, &do_metjzb,1},
|
271 |
|
|
{"jes", no_argument, &do_JES,1},
|
272 |
|
|
{"effcurve", no_argument, &do_jzb_efficiency_curve,1},
|
273 |
|
|
{"public", no_argument, &PlottingSetup::publicmode,1},
|
274 |
|
|
{"paper", no_argument, &PlottingSetup::PaperMode,1},
|
275 |
buchmann |
1.2 |
{"cc", no_argument, &PlottingSetup::do_CleanCache,1},
|
276 |
buchmann |
1.1 |
{"approved", no_argument, &PlottingSetup::Approved,1},
|
277 |
|
|
{"nosidebands",no_argument, &SwitchOffSidebands,1},
|
278 |
|
|
{"mlls", no_argument, &do_mlls,1},
|
279 |
|
|
{"rmue", no_argument, &do_rmue,1},
|
280 |
|
|
{"jedge", no_argument, &do_jedge,1},
|
281 |
|
|
{"medge", no_argument, &do_medge,1},
|
282 |
|
|
{"wz", no_argument, &do_wz,1},
|
283 |
|
|
{"ijzb", no_argument, &do_ijzb,1},
|
284 |
|
|
{"ittbar", no_argument, &do_ittbar,1},
|
285 |
|
|
{"fsr", no_argument, &do_fsr,1},
|
286 |
|
|
{"metplots", no_argument, &do_metplots,1},
|
287 |
|
|
{"metpred", no_argument, &do_metpred,1},
|
288 |
|
|
/* The following options store values.*/
|
289 |
|
|
{"jzbcuts", required_argument, 0, 'j'},
|
290 |
|
|
{"dir", required_argument, 0, 'd'},
|
291 |
buchmann |
1.2 |
{"aachen", required_argument, 0, 'c'},
|
292 |
buchmann |
1.1 |
{"gsig", required_argument, 0, 'g'},
|
293 |
buchmann |
1.2 |
{"samples", required_argument, 0, 's'},
|
294 |
|
|
{0, 0, 0, 0}
|
295 |
buchmann |
1.1 |
};
|
296 |
|
|
int option_index = 0;
|
297 |
buchmann |
1.2 |
option_iterator = getopt_long(argc, argv, "abc:d:g:j:s:",long_options, &option_index);
|
298 |
buchmann |
1.1 |
if(option_iterator == -1) moreoptions=false;
|
299 |
|
|
else {
|
300 |
|
|
option_counter++;
|
301 |
|
|
switch (option_iterator)
|
302 |
|
|
{
|
303 |
|
|
case 0:
|
304 |
|
|
if (long_options[option_index].flag != 0)
|
305 |
|
|
break;
|
306 |
|
|
printf ("option %s", long_options[option_index].name);
|
307 |
|
|
if (optarg)
|
308 |
|
|
printf (" with arg %s", optarg);
|
309 |
|
|
printf ("\n");
|
310 |
|
|
break;
|
311 |
|
|
case 'a':
|
312 |
|
|
do_all=true;
|
313 |
|
|
break;
|
314 |
|
|
case 'b':
|
315 |
|
|
dobtag=true;
|
316 |
|
|
break;
|
317 |
|
|
case 'c':
|
318 |
|
|
do_aachen=true;
|
319 |
|
|
AachenFileName=(std::string)optarg;
|
320 |
|
|
cout << "Received file to convert to Aachen format: " << AachenFileName << endl;
|
321 |
|
|
break;
|
322 |
|
|
case 'd':
|
323 |
|
|
directory=(std::string)optarg;
|
324 |
buchmann |
1.2 |
cout<<"Option directory was passed with argument " << optarg << endl;
|
325 |
buchmann |
1.1 |
break;
|
326 |
|
|
case 'j':
|
327 |
|
|
jzbcuts_string=(std::string)optarg;
|
328 |
buchmann |
1.2 |
cout<<"JZB cuts were manually defined:" << optarg << endl;
|
329 |
buchmann |
1.1 |
break;
|
330 |
|
|
case 'g':
|
331 |
|
|
do_global_significance=true;
|
332 |
|
|
local_signif=atof(optarg);
|
333 |
|
|
break;
|
334 |
buchmann |
1.2 |
case 's':
|
335 |
|
|
cout << "Loading sample list from : " << optarg << endl;
|
336 |
|
|
PlottingSetup::SampleList=(string)optarg;
|
337 |
|
|
break;
|
338 |
buchmann |
1.1 |
case '?':
|
339 |
|
|
usage(option_iterator);
|
340 |
|
|
break;
|
341 |
|
|
default:
|
342 |
|
|
usage(option_iterator);
|
343 |
|
|
}
|
344 |
|
|
}
|
345 |
|
|
}
|
346 |
|
|
|
347 |
|
|
if(directory!="") PlottingSetup::directoryname=directory;
|
348 |
|
|
if(dooffpeak) PlottingSetup::RestrictToMassPeak=false;
|
349 |
|
|
if(doonpeak) PlottingSetup::RestrictToMassPeak=true;
|
350 |
|
|
if(dobtag) PlottingSetup::DoBTag=true;
|
351 |
|
|
if(option_counter==0) usage();
|
352 |
|
|
if(SwitchOffSidebands) PlottingSetup::UseSidebandsForcJZB=false;
|
353 |
|
|
|
354 |
|
|
///----------------------------------- BELOW THIS LINE: NO MORE OPTIONS BUT ACTUAL FUNCTION CALLS! ---------------------------------------------------------
|
355 |
|
|
gROOT->SetStyle("Plain");
|
356 |
|
|
bool do_fat_line=false; // if you want to have HistLineWidth=1 and FuncWidth=1 as it was before instead of 2
|
357 |
|
|
setTDRStyle(do_fat_line);
|
358 |
|
|
gStyle->SetTextFont(42);
|
359 |
|
|
bool showList=true;
|
360 |
|
|
set_directory(directoryname);//Indicate the directory name where you'd like to save the output files in Setup.C
|
361 |
|
|
|
362 |
|
|
if(do_wz) {
|
363 |
|
|
IsWZAnalysis=true;
|
364 |
|
|
IsJZBAnalysis=false;
|
365 |
|
|
}
|
366 |
|
|
|
367 |
|
|
|
368 |
|
|
write_info(__FUNCTION__,"Making sure that we are only considering category A !!");
|
369 |
|
|
|
370 |
|
|
string backup_basicqualitycut = (const char*) basicqualitycut;
|
371 |
|
|
string backup_essentialcut = (const char*) essentialcut;
|
372 |
|
|
string backup_basiccut = (const char*) basiccut;
|
373 |
|
|
string backup_leptoncut = (const char*) leptoncut;
|
374 |
|
|
string backup_essential = (const char*) essential;
|
375 |
|
|
|
376 |
|
|
string Sbasicqualitycut = backup_basicqualitycut;
|
377 |
|
|
Sbasicqualitycut = ReplaceAll(Sbasicqualitycut,")<2.4",")<1.4");
|
378 |
|
|
basicqualitycut=TCut(Sbasicqualitycut.c_str());
|
379 |
|
|
|
380 |
|
|
string Sbasiccut = backup_basiccut;
|
381 |
|
|
Sbasiccut = ReplaceAll(Sbasiccut,")<2.4",")<1.4");
|
382 |
|
|
basiccut=TCut(Sbasiccut.c_str());
|
383 |
|
|
|
384 |
|
|
string Sessentialcut = backup_essentialcut;
|
385 |
|
|
Sessentialcut = ReplaceAll(Sessentialcut,")<2.4",")<1.4");
|
386 |
|
|
essentialcut=TCut(Sessentialcut.c_str());
|
387 |
|
|
|
388 |
|
|
string Sleptoncut = backup_leptoncut;
|
389 |
|
|
Sleptoncut = ReplaceAll(Sleptoncut,")<2.4",")<1.4");
|
390 |
|
|
leptoncut=TCut(Sleptoncut.c_str());
|
391 |
|
|
|
392 |
|
|
string Sessential = backup_essential;
|
393 |
|
|
Sessential = ReplaceAll(Sessential,")<2.4",")<1.4");
|
394 |
|
|
essential = TCut(Sessential.c_str());
|
395 |
|
|
|
396 |
|
|
|
397 |
|
|
if(do_global_significance) {
|
398 |
|
|
compute_global_significance(local_signif);
|
399 |
|
|
return 0;
|
400 |
|
|
}
|
401 |
|
|
|
402 |
|
|
define_samples(showList,allsamples,signalsamples,scansample,raresample,systsamples,qcdsamples,comparesamples);
|
403 |
|
|
setlumi(luminosity);
|
404 |
|
|
setessentialcut(essential);//this sets the essential cut; this one is used in the draw command so it is AUTOMATICALLY applied everywhere. IMPORTANT: Do NOT store weights here!
|
405 |
|
|
stringstream resultsummary;
|
406 |
|
|
|
407 |
|
|
write_analysis_type(PlottingSetup::RestrictToMassPeak,PlottingSetup::DoBTag);
|
408 |
|
|
do_png(savepng);
|
409 |
|
|
do_pdf(savepdf);
|
410 |
|
|
do_eps(saveeps);
|
411 |
|
|
do_C(saveC);
|
412 |
|
|
do_root(saveRoot);
|
413 |
|
|
|
414 |
|
|
write_info(__FUNCTION__,"Imposing standard JZB definition now");
|
415 |
|
|
/*
|
416 |
|
|
jzbvariabledata="((jzb[1]+0.0595776*pt-0.279212*numVtx)- 0.375633 )";
|
417 |
|
|
jzbvariablemc="((jzb[1]+0.0348755*pt-0.279212*numVtx)- 0.224927 )";
|
418 |
|
|
*/
|
419 |
|
|
|
420 |
|
|
/* jzbvariabledata="(jzb[1]+0.0595776*pt)";
|
421 |
|
|
jzbvariablemc="(jzb[1]+0.0348755*pt)";*/
|
422 |
buchmann |
1.2 |
|
423 |
|
|
jzbvariabledata="( (jzb[1]+0.0596047*pt) - numVtx * 0.27129 - 0.4187069 )";
|
424 |
|
|
jzbvariablemc= "( (jzb[1]+0.0347145*pt) - numVtx * 0.211429 - 0.7472459 )";
|
425 |
|
|
/* jzbvariabledata="( (jzb[1]+0.0596047*pt) )";
|
426 |
|
|
jzbvariablemc= "( (jzb[1]+0.0347145*pt) )";*/
|
427 |
|
|
|
428 |
|
|
|
429 |
|
|
/*
|
430 |
buchmann |
1.1 |
jzbvariabledata="((jzb[1]+0.0595776*pt)- 4.18673 )";
|
431 |
|
|
jzbvariablemc="((jzb[1]+0.0348755*pt)- 6.613429)";
|
432 |
|
|
jzbvariablemc="(((jzb[1]+0.0348755*pt)- 6.613429)+ 2.62837 )";
|
433 |
|
|
|
434 |
|
|
jzbvariabledata="(jzb[1]+0.0596047*pt - 4.18946)";
|
435 |
|
|
jzbvariablemc ="(jzb[1]+0.0347258*pt - 3.92238)";
|
436 |
|
|
|
437 |
|
|
jzbvariabledata="(jzb[1]+0.062396*pt - 0.69682 - numVtx * 0.2704 )";
|
438 |
|
|
jzbvariablemc="(jzb[1]+0.0391213*pt - 0.919679 - numVtx * 0.228712)";
|
439 |
buchmann |
1.2 |
*/
|
440 |
buchmann |
1.1 |
|
441 |
|
|
|
442 |
|
|
/*
|
443 |
|
|
jzbvariabledata="(jzb[1]+0.0595776*pt- 4.18673)";
|
444 |
|
|
jzbvariablemc="(jzb[1]+0.0348755*pt- 3.8028)";
|
445 |
|
|
jzbvariabledata="(jzb[1]+0.0595776*pt)";
|
446 |
|
|
jzbvariablemc="(jzb[1]+0.0348755*pt)";
|
447 |
|
|
*/
|
448 |
|
|
|
449 |
|
|
|
450 |
|
|
/* write_warning(__FUNCTION__,"WATCH OUT, EXPERIMENTAL PT CORRECTION");
|
451 |
|
|
jzbvariabledata="jzb[1]+(1-(9.57810e-01 + -3.53527e+00/pt + 1.85206e+02/pow(pt,2)))*pt";
|
452 |
|
|
jzbvariablemc ="jzb[1]+(1-(9.60547e-01 + -1.16558e+00/pt + 2.12197e+02/pow(pt,2)))*pt";
|
453 |
|
|
|
454 |
|
|
jzbvariabledata="(jzb[1]+(1-(9.57810e-01 + -3.53527e+00/pt + 1.85206e+02/pow(pt,2)))*pt- 1.92518 )";
|
455 |
|
|
jzbvariablemc ="(jzb[1]+(1-(9.60547e-01 + -1.16558e+00/pt + 2.12197e+02/pow(pt,2)))*pt+ 0.0553847 )";
|
456 |
|
|
*/
|
457 |
|
|
|
458 |
|
|
/*write_warning(__FUNCTION__,"No response correction");
|
459 |
|
|
jzbvariabledata="(jzb[1]+ 0.91084)";
|
460 |
|
|
jzbvariablemc="(jzb[1]- 0.694762)";*/
|
461 |
|
|
|
462 |
|
|
/*
|
463 |
|
|
jzbvariabledata="((jzb[1]+0.0596047*pt)- 4.18946 )";
|
464 |
|
|
jzbvariablemc="((jzb[1]+0.0310081*pt)- 5.11558 )";
|
465 |
|
|
*/
|
466 |
|
|
global_ratio_binning.push_back(0);
|
467 |
|
|
// global_ratio_binning.push_back(5);
|
468 |
|
|
global_ratio_binning.push_back(10);
|
469 |
|
|
global_ratio_binning.push_back(20);
|
470 |
|
|
global_ratio_binning.push_back(50);
|
471 |
|
|
global_ratio_binning.push_back(100);
|
472 |
|
|
global_ratio_binning.push_back(150);
|
473 |
|
|
global_ratio_binning.push_back(200);
|
474 |
|
|
global_ratio_binning.push_back(PlottingSetup::jzbHigh);
|
475 |
|
|
//global_ratio_binning.push_back(500);
|
476 |
|
|
|
477 |
|
|
//these are the JZB cuts defining our search regions
|
478 |
|
|
vector<float> jzb_cut; //starting where, please?
|
479 |
|
|
if(jzbcuts_string=="") {
|
480 |
|
|
// jzb_cut.push_back(50);
|
481 |
|
|
// jzb_cut.push_back(75);
|
482 |
buchmann |
1.2 |
// jzb_cut.push_back(80);
|
483 |
buchmann |
1.1 |
jzb_cut.push_back(100);
|
484 |
|
|
// jzb_cut.push_back(125);
|
485 |
|
|
jzb_cut.push_back(150);
|
486 |
|
|
// jzb_cut.push_back(175);
|
487 |
|
|
// jzb_cut.push_back(200);
|
488 |
|
|
// jzb_cut.push_back(225);
|
489 |
|
|
// jzb_cut.push_back(250);
|
490 |
|
|
// jzb_cut.push_back(275);
|
491 |
|
|
// jzb_cut.push_back(300);
|
492 |
|
|
} else {
|
493 |
|
|
manually_set_jzb_cuts(jzb_cut,jzbcuts_string);
|
494 |
|
|
if(jzb_cut.size()==0) {
|
495 |
|
|
write_error(__FUNCTION__,"There are no jzb cuts!");
|
496 |
|
|
return -1;
|
497 |
|
|
}
|
498 |
|
|
}
|
499 |
|
|
|
500 |
|
|
todo();
|
501 |
|
|
|
502 |
|
|
|
503 |
|
|
//**** part 1 : peak finding
|
504 |
|
|
float MCPeak=0,MCPeakError=0,DataPeak=0,DataPeakError=0,MCSigma=10,DataSigma=10;
|
505 |
|
|
method=Kostasmethod;//Kostasmethod;//dogaus3sigma;// options: dogaus,doKM,dogaus2sigma,dogaus3sigma
|
506 |
|
|
stringstream datajzb;
|
507 |
|
|
stringstream mcjzb;
|
508 |
|
|
|
509 |
|
|
|
510 |
|
|
if(do_pileup) FindPeakPileUpCorrection();
|
511 |
|
|
|
512 |
|
|
if ( do_peak_finding ) {
|
513 |
|
|
//if(do_peak_finding||do_pick_up_events||PlottingSetup::Approved||do_mlls||do_zjets_comparison||do_sideband_assessment||do_metjzb||do_zjet_ttbar_shapes||do_ttbartest||do_diboson_plots||do_region_comparison||do_jzb_plots||do_lepton_comparison||do_signal_bg_comparison_plot||do_pred||do_mc_yields||do_save_template||do_compute_upper_limits_from_counting_experiment||do_compute_upper_limits_from_shapes||do_compute_systematics||do_model_scan||do_prepare_limits_using_shapes||do_all||get_new_results||do_kinematic_variables||do_kinematic_PF_variables||do_aachen) find_peaks(MCPeak,MCPeakError, DataPeak, DataPeakError,resultsummary,true,datajzb,mcjzb);
|
514 |
|
|
find_peaks(MCPeak,MCPeakError, DataPeak, DataPeakError,resultsummary,true,datajzb,mcjzb);
|
515 |
|
|
|
516 |
|
|
if(datajzb.str().size()<1) datajzb<<"("<<jzbvariabledata<<")";
|
517 |
|
|
if(mcjzb.str().size()<1) mcjzb<<"("<<jzbvariablemc<<")";
|
518 |
|
|
|
519 |
|
|
} else {
|
520 |
|
|
write_warning(__FUNCTION__,"NOT DOING ANY PEAK FINDING ATM");
|
521 |
|
|
// datajzb << "((jzb[1]+0.059979*pt)- 4.18335 )";
|
522 |
|
|
// mcjzb << "((jzb[1]+0.034665*pt)- 3.58273 )";
|
523 |
|
|
// datajzb << "((jzb[1]+0.0595776*pt)- 4.17885 )";
|
524 |
|
|
// mcjzb << "((jzb[1]+0.0348755*pt)- 3.91542 )";
|
525 |
|
|
dout << "Not only not doing peak finding, but actually just copying global variable" << endl; datajzb << jzbvariabledata; mcjzb << jzbvariablemc;
|
526 |
|
|
}
|
527 |
|
|
|
528 |
|
|
|
529 |
|
|
if(do_pred || get_new_results) {
|
530 |
|
|
|
531 |
|
|
/* datajzb.str("");
|
532 |
|
|
mcjzb.str("");
|
533 |
|
|
jzbvariabledata="(((id1==0&&id1==id2)*(jzb[1]+0.0647272*pt))+((id1==1&&id1==id2)*(jzb[1]+0.053997*pt))+((id1!=id2)*(jzb[1]+0.0596296*pt)))";
|
534 |
|
|
jzbvariablemc="(((id1==0&&id1==id2)*(jzb[1]+0.0363773*pt))+((id1==1&&id1==id2)*(jzb[1]+0.0337406*pt))+((id1!=id2)*(jzb[1]+0.0350181*pt)))";
|
535 |
|
|
|
536 |
|
|
find_peaks(MCPeak,MCPeakError, DataPeak, DataPeakError,resultsummary,true,datajzb,mcjzb);
|
537 |
|
|
|
538 |
|
|
if(datajzb.str().size()<1) datajzb<<"("<<jzbvariabledata<<")";
|
539 |
|
|
if(mcjzb.str().size()<1) mcjzb<<"("<<jzbvariablemc<<")";
|
540 |
|
|
*/
|
541 |
|
|
}
|
542 |
|
|
|
543 |
|
|
|
544 |
|
|
dout << "With peak correction, we get : " << endl;
|
545 |
|
|
dout << " Data : " << datajzb.str() << endl;
|
546 |
buchmann |
1.2 |
dout << " MC : " << mcjzb.str() << endl;
|
547 |
buchmann |
1.1 |
|
548 |
|
|
|
549 |
|
|
|
550 |
|
|
|
551 |
|
|
if(do_ofsf) ProduceOFSFPlots(mcjzb.str(),datajzb.str(),do_aachen);
|
552 |
|
|
|
553 |
|
|
//**** part 2 : kinematic plots
|
554 |
|
|
if(do_kinematic_variables||(do_all&&!PlottingSetup::Approved)) do_kinematic_plots(mcjzb.str(),datajzb.str());
|
555 |
|
|
if(do_kinematic_PF_variables) do_kinematic_PF_plots(mcjzb.str(),datajzb.str());
|
556 |
|
|
|
557 |
|
|
//**** part 3: Leptonic comparison (ee vs mm, eemm vs emu)
|
558 |
|
|
if(do_lepton_comparison||(do_all&&!PlottingSetup::Approved)) lepton_comparison_plots();
|
559 |
|
|
|
560 |
|
|
|
561 |
|
|
//**** part 3b: comparison between control regions (SFZPJZBPOS,SFZPJZBNEG,...)
|
562 |
|
|
if (do_region_comparison||(do_all&&!PlottingSetup::Approved)) region_comparison_plots(mcjzb.str(),datajzb.str(),jzb_cut);
|
563 |
|
|
|
564 |
|
|
//**** part 4: JZB plots (OSOF, OSSF)
|
565 |
|
|
if(do_jzb_plots||do_all) jzb_plots(mcjzb.str(),datajzb.str(),global_ratio_binning);
|
566 |
|
|
|
567 |
|
|
//**** part 5 : Prediction plots
|
568 |
|
|
if(do_pred||do_all) do_prediction_plots(mcjzb.str(),datajzb.str(),DataSigma,MCSigma,overlay_signal);
|
569 |
|
|
|
570 |
|
|
//**** part 6: Ratio plots
|
571 |
|
|
//included in prediction plots.
|
572 |
|
|
|
573 |
|
|
//**** part 7: Some systematics plots
|
574 |
|
|
if(do_signal_bg_comparison_plot||(do_all&&!PlottingSetup::Approved)) signal_bg_comparison();
|
575 |
|
|
if(do_ttbar_comparison||(do_all&&!PlottingSetup::Approved)) ttbar_sidebands_comparison(mcjzb.str(),global_ratio_binning);
|
576 |
|
|
if(do_zjets_comparison||(do_all&&!PlottingSetup::Approved)) zjets_prediction_comparison(mcjzb.str());
|
577 |
|
|
|
578 |
|
|
if(do_diboson_plots) diboson_plots(mcjzb.str(),datajzb.str(),global_ratio_binning);
|
579 |
|
|
|
580 |
|
|
if(do_JES||(do_all&&!PlottingSetup::Approved)) {
|
581 |
|
|
make_JES_plot(cutmass&&cutOSSF&&basiccut,"_ossf");
|
582 |
|
|
make_JES_plot(cutmass&&cutOSOF&&basiccut,"_osof");
|
583 |
|
|
}
|
584 |
|
|
|
585 |
|
|
if (do_jzb_efficiency_curve) plot_jzb_sel_eff(mcjzb.str(),signalsamples,jzb_cut);
|
586 |
|
|
|
587 |
|
|
//**** part 8: observed and predicted!
|
588 |
|
|
if(do_all||get_new_results) doquick=0;
|
589 |
|
|
if(do_save_template) doquick=2;
|
590 |
|
|
// if(do_edge&&doquick>1) doquick=1;//we need at least doquick=1 (i.e. with storage) for edge fitting
|
591 |
|
|
|
592 |
|
|
if(do_all||do_save_template||do_compute_upper_limits_from_counting_experiment||do_model_scan||get_new_results) {
|
593 |
|
|
|
594 |
|
|
get_result(mcjzb.str(),datajzb.str(),DataPeakError,MCPeakError,jzb_cut,verbose,dopoisson,doquick);
|
595 |
|
|
// Also exclusive bins for low JZB
|
596 |
|
|
|
597 |
|
|
|
598 |
|
|
string MassRanges[3]={"NoMassCut","ZWindow10","LowMassRegion"};
|
599 |
|
|
TCut MassCuts[3]={TCut("mll>20"),Restrmasscut,TCut("mll>20&&mll<70")};
|
600 |
|
|
|
601 |
|
|
int InitialMassCut=0;
|
602 |
|
|
int FinalMassCut=2;
|
603 |
|
|
|
604 |
|
|
if(PlottingSetup::RestrictToMassPeak) {
|
605 |
|
|
InitialMassCut=1;
|
606 |
|
|
FinalMassCut=1;
|
607 |
|
|
}
|
608 |
|
|
|
609 |
|
|
for(int iMass=InitialMassCut;iMass<=FinalMassCut;iMass++) {
|
610 |
|
|
dout << "Processing mass region " << MassRanges[iMass] << endl;
|
611 |
|
|
cutmass=MassCuts[iMass];
|
612 |
|
|
get_exclusive_result(mcjzb.str(),datajzb.str(),DataPeakError,MCPeakError,0.,30.,verbose,dopoisson,doquick);
|
613 |
|
|
get_exclusive_result(mcjzb.str(),datajzb.str(),DataPeakError,MCPeakError,30.,50.,verbose,dopoisson,doquick);
|
614 |
|
|
}
|
615 |
|
|
}
|
616 |
|
|
|
617 |
|
|
|
618 |
|
|
vector<float>jzb_shape_limit_bins;
|
619 |
|
|
jzb_shape_limit_bins.push_back(50);
|
620 |
|
|
jzb_shape_limit_bins.push_back(65.05);
|
621 |
|
|
jzb_shape_limit_bins.push_back(73.4);
|
622 |
|
|
jzb_shape_limit_bins.push_back(88.7);
|
623 |
|
|
jzb_shape_limit_bins.push_back(115.25);
|
624 |
|
|
jzb_shape_limit_bins.push_back(200);
|
625 |
|
|
// jzb_shape_limit_bins.push_back(250);
|
626 |
|
|
if(do_prepare_limits_using_shapes) prepare_limits(mcjzb.str(),datajzb.str(),DataPeakError,MCPeakError,jzb_shape_limit_bins);
|
627 |
|
|
|
628 |
|
|
if(do_jedge) {
|
629 |
|
|
// write_info(__FUNCTION__,"Doing edge fit for data");
|
630 |
|
|
DoEdgeFit(mcjzb.str(),datajzb.str(),DataPeakError,MCPeakError,jzb_cut,data,cutmass&&cutnJets);
|
631 |
|
|
write_info(__FUNCTION__,"Doing JZB edge fit for MC");
|
632 |
|
|
// DoEdgeFit(mcjzb.str(),datajzb.str(),DataPeakError,MCPeakError,jzb_cut,mc,cutmass&&cutnJets);
|
633 |
|
|
// write_info(__FUNCTION__,"Doing edge fit for MC with signal");
|
634 |
|
|
// DoEdgeFit(mcjzb.str(),datajzb.str(),DataPeakError,MCPeakError,jzb_cut,mcwithsignal,cutmass&&cutnJets);
|
635 |
|
|
}
|
636 |
|
|
|
637 |
|
|
if(do_medge) {
|
638 |
|
|
vector<float> met_cuts;met_cuts.push_back(100);
|
639 |
|
|
// write_info(__FUNCTION__,"Doing MET edge fit for data");
|
640 |
|
|
// DoEdgeFit("met[4]","met[4]",DataPeakError,MCPeakError,met_cuts,data,cutmass&&cutnJets);
|
641 |
|
|
write_info(__FUNCTION__,"Doing MET edge fit for MC");
|
642 |
|
|
DoEdgeFit("met[4]","met[4]",DataPeakError,MCPeakError,met_cuts,mc,cutmass&&cutnJets);
|
643 |
|
|
// write_info(__FUNCTION__,"Doing edge fit for MC with signal");
|
644 |
|
|
// DoEdgeFit("met[4]","met[4]",DataPeakError,MCPeakError,met_cuts,mcwithsignal,cutmass&&cutnJets);
|
645 |
|
|
}
|
646 |
|
|
|
647 |
|
|
//------------------------ end of standard functions
|
648 |
|
|
|
649 |
|
|
// if(calculate_yields||do_all) calculate_all_yields(mcjzb.str(),jzb_cut); // now outdated - get_results now replaces this.
|
650 |
|
|
|
651 |
|
|
|
652 |
|
|
vector<vector<float> > all_systematics;
|
653 |
|
|
vector<vector<float> > all_efficiency;
|
654 |
|
|
|
655 |
|
|
if(do_compute_systematics||do_compute_upper_limits_from_counting_experiment||do_all) all_systematics=compute_systematics(mcjzb.str(),MCPeakError,alwaysflip,datajzb.str(),signalsamples,jzb_cut,requireZ);
|
656 |
|
|
// if(do_compute_efficiency) compute_efficiency(mcjzb.str(),allsamples, 50, -200, 300);
|
657 |
|
|
if(do_compute_efficiency) write_warning(__FUNCTION__,"efficiency computation deactivated");
|
658 |
|
|
|
659 |
|
|
if(do_compute_upper_limits_from_counting_experiment||do_all) compute_upper_limits_from_counting_experiment(all_systematics,jzb_cut,mcjzb.str(),doobserved,alwaysflip);
|
660 |
|
|
|
661 |
|
|
//------------------------ end of analysis parts - below: special applications
|
662 |
|
|
|
663 |
|
|
if(do_model_scan) scan_SUSY_parameter_space(mcjzb.str(),datajzb.str(),jzb_cut,requireZ,MCPeakError,DataPeakError);
|
664 |
|
|
|
665 |
|
|
if(do_zjet_ttbar_shapes) draw_ttbar_and_zjets_shape(mcjzb.str(),datajzb.str());
|
666 |
|
|
|
667 |
|
|
if(do_response_correction) {
|
668 |
|
|
find_correction_factors(jzbvariabledata,jzbvariablemc);
|
669 |
|
|
dout << "Please update ../Plotting/Modules/Setup.C to reflect the following values (round them first ... )" <<endl;
|
670 |
|
|
dout << "Corrected JZB variable definition " << endl;
|
671 |
|
|
cout << " Data: " << jzbvariabledata << endl;
|
672 |
|
|
cout << " MC: " << jzbvariablemc << endl;
|
673 |
|
|
dout << endl;
|
674 |
|
|
dout << "If you're feeling lazy, copy & paste this : " << endl;
|
675 |
|
|
dout << " string jzbvariabledata=\""<<jzbvariabledata<<"\";"<<endl;
|
676 |
|
|
dout << " string jzbvariablemc=\"" <<jzbvariablemc<<"\";"<<endl;
|
677 |
|
|
}
|
678 |
|
|
|
679 |
|
|
if(do_pick_up_events) {
|
680 |
|
|
|
681 |
|
|
TCut essentialcutbkp = essentialcut;
|
682 |
|
|
essentialcut=TCut("1.0");
|
683 |
|
|
|
684 |
|
|
|
685 |
|
|
pick_up_events("((((((passed_triggers ||!is_data)))&&((abs(eta1)<2.4 && abs(eta2)<2.4 && pt1>30 && pt2>20)))&&(((met[4]>100)&&((id1==id2)&&(ch1*ch2<0)))&&((((pfJetGoodNum40>=2&&pfJetGoodID[0]!=0)&&(pfJetGoodNum40>=2&&pfJetGoodID[1]!=0))&&((mll>2)&&((abs(eta1)<2.4 && abs(eta2)<2.4 && pt1>30 && pt2>20))))&&(pfJetGoodNum40>=3))&&mll>20&&mll<70&&(abs(eta1)<2.4 && abs(eta2)<2.4 && pt1>30 && pt2>20)&&pt1>20&&pt2>20)))*((weight*(weight<1000)*(is_data+(!is_data)*((id1==id2)*0.95+(id1!=id2)*0.94))))","ETH_SF__LOOSE.txt");
|
686 |
|
|
|
687 |
|
|
pick_up_events("((((((passed_triggers ||!is_data)))&&((abs(eta1)<2.4 && abs(eta2)<2.4 && pt1>30 && pt2>10)))&&(((met[4]>150)&&((id1==id2)&&(ch1*ch2<0)))&&((((pfJetGoodNum40>=2&&pfJetGoodID[0]!=0)&&(pfJetGoodNum40>=2&&pfJetGoodID[1]!=0))&&((mll>2)&&((abs(eta1)<2.4 && abs(eta2)<2.4 && pt1>30 && pt2>10))))&&(pfJetGoodNum40>=2&&pfTightHT>100))&&mll>20&&mll<70&&(abs(eta1)<2.4 && abs(eta2)<2.4 && pt1>30 && pt2>10)&&pt1>20&&pt2>10)))*((weight*(weight<1000)*(is_data+(!is_data)*((id1==id2)*0.95+(id1!=id2)*0.94))))","Aachen_SF__LOOSE.txt");
|
688 |
|
|
|
689 |
|
|
pick_up_events("((((((passed_triggers ||!is_data)))&&((abs(eta1)<1.4 && abs(eta2)<1.4 && pt1>30 && pt2>20)))&&(((met[4]>100)&&((id1==id2)&&(ch1*ch2<0)))&&((((pfJetGoodNum40>=2&&pfJetGoodID[0]!=0)&&(pfJetGoodNum40>=2&&pfJetGoodID[1]!=0))&&((mll>2)&&((abs(eta1)<1.4 && abs(eta2)<1.4 && pt1>30 && pt2>20))))&&(pfJetGoodNum40>=3))&&mll>20&&mll<70&&(abs(eta1)<1.4 && abs(eta2)<1.4 && pt1>30 && pt2>20)&&pt1>20&&pt2>20)))*((weight*(weight<1000)*(is_data+(!is_data)*((id1==id2)*0.95+(id1!=id2)*0.94))))","ETH_SF__TIGHT.txt");
|
690 |
|
|
|
691 |
|
|
pick_up_events("((((((passed_triggers ||!is_data)))&&((abs(eta1)<1.4 && abs(eta2)<1.4 && pt1>30 && pt2>10)))&&(((met[4]>150)&&((id1==id2)&&(ch1*ch2<0)))&&((((pfJetGoodNum40>=2&&pfJetGoodID[0]!=0)&&(pfJetGoodNum40>=2&&pfJetGoodID[1]!=0))&&((mll>2)&&((abs(eta1)<1.4 && abs(eta2)<1.4 && pt1>30 && pt2>10))))&&(pfJetGoodNum40>=2&&pfTightHT>100))&&mll>20&&mll<70&&(abs(eta1)<1.4 && abs(eta2)<1.4 && pt1>30 && pt2>10)&&pt1>20&&pt2>10)))*((weight*(weight<1000)*(is_data+(!is_data)*((id1==id2)*0.95+(id1!=id2)*0.94))))","Aachen_SF__TIGHT.txt");
|
692 |
|
|
|
693 |
|
|
|
694 |
|
|
|
695 |
|
|
|
696 |
|
|
/*
|
697 |
|
|
cout << "LOW MASS, SF, ETH " << endl;
|
698 |
|
|
pick_up_events("((((((passed_triggers ||!is_data)))&&((abs(eta1)<1.4 && abs(eta2)<1.4 && pt1>30 && pt2>20)))&&(((met[4]>100)&&((id1==id2)&&(ch1*ch2<0)))&&((((pfJetGoodNum40>=2&&pfJetGoodID[0]!=0)&&(pfJetGoodNum40>=2&&pfJetGoodID[1]!=0))&&((mll>2)&&((abs(eta1)<1.4 && abs(eta2)<1.4 && pt1>30 && pt2>20))))&&(pfJetGoodNum40>=3))&&mll>20&&mll<70&&(abs(eta1)<1.4 && abs(eta2)<1.4 && pt1>30 && pt2>20)&&pt1>20&&pt2>20)))*((weight*(weight<1000)*(is_data+(!is_data)*((id1==id2)*0.95+(id1!=id2)*0.94))))","ETH_SF.txt");
|
699 |
|
|
|
700 |
|
|
cout << "LOW MASS, OF, ETH " << endl;
|
701 |
|
|
pick_up_events("((((((passed_triggers ||!is_data)))&&((abs(eta1)<1.4 && abs(eta2)<1.4 && pt1>30 && pt2>20)))&&(((met[4]>100)&&((id1!=id2)&&(ch1*ch2<0)))&&((((pfJetGoodNum40>=2&&pfJetGoodID[0]!=0)&&(pfJetGoodNum40>=2&&pfJetGoodID[1]!=0))&&((mll>2)&&((abs(eta1)<1.4 && abs(eta2)<1.4 && pt1>30 && pt2>20))))&&(pfJetGoodNum40>=3))&&mll>20&&mll<70&&(abs(eta1)<1.4 && abs(eta2)<1.4 && pt1>30 && pt2>20)&&pt1>20&&pt2>20)))*((weight*(weight<1000)*(is_data+(!is_data)*((id1==id2)*0.95+(id1!=id2)*0.94))))","ETH_OF.txt");
|
702 |
|
|
|
703 |
|
|
cout << "LOW MASS, SF, Aachen " << endl;
|
704 |
|
|
pick_up_events("((((((passed_triggers ||!is_data)))&&((abs(eta1)<2.4 && abs(eta2)<2.4 && pt1>30 && pt2>10)))&&(((met[4]>150)&&((id1==id2)&&(ch1*ch2<0)))&&((((pfJetGoodNum40>=2&&pfJetGoodID[0]!=0)&&(pfJetGoodNum40>=2&&pfJetGoodID[1]!=0))&&((mll>2)&&((abs(eta1)<2.4 && abs(eta2)<2.4 && pt1>30 && pt2>10))))&&(pfJetGoodNum40>=2&&pfTightHT>100))&&mll>20&&mll<70&&(abs(eta1)<2.4 && abs(eta2)<2.4 && pt1>30 && pt2>10)&&pt1>20&&pt2>10)))*((weight*(weight<1000)*(is_data+(!is_data)*((id1==id2)*0.95+(id1!=id2)*0.94))))","Aachen_SF.txt");
|
705 |
|
|
|
706 |
|
|
cout << "LOW MASS, OF, Aachen " << endl;
|
707 |
|
|
pick_up_events("((((((passed_triggers ||!is_data)))&&((abs(eta1)<2.4 && abs(eta2)<2.4 && pt1>30 && pt2>10)))&&(((met[4]>150)&&((id1!=id2)&&(ch1*ch2<0)))&&((((pfJetGoodNum40>=2&&pfJetGoodID[0]!=0)&&(pfJetGoodNum40>=2&&pfJetGoodID[1]!=0))&&((mll>2)&&((abs(eta1)<2.4 && abs(eta2)<2.4 && pt1>30 && pt2>10))))&&(pfJetGoodNum40>=2&&pfTightHT>100))&&mll>20&&mll<70&&(abs(eta1)<2.4 && abs(eta2)<2.4 && pt1>30 && pt2>10)&&pt1>20&&pt2>10)))*((weight*(weight<1000)*(is_data+(!is_data)*((id1==id2)*0.95+(id1!=id2)*0.94))))","Aachen_OF.txt");
|
708 |
|
|
essentialcut=essentialcutbkp;
|
709 |
|
|
/*
|
710 |
|
|
dout << "Observed: " << endl;
|
711 |
|
|
pick_up_events((const char*)(cutmass&&cutOSSF&&cutnJets&&basiccut&&((string)"(("+datajzb.str()+")"+">100)").c_str()));
|
712 |
|
|
dout << "Predicted (JZB<-100) OSSF" << endl;
|
713 |
|
|
pick_up_events((const char*)(cutmass&&cutOSSF&&cutnJets&&basiccut&&((string)"(("+datajzb.str()+")"+"<-100)").c_str()));
|
714 |
|
|
dout << "Predicted (emu, JZB>100) OSOF" << endl;
|
715 |
|
|
pick_up_events((const char*)(cutmass&&cutOSOF&&cutnJets&&basiccut&&((string)"(("+datajzb.str()+")"+">100)").c_str()));
|
716 |
|
|
dout << "Predicted (emu, JZB<-100) OSOF" << endl;
|
717 |
|
|
pick_up_events((const char*)(cutmass&&cutOSOF&&cutnJets&&basiccut&&((string)"(("+datajzb.str()+")"+"<-100)").c_str()));
|
718 |
|
|
dout << "Predicted (SB SF, JZB>100) OSSF" << endl;
|
719 |
|
|
pick_up_events((const char*)(sidebandcut&&cutOSSF&&cutnJets&&basiccut&&((string)"(("+datajzb.str()+")"+">100)").c_str()));
|
720 |
|
|
dout << "Predicted (SB SF, JZB<-100) OSSF" << endl;
|
721 |
|
|
pick_up_events((const char*)(sidebandcut&&cutOSSF&&cutnJets&&basiccut&&((string)"(("+datajzb.str()+")"+"<-100)").c_str()));
|
722 |
|
|
dout << "Predicted (SB emu, JZB>100) OSOF" << endl;
|
723 |
|
|
pick_up_events((const char*)(sidebandcut&&cutOSOF&&cutnJets&&basiccut&&((string)"(("+datajzb.str()+")"+">100)").c_str()));
|
724 |
|
|
dout << "Predicted (SB emu, JZB<-100) OSOF" << endl;
|
725 |
|
|
pick_up_events((const char*)(cutOSOF&&cutnJets&&basiccut&&sidebandcut&&((string)"(("+datajzb.str()+")"+"<-100)").c_str()));*/
|
726 |
|
|
}
|
727 |
|
|
|
728 |
|
|
if(do_save_template||do_compute_upper_limits_from_shapes) {
|
729 |
|
|
// write_error(__FUNCTION__,"Currently commented out shape storage");
|
730 |
|
|
save_template(mcjzb.str(),datajzb.str(),jzb_cut,MCPeakError,DataPeakError,jzb_shape_limit_bins);
|
731 |
|
|
// PrepareDataShapes(mcjzb.str(), datajzb.str(), jzb_shape_limit_bins, DataPeakError);
|
732 |
|
|
// PrepareEdgeShapes(mcjzb.str(), datajzb.str(), jzb_shape_limit_bins, DataPeakError);
|
733 |
|
|
}
|
734 |
|
|
|
735 |
|
|
if(do_compute_upper_limits_from_shapes) compute_upper_limits_from_shapes(mcjzb.str(),datajzb.str(),jzb_cut,requireZ, MCPeakError, DataPeakError);
|
736 |
|
|
|
737 |
|
|
if(do_sideband_assessment) sideband_assessment(datajzb.str(),30.0,50.0);
|
738 |
|
|
|
739 |
|
|
if(do_mc_yields) {
|
740 |
|
|
TCut MassCuts[3] = {TCut("mll>20"),Restrmasscut,TCut("mll>20&&mll<70")};
|
741 |
|
|
string sMassCut[3] = {"NoMassCut" ,"ZWindow" , "LowMassRegion" };
|
742 |
|
|
for(int i=0;i<3;i++) {
|
743 |
|
|
cutmass=MassCuts[i];
|
744 |
|
|
cout << "_____________________________________________" << endl;
|
745 |
|
|
cout << "Considering mass region : " << sMassCut[i] << endl;
|
746 |
|
|
compute_Improved_MC_yields(mcjzb.str(),jzb_cut);
|
747 |
|
|
}
|
748 |
|
|
}
|
749 |
|
|
|
750 |
|
|
if(do_metjzb) met_jzb_cut(datajzb.str(),mcjzb.str(),jzb_cut);
|
751 |
|
|
|
752 |
|
|
if(do_qcd||do_all) qcd_plots(datajzb.str(),mcjzb.str(),jzb_cut);
|
753 |
|
|
|
754 |
|
|
if(do_mlls) do_mlls_plot(mcjzb.str());
|
755 |
|
|
|
756 |
|
|
if(do_ptsanity) check_ptsanity();
|
757 |
|
|
|
758 |
|
|
if(do_metpred) ExperimentalMetPrediction(false,false);
|
759 |
|
|
|
760 |
|
|
if(do_met_vs_jzb) met_vs_jzb_plots(datajzb.str(),mcjzb.str());
|
761 |
|
|
|
762 |
|
|
if(do_aachen) {
|
763 |
|
|
if(Contains(AachenFileName,"Data")) CastETHtoAachenNtuple(datajzb.str(),AachenFileName);
|
764 |
|
|
else CastETHtoAachenNtuple(mcjzb.str(),AachenFileName);
|
765 |
|
|
}
|
766 |
|
|
|
767 |
|
|
if(do_metplots) {
|
768 |
|
|
DoMetPlots(datajzb.str(),mcjzb.str());
|
769 |
|
|
}
|
770 |
|
|
|
771 |
|
|
if(do_wz) WZstudy();
|
772 |
|
|
|
773 |
|
|
if(do_rmue) ComputeRMuE();
|
774 |
|
|
|
775 |
|
|
// if(do_fsr) FSRstudy();
|
776 |
|
|
|
777 |
|
|
if(do_ttbartest) ttbar_tests(mcjzb.str());
|
778 |
|
|
|
779 |
|
|
if(do_test) test();
|
780 |
|
|
|
781 |
|
|
if(do_ttbaranalysis) ttbar_analysis();
|
782 |
|
|
|
783 |
|
|
if(do_overlap) overlapanalysis(datajzb.str(),mcjzb.str());
|
784 |
|
|
|
785 |
|
|
if(do_ittbar) make_ijzb_ttbar_closure_test(datajzb.str(),mcjzb.str());
|
786 |
|
|
return 0;
|
787 |
|
|
}
|
788 |
|
|
|