1 |
#include "CommonParameters.h"
|
2 |
#include "TLine.h"
|
3 |
#include <string>
|
4 |
#include "Slices.h"
|
5 |
|
6 |
|
7 |
using namespace std;
|
8 |
|
9 |
|
10 |
void plotSummary(int iPlot = 0){
|
11 |
|
12 |
bool showPbPb = 0;
|
13 |
if(iPlot == 0 || iPlot == 3) showPbPb = 1;
|
14 |
|
15 |
|
16 |
TH1::SetDefaultSumw2();
|
17 |
|
18 |
TString infname = "/d101/yetkin/analysis/d0204/ntuple_data_pPb_akPu3PF_forest71_20130204_01.root";
|
19 |
TString refname = "/d101/yetkin/analysis/d0205/ntuple_data_PbPb_akPu3PF_forest71_20130205_01.root";
|
20 |
TString mixname = "/d101/yetkin/analysis/d0204/hijing.root";
|
21 |
|
22 |
|
23 |
infname = "ntuple_data_pPb_akPu3PF_forest71_20130204_01.root";
|
24 |
refname = "ntuple_data_PbPb_akPu3PF_forest71_20130205_01.root";
|
25 |
mixname = "hijing.root";
|
26 |
|
27 |
|
28 |
TFile *inf = new TFile(infname.Data());
|
29 |
TTree *nt =(TTree*)inf->FindObjectAny("ntdijet");
|
30 |
TTree *ntevt =(TTree*)inf->FindObjectAny("ntevt");
|
31 |
nt->AddFriend(ntevt);
|
32 |
|
33 |
TFile *infMix = new TFile(mixname.Data());
|
34 |
TTree *ntMix =(TTree*)infMix->FindObjectAny("ntdijet");
|
35 |
TTree *ntevtMix =(TTree*)infMix->FindObjectAny("ntevt");
|
36 |
TTree *ntw =(TTree*)infMix->FindObjectAny("ntw");
|
37 |
ntMix->AddFriend(ntw);
|
38 |
ntMix->AddFriend(ntevtMix);
|
39 |
|
40 |
TFile *infReference = new TFile(refname.Data());
|
41 |
TTree *ntReference;
|
42 |
TTree *ntevtReference;
|
43 |
|
44 |
ntReference = (TTree*) infReference->FindObjectAny("ntdijet");
|
45 |
ntevtReference = (TTree*) infReference->FindObjectAny("ntevt");
|
46 |
ntReference->AddFriend(ntevtReference);
|
47 |
|
48 |
|
49 |
nt->SetAlias("pt1","jtpt1");
|
50 |
nt->SetAlias("pt2","jtpt2");
|
51 |
nt->SetAlias("eta1","jteta1");
|
52 |
nt->SetAlias("eta2","jteta2");
|
53 |
nt->SetAlias("phi1","jtphi1");
|
54 |
nt->SetAlias("phi2","jtphi2");
|
55 |
|
56 |
ntMix->SetAlias("pt1","jtpt1");
|
57 |
ntMix->SetAlias("pt2","jtpt2");
|
58 |
ntMix->SetAlias("eta1","jteta1");
|
59 |
ntMix->SetAlias("eta2","jteta2");
|
60 |
ntMix->SetAlias("phi1","jtphi1");
|
61 |
ntMix->SetAlias("phi2","jtphi2");
|
62 |
|
63 |
|
64 |
ntReference->SetAlias("pt1","jtpt1");
|
65 |
ntReference->SetAlias("pt2","jtpt2");
|
66 |
ntReference->SetAlias("eta1","jteta1");
|
67 |
ntReference->SetAlias("eta2","jteta2");
|
68 |
ntReference->SetAlias("phi1","jtphi1");
|
69 |
ntReference->SetAlias("phi2","jtphi2");
|
70 |
|
71 |
|
72 |
|
73 |
nt->SetAlias("cent","hfp");
|
74 |
ntMix->SetAlias("cent","hfp");
|
75 |
|
76 |
|
77 |
nt->SetAlias("w","pt1> -999");
|
78 |
ntReference->SetAlias("w","pt1> -999");
|
79 |
|
80 |
ntMix->SetAlias("w","weight*(pthat > 50)");
|
81 |
|
82 |
TCut weight("w");
|
83 |
|
84 |
TTree* t[3] = {nt,ntMix,ntReference};
|
85 |
|
86 |
TH2D* h[3];
|
87 |
TH1D* hMean[3];
|
88 |
TH1D* hSigma[3];
|
89 |
|
90 |
string varNames[] = {
|
91 |
"p_{T,2}/p_{T,1}",
|
92 |
"#eta_{dijet} = (#eta_{1}+#eta_{2})/2",
|
93 |
"",
|
94 |
"#Delta #phi_{1,2}",
|
95 |
"",
|
96 |
|
97 |
"","","","","",
|
98 |
"","","","","",
|
99 |
"","","","","",
|
100 |
|
101 |
"",
|
102 |
"#eta_{1}",
|
103 |
"#eta_{1}"
|
104 |
};
|
105 |
|
106 |
string figures[] = {"imbalance","etaDijet","", "dphi","",
|
107 |
"","", "", "pudifference", "ntrk",
|
108 |
"","pu1","pu2","trkMax1","trkMax2",
|
109 |
"","","","","",
|
110 |
"","eta1","eta2"
|
111 |
};
|
112 |
|
113 |
|
114 |
nt->SetAlias("dphi","acos(cos(phi1-phi2))");
|
115 |
ntMix->SetAlias("dphi","acos(cos(phi1-phi2))");
|
116 |
ntReference->SetAlias("dphi","acos(cos(phi1-phi2))");
|
117 |
|
118 |
if(iPlot == 0){
|
119 |
nt->SetAlias("var","pt2/pt1");
|
120 |
ntReference->SetAlias("var","pt2/pt1");
|
121 |
ntMix->SetAlias("var","pt2/pt1");
|
122 |
}
|
123 |
|
124 |
if(iPlot == 1){
|
125 |
nt->SetAlias("var","(eta1+eta2)/2");
|
126 |
ntReference->SetAlias("var","(eta1+eta2)/2");
|
127 |
ntMix->SetAlias("var","(eta1+eta2)/2");
|
128 |
}
|
129 |
|
130 |
if(iPlot == 3){
|
131 |
nt->SetAlias("var","acos(cos(phi1-phi2))");
|
132 |
ntReference->SetAlias("var","acos(cos(phi1-phi2))");
|
133 |
ntMix->SetAlias("var","acos(cos(phi1-phi2))");
|
134 |
}
|
135 |
|
136 |
|
137 |
int nBins = 12;
|
138 |
double xBins[] = {0,5,10,15,20,25,30,35,40,45,50,60,70};
|
139 |
|
140 |
for(int i = 0; i < 3; ++i){
|
141 |
h[i] = new TH2D(Form("h%d",i),Form(";E_{T}^{HF[#eta > 4]};%s"),nBins,xBins,100,0,1);
|
142 |
h[i]->GetXaxis()->CenterTitle();
|
143 |
h[i]->GetYaxis()->CenterTitle();
|
144 |
|
145 |
if(i == 1) t[i]->Draw(Form("var:hfp>>%s",h[i]->GetName()),weight*dijet&&deltaPhi&&jetID&&vtx,"colz");
|
146 |
else t[i]->Draw(Form("var:hfp>>%s",h[i]->GetName()),weight*dijet&&deltaPhi&&jetID&&vtx&&noise,"colz");
|
147 |
|
148 |
fitSlices(h[i]);
|
149 |
hMean[i] = (TH1D*)gDirectory->Get(Form("%s_1",h[i]->GetName()));
|
150 |
hSigma[i] = (TH1D*)gDirectory->Get(Form("%s_2",h[i]->GetName()));
|
151 |
}
|
152 |
|
153 |
|
154 |
TCanvas* c1 = new TCanvas("c1","",600,600);
|
155 |
|
156 |
hMean[1]->SetMarkerColor(2);
|
157 |
hMean[1]->SetLineColor(2);
|
158 |
hMean[2]->SetMarkerColor(4);
|
159 |
hMean[2]->SetLineColor(4);
|
160 |
hMean[2]->SetMarkerStyle(25);
|
161 |
|
162 |
hMean[1]->SetMinimum(0.5);
|
163 |
hMean[1]->SetMaximum(0.9);
|
164 |
|
165 |
hMean[1]->Draw("hist");
|
166 |
hMean[0]->Draw("same");
|
167 |
if(showPbPb) hMean[2]->Draw("same");
|
168 |
|
169 |
|
170 |
const char* date = "20130205";
|
171 |
|
172 |
string formats[] = {"gif","pdf","eps","C"};
|
173 |
|
174 |
for(int it = 0; it < 4; ++it){
|
175 |
c1->Print(Form("./fig/figure_mean_%s_%s%s.%s",figures[iPlot].data(),date,subtract?"_subt":"",formats[it].data()));
|
176 |
}
|
177 |
|
178 |
|
179 |
|
180 |
}
|
181 |
|