7 #include "TGraphErrors.h" 26 vector<vector<double> >
getYields(
small_tree_rpv &tree, vector<vector<double> >& low_drbb, vector<vector<double> >& high_drbb_err, vector<vector<double> >& low_drbb_err,
bool isData=
false);
27 void printPlots(TGraphErrors *
graph, TString title=
"", TString filename=
"syst_gs.pdf");
28 void printPlotsOverlay(TGraphErrors *graph1, TGraphErrors *graph2, TString title=
"", TString filename=
"syst_gs.pdf");
29 void print1D(vector<vector<double> > norm);
30 double addError(
double error,
double added_error);
31 double divideErrors(
double x,
double y,
double dx,
double dy);
35 string folder =
"/net/cms29/cms29r0/cawest/skims/ht1200/";
38 data.
Add(folder+
"*JetHT_Run2015D-05Oct2015-v1*");
39 data.
Add(folder+
"*JetHT_Run2015D-PromptReco-v4*");
41 small_tree_rpv qcd(folder+
"*QCD_HT1000to1500_TuneCUETP8M1_13TeV-madgraphMLM-pythia8*");
42 qcd.
Add(folder+
"*QCD_HT1000to1500_TuneCUETP8M1_13TeV-madgraphMLM-pythia8_ext1*");
43 qcd.
Add(folder+
"*QCD_HT1500to2000_TuneCUETP8M1_13TeV-madgraphMLM-pythia8*");
44 qcd.
Add(folder+
"*QCD_HT1500to2000_TuneCUETP8M1_13TeV-madgraphMLM-pythia8_ext1*");
45 qcd.
Add(folder+
"*QCD_HT2000toInf_TuneCUETP8M1_13TeV-madgraphMLM-pythia8*");
46 qcd.
Add(folder+
"*QCD_HT2000toInf_TuneCUETP8M1_13TeV-madgraphMLM-pythia8_ext1*");
48 small_tree_rpv other(
"/net/cms2/cms2r0/jaehyeokyoo/babies/skim_ht1200/*TTJets_TuneCUETP8M1_13TeV-madgraphMLM*");
49 other.
Add(folder+
"*TTJets_DiLept_TuneCUETP8M1_13TeV-madgraphMLM-pythia8*");
50 other.
Add(folder+
"*TTJets_DiLept_TuneCUETP8M1_13TeV-madgraphMLM-pythia8_ext1*");
51 other.
Add(folder+
"*TTJets_SingleLeptFromT_TuneCUETP8M1_13TeV-madgraphMLM-pythia8*");
52 other.
Add(folder+
"*TTJets_SingleLeptFromT_TuneCUETP8M1_13TeV-madgraphMLM-pythia8_ext1*");
53 other.
Add(folder+
"*TTJets_SingleLeptFromTbar_TuneCUETP8M1_13TeV-madgraphMLM-pythia8*");
54 other.
Add(folder+
"*TTJets_SingleLeptFromTbar_TuneCUETP8M1_13TeV-madgraphMLM-pythia8_ext1*");
55 other.
Add(folder+
"*ST_s-channel_4f_leptonDecays_13TeV-amcatnlo-pythia8_TuneCUETP8M1*");
56 other.
Add(folder+
"*ST_t-channel_antitop_4f_leptonDecays_13TeV-powheg-pythia8_TuneCUETP8M1*");
57 other.
Add(folder+
"*ST_t-channel_top_4f_leptonDecays_13TeV-powheg-pythia8_TuneCUETP8M1*");
58 other.
Add(folder+
"*ST_tW_antitop_5f_inclusiveDecays_13TeV-powheg-pythia8_TuneCUETP8M1*");
59 other.
Add(folder+
"*ST_tW_top_5f_inclusiveDecays_13TeV-powheg-pythia8_TuneCUETP8M1*");
60 other.
Add(folder+
"*DYJetsToLL_M-50_HT-600toInf_TuneCUETP8M1_13TeV-madgraphMLM-pythia8*");
61 other.
Add(folder+
"*ttHJetTobb_M125_13TeV_amcatnloFXFX_madspin_pythia8*");
62 other.
Add(folder+
"*TTTT_TuneCUETP8M1_13TeV-amcatnlo-pythia8*");
63 other.
Add(folder+
"*TTWJetsToLNu_TuneCUETP8M1_13TeV-amcatnloFXFX-madspin-pythia8*");
64 other.
Add(folder+
"*TTWJetsToQQ_TuneCUETP8M1_13TeV-amcatnloFXFX-madspin-pythia8*");
65 other.
Add(folder+
"*TTZToLLNuNu_M-10_TuneCUETP8M1_13TeV-amcatnlo-pythia8*");
66 other.
Add(folder+
"*TTZToQQ_TuneCUETP8M1_13TeV-amcatnlo-pythia8*");
67 other.
Add(folder+
"*WJetsToLNu_HT-600ToInf_TuneCUETP8M1_13TeV-madgraphMLM-pythia8*");
68 other.
Add(folder+
"*WJetsToQQ_HT-600ToInf_TuneCUETP8M1_13TeV-madgraphMLM-pythia8*");
69 other.
Add(folder+
"*ZJetsToQQ_HT600toInf_13TeV-madgraph*");
72 cout<<
"[syst_gs] Getting Yields..."<<endl;
75 vector<vector<double> > data_yields_ldrbb, data_yields_hdrbb_err, data_yields_ldrbb_err;
76 vector<vector<double> > qcd_yields_ldrbb, qcd_yields_hdrbb_err, qcd_yields_ldrbb_err;
77 vector<vector<double> > other_yields_ldrbb, other_yields_hdrbb_err, other_yields_ldrbb_err;
79 vector<vector<double> > data_yields_hdrbb =
getYields(data, data_yields_ldrbb, data_yields_hdrbb_err, data_yields_ldrbb_err,
true);
80 vector<vector<double> > qcd_yields_hdrbb =
getYields(qcd, qcd_yields_ldrbb, qcd_yields_hdrbb_err, qcd_yields_ldrbb_err);
81 vector<vector<double> > other_yields_hdrbb =
getYields(other, other_yields_ldrbb, other_yields_hdrbb_err, other_yields_ldrbb_err);
88 cout<<
"[syst_gs] Finding Normalization..."<<endl;
90 for(
unsigned int i=0; i<data_yields_hdrbb.size(); i++){
91 for(
unsigned int j=0; j<data_yields_hdrbb[i].size(); j++){
94 data_yields_hdrbb[i][j] -= other_yields_hdrbb[i][j];
97 data_yields_hdrbb_err[i][j] =
AddInQuadrature(data_yields_hdrbb_err[i][j], other_yields_hdrbb_err[i][j]);
100 norm_hdrbb[i][j] = data_yields_hdrbb[i][j]/qcd_yields_hdrbb[i][j];
102 norm_hdrbb_err[i][j] =
divideErrors(data_yields_hdrbb[i][j], qcd_yields_hdrbb[i][j], data_yields_hdrbb_err[i][j], qcd_yields_hdrbb_err[i][j]);
105 dmc_ldrbb[i][j] = data_yields_ldrbb[i][j]/((norm_hdrbb[i][j]*qcd_yields_ldrbb[i][j]) + other_yields_ldrbb[i][j]);
107 dmc_ldrbb_err[i][j] =
divideErrors(data_yields_ldrbb[i][j],
108 (norm_hdrbb[i][j]*qcd_yields_ldrbb[i][j]) + other_yields_ldrbb[i][j],
109 data_yields_ldrbb_err[i][j],
111 divideErrors(data_yields_hdrbb[i][j], qcd_yields_hdrbb[i][j]/qcd_yields_ldrbb[i][j], data_yields_hdrbb_err[i][j],
112 divideErrors(qcd_yields_hdrbb[i][j], qcd_yields_ldrbb[i][j], qcd_yields_hdrbb_err[i][j], qcd_yields_ldrbb_err[i][j])),
113 other_yields_ldrbb_err[i][j])
118 cout<<
"[syst_gs] Writing Files..."<<endl;
120 vector<double> xbins = {0,1,2,3};
121 vector<double> xerr = {0,0,0,0};
123 TGraphErrors *dmc_ldrbb_allmj =
new TGraphErrors(dmc_ldrbb[0].size(), &(xbins[0]), &(dmc_ldrbb[0][0]), &(xerr[0]), &(dmc_ldrbb_err[0][0]));
124 dmc_ldrbb_allmj->SetName(
"dmc_ldrbb_allmj");
125 TGraphErrors *dmc_ldrbb_lowmj =
new TGraphErrors(dmc_ldrbb[1].size(), &(xbins[0]), &(dmc_ldrbb[1][0]), &(xerr[0]), &(dmc_ldrbb_err[1][0]));
126 dmc_ldrbb_lowmj->SetName(
"dmc_ldrbb_lowmj");
127 TGraphErrors *dmc_ldrbb_highmj =
new TGraphErrors(dmc_ldrbb[2].size(), &(xbins[0]), &(dmc_ldrbb[2][0]), &(xerr[0]), &(dmc_ldrbb_err[2][0]));
128 dmc_ldrbb_highmj->SetName(
"dmc_ldrbb_highmj");
131 TFile *out =
new TFile(
"syst_gs.root",
"recreate");
133 dmc_ldrbb_allmj->Write();
134 dmc_ldrbb_lowmj->Write();
135 dmc_ldrbb_highmj->Write();
139 printPlots(dmc_ldrbb_allmj,
"M_{J}>500",
"syst_gs/dmc_ldrbb_allmj.pdf");
140 printPlots(dmc_ldrbb_lowmj,
"500 #leq M_{J} #leq 800",
"syst_gs/dmc_ldrbb_lowmj.pdf");
141 printPlots(dmc_ldrbb_highmj,
"M_{J}>800",
"syst_gs/dmc_ldrbb_highmj.pdf");
142 printPlotsOverlay(dmc_ldrbb_highmj, dmc_ldrbb_lowmj,
"",
"syst_gs/dmc_ldrbb_overlaid.pdf");
146 cout<<
"[syst_gs] Making 1D Distributions... "<<endl;
151 vector<vector<double> >
getYields(
small_tree_rpv &tree, vector<vector<double> >& low_drbb, vector<vector<double> >& high_drbb_err, vector<vector<double> >& low_drbb_err,
bool isData){
156 vector<vector<double> > yields_hdrbb_err(
nmjbins, vector<double>(
nnjetbins));
157 vector<vector<double> > yields_ldrbb_err(
nmjbins, vector<double>(
nnjetbins));
163 for(
int iEnt=0; iEnt<tree.
GetEntries(); iEnt++){
167 if(isData && (!tree.
pass()||!tree.
trig()[12]))
continue;
170 if(tree.
nbm()!=2)
continue;
173 if(tree.
nleps()==0 && tree.
ht()>1500 && tree.
mj()>500){
177 for(
unsigned int iDrbb=0; iDrbb<tree.
dr_bb().size(); iDrbb++){
179 if(tree.
dr_bb()[iDrbb]>=2.4){
184 if(tree.
mj()>500 && tree.
mj()<=800){
189 else if(tree.
mj()>800){
195 else if(tree.
dr_bb()[iDrbb]<=1.6){
200 if(tree.
mj()>500 && tree.
mj()<=800){
205 else if(tree.
mj()>800){
215 for(
unsigned int iDrbb=0; iDrbb<tree.
dr_bb().size(); iDrbb++){
217 if(tree.
dr_bb()[iDrbb]>=2.4){
222 if(tree.
mj()>500 && tree.
mj()<=800){
227 else if(tree.
mj()>800){
233 else if(tree.
dr_bb()[iDrbb]<=1.6){
238 if(tree.
mj()>500 && tree.
mj()<=800){
243 else if(tree.
mj()>800){
254 for(
unsigned int iDrbb=0; iDrbb<tree.
dr_bb().size(); iDrbb++){
257 if(tree.
dr_bb()[iDrbb]>=2.4){
262 if(tree.
mj()>500 && tree.
mj()<=800){
267 else if(tree.
mj()>800){
273 else if(tree.
dr_bb()[iDrbb]<=1.6){
278 if(tree.
mj()>500 && tree.
mj()<=800){
283 else if(tree.
mj()>800){
290 else if(tree.
njets()>=10){
291 for(
unsigned int iDrbb=0; iDrbb<tree.
dr_bb().size(); iDrbb++){
294 if(tree.
dr_bb()[iDrbb]>=2.4){
299 if(tree.
mj()>500 && tree.
mj()<=800){
304 else if(tree.
mj()>800){
310 else if(tree.
dr_bb()[iDrbb]<=1.6){
315 if(tree.
mj()>500 && tree.
mj()<=800){
320 else if(tree.
mj()>800){
329 low_drbb = yields_ldrbb;
330 high_drbb_err = yields_hdrbb_err;
331 low_drbb_err = yields_ldrbb_err;
335 void printPlotsOverlay(TGraphErrors *graph1, TGraphErrors *graph2, TString title, TString filename){
337 gStyle->SetOptStat(0);
340 graph1->SetMarkerStyle(20);
341 graph2->SetMarkerStyle(20);
351 TH1F* h =
new TH1F(
"h",title,nnjetbins,x[0]-0.5,x[nnjetbins-1]+0.5);
353 if(i==0) h->GetXaxis()->SetBinLabel(i+1,
"4 #leq N_{jets} #leq5");
354 if(i==1) h->GetXaxis()->SetBinLabel(i+1,
"6 #leq N_{jets} #leq7");
355 if(i==2) h->GetXaxis()->SetBinLabel(i+1,
"8 #leq N_{jets} #leq9");
356 if(i==3) h->GetXaxis()->SetBinLabel(i+1,
"N_{jets} #geq10");
358 h->GetYaxis()->SetTitle(
"Data/MC");
359 h->GetYaxis()->SetTitleSize(0.045);
361 h->SetLabelSize(0.06);
362 h->SetLabelSize(0.06,
"Y");
365 graph1->SetLineColor(kRed);
366 graph1->SetMarkerColor(kRed);
368 graph2->Draw(
"SAME P");
370 c1.SaveAs(
"plots/"+filename);
376 gStyle->SetOptStat(0);
379 graph->SetMarkerStyle(20);
389 TH1F* h =
new TH1F(
"h",title,nnjetbins,x[0]-0.5,x[nnjetbins-1]+0.5);
391 if(i==0) h->GetXaxis()->SetBinLabel(i+1,
"4 #leq N_{jets} #leq5");
392 if(i==1) h->GetXaxis()->SetBinLabel(i+1,
"6 #leq N_{jets} #leq7");
393 if(i==2) h->GetXaxis()->SetBinLabel(i+1,
"8 #leq N_{jets} #leq9");
394 if(i==3) h->GetXaxis()->SetBinLabel(i+1,
"N_{jets} #geq10");
396 h->GetYaxis()->SetTitle(
"Data/MC");
397 h->GetYaxis()->SetTitleSize(0.045);
399 h->SetLabelSize(0.06);
400 h->SetLabelSize(0.06,
"Y");
405 c1.SaveAs(
"plots/"+filename);
412 string extraWeight(
"w_pu_rpv/eff_trig");
414 vector<TString> s_rpv_M1000;
415 s_rpv_M1000.push_back(
"/homes/cawest/babymaker/CMSSW_7_4_14/src/babymaker/RPV_M1000.root");
416 vector<TString> s_rpv_M1100;
417 s_rpv_M1100.push_back(
"/homes/cawest/babymaker/CMSSW_7_4_14/src/babymaker/RPV_M1100.root");
418 vector<TString> s_rpv_NLO;
419 s_rpv_NLO.push_back(
"/homes/cawest/CMSSW_7_4_14/src/babymaker/RPV_M1000_NLO.root");
421 vector<TString> s_tt_had;
422 s_tt_had.push_back(
"/net/cms2/cms2r0/jaehyeokyoo/babies/skim_ht1200/*TTJets_TuneCUETP8M1_13TeV-madgraphMLM*");
423 vector<TString> s_tt;
424 s_tt.push_back(
filestring(
"TTJets_DiLept_TuneCUETP8M1_13TeV-madgraphMLM-pythia8"));
425 s_tt.push_back(
filestring(
"TTJets_DiLept_TuneCUETP8M1_13TeV-madgraphMLM-pythia8_ext1"));
426 s_tt.push_back(
filestring(
"TTJets_SingleLeptFromT_TuneCUETP8M1_13TeV-madgraphMLM-pythia8"));
427 s_tt.push_back(
filestring(
"TTJets_SingleLeptFromT_TuneCUETP8M1_13TeV-madgraphMLM-pythia8_ext1"));
428 s_tt.push_back(
filestring(
"TTJets_SingleLeptFromTbar_TuneCUETP8M1_13TeV-madgraphMLM-pythia8"));
429 s_tt.push_back(
filestring(
"TTJets_SingleLeptFromTbar_TuneCUETP8M1_13TeV-madgraphMLM-pythia8_ext1"));
430 vector<TString> s_wjets;
431 s_wjets.push_back(
filestring(
"WJetsToLNu_HT-600ToInf_TuneCUETP8M1_13TeV-madgraphMLM-pythia8"));
432 vector<TString> s_singlet;
433 s_singlet.push_back(
filestring(
"ST_s-channel_4f_leptonDecays_13TeV-amcatnlo-pythia8_TuneCUETP8M1"));
434 s_singlet.push_back(
filestring(
"ST_t-channel_antitop_4f_leptonDecays_13TeV-powheg-pythia8_TuneCUETP8M1"));
435 s_singlet.push_back(
filestring(
"ST_t-channel_top_4f_leptonDecays_13TeV-powheg-pythia8_TuneCUETP8M1"));
436 s_singlet.push_back(
filestring(
"ST_tW_antitop_5f_inclusiveDecays_13TeV-powheg-pythia8_TuneCUETP8M1"));
437 s_singlet.push_back(
filestring(
"ST_tW_top_5f_inclusiveDecays_13TeV-powheg-pythia8_TuneCUETP8M1"));
438 vector<TString> s_qcd;
439 s_qcd.push_back(
filestring(
"QCD_HT1000to1500_TuneCUETP8M1_13TeV-madgraphMLM-pythia8"));
440 s_qcd.push_back(
filestring(
"QCD_HT1000to1500_TuneCUETP8M1_13TeV-madgraphMLM-pythia8_ext1"));
441 s_qcd.push_back(
filestring(
"QCD_HT1500to2000_TuneCUETP8M1_13TeV-madgraphMLM-pythia8"));
442 s_qcd.push_back(
filestring(
"QCD_HT1500to2000_TuneCUETP8M1_13TeV-madgraphMLM-pythia8_ext1"));
443 s_qcd.push_back(
filestring(
"QCD_HT2000toInf_TuneCUETP8M1_13TeV-madgraphMLM-pythia8"));
444 s_qcd.push_back(
filestring(
"QCD_HT2000toInf_TuneCUETP8M1_13TeV-madgraphMLM-pythia8_ext1"));
445 vector<TString> s_other;
446 s_other.push_back(
filestring(
"DYJetsToLL_M-50_HT-600toInf_TuneCUETP8M1_13TeV-madgraphMLM-pythia8"));
447 s_other.push_back(
filestring(
"TTWJetsToLNu_TuneCUETP8M1_13TeV-amcatnloFXFX-madspin-pythia8"));
448 s_other.push_back(
filestring(
"TTWJetsToQQ_TuneCUETP8M1_13TeV-amcatnloFXFX-madspin-pythia8"));
449 s_other.push_back(
filestring(
"TTZToQQ_TuneCUETP8M1_13TeV-amcatnlo-pythia8"));
450 s_other.push_back(
filestring(
"TTZToLLNuNu_M-10_TuneCUETP8M1_13TeV-amcatnlo-pythia8"));
451 s_other.push_back(
filestring(
"ttHJetTobb_M125_13TeV_amcatnloFXFX_madspin_pythia8"));
452 s_other.push_back(
filestring(
"TTTT_TuneCUETP8M1_13TeV-amcatnlo-pythia8"));
453 vector<TString> s_w_had;
454 s_w_had.push_back(
filestring(
"WJetsToQQ_HT-600ToInf_TuneCUETP8M1_13TeV-madgraphMLM-pythia8"));
455 vector<TString> s_z_had;
456 s_z_had.push_back(
filestring(
"ZJetsToQQ_HT600toInf_13TeV-madgraph"));
457 vector<TString> s_jetht;
458 s_jetht.push_back(
filestring(
"JetHT_Run2015C_25ns-05Oct2015-v1"));
459 s_jetht.push_back(
filestring(
"JetHT_Run2015D-05Oct2015-v1"));
460 s_jetht.push_back(
filestring(
"JetHT_Run2015D-PromptReco-v4"));
464 vector<sfeats> Samples;
465 Samples.push_back(
sfeats(s_jetht,
"Data",kBlack,1,
"trig[12] && pass && (njets<10 || (nmus+nels)==0)"));
466 Samples.back().isData =
true;
467 Samples.back().doStack =
false;
469 Samples.push_back(
sfeats(s_rpv_M1000,
"#tilde{g}(1.0 TeV)#rightarrow tbs",
ra4::c_t1tttt));
470 Samples.back().doStack =
false;
471 Samples.back().isSig =
true;
472 Samples.push_back(
sfeats(s_rpv_M1100,
"#tilde{g}(1.1 TeV)#rightarrow tbs",
ra4::c_t1tttt, 2));
473 Samples.back().doStack =
false;
474 Samples.back().isSig =
true;
476 Samples.push_back(
sfeats(s_qcd,
"QCD", kYellow, 1,
cutandweight(
"1",to_string(norm[0][0])+
"*w_pu_rpv/eff_trig")));
477 Samples.push_back(
sfeats(s_qcd,
"QCD", kYellow, 1,
cutandweight(
"1",to_string(norm[0][1])+
"*w_pu_rpv/eff_trig")));
478 Samples.push_back(
sfeats(s_qcd,
"QCD", kYellow, 1,
cutandweight(
"1",to_string(norm[0][2])+
"*w_pu_rpv/eff_trig")));
479 Samples.push_back(
sfeats(s_qcd,
"QCD", kYellow, 1,
cutandweight(
"1",to_string(norm[0][3])+
"*w_pu_rpv/eff_trig")));
480 Samples.push_back(
sfeats(s_qcd,
"QCD", kYellow, 1,
cutandweight(
"1",to_string(norm[1][0])+
"*w_pu_rpv/eff_trig")));
481 Samples.push_back(
sfeats(s_qcd,
"QCD", kYellow, 1,
cutandweight(
"1",to_string(norm[1][1])+
"*w_pu_rpv/eff_trig")));
482 Samples.push_back(
sfeats(s_qcd,
"QCD", kYellow, 1,
cutandweight(
"1",to_string(norm[1][2])+
"*w_pu_rpv/eff_trig")));
483 Samples.push_back(
sfeats(s_qcd,
"QCD", kYellow, 1,
cutandweight(
"1",to_string(norm[1][3])+
"*w_pu_rpv/eff_trig")));
484 Samples.push_back(
sfeats(s_qcd,
"QCD", kYellow, 1,
cutandweight(
"1",to_string(norm[2][0])+
"*w_pu_rpv/eff_trig")));
485 Samples.push_back(
sfeats(s_qcd,
"QCD", kYellow, 1,
cutandweight(
"1",to_string(norm[2][1])+
"*w_pu_rpv/eff_trig")));
486 Samples.push_back(
sfeats(s_qcd,
"QCD", kYellow, 1,
cutandweight(
"1",to_string(norm[2][2])+
"*w_pu_rpv/eff_trig")));
487 Samples.push_back(
sfeats(s_qcd,
"QCD", kYellow, 1,
cutandweight(
"1",to_string(norm[2][3])+
"*w_pu_rpv/eff_trig")));
490 Samples.push_back(
sfeats(s_z_had,
"Z+jets, 0 l", kBlack, 1,
cutandweight(
"1",extraWeight)));
493 Samples.push_back(
sfeats(s_tt_had,
"t#bar{t}, 0 l", kTeal, 1,
cutandweight(
"ntruleps==0", extraWeight)));
499 vector<vector<int> >rpv_sam(nBins);
500 for(
unsigned sam(0); sam <
nBins; sam++){
501 rpv_sam[sam].push_back(0);
502 rpv_sam[sam].push_back(1);
503 rpv_sam[sam].push_back(2);
505 rpv_sam[sam].push_back(3+sam);
507 rpv_sam[sam].push_back(15);
508 rpv_sam[sam].push_back(16);
509 rpv_sam[sam].push_back(17);
510 rpv_sam[sam].push_back(18);
511 rpv_sam[sam].push_back(19);
512 rpv_sam[sam].push_back(20);
513 rpv_sam[sam].push_back(21);
514 rpv_sam[sam].push_back(22);
519 vector<TString> cuts;
520 cuts.push_back(
"nleps==0&&ht>1500&&mj>500&&njets>=4&&njets<=5&&nbm==2");
521 cuts.push_back(
"nleps==0&&ht>1500&&mj>500&&njets>=6&&njets<=7&&nbm==2");
522 cuts.push_back(
"nleps==0&&ht>1500&&mj>500&&njets>=8&&njets<=9&&nbm==2");
523 cuts.push_back(
"nleps==0&&ht>1500&&mj>500&&njets>=10&&nbm==2");
525 cuts.push_back(
"nleps==0&&ht>1500&&mj>500&&mj<=800&&njets>=4&&njets<=5&&nbm==2");
526 cuts.push_back(
"nleps==0&&ht>1500&&mj>500&&mj<=800&&njets>=6&&njets<=7&&nbm==2");
527 cuts.push_back(
"nleps==0&&ht>1500&&mj>500&&mj<=800&&njets>=8&&njets<=9&&nbm==2");
528 cuts.push_back(
"nleps==0&&ht>1500&&mj>500&&mj<=800&&njets>=10&&nbm==2");
530 cuts.push_back(
"nleps==0&&ht>1500&&mj>800&&njets>=4&&njets<=5&&nbm==2");
531 cuts.push_back(
"nleps==0&&ht>1500&&mj>800&&njets>=6&&njets<=7&&nbm==2");
532 cuts.push_back(
"nleps==0&&ht>1500&&mj>800&&njets>=8&&njets<=9&&nbm==2");
533 cuts.push_back(
"nleps==0&&ht>1500&&mj>800&&njets>=10&&nbm==2");
536 for(
int iBins=0; iBins<
nBins; iBins++){
537 vars.push_back(
hfeats(
"dr_bb",15, 0, 6, rpv_sam[iBins],
"#DeltaR_{b#bar{b}}", cuts[iBins]));
538 vars.back().whichPlots=
"12";
545 return sqrt(pow(error,2)+pow(added_error,2));
549 if(x==0||y==0||dx==0||dy==0) cout<<
"Dividing by 0 in divideErrors"<<endl;
550 return (x/y)*sqrt(pow(dx/x,2)+pow(dy/y,2));
void plot_distributions(std::vector< sfeats > Samples, std::vector< hfeats > vars, TString luminosity="10", TString filetype=".eps", TString namestyle="LargeLabels", TString dir="1d", bool doRatio=false, bool showcuts=false)
virtual std::vector< float > const & dr_bb() const
virtual std::vector< bool > const & trig() const
void printPlots(TGraphErrors *graph, TString title="", TString filename="syst_gs.pdf")
float const & weight() const
double divideErrors(double x, double y, double dx, double dy)
std::string cutandweight(std::string cut, std::string weight)
void printPlotsOverlay(TGraphErrors *graph1, TGraphErrors *graph2, TString title="", TString filename="syst_gs.pdf")
vector< vector< double > > getYields(small_tree_rpv &tree, vector< vector< double > > &low_drbb, vector< vector< double > > &high_drbb_err, vector< vector< double > > &low_drbb_err, bool isData=false)
int const & nleps() const
void print1D(vector< vector< double > > norm)
virtual float const & mj() const
int const & njets() const
TString filestring(TString dataset, bool isSkimmed=true)
virtual bool const & pass() const
virtual void GetEntry(const long entry)
virtual float const & w_pu_rpv() const
int Add(const std::string &filename)
double addError(double error, double added_error)
virtual float const & eff_trig() const
long double AddInQuadrature(long double x, long double y)