-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbtag.cpp
More file actions
97 lines (90 loc) · 3.36 KB
/
Copy pathbtag.cpp
File metadata and controls
97 lines (90 loc) · 3.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
void save(TString name="QCD"){
TFile* file1 = TFile::Open("2016_"+name+".root");
TFile* file2 = TFile::Open("2016APV_"+name+".root");
TFile* file3 = TFile::Open("2017_"+name+".root");
TFile* file4 = TFile::Open("2018_"+name+".root");
TH2D* h2016[6];
TH2D* h2016APV[6];
TH2D* h2017[6];
TH2D* h2018[6];
h2016[0] = (TH2D*)file1->Get("btag_eff_b_loose");
h2016[1] = (TH2D*)file1->Get("btag_eff_c_loose");
h2016[2] = (TH2D*)file1->Get("btag_eff_l_loose");
h2016[3] = (TH2D*)file1->Get("btag_eff_b_medium");
h2016[4] = (TH2D*)file1->Get("btag_eff_c_medium");
h2016[5] = (TH2D*)file1->Get("btag_eff_l_medium");
h2016APV[0] = (TH2D*)file1->Get("btag_eff_b_loose");
h2016APV[1] = (TH2D*)file1->Get("btag_eff_c_loose");
h2016APV[2] = (TH2D*)file1->Get("btag_eff_l_loose");
h2016APV[3] = (TH2D*)file1->Get("btag_eff_b_medium");
h2016APV[4] = (TH2D*)file1->Get("btag_eff_c_medium");
h2016APV[5] = (TH2D*)file1->Get("btag_eff_l_medium");
h2017[0] = (TH2D*)file2->Get("btag_eff_b_loose");
h2017[1] = (TH2D*)file2->Get("btag_eff_c_loose");
h2017[2] = (TH2D*)file2->Get("btag_eff_l_loose");
h2017[3] = (TH2D*)file2->Get("btag_eff_b_medium");
h2017[4] = (TH2D*)file2->Get("btag_eff_c_medium");
h2017[5] = (TH2D*)file2->Get("btag_eff_l_medium");
h2018[0] = (TH2D*)file3->Get("btag_eff_b_loose");
h2018[1] = (TH2D*)file3->Get("btag_eff_c_loose");
h2018[2] = (TH2D*)file3->Get("btag_eff_l_loose");
h2018[3] = (TH2D*)file3->Get("btag_eff_b_medium");
h2018[4] = (TH2D*)file3->Get("btag_eff_c_medium");
h2018[5] = (TH2D*)file3->Get("btag_eff_l_medium");
h2016[0]->SetName("btag_eff_b_loose_2016");
h2016[1]->SetName("btag_eff_c_loose_2016");
h2016[2]->SetName("btag_eff_l_loose_2016");
h2016[3]->SetName("btag_eff_b_medium_2016");
h2016[4]->SetName("btag_eff_c_medium_2016");
h2016[5]->SetName("btag_eff_l_medium_2016");
h2016APV[0]->SetName("btag_eff_b_loose_2016APV");
h2016APV[1]->SetName("btag_eff_c_loose_2016APV");
h2016APV[2]->SetName("btag_eff_l_loose_2016APV");
h2016APV[3]->SetName("btag_eff_b_medium_2016APV");
h2016APV[4]->SetName("btag_eff_c_medium_2016APV");
h2016APV[5]->SetName("btag_eff_l_medium_2016APV");
h2017[0]->SetName("btag_eff_b_loose_2017");
h2017[1]->SetName("btag_eff_c_loose_2017");
h2017[2]->SetName("btag_eff_l_loose_2017");
h2017[3]->SetName("btag_eff_b_medium_2017");
h2017[4]->SetName("btag_eff_c_medium_2017");
h2017[5]->SetName("btag_eff_l_medium_2017");
h2018[0]->SetName("btag_eff_b_loose_2018");
h2018[1]->SetName("btag_eff_c_loose_2018");
h2018[2]->SetName("btag_eff_l_loose_2018");
h2018[3]->SetName("btag_eff_b_medium_2018");
h2018[4]->SetName("btag_eff_c_medium_2018");
h2018[5]->SetName("btag_eff_l_medium_2018");
TFile* output = new TFile(name+".root", "recreate");
h2016[0]->Write();
h2016[1]->Write();
h2016[2]->Write();
h2016[3]->Write();
h2016[4]->Write();
h2016[5]->Write();
h2016APV[0]->Write();
h2016APV[1]->Write();
h2016APV[2]->Write();
h2016APV[3]->Write();
h2016APV[4]->Write();
h2016APV[5]->Write();
h2017[0]->Write();
h2017[1]->Write();
h2017[2]->Write();
h2017[3]->Write();
h2017[4]->Write();
h2017[5]->Write();
h2018[0]->Write();
h2018[1]->Write();
h2018[2]->Write();
h2018[3]->Write();
h2018[4]->Write();
h2018[5]->Write();
}
void btag(){
save("QCD");
save("ST");
save("TT");
save("WJetsToLNu");
//save("SMS-T5ttcc");
}