22 |
|
|
23 |
|
#endif |
24 |
|
|
25 |
< |
#include "weightMix.C" |
25 |
> |
#include "CommonParameters.h" |
26 |
|
|
27 |
|
static int iPlot = -99; |
28 |
|
|
41 |
|
TString infname = "file1.root", |
42 |
|
TString refname = "file2.root", |
43 |
|
TString mixname = "file3.root", |
44 |
– |
bool useWeight = true, |
44 |
|
bool drawXLabel = false, |
45 |
|
bool drawLeg = false); |
46 |
|
|
56 |
|
//--------------------------------------------------------------------- |
57 |
|
|
58 |
|
void plotFigure(int iplot = 9){ |
59 |
< |
TString infname = "/d101/yetkin/analysis/d0131/ntuple_data_akPu3PF_forest68_20130201_01.root"; |
60 |
< |
TString refname = "/d101/yetkin/analysis/d0128/data_PbPb.root"; |
61 |
< |
// TString mixname = "/d101/yetkin/analysis/d0128/mix_hydjet.root"; |
63 |
< |
TString mixname = "/d101/yetkin/analysis/d0201/hijing.root"; |
59 |
> |
TString infname = "/d101/yetkin/analysis/d0204/ntuple_data_pPb_akPu3PF_forest71_20130204_01.root"; |
60 |
> |
TString refname = "/d101/yetkin/analysis/d0204/ntuple_data_PbPb_akPu3PF_forest71_20130204_01.root"; |
61 |
> |
TString mixname = "/d101/yetkin/analysis/d0204/hijing.root"; |
62 |
|
|
63 |
|
string hfNames[] = { |
64 |
|
"30<E_{T}^{HF[#eta > 4]}<70", |
106 |
|
|
107 |
|
for(int i = 0; i < 6; ++i){ |
108 |
|
c1->cd(6-i); |
109 |
< |
plotBalance(i,infname,refname,mixname,true,false,false); |
109 |
> |
plotBalance(i,infname,refname,mixname,i==1,i==0); |
110 |
|
double y1 = 0.07; |
111 |
|
if(i < 3) y1 = 0.23; |
112 |
|
y1= 0.9; |
179 |
|
TString infname, |
180 |
|
TString pythia, |
181 |
|
TString mix, |
184 |
– |
bool useWeight, |
182 |
|
bool drawXLabel, |
183 |
|
bool drawLeg) |
184 |
|
{ |
185 |
|
|
189 |
– |
useWeight = 1; |
190 |
– |
|
191 |
– |
bool refOldNtuple = 0; |
192 |
– |
TCut lead(Form("pt1>%d && abs(eta1) < 2",leadCut)); |
193 |
– |
TCut dijet(Form("pt1>%d && pt2>%d && abs(eta1) < 2 && abs(eta2) < 2",leadCut,subleadCut)); |
194 |
– |
|
195 |
– |
TCut deltaPhi("abs(dphi)>2.0944"); |
196 |
– |
|
186 |
|
if(iPlot != 3) dijet = dijet&&deltaPhi; |
187 |
|
|
199 |
– |
TCut side(Form("pt1>%d && pt2>%d && abs(dphi)>%f && abs(dphi)<%f && abs(eta1) < 2 && abs(eta2) < 2",leadCut,subleadCut, sideMin, sideMax)); |
200 |
– |
|
201 |
– |
TCut jetID("trkMax1 > 4 || trkMax2 > 4"); |
202 |
– |
// jetID = "trkMax1 > -99999"; |
203 |
– |
TCut noise("noise < 0"); |
204 |
– |
TCut weight("weight*(pthat > 50)"); |
205 |
– |
|
206 |
– |
|
207 |
– |
double sideScale = sideCorrect*(3.1415926536-2.0944)/(sideMax-sideMin); |
208 |
– |
|
209 |
– |
TString cstring = ""; |
210 |
– |
|
188 |
|
TCut centHF(""); |
189 |
|
TCut centNtrk(""); |
190 |
|
|
205 |
|
} |
206 |
|
|
207 |
|
if(centMode == 1){ |
231 |
– |
if(cbin==0) centHF = "hf>=30 && hf<70"; |
232 |
– |
if(cbin==1) centHF = "hf>=20 && hf<30"; |
233 |
– |
if(cbin==2) centHF = "hf>=15 && hf<20"; |
234 |
– |
if(cbin==3) centHF = "hf>=10 && hf<15"; |
235 |
– |
if(cbin==4) centHF = "hf>=5 && hf<10"; |
236 |
– |
if(cbin==5) centHF = "hf<5"; |
237 |
– |
|
208 |
|
if(cbin==0) centHF = "cent>=30 && cent<70"; |
209 |
|
if(cbin==1) centHF = "cent>=20 && cent<30"; |
210 |
|
if(cbin==2) centHF = "cent>=15 && cent<20"; |
243 |
|
if(entryMode < 1) nt->AddFriend(ntevt); |
244 |
|
|
245 |
|
// open the pythia (MC) file |
246 |
< |
TFile *infPythia = new TFile(pythia.Data()); |
247 |
< |
TTree *ntPythia; |
248 |
< |
TTree *ntevtPythia; |
249 |
< |
if(!refOldNtuple){ |
250 |
< |
ntPythia = (TTree*) infPythia->FindObjectAny(treeName.data()); |
251 |
< |
ntevtPythia = (TTree*) infPythia->FindObjectAny("ntevt"); |
252 |
< |
if(entryMode < 1) ntPythia->AddFriend(ntevtPythia); |
253 |
< |
}else{ |
284 |
< |
ntPythia = (TTree*) infPythia->FindObjectAny("nt"); |
285 |
< |
} |
286 |
< |
|
246 |
> |
TFile *infReference = new TFile(pythia.Data()); |
247 |
> |
TTree *ntReference; |
248 |
> |
TTree *ntevtReference; |
249 |
> |
|
250 |
> |
ntReference = (TTree*) infReference->FindObjectAny(treeName.data()); |
251 |
> |
ntevtReference = (TTree*) infReference->FindObjectAny("ntevt"); |
252 |
> |
if(entryMode < 1) ntReference->AddFriend(ntevtReference); |
253 |
> |
|
254 |
|
// open the datamix file |
255 |
|
TFile *infMix = new TFile(mix.Data()); |
256 |
|
TTree *ntMix =(TTree*)infMix->FindObjectAny(treeName.data()); |
301 |
|
|
302 |
|
// projection histogram |
303 |
|
TH1D *h = new TH1D(Form("h",cbin),"",Nbin,min,max); |
304 |
< |
TH1D *hPythia = new TH1D(Form("hPythia",cbin),"",Nbin,min,max); |
304 |
> |
TH1D *hReference = new TH1D(Form("hReference",cbin),"",Nbin,min,max); |
305 |
|
TH1D *hDataMix = new TH1D(Form("hDataMix",cbin),"",Nbin,min,max); |
306 |
|
|
307 |
|
TH1D *hB = new TH1D(Form("hB",cbin),"",Nbin,min,max); |
308 |
< |
TH1D *hPythiaB = new TH1D(Form("hPythiaB",cbin),"",Nbin,min,max); |
308 |
> |
TH1D *hReferenceB = new TH1D(Form("hReferenceB",cbin),"",Nbin,min,max); |
309 |
|
TH1D *hDataMixB = new TH1D(Form("hDataMixB",cbin),"",Nbin,min,max); |
310 |
|
|
311 |
|
TH1D *hFull = new TH1D("hFull","",Nbin,min,max); |
312 |
< |
TH1D *hPythiaFull = new TH1D("hPythiaFull","",Nbin,min,max); |
312 |
> |
TH1D *hReferenceFull = new TH1D("hReferenceFull","",Nbin,min,max); |
313 |
|
TH1D *hDataMixFull = new TH1D("hDataMixFull","",Nbin,min,max); |
314 |
|
|
315 |
|
TH1D* hNorm = new TH1D("hNorm","",1000,0,1000); |
316 |
< |
TH1D* hNormPythia = new TH1D("hNormPythia","",1000,0,1000); |
316 |
> |
TH1D* hNormReference = new TH1D("hNormReference","",1000,0,1000); |
317 |
|
TH1D* hNormDataMix = new TH1D("hNormDataMix","",1000,0,1000); |
318 |
|
|
319 |
|
hB->SetLineStyle(2); |
320 |
< |
hPythiaB->SetLineStyle(2); |
320 |
> |
hReferenceB->SetLineStyle(2); |
321 |
|
hDataMixB->SetLineStyle(2); |
322 |
|
|
323 |
< |
// ntPythia->SetAlias("pt1","et1"); |
324 |
< |
// ntPythia->SetAlias("pt2","et2"); |
323 |
> |
// ntReference->SetAlias("pt1","et1"); |
324 |
> |
// ntReference->SetAlias("pt2","et2"); |
325 |
|
|
326 |
|
nt->SetAlias("pt1","jtpt1"); |
327 |
|
nt->SetAlias("pt2","jtpt2"); |
329 |
|
nt->SetAlias("eta2","jteta2"); |
330 |
|
nt->SetAlias("phi1","jtphi1"); |
331 |
|
nt->SetAlias("phi2","jtphi2"); |
365 |
– |
|
332 |
|
ntMix->SetAlias("pt1","jtpt1"); |
333 |
|
ntMix->SetAlias("pt2","jtpt2"); |
334 |
|
ntMix->SetAlias("eta1","jteta1"); |
335 |
|
ntMix->SetAlias("eta2","jteta2"); |
336 |
|
ntMix->SetAlias("phi1","jtphi1"); |
337 |
|
ntMix->SetAlias("phi2","jtphi2"); |
338 |
< |
|
339 |
< |
|
340 |
< |
if(!refOldNtuple){ |
341 |
< |
ntPythia->SetAlias("pt1","jtpt1"); |
342 |
< |
ntPythia->SetAlias("pt2","jtpt2"); |
343 |
< |
ntPythia->SetAlias("eta1","jteta1"); |
344 |
< |
ntPythia->SetAlias("eta2","jteta2"); |
345 |
< |
ntPythia->SetAlias("phi1","jtphi1"); |
346 |
< |
ntPythia->SetAlias("phi2","jtphi2"); |
347 |
< |
} |
382 |
< |
|
383 |
< |
nt->SetAlias("cent","hf"); |
384 |
< |
ntMix->SetAlias("cent","hf"); |
385 |
< |
ntPythia->SetAlias("cent","hf"); |
338 |
> |
ntReference->SetAlias("pt1","jtpt1"); |
339 |
> |
ntReference->SetAlias("pt2","jtpt2"); |
340 |
> |
ntReference->SetAlias("eta1","jteta1"); |
341 |
> |
ntReference->SetAlias("eta2","jteta2"); |
342 |
> |
ntReference->SetAlias("phi1","jtphi1"); |
343 |
> |
ntReference->SetAlias("phi2","jtphi2"); |
344 |
> |
|
345 |
> |
nt->SetAlias("cent","hfp"); |
346 |
> |
ntMix->SetAlias("cent","hfp"); |
347 |
> |
ntReference->SetAlias("cent","hfp"); |
348 |
|
|
349 |
|
nt->SetAlias("dphi","acos(cos(phi1-phi2))"); |
350 |
|
ntMix->SetAlias("dphi","acos(cos(phi1-phi2))"); |
351 |
< |
ntPythia->SetAlias("dphi","acos(cos(phi1-phi2))"); |
351 |
> |
ntReference->SetAlias("dphi","acos(cos(phi1-phi2))"); |
352 |
|
|
353 |
|
if(iPlot == 0){ |
354 |
|
nt->SetAlias("var","pt2/pt1"); |
355 |
< |
ntPythia->SetAlias("var","pt2/pt1"); |
355 |
> |
ntReference->SetAlias("var","pt2/pt1"); |
356 |
|
ntMix->SetAlias("var","pt2/pt1"); |
357 |
|
} |
358 |
|
|
359 |
|
if(iPlot == 1){ |
360 |
|
nt->SetAlias("var","(eta1+eta2)/2"); |
361 |
< |
ntPythia->SetAlias("var","(eta1+eta2)/2"); |
361 |
> |
ntReference->SetAlias("var","(eta1+eta2)/2"); |
362 |
|
ntMix->SetAlias("var","(eta1+eta2)/2"); |
363 |
|
} |
364 |
|
|
365 |
|
if(iPlot == 3){ |
366 |
|
nt->SetAlias("var","acos(cos(phi1-phi2))"); |
367 |
< |
ntPythia->SetAlias("var","acos(cos(phi1-phi2))"); |
367 |
> |
ntReference->SetAlias("var","acos(cos(phi1-phi2))"); |
368 |
|
ntMix->SetAlias("var","acos(cos(phi1-phi2))"); |
369 |
|
} |
370 |
|
|
371 |
|
if(iPlot == 8){ |
372 |
|
nt->SetAlias("var","pu1-pu2"); |
373 |
< |
ntPythia->SetAlias("var","pu1-pu2"); |
373 |
> |
ntReference->SetAlias("var","pu1-pu2"); |
374 |
|
ntMix->SetAlias("var","pu1-pu2"); |
375 |
|
} |
376 |
|
|
377 |
|
if(iPlot == 11){ |
378 |
|
nt->SetAlias("var","pu1"); |
379 |
< |
ntPythia->SetAlias("var","pu1"); |
379 |
> |
ntReference->SetAlias("var","pu1"); |
380 |
|
ntMix->SetAlias("var","pu1"); |
381 |
|
} |
382 |
|
|
383 |
|
if(iPlot == 12){ |
384 |
|
nt->SetAlias("var","pu2"); |
385 |
< |
ntPythia->SetAlias("var","pu2"); |
385 |
> |
ntReference->SetAlias("var","pu2"); |
386 |
|
ntMix->SetAlias("var","pu2"); |
387 |
|
} |
388 |
|
|
389 |
|
if(iPlot == 9){ |
390 |
|
nt->SetAlias("var","ntrk"); |
391 |
< |
ntPythia->SetAlias("var","ntrk"); |
391 |
> |
ntReference->SetAlias("var","ntrk"); |
392 |
|
ntMix->SetAlias("var","ntrk"); |
393 |
|
} |
394 |
|
|
395 |
|
if(iPlot == 21){ |
396 |
|
nt->SetAlias("var","eta1"); |
397 |
< |
ntPythia->SetAlias("var","eta1"); |
397 |
> |
ntReference->SetAlias("var","eta1"); |
398 |
|
ntMix->SetAlias("var","eta1"); |
399 |
|
} |
400 |
|
|
401 |
|
if(iPlot == 22){ |
402 |
|
nt->SetAlias("var","eta2"); |
403 |
< |
ntPythia->SetAlias("var","eta2"); |
403 |
> |
ntReference->SetAlias("var","eta2"); |
404 |
|
ntMix->SetAlias("var","eta2"); |
405 |
|
} |
406 |
|
|
408 |
|
|
409 |
|
if(iPlot == 101){ |
410 |
|
nt->SetAlias("var","eta"); |
411 |
< |
ntPythia->SetAlias("var","eta"); |
411 |
> |
ntReference->SetAlias("var","eta"); |
412 |
|
ntMix->SetAlias("var","eta"); |
413 |
|
} |
414 |
|
|
415 |
|
if(iPlot == 51){ |
416 |
|
nt->SetAlias("var","matchPt1/pt1"); |
417 |
< |
ntPythia->SetAlias("var","matchPt1/pt1"); |
417 |
> |
ntReference->SetAlias("var","matchPt1/pt1"); |
418 |
|
ntMix->SetAlias("var","matchPt1/pt1"); |
419 |
|
} |
420 |
|
|
421 |
|
if(iPlot == 52){ |
422 |
|
nt->SetAlias("var","matchPt2/pt2"); |
423 |
< |
ntPythia->SetAlias("var","matchPt2/pt2"); |
423 |
> |
ntReference->SetAlias("var","matchPt2/pt2"); |
424 |
|
ntMix->SetAlias("var","matchPt2/pt2"); |
425 |
|
} |
426 |
|
|
427 |
|
|
428 |
< |
nt->Draw("var>>hFull",dijet&&noise&&jetID&¢Ntrk); |
429 |
< |
nt->Draw("var>>hB",side&&noise&&jetID&¢Ntrk); |
430 |
< |
nt->Draw("pt1>>hNorm",lead&&noise&&jetID&¢Ntrk); |
428 |
> |
nt->Draw("var>>hFull",dijet&&noise&&jetID&¢HF&&vtx); |
429 |
> |
nt->Draw("var>>hB",side&&noise&&jetID&¢HF&&vtx); |
430 |
> |
nt->Draw("pt1>>hNorm",lead&&noise&&jetID&¢HF&&vtx); |
431 |
|
|
432 |
< |
ntMix->Draw("var>>hDataMixFull",weight*(dijet&&jetID&¢HF)); |
433 |
< |
ntMix->Draw("var>>hDataMixB",weight*(side&&jetID&¢HF)); |
434 |
< |
ntMix->Draw("pt1>>hNormDataMix",weight*(lead&&jetID&¢HF)); |
432 |
> |
ntMix->Draw("var>>hDataMixFull",weight*(dijet&&jetID&¢HF&&vtx)); |
433 |
> |
ntMix->Draw("var>>hDataMixB",weight*(side&&jetID&¢HF&&vtx)); |
434 |
> |
ntMix->Draw("pt1>>hNormDataMix",weight*(lead&&jetID&¢HF&&vtx)); |
435 |
|
|
436 |
< |
ntPythia->Draw("var>>hPythiaFull",dijet&&noise&&jetID&¢HF); |
437 |
< |
ntPythia->Draw("var>>hPythiaB",side&&noise&&jetID&¢HF); |
438 |
< |
ntPythia->Draw("pt1>>hNormPythia",lead&&noise&&jetID&¢HF); |
477 |
< |
|
478 |
< |
hDataMixB->Scale(sideScale); |
479 |
< |
hB->Scale(sideScale); |
480 |
< |
hPythiaB->Scale(sideScale); |
436 |
> |
ntReference->Draw("var>>hReferenceFull",dijet&&noise&&jetID&¢HF&&vtx); |
437 |
> |
ntReference->Draw("var>>hReferenceB",side&&noise&&jetID&¢HF&&vtx); |
438 |
> |
ntReference->Draw("pt1>>hNormReference",lead&&noise&&jetID&¢HF&&vtx); |
439 |
|
|
440 |
|
hDataMix->Add(hDataMixFull); |
441 |
|
h->Add(hFull); |
442 |
< |
hPythia->Add(hPythiaFull); |
442 |
> |
hReference->Add(hReferenceFull); |
443 |
|
|
444 |
|
if(subtract){ |
445 |
|
hDataMix->Add(hDataMixB,-1); |
446 |
|
h->Add(hB,-1); |
447 |
< |
hPythia->Add(hPythiaB,-1); |
447 |
> |
hReference->Add(hReferenceB,-1); |
448 |
|
} |
449 |
|
|
450 |
|
hB->SetFillStyle(3005); |
463 |
|
} |
464 |
|
h->SetMarkerStyle(20); |
465 |
|
|
466 |
< |
if(hPythia->Integral() > 0){ |
467 |
< |
hPythia->Scale(1./hNormPythia->Integral()); |
466 |
> |
if(hReference->Integral() > 0){ |
467 |
> |
hReference->Scale(1./hNormReference->Integral()); |
468 |
|
} |
469 |
|
|
470 |
< |
hPythia->SetLineColor(kBlue); |
471 |
< |
hPythia->SetFillColor(kAzure-8); |
472 |
< |
hPythia->SetFillStyle(3005); |
470 |
> |
hReference->SetLineColor(kBlue); |
471 |
> |
hReference->SetFillColor(kAzure-8); |
472 |
> |
hReference->SetFillStyle(3005); |
473 |
|
|
474 |
|
if(normLead){ |
475 |
|
hDataMixB->Scale(1./hNormDataMix->Integral()); |
551 |
|
//hDataMix->GetXaxis()->SetNdivisions(905,true); |
552 |
|
hDataMix->GetYaxis()->SetNdivisions(505,true); |
553 |
|
|
554 |
< |
hPythia->SetMarkerColor(ppColor); |
555 |
< |
hPythia->SetLineColor(ppColor); |
556 |
< |
hPythia->SetMarkerStyle(25); |
554 |
> |
hReference->SetMarkerColor(ppColor); |
555 |
> |
hReference->SetLineColor(ppColor); |
556 |
> |
hReference->SetMarkerStyle(25); |
557 |
|
|
558 |
|
hDataMix->Draw();//"hist"); |
559 |
|
hDataMix->Draw("hist same"); |
560 |
< |
// hPythia->Draw("same"); |
560 |
> |
// hReference->Draw("same"); |
561 |
|
|
562 |
|
cout<<"PbPb ENTRIES : "<<endl; |
563 |
< |
cout<<hPythia->GetEntries()<<endl; |
563 |
> |
cout<<hReference->GetEntries()<<endl; |
564 |
|
|
565 |
|
cout<<"PbPb integral : "<<endl; |
566 |
< |
cout<<hPythia->Integral()<<endl; |
566 |
> |
cout<<hReference->Integral()<<endl; |
567 |
|
|
568 |
|
cout<<"pPb integral : "<<endl; |
569 |
|
cout<<h->Integral()<<endl; |
586 |
|
|
587 |
|
// t3->AddEntry(h,Form("%s #mub^{-1}",LUM),""); |
588 |
|
t3->AddEntry(h,"pPb #sqrt{s}=5.02 TeV","p"); |
589 |
< |
t3->AddEntry(hPythia,"PbPb #sqrt{s}=2.76 TeV","p"); |
589 |
> |
t3->AddEntry(hReference,"PbPb #sqrt{s}=2.76 TeV","p"); |
590 |
|
t3->AddEntry(hDataMix,"PYTHIA+HYDJET 1.8","lf"); |
591 |
|
|
592 |
|
t3->SetFillColor(0); |