-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.C
81 lines (66 loc) · 2.28 KB
/
example.C
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
#include "MyAnalysis.h"
#include "Plotter.h"
#include <iostream>
#include <TChain.h>
#include <TGraphAsymmErrors.h>
#include <string>
int main() {
float lumi = 50.;
MyAnalysis *A = new MyAnalysis();
TChain* ch = new TChain("events");
ch->Add("files/data.root");
ch->Process(A);
MyAnalysis *B = new MyAnalysis();
TChain* ch2 = new TChain("events");
ch2->Add("files/ttbar.root");
ch2->Process(B);
MyAnalysis *C = new MyAnalysis();
TChain* ch3 = new TChain("events");
ch3->Add("files/wjets.root");
ch3->Process(C);
MyAnalysis *D = new MyAnalysis();
TChain* ch4 = new TChain("events");
ch4->Add("files/dy.root");
ch4->Process(D);
MyAnalysis *E = new MyAnalysis();
TChain* ch5 = new TChain("events");
ch5->Add("files/ww.root");
ch5->Process(E);
MyAnalysis *F = new MyAnalysis();
TChain* ch6 = new TChain("events");
ch6->Add("files/wz.root");
ch6->Process(F);
MyAnalysis *G = new MyAnalysis();
TChain* ch7 = new TChain("events");
ch7->Add("files/zz.root");
ch7->Process(G);
MyAnalysis *H = new MyAnalysis();
TChain* ch8 = new TChain("events");
ch8->Add("files/qcd.root");
ch8->Process(H);
MyAnalysis *I = new MyAnalysis();
TChain* ch9 = new TChain("events");
ch9->Add("files/single_top.root");
ch9->Process(I);
Plotter P;
P.SetData(A->histograms, std::string("Data"));
P.AddBg(B->histograms, std::string("TTbar"));
P.AddBg(C->histograms, std::string("Wjets"));
P.AddBg(D->histograms, std::string("DY"));
P.AddBg(E->histograms, std::string("WW"));
P.AddBg(F->histograms, std::string("WZ"));
P.AddBg(G->histograms, std::string("ZZ"));
P.AddBg(H->histograms, std::string("QCD"));
P.AddBg(I->histograms, std::string("single Top"));
P.Plot(string("results.pdf"));
Plotter P_MC;
P_MC.AddBg(B->histograms_MC, std::string("TTbar"));
P_MC.AddBg(C->histograms_MC, std::string("Wjets"));
P_MC.AddBg(D->histograms_MC, std::string("DY"));
P_MC.AddBg(E->histograms_MC, std::string("WW"));
P_MC.AddBg(F->histograms_MC, std::string("WZ"));
P_MC.AddBg(G->histograms_MC, std::string("ZZ"));
P_MC.AddBg(H->histograms_MC, std::string("QCD"));
P_MC.AddBg(I->histograms_MC, std::string("single Top"));
P_MC.Plot(string("results_MC.pdf"));
}