1 |
|
#include "weightMix.C" |
2 |
|
#include "TProfile.h" |
3 |
+ |
#include "Slices.h" |
4 |
|
|
5 |
< |
static int centMode = 3; |
5 |
> |
static int centMode = 1; |
6 |
|
static string centName[] = {"N_{trk}^{offline}","HF+","N_{side}","N_{trk}^{low p_{T}}"}; |
7 |
|
|
8 |
< |
TProfile* getMult(int isample = 2, string var = "xreco"){ |
8 |
> |
TH1D* getMult(int isample = 2, string var = "xreco"){ |
9 |
|
|
10 |
|
TH1::SetDefaultSumw2(); |
11 |
|
|
14 |
|
TChain* ntevt = new TChain("ntevt"); |
15 |
|
TChain* ntw; |
16 |
|
|
17 |
< |
const char* pPbFile = "data_pPb.root"; |
18 |
< |
const char* PbPbFile = "data_PbPb.root"; |
19 |
< |
const char* HydjetFile = "hydjet.root"; |
20 |
< |
const char* HijingFile = "hijing.root"; |
17 |
> |
const char* pPbFile = "/d101/yetkin/analysis/d0204/ntuple_data_pPb_akPu3PF_forest71_20130204_01.root"; |
18 |
> |
const char* PbPbFile = "/d101/yetkin/analysis/d0204/ntuple_data_PbPb_akPu3PF_forest71_20130204_01.root"; |
19 |
> |
const char* HydjetFile = "/d101/yetkin/analysis/d0204/hydjet.root"; |
20 |
> |
const char* HijingFile = "/d101/yetkin/analysis/d0204/hijing.root"; |
21 |
> |
|
22 |
> |
|
23 |
> |
pPbFile = "ntuple_data_pPb_akPu3PF_forest71_20130204_01.root"; |
24 |
> |
// PbPbFile = "ntuple_data_PbPb2011_akPu3PF_forest71_20130204_01.root"; |
25 |
> |
PbPbFile = "ntuple_data_PbPb_akPu3PF_forest71_20130205_01.root"; |
26 |
> |
|
27 |
> |
HijingFile = "hijing.root"; |
28 |
> |
HydjetFile = "hydjet.root"; |
29 |
> |
|
30 |
|
|
31 |
|
if(isample == 0){ |
32 |
|
ntdijet->Add(pPbFile); |
72 |
|
} |
73 |
|
|
74 |
|
TH2D* h[20]; |
75 |
< |
TProfile* p[20]; |
75 |
> |
TH1D* p[20]; |
76 |
|
|
77 |
|
int nmax = 300; |
78 |
< |
if(centMode == 1) nmax = 100; |
79 |
< |
if(centMode == 2) nmax = 100; |
78 |
> |
if(centMode == 1) nmax = 50; |
79 |
> |
if(centMode == 2) nmax = 50; |
80 |
|
|
81 |
+ |
int Nbins = 50; |
82 |
|
double ymax = 10; |
83 |
|
|
84 |
|
if(var == "dphi"){ |
91 |
|
// if(isample == 2) nmax = 500; |
92 |
|
|
93 |
|
for(int i = 0; i < 5; ++i){ |
94 |
< |
h[i] = new TH2D(Form("h%d",i),"",nmax/10,0,nmax,100,0,ymax); |
94 |
> |
h[i] = new TH2D(Form("h%d",i),"",Nbins,0,nmax,100,0,ymax); |
95 |
|
} |
96 |
|
|
97 |
< |
TH2D* hn = new TH2D(Form("hn%d",isample),"",nmax/10,0,nmax,100,0,2.); |
97 |
> |
TH2D* hn = new TH2D(Form("hn%d",isample),"",Nbins,0,nmax,100,0,2.); |
98 |
|
|
99 |
|
TCut dijet("jtpt1 > 120 && jtpt2 > 30"); |
100 |
|
|
101 |
|
if(var != "dphi") dijet = dijet&&"acos(cos(jtphi1-jtphi2))> 2.0944"; |
102 |
< |
TCut weight("weight"); |
102 |
> |
TCut weight("weight*(pthat > 80)"); |
103 |
|
if(isample < 2) weight = "jtpt1 > -999"; |
104 |
|
|
105 |
|
if(centMode == 0){ |
109 |
|
} |
110 |
|
|
111 |
|
if(centMode == 1){ |
112 |
< |
ntdijet->SetAlias("cent","hf"); |
112 |
> |
ntdijet->SetAlias("cent","hfp"); |
113 |
|
ntdijet->SetAlias("gens","hfs"); |
114 |
|
ntdijet->SetAlias("genb","hfb"); |
115 |
|
} |
132 |
|
ntdijet->SetAlias("xgen","pt2/pt1"); |
133 |
|
ntdijet->SetAlias("xreco","jtpt2/jtpt1"); |
134 |
|
ntdijet->SetAlias("dphi","acos(cos(jtphi1-jtphi2))"); |
135 |
< |
ntdijet->SetAlias("",""); |
136 |
< |
ntdijet->SetAlias("",""); |
135 |
> |
ntdijet->SetAlias("etaDijet","(jteta1+jteta2)/2"); |
136 |
> |
|
137 |
|
|
138 |
|
ntdijet->SetAlias("var",var.data()); |
139 |
|
|
145 |
|
|
146 |
|
TCanvas* c2 = new TCanvas("c2","",600,600); |
147 |
|
ntdijet->Draw(Form("var:cent>>h%d",0),weight*dijet,"colz"); |
148 |
< |
c2->Print(Form("figure_c2_%s_%d.pdf",var.data(),isample)); |
148 |
> |
c2->Print(Form("figure_c2_%s_%d_centMode%d.pdf",var.data(),isample,centMode)); |
149 |
|
|
150 |
|
|
151 |
|
if(isample > 1){ |
160 |
|
|
161 |
|
|
162 |
|
hn->ProfileX(Form("phn_%d",isample))->Draw("same"); |
163 |
< |
c1->Print(Form("figure_c1_%s_%d.pdf",var.data(),isample)); |
163 |
> |
c1->Print(Form("figure_c1_%s_%d_centMode%d.pdf",var.data(),isample,centMode)); |
164 |
|
|
165 |
|
TCanvas* c3 = new TCanvas("c3","",600,600); |
166 |
|
ntdijet->Draw(Form("var:genb+gens>>h%d",1),weight*dijet,"colz"); |
167 |
< |
c3->Print(Form("figure_c3_%s_%d.pdf",var.data(),isample)); |
167 |
> |
c3->Print(Form("figure_c3_%s_%d_centMode%d.pdf",var.data(),isample,centMode)); |
168 |
|
|
169 |
|
|
170 |
|
TCanvas* c4 = new TCanvas("c4","",600,600); |
171 |
|
ntdijet->Draw(Form("var:gens>>h%d",2),weight*dijet,"colz"); |
172 |
< |
c4->Print(Form("figure_c4_%s_%d.pdf",var.data(),isample)); |
172 |
> |
c4->Print(Form("figure_c4_%s_%d_centMode%d.pdf",var.data(),isample,centMode)); |
173 |
|
|
174 |
|
TCanvas* c5 = new TCanvas("c5","",600,600); |
175 |
|
ntdijet->Draw(Form("var:genb>>h%d",3),weight*dijet,"colz"); |
176 |
< |
c5->Print(Form("figure_c5_%s_%d.pdf",var.data(),isample)); |
176 |
> |
c5->Print(Form("figure_c5_%s_%d_centMode%d.pdf",var.data(),isample,centMode)); |
177 |
|
|
178 |
|
} |
179 |
|
|
180 |
|
TCanvas* cc1 = new TCanvas("cc1","",600,600); |
181 |
+ |
|
182 |
|
for(int i = 0; i < 4; ++i){ |
183 |
< |
p[i] = h[i]->ProfileX(Form("p%d_%d",i,isample)); |
183 |
> |
// h[i]->RebinX(2); |
184 |
> |
|
185 |
> |
fitSlices(h[i]); |
186 |
> |
p[i] = (TH1D*)gDirectory->Get(Form("%s_1",h[i]->GetName())); |
187 |
> |
// p[i] = h[i]->ProfileX(); |
188 |
> |
|
189 |
> |
p[i]->SetName(Form("p%d_%d",i,isample)); |
190 |
|
} |
191 |
|
|
192 |
|
p[2]->SetMarkerColor(2); |
247 |
|
|
248 |
|
t3->Draw(); |
249 |
|
|
250 |
< |
cc1->Print(Form("figure_cc1_%s_%d.pdf",var.data(),isample)); |
250 |
> |
cc1->Print(Form("figure_cc1_%s_%d_centMode%d.pdf",var.data(),isample,centMode)); |
251 |
|
|
252 |
|
|
253 |
|
return p[0]; |
261 |
|
// var = "npb"; |
262 |
|
|
263 |
|
TCanvas* cc2 = new TCanvas("cc2","",600,600); |
264 |
< |
|
265 |
< |
TProfile* p[4]; |
264 |
> |
TFile* outf = new TFile("nothing.root","recreate"); |
265 |
> |
TH1D* p[4]; |
266 |
|
|
267 |
|
for(int i = 0; i < 4; ++i){ |
268 |
|
p[i] = getMult(i,var); |
315 |
|
if(var == "pt2/pt1") var = "xgen"; |
316 |
|
if(var == "acos(cos(jtphi1-jtphi2))") var = "dphi"; |
317 |
|
|
318 |
< |
cc2->Print(Form("figure_cc0_%s.pdf",var.data())); |
318 |
> |
cc2->Print(Form("figure_cc0_%s_centMode%d.pdf",var.data(),centMode)); |
319 |
|
|
320 |
|
|
321 |
|
TCanvas* cc3 = new TCanvas("cc3","",600,600); |
336 |
|
|
337 |
|
t3->Draw(); |
338 |
|
|
339 |
< |
cc3->Print(Form("figure_cc3_pPb_%s.pdf",var.data())); |
339 |
> |
cc3->Print(Form("figure_cc3_pPb_%s_centMode%d.pdf",var.data(),centMode)); |
340 |
|
|
341 |
|
TCanvas* cc4 = new TCanvas("cc4","",600,600); |
342 |
|
if(centMode == 0){ |
360 |
|
|
361 |
|
t3->Draw(); |
362 |
|
|
363 |
< |
cc4->Print(Form("figure_cc4_PbPb_%s.pdf",var.data())); |
346 |
< |
|
347 |
< |
|
348 |
< |
|
349 |
< |
|
363 |
> |
cc4->Print(Form("figure_cc4_PbPb_%s_centMode%d.pdf",var.data(),centMode)); |
364 |
|
|
365 |
+ |
outf->Write(); |
366 |
+ |
outf->Close(); |
367 |
|
|
368 |
|
|
369 |
|
} |
372 |
|
|
373 |
|
void plotSignalMultiplicity(){ |
374 |
|
|
375 |
< |
string var = "xreco"; |
375 |
> |
string var = ""; |
376 |
> |
|
377 |
> |
var = "etaDijet"; |
378 |
|
plotVariable(var); |
379 |
|
|
380 |
|
return; |
381 |
|
|
382 |
< |
var = "xgen"; |
382 |
> |
var = "xreco"; |
383 |
|
plotVariable(var); |
384 |
|
|
385 |
+ |
var = "xgen"; |
386 |
+ |
plotVariable(var); |
387 |
|
|
388 |
|
var = "dphi"; |
389 |
|
plotVariable(var); |