1 #if !defined(__CINT__) || defined(__MAKECINT__)
10 #include <TDirectoryFile.h>
14 #include <TPaveText.h>
15 #include <TPaveStats.h>
18 #include <TDatabasePDG.h>
19 #include <TParameter.h>
20 #include <AliCounterCollection.h>
23 #include "MakePIDqaReport.C"
43 TString lstatname=
"nEntriesQA", cutobjname=
"";
44 filename.Prepend(path);
48 TFile* f=
new TFile(filename.Data());
50 cout<<filename.Data()<<
" not found"<<endl;
53 TDirectoryFile* dir=(TDirectoryFile*)f->Get(dirname);
55 cout<<dirname.Data()<<
" not found in "<<filename.Data()<<endl;
60 list=(
TList*)dir->Get(listname);
62 cout<<
"List "<<listname.Data()<<
" not found"<<endl;
67 lstat=(
TList*)dir->Get(lstatname);
69 cout<<lstatname.Data()<<
" not found"<<endl;
78 TString lstatname=
"nEntriesQA", cutobjname=
"";
79 filename.Prepend(path);
83 if(partname.Contains(
"Dplus")) cutobjname=
"AnalysisCuts";
85 if(partname.Contains(
"D0")) cutobjname=
"D0toKpiCutsStandard";
87 if(partname.Contains(
"Dstar")) cutobjname=
"DStartoKpipiCuts";
89 if(partname.Contains(
"Ds")) cutobjname=
"DstoKKpiCuts";
91 if(partname.Contains(
"D04")) cutobjname=
"D0toKpipipiCuts";
93 if(partname.Contains(
"Lc")) cutobjname=
"LctopKpiAnalysisCuts";
100 TFile* f=
new TFile(filename.Data());
102 cout<<filename.Data()<<
" not found"<<endl;
105 TDirectoryFile* dir=(TDirectoryFile*)f->Get(dirname);
107 cout<<dirname.Data()<<
" not found in "<<filename.Data()<<endl;
111 list=(
TList*)dir->Get(listname);
113 cout<<
"List "<<listname.Data()<<
" not found"<<endl;
118 lstat=(
TList*)dir->Get(lstatname);
120 cout<<lstatname.Data()<<
" not found"<<endl;
126 cout<<cutobjname.Data()<<
" not found"<<endl;
135 gStyle->SetCanvasColor(0);
136 gStyle->SetTitleFillColor(0);
137 gStyle->SetStatColor(0);
138 gStyle->SetPalette(1);
140 TString listname=
"outputTrack",name1=
"",name2=
"",path2=
"",filename2=
"PWG3histograms.root",legtext1=
"",legtext2=
"",suffixdir2=
"";
145 cout<<
"Enter the names:\n>";
149 cout<<
"Are they in the same output file? (y/n)"<<endl;
155 cout<<
"Filename: "<<endl;
158 cout<<
"Suffix in the dir name, if any (otherwhise write no)\n>";
160 if(suffixdir2==
"no") suffixdir2=
"";
161 cout<<
"Text in the legend:\n 1)";
171 TList * lstat = NULL;
173 TH1F* hHasFilterBit = NULL;
177 Bool_t isRead=
ReadFile(list,lstat,listname,Form(
"%s%s",partname.Data(),name1.Data()),path,
filename,Form(
"%s%s",dirname.Data(),suffixdir.Data()));
180 cout<<
":-( null pointers..."<<endl;
183 hEntr = (TH1F*) lstat->FindObject(
"hNentries");
184 hHasFilterBit = (TH1F*) lstat->FindObject(
"HasSelBit");
186 nevents=hEntr->GetBinContent(1);
187 TPaveText *pvtxt=
new TPaveText(0.6,0.6,0.9,0.9,
"NDC");
188 pvtxt->SetBorderSize(0);
189 pvtxt->SetFillStyle(0);
190 pvtxt->AddText(legtext1);
193 TList* llstat = NULL;
195 TH1F* hHasFilterBit1 = NULL;
198 isRead=
ReadFile(llist,llstat,listname,Form(
"%s%s",partname.Data(),name2.Data()),path2,filename2,Form(
"%s%s",dirname.Data(),suffixdir2.Data()));
200 if(!llist || !llstat){
201 cout<<
":-( null pointers..."<<endl;
204 hEntr1 = (TH1F*) llstat->FindObject(
"hNentries");
205 hHasFilterBit1 = (TH1F*) llstat->FindObject(
"HasSelBit");
207 nevents2=hEntr1->GetBinContent(1);
208 TText *redtext=pvtxt->AddText(legtext2);
209 redtext->SetTextColor(kRed);
210 hEntr1->Scale(hEntr->Integral()/hEntr1->Integral());
211 hHasFilterBit1->Scale(hEntr->Integral()/hEntr1->Integral());
214 for(
Int_t i=0;i<list->GetEntries();i++){
215 TH1F* h=(TH1F*)list->At(i);
219 hh=(TH1F*)llist->At(i);
220 hr=(TH1F*)hh->Clone(Form(
"%s_ratio",hh->GetName()));
221 if(hh && TMath::Abs(hh->Integral()) > 1e-6)hh->Scale(h->Integral()/hh->Integral());
223 if(!h || (superimpose && !hh)){
224 cout<<
"Histogram "<<i<<
" not found"<<endl;
228 if(normint) hh->Scale(h->Integral()/hh->Integral());
229 else hh->Scale(nevents/nevents2);
230 hEntr1->SetLineColor(kRed);
231 hh->SetLineColor(kRed);
235 TCanvas*
c=
new TCanvas(Form(
"c%s",h->GetName()),h->GetName());
239 if(!hname.Contains(
"nCls")){
241 if(hname.Contains(
"Layer")){
242 for(
Int_t ibin=1;ibin<=h->GetNbinsX();ibin++){
243 h->GetXaxis()->SetBinLabel(ibin+1,Form(
"%d",ibin));
245 h->GetXaxis()->SetLabelSize(0.06);
246 h->GetXaxis()->SetRangeUser(0,6);
249 if(hname.Contains(
"vs")||hname.Contains(
"dauphi")|| hname.Contains(
"dauphi_filt")){
256 TCanvas* c2=
new TCanvas(Form(
"c2%s",h->GetName()),h->GetName());
260 c2->SaveAs(Form(
"%s%s%s%sRatio.png",c->GetName(),name1.Data(),name2.Data(),textleg.Data()));
265 if(superimpose)hh->Draw(
"htext0sames");
269 c->SaveAs(Form(
"%s%s%s%s.png",c->GetName(),name1.Data(),name2.Data(),textleg.Data()));
270 c->SaveAs(Form(
"%s%s%s%s.eps",c->GetName(),name1.Data(),name2.Data(),textleg.Data()));
274 TCanvas* cstFilter=
new TCanvas(
"cstFilter",
"Stat_HasFilterBit");
275 cstFilter->SetGridy();
277 hHasFilterBit->Draw(
"htext0");
280 hHasFilterBit1->Draw(
"htext0sames");
283 cstFilter->SaveAs(Form(
"%s%s.png",hHasFilterBit->GetName(),textleg.Data()));
284 cstFilter->SaveAs(Form(
"%s%s.eps",hHasFilterBit->GetName(),textleg.Data()));
288 TCanvas* cst=
new TCanvas(
"cst",
"Stat");
291 hEntr->Draw(
"htext0");
294 hEntr1->Draw(
"htext0sames");
297 cst->SaveAs(Form(
"%s%s.png",hEntr->GetName(),textleg.Data()));
298 cst->SaveAs(Form(
"%s%s.eps",hEntr->GetName(),textleg.Data()));
300 TH1F* hd0fb4=(TH1F*)list->FindObject(
"hd0TracksFilterBit4");
301 TH1F* hd0SPD1=(TH1F*)list->FindObject(
"hd0TracksSPDin");
302 TH1F* hd0SPDany=(TH1F*)list->FindObject(
"hd0TracksSPDany");
303 TH1F* hd0TPCITScuts=(TH1F*)list->FindObject(
"hd0TracksTPCITSSPDany");
304 TH1F* hhd0fb4=0x0; TH1F* hhd0SPD1=0x0; TH1F* hhd0SPDany=0x0; TH1F* hhd0TPCITScuts=0x0;
306 hhd0fb4=(TH1F*)llist->FindObject(
"hd0TracksFilterBit4");
307 hhd0SPD1=(TH1F*)llist->FindObject(
"hd0TracksSPDin");
308 hhd0SPDany=(TH1F*)llist->FindObject(
"hd0TracksSPDany");
309 hhd0TPCITScuts=(TH1F*)llist->FindObject(
"hd0TracksTPCITSSPDany");
312 if(hd0fb4 && hd0SPD1 && hd0SPDany && hd0TPCITScuts){
313 TCanvas* ctrsel=
new TCanvas(
"ctrsel",
"Track Sel");
315 hd0SPD1->SetLineColor(kCyan+3);
318 TPaveStats *st1=(TPaveStats*)hd0SPD1->GetListOfFunctions()->FindObject(
"stats");
319 st1->SetTextColor(kCyan+3);
322 hd0SPDany->SetLineColor(4);
323 hd0SPDany->Draw(
"sames");
325 TPaveStats *st2=(TPaveStats*)hd0SPDany->GetListOfFunctions()->FindObject(
"stats");
328 st2->SetTextColor(4);
329 hd0fb4->SetLineColor(2);
330 hd0fb4->Draw(
"sames");
332 TPaveStats *st3=(TPaveStats*)hd0fb4->GetListOfFunctions()->FindObject(
"stats");
335 st3->SetTextColor(2);
336 hd0TPCITScuts->SetLineColor(kGreen+1);
337 hd0TPCITScuts->Draw(
"sames");
339 TPaveStats *st4=(TPaveStats*)hd0TPCITScuts->GetListOfFunctions()->FindObject(
"stats");
344 st4->SetTextColor(kGreen+1);
346 TLegend* leg=
new TLegend(0.15,0.5,0.45,0.78);
347 leg->SetFillStyle(0);
348 leg->SetBorderSize(0);
349 leg->AddEntry(hd0SPD1,
"kITSrefit+SPD inner",
"L");
350 leg->AddEntry(hd0SPDany,
"kITSrefit+SPD any",
"L");
351 leg->AddEntry(hd0TPCITScuts,
"TPC+ITS cuts+SPD any",
"L");
352 leg->AddEntry(hd0fb4,
"Filter Bit 4",
"L");
355 if(superimpose && hhd0fb4 && hhd0SPD1 && hhd0SPDany && hhd0TPCITScuts){
356 hhd0SPD1->SetLineColor(kCyan+3);
357 hhd0SPD1->SetStats(0);
358 hhd0SPD1->SetLineStyle(3);
359 hhd0SPDany->SetLineColor(4);
360 hhd0SPDany->SetStats(0);
361 hhd0SPDany->SetLineStyle(3);
362 hhd0TPCITScuts->SetLineColor(kGreen+1);
363 hhd0TPCITScuts->SetStats(0);
364 hhd0TPCITScuts->SetLineStyle(3);
365 hhd0fb4->SetLineColor(2);
366 hhd0fb4->SetStats(0);
367 hhd0fb4->SetLineStyle(3);
369 hhd0SPD1->Draw(
"sames");
370 hhd0SPDany->Draw(
"sames");
371 hhd0TPCITScuts->Draw(
"sames");
372 hhd0fb4->Draw(
"sames");
375 ctrsel->SaveAs(
"ImpactParameterTrackSel.eps");
376 ctrsel->SaveAs(
"ImpactParameterTrackSel.png");
384 gStyle->SetCanvasColor(0);
385 gStyle->SetTitleFillColor(0);
386 gStyle->SetOptStat(0);
387 gStyle->SetPalette(1);
389 Int_t period=2 ,set=0;
391 cout<<
"Choose period: \n-LHC10h -> 2;\n-LHC10de -> 1;\n-LHC10bc -> 0"<<endl;
394 cout<<
"Choose set: "<<endl;
395 if(period==2) cout<<
"-pass1 -> 0;\n-pass2 -> 1"<<endl;
405 TList * lstat = NULL;
410 Double_t nsigmaTPC[3]={},plimTPC[2]={};
416 cout<<
":-( null pointers..."<<endl;
421 cout<<
"PidHF object not found! cannot get the nsigma values"<<endl;
435 cout<<
":-( null pointers..."<<endl;
441 TPaveText *txtsigmaTOF=
new TPaveText(0.1,0.65,0.5,0.9,
"NDC");
442 txtsigmaTOF->SetBorderSize(0);
443 txtsigmaTOF->SetFillStyle(0);
444 txtsigmaTOF->AddText(Form(
"nsigmacut from cutobj = %.1f",nsigmaTOF));
446 lTOF.SetLineColor(kMagenta+1);
447 lTOF.SetLineStyle(2);
448 lTOF.SetLineWidth(3);
450 TPaveText *txtsigmaTPC=
new TPaveText(0.3,0.6,0.6,0.9,
"NDC");
451 txtsigmaTPC->SetBorderSize(0);
452 txtsigmaTPC->SetFillStyle(0);
453 txtsigmaTPC->AddText(
"nsigmacut from cutobj \n");
454 txtsigmaTPC->AddText(Form(
"p < %.1f : %.1f \n",plimTPC[0],nsigmaTPC[0]));
455 txtsigmaTPC->AddText(Form(
"%.1f < p < %.1f : %.1f \n",plimTPC[0],plimTPC[1],nsigmaTPC[1]));
456 txtsigmaTPC->AddText(Form(
"p > %.1f : %.1f \n",plimTPC[1],nsigmaTPC[2]));
458 lTPC.SetLineColor(kMagenta+1);
459 lTPC.SetLineStyle(2);
460 lTPC.SetLineWidth(3);
468 for(
Int_t i=0;i<list->GetEntries();i++){
469 TClass* objtype=list->At(i)->IsA();
470 TString tpname=objtype->GetName();
473 TH1F* h=(TH1F*)list->At(i);
476 cout<<
"Histogram "<<i<<
" not found"<<endl;
480 TCanvas*
c=
new TCanvas(Form(
"c%s",h->GetName()),h->GetName());
486 c->SaveAs(Form(
"%s%s.png",h->GetName(),textleg.Data()));
487 c->SaveAs(Form(
"%s%s.eps",h->GetName(),textleg.Data()));
488 TFile* fout=
new TFile(Form(
"%s.root",h->GetName()),
"recreate");
497 cout<<
"Histogram "<<i<<
" not found"<<endl;
502 if(h->Integral(
"width")==0) {cout<<
"Empty histogram, skip\n";
continue;}
503 h->Scale(1./h->Integral(
"width"));
505 Double_t maxzaxis=h->GetBinContent(h->GetMaximumBin());
506 Double_t minzaxis=h->GetBinContent(h->GetMinimumBin());
507 printf(
"Minimum = %f, maximum = %f\n",minzaxis,maxzaxis);
508 TH2F* hallzrange=(
TH2F*)h->Clone(Form(
"%swholez",hname.Data()));
509 hallzrange->SetAxisRange(1e-07,maxzaxis,
"Z");
512 TCanvas* cwholez=
new TCanvas(Form(
"c%swholez",hname.Data()),Form(
"%s down to lowest z",hname.Data()));
514 hallzrange->Draw(
"colz");
515 cwholez->SaveAs(Form(
"%swholez.png",h->GetName()));
516 cwholez->SaveAs(Form(
"%swholez.eps",h->GetName()));
518 if(hname.Contains(
"hTOFtimeKaonHyptime")){
519 TCanvas* cz=
new TCanvas(Form(
"c%szoom",hname.Data()),Form(
"%szoom",hname.Data()));
521 TH2F* hz=(
TH2F*)h->Clone(Form(
"%sz",hname.Data()));
523 hz->SetAxisRange(-1500,1500,
"Y");
524 hz->SetAxisRange(0.,5.,
"X");
526 cz->SaveAs(Form(
"%szoom.png",h->GetName()));
527 cz->SaveAs(Form(
"%szoom.eps",h->GetName()));
530 TCanvas*
c=
new TCanvas(Form(
"c%s",hname.Data()),hname.Data());
533 TCanvas* c2=
new TCanvas(Form(
"c2%s",hname.Data()),hname.Data());
537 h->DrawClone(
"colz");
539 if (hname.Contains(
"Sig") || hname.Contains(
"sigma"))h->SetAxisRange(-5,5,
"Y");
542 h->SetAxisRange(0.,5.,
"X");
551 if(hname.Contains(
"TOFsigma")) {
555 lTOF.DrawLine(.2,nsigmaTOF,20,nsigmaTOF);
556 lTOF.DrawLine(.2,-1*nsigmaTOF,4.,-1*nsigmaTOF);
561 if(hname.Contains(
"TPCsigma")){
565 lTPC.DrawLine(0.,nsigmaTPC[0],plimTPC[0],nsigmaTPC[0]);
566 lTPC.DrawLine(plimTPC[0],nsigmaTPC[1],plimTPC[1],nsigmaTPC[1]);
567 lTPC.DrawLine(plimTPC[1],nsigmaTPC[2],4,nsigmaTPC[2]);
568 lTPC.DrawLine(0.,-1*nsigmaTPC[0],plimTPC[0],-1*nsigmaTPC[0]);
569 lTPC.DrawLine(plimTPC[0],-1*nsigmaTPC[1],plimTPC[1],-1*nsigmaTPC[1]);
570 lTPC.DrawLine(plimTPC[1],-1*nsigmaTPC[2],4,-1*nsigmaTPC[2]);
573 if(hname.Contains(
"TPCsigvsp")){
579 c->SaveAs(Form(
"%s%d.png",h->GetName(),
mode));
580 c->SaveAs(Form(
"%s%d.eps",h->GetName(),
mode));
581 c2->SaveAs(Form(
"%s2%d.png",h->GetName(),
mode));
582 c2->SaveAs(Form(
"%s2%d.eps",h->GetName(),
mode));
584 TFile* fout=
new TFile(Form(
"%s%d.root",h->GetName(),
mode),
"recreate");
594 TFile* fBethe=
new TFile(
"BetheBlochTPC.root");
595 if(!fBethe->IsOpen()){
597 fBethe=
new TFile(
"BetheBlochTPC.root");
600 TString partnames[npart]={
"Kaon",
"Pion",
"Electron",
"Proton"};
601 for(
Int_t ipart=0;ipart<npart;ipart++){
602 TString grname=Form(
"%sP%d",partnames[ipart].
Data(),period);
615 gStyle->SetOptTitle(0);
616 gStyle->SetCanvasColor(0);
618 AliTPCPIDResponse *tpcResp=
new AliTPCPIDResponse();
622 TString partnames[npart]={
"Kaon",
"Pion",
"Electron",
"Proton"};
624 TCanvas *cBethe=
new TCanvas(
"cBethe",
"Bethe Bloch K pi e p");
629 periodsname=
new TString[nsets];
630 cout<<
"Creating the file of the Bethe Bloch"<<endl;
631 TFile* fout=
new TFile(
"BetheBlochTPC.root",
"recreate");
633 for(
Int_t iperiod=0;iperiod<nperiods;iperiod++){
634 cout<<
"Period "<<iperiod<<
" : ";
637 alephParameters[0] = 0.0283086/0.97;
638 alephParameters[1] = 2.63394e+01;
639 alephParameters[2] = 5.04114e-11;
640 alephParameters[3] = 2.12543e+00;
641 alephParameters[4] = 4.88663e+00;
642 periodsname[0]=
"dataLHC10bc";
646 alephParameters[0] = 1.63246/50.;
647 alephParameters[1] = 2.20028e+01;
648 alephParameters[2] = TMath::Exp(-2.48879e+01);
649 alephParameters[3] = 2.39804e+00;
650 alephParameters[4] = 5.12090e+00;
651 periodsname[1]=
"dataLHC10deold";
654 alephParameters[0] = 1.34490e+00/50.;
655 alephParameters[1] = 2.69455e+01;
656 alephParameters[2] = TMath::Exp(-2.97552e+01);
657 alephParameters[3] = 2.35339e+00;
658 alephParameters[4] = 5.98079e+00;
659 periodsname[2]=
"dataLHC10denew";
665 alephParameters[0]=1.25202/50.;
666 alephParameters[1]=2.74992e+01;
667 alephParameters[2]=TMath::Exp(-3.31517e+01);
668 alephParameters[3]=2.46246;
669 alephParameters[4]=6.78938;
670 periodsname[3]=
"dataLHC10hpass1";
673 alephParameters[0]=1.25202/50.;
674 alephParameters[1]=2.74992e+01;
675 alephParameters[2]=TMath::Exp(-3.31517e+01);
676 alephParameters[3]=2.46246;
677 alephParameters[4]=6.78938;
678 periodsname[4]=
"dataLHC10hpass2";
683 alephParameters[0] = 2.15898e+00/50.;
684 alephParameters[1] = 1.75295e+01;
685 alephParameters[2] = 3.40030e-09;
686 alephParameters[3] = 1.96178e+00;
687 alephParameters[4] = 3.91720e+00;
688 periodsname[5]=
"MCold";
691 alephParameters[0] = 1.44405/50;
692 alephParameters[1] = 2.35409e+01;
693 alephParameters[2] = TMath::Exp(-2.90330e+01);
694 alephParameters[3] = 2.10681;
695 alephParameters[4] = 4.62254;
696 periodsname[6]=
"MCnew";
700 alephParameters[0] = 0.029021;
701 alephParameters[1] = 25.4181;
702 alephParameters[2] = 4.66596e-08;
703 alephParameters[3] = 1.90008;
704 alephParameters[4] = 4.63783;
705 periodsname[7]=
"MCBBFrancesco";
709 alephParameters[0] = 0.0207667;
710 alephParameters[1] = 29.9936;
711 alephParameters[2] = 3.87866e-11;
712 alephParameters[3] = 2.17291;
713 alephParameters[4] = 7.1623;
720 tpcResp->SetBetheBlochParameters(alephParameters[0],alephParameters[1],alephParameters[2],alephParameters[3],alephParameters[4]);
722 for(
Int_t ipart=0;ipart<npart;ipart++){
727 for(
Int_t k=0;k<n;k++){
731 AliPID::EParticleType ptype=AliPID::kKaon;
732 if(ipart==1) ptype=AliPID::kPion;
733 if(ipart==2) ptype=AliPID::kElectron;
735 bethe[k]=tpcResp->GetExpectedSignal(p[k],ptype);
739 gr->SetName(Form(
"%sP%d",partnames[ipart].
Data(),iperiod));
740 gr->SetTitle(Form(
"%sP%d;p (GeV/c);",partnames[ipart].
Data(),iperiod));
741 gr->SetLineColor(ipart+1);
742 gr->SetMarkerColor(ipart+1);
743 gr->GetYaxis()->SetRangeUser(35,100);
745 if(iperiod==0 && ipart==0)gr->DrawClone(
"AL");
746 else gr->DrawClone(
"L");
762 gStyle->SetCanvasColor(0);
763 gStyle->SetTitleFillColor(0);
764 gStyle->SetStatColor(0);
765 gStyle->SetPalette(1);
767 TString listname=
"outputCentrCheck",partname2=
"",path2=
"",suffixdir2=
"",filename2=
"PWG3histograms.root";
779 cout<<
"##Second file\n";
780 cout<<
"Enter the name:\n";
783 cout<<
"Are they in the same output file? (y/n)"<<endl;
792 cout<<
"Filename: "<<endl;
811 TList * lstat = NULL;
814 TString dirname=
"PWG3_D2H_QA",dirname2=dirname;
816 dirname2+=suffixdir2;
820 cout<<
":-( null pointers..."<<endl;
824 TPaveText *pvtxt=
new TPaveText(0.6,0.6,0.9,0.9,
"NDC");
825 pvtxt->SetBorderSize(0);
826 pvtxt->SetFillStyle(0);
827 pvtxt->AddText(partname);
830 TList* llstat = NULL;
834 isRead=
ReadFile(llist,llstat,listname,partname2.Data(),path2,filename2,dirname2);
836 if(!llist || !llstat){
837 cout<<
":-( null pointers..."<<endl;
840 TText *redtext=pvtxt->AddText(partname2);
841 redtext->SetTextColor(kRed);
846 TCanvas* cst=
new TCanvas(
"cst",
"Stat");
849 hEntr=(TH1F*)lstat->FindObject(
"hNentries");
850 hEntr1=(TH1F*)llstat->FindObject(
"hNentries");
852 hEntr->Draw(
"htext0");
853 cst->SaveAs(Form(
"%s%s.png",hEntr->GetName(),textleg.Data()));
854 cst->SaveAs(Form(
"%s%s.eps",hEntr->GetName(),textleg.Data()));
855 Int_t nevents080=1,nnevents080=1;
859 for(
Int_t i=0;i<list->GetEntries();i++){
861 TClass* objtype=list->At(i)->IsA();
862 TString tpname=objtype->GetName();
866 TH1F* h=(TH1F*)list->At(i);
869 hh=(TH1F*)llist->At(i);
871 if(!h || (superimpose && !hh)){
872 cout<<
"Histogram "<<i<<
" not found"<<endl;
876 hEntr1->SetLineColor(kRed);
877 hh->SetLineColor(kRed);
880 TCanvas*
c=
new TCanvas(Form(
"c%s",h->GetName()),h->GetName());
881 TPaveText *pvtxt2=
new TPaveText(0.6,0.6,0.9,0.9,
"NDC");
882 pvtxt2->SetBorderSize(0);
883 pvtxt2->SetFillStyle(0);
888 Int_t entries=h->Integral();
889 pvtxt2->AddText(Form(
"%.1f %s of the events",(
Double_t)entries/(
Double_t)nevents*100,
"%"));
896 c->SaveAs(Form(
"%s%s.pdf",c->GetName(),textleg.Data()));
897 c->SaveAs(Form(
"%s%s.eps",c->GetName(),textleg.Data()));
902 cout<<
"Histogram "<<i<<
" not found"<<endl;
905 TCanvas*
c=
new TCanvas(Form(
"c%s",hhh->GetName()),hhh->GetName());
906 TPaveText *pvtxt3=
new TPaveText(0.6,0.6,0.9,0.9,
"NDC");
907 pvtxt3->SetBorderSize(0);
908 pvtxt3->SetFillStyle(0);
912 Int_t entries=hhh->Integral();
913 pvtxt3->AddText(Form(
"%.1f %s of the events",(
Double_t)entries/(
Double_t)nevents*100,
"%"));
917 c->SaveAs(Form(
"%s%s.pdf",c->GetName(),textleg.Data()));
918 c->SaveAs(Form(
"%s%s.eps",c->GetName(),textleg.Data()));
923 listname=
"countersCentrality";
928 cout<<
":-( null pointers..."<<endl;
934 isRead=
ReadFile(llist,llstat,listname,partname2.Data(),path2,filename2,dirname2);
936 if(!llist || !llstat){
937 cout<<
":-( null pointers..."<<endl;
940 TText *redtext=pvtxt->AddText(partname2);
941 redtext->SetTextColor(kRed);
947 cout<<
"normalizing to 0-80% as a check"<<endl;
954 TCanvas *cvnocnt=
new TCanvas(
"cvnocnt",
"No Centrality estimation",800,400);
955 cvnocnt->Divide(2,1);
958 for(
Int_t i=0;i<list->GetEntries();i++){
959 AliCounterCollection* coll=(AliCounterCollection*)list->At(i);
960 AliCounterCollection* colle=0x0;
961 if(superimpose) colle=(AliCounterCollection*)llist->At(i);
962 coll->SortRubric(
"run");
972 TH1F* hbad=(TH1F*)coll->Get(
"run",Form(
"centralityclass:-990_-980"));
974 if(hbad) hbad->Draw();
976 ccent=
new TCanvas(Form(
"ccent%s",coll->GetName()),Form(
"Centrality vs Run (%s)",coll->GetName()),1400,800);
982 for(
Int_t ic=0;ic<8;ic++){
984 TH1F* h=(TH1F*)coll->Get(
"run",Form(
"centralityclass:%d_%d",ic*10,ic*10+10));
985 h->SetName(Form(
"h%d%d",i,ic));
987 hallcntr=(TH1F*)h->Clone(
"hallcntr");
993 nevents080+=h->Integral();
996 hh=(TH1F*)colle->Get(
"run",Form(
"centralityclass:%d_%d",ic*10,ic*10+10));
997 hh->SetName(Form(
"hh%d%d",i,ic));
999 hhallcntr=(TH1F*)hh->Clone(
"hhallcntr");
1001 }
else hhallcntr->Add(hh);
1003 nnevents080+=hh->Integral();
1008 for(
Int_t ic=0;ic<ncentr;ic++){
1010 TH1F* h=(TH1F*)coll->Get(
"run",Form(
"centralityclass:%d_%d",ic*10,ic*10+10));
1011 h->SetName(Form(
"h%d%d",i,ic));
1016 h020=(TH1F*)h->Clone(Form(
"h020%s",coll->GetName()));
1017 h020->SetTitle(Form(
"Centrality 0-20 %s",coll->GetName()));
1019 hh020=(TH1F*)hh->Clone(Form(
"hh020%s",coll->GetName()));
1020 hh020->SetTitle(Form(
"Centrality 0-20 %s",coll->GetName()));
1025 if(superimpose)hh020->Add(hh);
1030 h2080=(TH1F*)h->Clone(Form(
"h2080%s",coll->GetName()));
1031 h2080->SetTitle(Form(
"Centrality 20-80 %s",coll->GetName()));
1033 hh2080=(TH1F*)hh->Clone(Form(
"hh2080%s",coll->GetName()));
1034 hh2080->SetTitle(Form(
"Centrality 20-80 %s",coll->GetName()));
1039 if(superimpose)hh2080->Add(hh);
1044 h->Divide(hallcntr);
1048 h->GetYaxis()->SetLabelSize(0.05);
1049 h->GetYaxis()->SetTitleOffset(1.5);
1065 h020->Divide(hallcntr);
1067 hh020->Divide(hhallcntr);
1068 hh020->SetLineColor(2);
1069 hh020->SetMarkerColor(2);
1079 TCanvas* cv020=
new TCanvas(Form(
"cv020-%d",i),
"0-20% vs run number",1400,600);
1082 h020->GetYaxis()->SetRangeUser(0.,1.);
1084 if(superimpose)hh020->DrawClone(
"sames");
1085 cv020->SaveAs(Form(
"cv020-%d.pdf",i));
1086 cv020->SaveAs(Form(
"cv020-%d.eps",i));
1088 h2080->Divide(hallcntr);
1090 hh2080->Divide(hhallcntr);
1091 hh2080->SetLineColor(2);
1092 hh2080->SetMarkerColor(2);
1103 TCanvas* cv2080=
new TCanvas(Form(
"cv2080-%d",i),
"20-80% vs run number",1400,600);
1106 h2080->GetYaxis()->SetRangeUser(0.,1.);
1108 if(superimpose)hh2080->DrawClone(
"sames");
1109 cv2080->SaveAs(Form(
"cv2080-%d.pdf",i));
1110 cv2080->SaveAs(Form(
"cv2080-%d.eps",i));
1112 ccent->SaveAs(Form(
"%s%s.pdf",ccent->GetName(),textleg.Data()));
1113 ccent->SaveAs(Form(
"%s%s.eps",ccent->GetName(),textleg.Data()));
1119 gStyle->SetCanvasColor(0);
1120 gStyle->SetTitleFillColor(0);
1121 gStyle->SetStatColor(0);
1122 gStyle->SetPalette(1);
1124 TString listname=
"outputCentrCheck";
1125 TString dirname=
"PWG3_D2H_QA";
1129 TList * lstat = NULL;
1134 if(!list || !lstat){
1135 cout<<
":-( null pointers..."<<endl;
1138 hEntr = (TH1F*) lstat->FindObject(
"hNentries");
1141 TH2F* h2=(
TH2F*)list->FindObject(h2dname);
1143 cout<<h2dname.Data()<<
" not found"<<endl;
1147 TCanvas* cv2d=
new TCanvas(
"cv2d",h2->GetName());
1152 TPaveText *pvst=
new TPaveText(0.6,0.2,0.9,0.7,
"NDC");
1153 pvst->SetBorderSize(0);
1154 pvst->SetFillStyle(0);
1155 pvst->AddText(
"Bin -> Cont/nEvVtx");
1160 if(direction==
"X") nsteps=h2->GetNbinsY()/groupnbins;
1161 if(direction==
"Y") nsteps=h2->GetNbinsX()/groupnbins;
1162 cout<<
"Grouping bins by " <<groupnbins<<
" I obtaine "<<nsteps<<
" projections"<<endl;
1164 TCanvas *cvpj=
new TCanvas(Form(
"cvpj%s%s",direction.Data(),h2dname.Data()),Form(
"cvpj%s",direction.Data()),1200,800);
1165 cvpj->Divide((
Int_t)(nsteps/3)+1,3);
1166 TFile* fout=
new TFile(Form(
"proj%s%s.root",direction.Data(),h2dname.Data()),
"recreate");
1173 minx=h2->GetYaxis()->GetXmin();
1174 maxx=h2->GetYaxis()->GetXmax();
1177 minx=h2->GetXaxis()->GetXmin();
1178 maxx=h2->GetXaxis()->GetXmax();
1180 printf(
"Plotting from %.1f to %.1f\n",minx,maxx);
1181 TCanvas *cintegral=
new TCanvas(
"cintegral",
"Integral of each projection");
1182 TH1F* hint=
new TH1F(
"hint",
"Integral of each projection;Centrality (%);Entries",nsteps,minx,maxx);
1183 Double_t minint=999999999,maxint=0;
1185 for(
Int_t i=0;i<nsteps;i++){
1189 if(direction==
"X")h=(TH1F*)h2->ProjectionX(Form(
"px%d",i),groupnbins*i+1,groupnbins*(i+1));
1190 if(direction==
"Y")h=(TH1F*)h2->ProjectionY(Form(
"py%d",i),groupnbins*i+1,groupnbins*(i+1));
1192 cout<<
"Integral of projection "<<i<<
" = "<<projint<<endl;
1193 hint->SetBinContent(i+1,projint);
1194 hint->SetBinError(i+1,TMath::Sqrt(projint));
1196 if(projint<1e-7)
continue;
1197 if(minint>projint) minint=projint;
1198 if(projint>maxint) maxint=projint;
1199 integralpernev[i]=h->Integral()/
nevents;
1201 TPaveText *pvtxt=
new TPaveText(0.6,0.6,0.9,0.9,
"NDC");
1202 pvtxt->SetBorderSize(0);
1203 pvtxt->SetFillStyle(0);
1204 pvtxt->AddText(Form(
"%.0f - %.0f",h2->GetYaxis()->GetBinLowEdge(groupnbins*i+1),h2->GetYaxis()->GetBinLowEdge(groupnbins*(i+1))));
1205 pvst->AddText(Form(
"%.0f - %.0f -> %.2f",h2->GetYaxis()->GetBinLowEdge(groupnbins*i+1),h2->GetYaxis()->GetBinLowEdge((groupnbins*(i+1))),integralpernev[i]));
1214 cvpj->SaveAs(Form(
"cvpj%s%s.pdf",direction.Data(),h2dname.Data()));
1215 cvpj->SaveAs(Form(
"cvpj%s%s.eps",direction.Data(),h2dname.Data()));
1219 cv2d->SaveAs(Form(
"%s.pdf",h2->GetName()));
1220 cv2d->SaveAs(Form(
"%s.eps",h2->GetName()));
1223 hint->SetMarkerStyle(20);
1225 if(!
fitfunc.Contains(
"nofit")){
1226 hint->Fit(
fitfunc.Data(),
"RL",
"PE",fitmin,fitmax);
1227 TF1* fpolfit=hint->GetFunction(
fitfunc.Data());
1228 TPaveText *txtvar=
new TPaveText(0.3,0.1,0.9,0.4,
"NDC");
1229 txtvar->SetBorderSize(0);
1230 txtvar->SetFillStyle(0);
1232 txtvar->AddText(Form(
"Fit in %.1f-%.1f; ",fitmin,fitmax));
1233 for(
Int_t ipar=0;ipar<fpolfit->GetNpar();ipar++){
1234 txtvar->AddText(Form(
"par%d = %.0f, ",ipar, fpolfit->GetParameter(ipar)));
1236 txtvar->AddText(Form(
"#tilde{#chi}^{2} = %.2f",fpolfit->GetChisquare()/fpolfit->GetNDF()));
1237 txtvar->AddText(Form(
"bin width = %.1f %s",hint->GetBinWidth(3),
"%"));
1242 cintegral->SaveAs(Form(
"%s.pdf",hint->GetName()));
1243 cintegral->SaveAs(Form(
"%s.eps",hint->GetName()));
1247 gStyle->SetCanvasColor(0);
1248 gStyle->SetTitleFillColor(0);
1249 gStyle->SetStatColor(0);
1250 gStyle->SetPalette(1);
1251 gStyle->SetOptStat(0);
1253 TString listname=
"outputEvSel";
1254 TString dirname=
"PWG3_D2H_QA";
1258 TList * lstat = NULL;
1264 if(!list || !lstat){
1265 cout<<
":-( null pointers..."<<endl;
1268 hEntr =(TH1F *)lstat->FindObject(
"hNentries");
1271 for(
Int_t i=0;i<list->GetEntries();i++){
1273 TClass* objtype=list->At(i)->IsA();
1274 TString tpname=objtype->GetName();
1277 TH1F* htmp=(TH1F*)list->At(i);
1278 TCanvas*
c=
new TCanvas(Form(
"c%s",htmp->GetName()),Form(
"c%s",htmp->GetName()));
1281 c->SaveAs(Form(
"%s.pdf",htmp->GetName()));
1282 c->SaveAs(Form(
"%s.eps",htmp->GetName()));
1287 TCanvas*
c=
new TCanvas(Form(
"c%s",htmp->GetName()),Form(
"c%s",htmp->GetName()),1200,800);
1289 htmp->SetMarkerSize(1.3);
1290 htmp->Draw(
"colzhtext45");
1291 c->SaveAs(Form(
"%s.pdf",htmp->GetName()));
1292 c->SaveAs(Form(
"%s.eps",htmp->GetName()));
1296 AliCounterCollection* coll=(AliCounterCollection*)list->FindObject(
"trigCounter");
1298 cout<<
"Trigger counter not found"<<endl;
1302 coll->SortRubric(
"run");
1304 TString collname=coll->GetName();
1306 TString keywords=coll->GetKeyWords(
"triggertype");
1308 Int_t nkeys=keywords.CountChar(
',')+1;
1311 for(
Int_t k=0;k<nkeys;k++) words[k]=
"";
1312 printf(
"Keywords: ");
1314 for(
Int_t l=0;l<keywords.Length();l++){
1315 if(keywords[l] !=
',') words[count]+=keywords[l];
1317 printf(
"%s ",words[count].
Data());
1324 TH1D** htrignormAll=
new TH1D*[nkeys];
1325 TH1D** htrignormAny=
new TH1D*[nkeys];
1326 TCanvas* ctrigfractionAll=
new TCanvas(
"cvtrigfrac",
"Fraction of given trigger type vs run (kAll)",1400,800);
1327 TCanvas* ctrigfractionAny=
new TCanvas(
"cvtrigfracAll",
"Fraction of given trigger type vs run (kAny)",1400,800);
1328 TLegend* legtr=
new TLegend(0.15,0.5,0.35,0.8);
1329 legtr->SetBorderSize(0);
1330 legtr->SetFillStyle(0);
1333 htrigkAny = coll->Get(
"run",Form(
"triggertype:%s",
"ANY"));
1334 htrigkAny->SetName(Form(
"h%s",
"ANY"));
1335 htrigkAny->SetTitle(
"Trigger type;RUN; counts");
1338 htrigkAll = coll->Get(
"run",Form(
"triggertype:%s",
"ALL"));
1339 htrigkAll->SetName(Form(
"h%s",
"ALL"));
1340 htrigkAll->SetTitle(
"Trigger type;RUN; counts");
1343 for(
Int_t k=0;k<nkeys;k++){
1344 htrig[k]=coll->Get(
"run",Form(
"triggertype:%s",words[k].
Data()));
1345 htrig[k]->SetName(Form(
"h%s",words[k].
Data()));
1346 htrig[k]->SetTitle(
"Trigger type;RUN; counts");
1347 htrig[k]->SetMarkerColor(k+1);
1348 htrig[k]->SetMarkerStyle(k+20);
1350 legtr->AddEntry(htrig[k],Form(
"%s",words[k].
Data()),
"P");
1353 htrignormAll[k]=(
TH1D*)htrig[k]->Clone(Form(
"h%snormAll",words[k].
Data()));
1354 htrignormAll[k]->SetTitle(
"Trigger type over ALL trigger;RUN; counts/countsALL");
1355 htrignormAll[k]->Divide(htrig[k],htrigkAll,1.,1.,
"B");
1356 htrignormAll[k]->GetXaxis()->SetRangeUser(0,1.1);
1358 ctrigfractionAll->cd();
1359 if(k>0)htrignormAll[k]->Draw(
"PEsames");
1360 else htrignormAll[k]->Draw(
"PE");
1363 htrignormAny[k]=(
TH1D*)htrig[k]->Clone(Form(
"h%snormAny",words[k].
Data()));
1364 htrignormAny[k]->SetTitle(
"Trigger type over ANY trigger;RUN; counts/countsANY");
1365 htrignormAny[k]->Divide(htrig[k],htrigkAny,1.,1.,
"B");
1366 htrignormAny[k]->GetXaxis()->SetRangeUser(0,1.1);
1368 ctrigfractionAny->cd();
1369 if(k>0)htrignormAny[k]->Draw(
"PEsames");
1370 else htrignormAny[k]->Draw(
"PE");
1373 ctrigfractionAll->cd();
1375 ctrigfractionAll->SaveAs(
"TrgFractionOverALL.pdf");
1376 ctrigfractionAll->SaveAs(
"TrgFractionOverALL.eps");
1378 ctrigfractionAny->cd();
1380 ctrigfractionAny->SaveAs(
"TrgFractionOverANY.pdf");
1381 ctrigfractionAny->SaveAs(
"TrgFractionOverANY.eps");
1384 delete htrigkAll;
delete htrigkAny;
1387 TH2F* hTrigMul=(
TH2F*)list->FindObject(
"hTrigMul");
1389 TH1F *hnEvPerTrig=(TH1F*)hTrigMul->ProjectionX(
"hnEvPerTrig");
1390 hnEvPerTrig->SetTitle(
"Number of events per trigger");
1391 TCanvas* cnev=
new TCanvas(
"cnev",
"Number of events",1400,800);
1393 hnEvPerTrig->Draw(
"htext0");
1394 cnev->SaveAs(Form(
"%s.pdf",cnev->GetName()));
1395 cnev->SaveAs(Form(
"%s.eps",cnev->GetName()));
1398 TH2F* hTrigMulSel=(
TH2F*)list->FindObject(
"hTrigMulSel");
1400 TH1F *hnEvPerTrigSel=(TH1F*)hTrigMulSel->ProjectionX(
"hnEvPerTrigSel");
1401 hnEvPerTrigSel->SetTitle(
"Number of events selected per trigger");
1402 TCanvas* cnevs=
new TCanvas(
"cnevs",
"Number of events selected",1400,800);
1404 hnEvPerTrigSel->Draw(
"htext0");
1405 cnevs->SaveAs(Form(
"%s%s.pdf",cnevs->GetName(),suffixdir.Data()));
1406 cnevs->SaveAs(Form(
"%s%s.eps",cnevs->GetName(),suffixdir.Data()));
1408 TH1F* hnEvSelPerc=(TH1F*)hnEvPerTrigSel->Clone(
"hnEvSelFrac");
1409 hnEvSelPerc->SetTitle(
"Fraction of event selected per trigger");
1410 hnEvSelPerc->Divide(hnEvPerTrig);
1411 TCanvas* cnevsp=
new TCanvas(
"cnevsp",
"Fraction of events selected",1400,800);
1413 hnEvSelPerc->Draw(
"htext0");
1414 cnevsp->SaveAs(Form(
"%s%s.pdf",cnevsp->GetName(),suffixdir.Data()));
1415 cnevsp->SaveAs(Form(
"%s%s.eps",cnevsp->GetName(),suffixdir.Data()));
1428 Printf(
"WARNING! Did you customize the parameters in the macro?");
1430 TString prepath=
"/data/Work/HFQA/LHC12QATrainOutputs/";
1431 TString pathname[n]={
"LHC12a/Train165/",
"LHC12b/Train166/",
"LHC12d/Train168/",
"LHC12e/Train170/",
"LHC12f/Train171/",
"LHC12g/Train172/"};
1436 myfile.open(inputtextfile);
1440 TString basedirname=
"PWG3_D2H_QA";
1442 TString baselistname=
"", partname=
"D00100";
1443 TString legend[n]={
"LHC12a165",
"LHC12b166",
"LHC12d168",
"LHC12e170",
"LHC12f171",
"LHC12g172"};
1444 if(analysistype==1) baselistname=
"outputTrack";
1445 if(analysistype==2) baselistname=
"outputEvSel";
1449 for(
Int_t i=0;i<n;i++){
1451 pathname[i]=prepath+pathname[i];
1453 dirname[i]=basedirname+trgnames[i];
1454 listname[i]=baselistname+partname+trgnames[i];
1455 if(legend[i]==
"") legend[i]=trgnames[i];
1463 myfile<<pathname[i].Data()<<filename.Data()<<endl;
1464 myfile<<dirname[i].Data()<<endl;
1465 myfile<<listname[i].Data()<<endl;
1466 myfile<<legend[i].Data()<<endl;
1477 myfile.open(inputtextfile);
1478 if(!myfile.is_open()) Printf(
"No files found, did you make it correctly?");
1481 lists=
new TList*[n];
1492 TFile *fin=
new TFile(filename);
1494 Printf(
"File %s not found",filename.Data());
1501 TDirectoryFile* dir=(TDirectoryFile*)fin->Get(dirname);
1503 Printf(
"Directory %s not found in %s",dirname.Data(),filename.Data());
1511 lists[k]=(
TList*)dir->Get(listname);
1513 Printf(
"List %s not found in %s",listname.Data(),dirname.Data());
1521 Printf(
"Legend = %s",legend[k].
Data());
1523 Printf(
"Legend %s not found",filename.Data());
1529 if(k==n)
return kTRUE;
1546 Printf(
"Did you write %s with WriteTextFileForCompilation(%s)?",inputtextfile.Data(),inputtextfile.Data());
1557 TCanvas *cnevs=
new TCanvas(
"cnevs",
"Number of events selected",1400,800);
1558 TCanvas *cnevsp=
new TCanvas(
"cnevsp",
"Fraction of events selected",1400,800);
1559 TH1F** hnEvPerTrig=
new TH1F*[n];
1560 TH1F** hnEvPerTrigSel=
new TH1F*[n];
1561 TH1F** hnEvSelPerc=
new TH1F*[n];
1563 TLegend* leg=
new TLegend(0.15,0.5,0.45,0.78);
1564 leg->SetFillStyle(0);
1565 leg->SetBorderSize(0);
1568 Int_t nentriesl=lists[0]->GetEntries();
1569 TCanvas**
c=
new TCanvas*[nentriesl];
1572 for(
Int_t i=0;i<n;i++){
1576 hnEvPerTrig[i]=(TH1F*)hTrigMul->ProjectionX(Form(
"hnEvPerTrig%d",i));
1577 hnEvPerTrig[i]->SetTitle(
"Number of events selected per trigger");
1582 hnEvPerTrigSel[i]=(TH1F*)hTrigMulSel->ProjectionX(Form(
"hnEvPerTrigSel%d",i));
1583 hnEvPerTrigSel[i]->SetTitle(
"Number of events selected per trigger");
1584 hnEvPerTrigSel[i]->SetLineColor(i+1);
1585 hnEvPerTrigSel[i]->SetLineWidth(2);
1588 if(i==0) hnEvPerTrigSel[i]->Draw();
1589 else hnEvPerTrigSel[i]->Draw(
"sames");
1591 hnEvSelPerc[i]=(TH1F*)hnEvPerTrigSel[i]->Clone(Form(
"hnEvSelFrac%d",i));
1592 hnEvSelPerc[i]->SetTitle(
"Fraction of event selected per trigger");
1593 hnEvSelPerc[i]->SetLineColor(i+1);
1594 hnEvSelPerc[i]->SetLineWidth(2);
1595 hnEvSelPerc[i]->Divide(hnEvPerTrig[i]);
1597 if(i==0) hnEvSelPerc[i]->Draw(
"htext0");
1598 else hnEvSelPerc[i]->Draw(
"htext0sames");
1602 leg->AddEntry(hnEvSelPerc[i],legend[i],
"L");
1604 for(
Int_t j=0; j<nentriesl; j++){
1605 TClass* objtype=lists[i]->At(j)->IsA();
1606 TString tpname=objtype->GetName();
1608 if (tpname==
"TH1F"){
1609 TH1F* htmp=(TH1F*)lists[i]->At(j);
1611 htmp->SetLineColor(1+i);
1612 if(htmp->Integral()>0) htmp->Scale(1./htmp->Integral());
1615 c[nth1f]=
new TCanvas(Form(
"c%s",htmp->GetName()),Form(
"c%s",htmp->GetName()));
1622 htmp->Draw(
"sames");
1632 for(
Int_t j=0;j<nth1f;j++){
1635 c[j]->SaveAs(Form(
"%s.pdf",c[j]->GetName()));
1636 c[j]->SaveAs(Form(
"%s.eps",c[j]->GetName()));
1641 cnevs->SaveAs(Form(
"%s.eps",cnevs->GetName()));
1642 cnevs->SaveAs(Form(
"%s.pdf",cnevs->GetName()));
1646 cnevsp->SaveAs(Form(
"%s.eps",cnevsp->GetName()));
1647 cnevsp->SaveAs(Form(
"%s.pdf",cnevsp->GetName()));
1648 TCanvas *test=
new TCanvas();
1649 test->cd(); leg->Draw();
1657 for(
Int_t i=0;i<lists[0]->GetEntries();i++){
1662 is2d = lists[0]->At(i)->InheritsFrom(
"TH2");
1665 for(
Int_t j=0; j<n; j++){
1666 TH1F* temph=(TH1F*)lists[j]->At(i);
1671 temphr= (TH1F*)temph->Clone(Form(
"%s_ratio",temph->GetName()));
1672 if(j==0)ploto = temphr;
1673 else ploto = (TH1F*)plotseth->At(0);
1674 temphr->Divide(ploto);
1675 if(temphr->Integral()>0){temphr->
Scale(1./temphr->Integral());}
1676 if(temph->Integral()>0){ temph->
Scale(1./temph->Integral());}
1678 plotseth->AddLast(
new TH1F(*temph));
1679 plotsethr->AddLast(
new TH1F(*temphr));
1683 TH1F *h = (TH1F*)plotseth->At(0);
1684 TCanvas*
c=
new TCanvas(Form(
"c%s",h->GetName()),h->GetName());
1689 if(!hname.Contains(
"nCls")){
1691 if(hname.Contains(
"Layer")){
1692 for(
Int_t ibin=1;ibin<=h->GetNbinsX();ibin++){
1693 h->GetXaxis()->SetBinLabel(ibin+1,Form(
"%d",ibin));
1695 h->GetXaxis()->SetLabelSize(0.06);
1696 h->GetXaxis()->SetRangeUser(0,6);
1701 TLegend* leg=
new TLegend(0.15,0.5,0.45,0.78);
1702 leg->SetFillStyle(0);
1703 leg->SetBorderSize(0);
1704 leg->AddEntry(h,legend[0],
"L");
1706 for(
Int_t j=1; j<n; j++){
1707 TH1F * h2 = (TH1F*)plotseth->At(j);
1708 h2->SetLineColor(1+j);
1710 leg->AddEntry(h2,legend[j],
"L");
1715 TCanvas* c2=
new TCanvas(Form(
"c2%s",h->GetName()),h->GetName());
1718 TH1F *hr = (TH1F*)plotsethr->At(1);
1719 hr->SetLineColor(2);
1721 TLegend* leg2=
new TLegend(0.15,0.5,0.45,0.78);
1722 leg2->SetFillStyle(0);
1723 leg2->SetBorderSize(0);
1726 ratioleg+=legend[1];
1728 ratioleg+=legend[0];
1730 leg2->AddEntry(hr,ratioleg,
"L");
1732 for(
Int_t j=2; j<n; j++){
1733 TH1F * hr2 = (TH1F*)plotsethr->At(j);
1734 hr2->SetLineColor(1+j);
1738 ratioleg2+=legend[j];
1740 ratioleg2+=legend[0];
1742 leg2->AddEntry(hr2,ratioleg2,
"L");
1745 c2->SaveAs(Form(
"%s%s%sRatio.pdf",c->GetName(),legend[0].Data(), legend[n-1].Data()));
1746 c2->SaveAs(Form(
"%s%s%sRatio.eps",c->GetName(),legend[0].Data(), legend[n-1].Data()));
1751 TLegend* leg=
new TLegend(0.15,0.5,0.45,0.78);
1752 leg->SetFillStyle(0);
1753 leg->SetBorderSize(0);
1754 leg->AddEntry(h,legend[0],
"L");
1756 for(
Int_t j=1; j<n; j++){
1757 TH1F * h2 = (TH1F*)plotseth->At(j);
1758 h2->SetLineColor(1+j);
1759 leg->AddEntry(h2,legend[j],
"L");
1760 h2->Draw(
"htext0sames");
1766 c->SaveAs(Form(
"%s%s%s.eps",c->GetName(),legend[0].Data(), legend[n-1].Data()));
1767 c->SaveAs(Form(
"%s%s%s.pdf",c->GetName(),legend[0].Data(), legend[n-1].Data()));
1773 else cout<<
"Warning: To many files for combinationplot, show only original"<<endl;
1774 TLegend* leg3=
new TLegend(0.15,0.5,0.45,0.78);
1775 leg3->SetFillStyle(0);
1776 leg3->SetBorderSize(0);
1777 TCanvas* ctrsel=
new TCanvas(
"ctrsel",
"Track Sel");
1779 for(
Int_t i=0; i<maxfa; i++){
1780 TH1F* hd0fb4=(TH1F*)lists[i]->
FindObject(
"hd0TracksFilterBit4");
1781 TH1F* hd0SPD1=(TH1F*)lists[i]->
FindObject(
"hd0TracksSPDin");
1782 TH1F* hd0SPDany=(TH1F*)lists[i]->
FindObject(
"hd0TracksSPDany");
1783 TH1F* hd0TPCITScuts=(TH1F*)lists[i]->
FindObject(
"hd0TracksTPCITSSPDany");
1784 if(hd0fb4 && hd0SPD1 && hd0SPDany && hd0TPCITScuts){
1786 else{
if(check==0)
return;}
1788 hd0SPD1->SetLineColor(kCyan+3);
1789 hd0SPDany->SetLineColor(4);
1790 hd0TPCITScuts->SetLineColor(kGreen+1);
1791 hd0fb4->SetLineColor(2);
1795 TPaveStats *st1=(TPaveStats*)hd0SPD1->GetListOfFunctions()->FindObject(
"stats");
1796 st1->SetTextColor(kCyan+3);
1797 st1->SetY1NDC(0.71);
1799 hd0SPDany->Draw(
"sames");
1801 TPaveStats *st2=(TPaveStats*)hd0SPDany->GetListOfFunctions()->FindObject(
"stats");
1802 st2->SetY1NDC(0.51);
1804 st2->SetTextColor(4);
1805 hd0fb4->Draw(
"sames");
1807 TPaveStats *st3=(TPaveStats*)hd0fb4->GetListOfFunctions()->FindObject(
"stats");
1808 st3->SetY1NDC(0.31);
1810 st3->SetTextColor(2);
1811 hd0TPCITScuts->Draw(
"sames");
1813 TPaveStats *st4=(TPaveStats*)hd0TPCITScuts->GetListOfFunctions()->FindObject(
"stats");
1814 st4->SetY1NDC(0.71);
1816 st4->SetX1NDC(0.55);
1817 st4->SetX2NDC(0.75);
1818 st4->SetTextColor(kGreen+1);
1820 leg3->AddEntry(hd0SPD1,
"kITSrefit+SPD inner",
"L");
1821 leg3->AddEntry(hd0SPDany,
"kITSrefit+SPD any",
"L");
1822 leg3->AddEntry(hd0TPCITScuts,
"TPC+ITS cuts+SPD any",
"L");
1823 leg3->AddEntry(hd0fb4,
"Filter Bit 4",
"L");
1824 leg3->AddEntry(hd0SPD1, legend[i],
"L");
1827 hd0SPD1->SetStats(0);
1828 hd0SPD1->SetLineStyle(i+1);
1829 hd0SPD1->Draw(
"sames");
1830 hd0SPDany->SetStats(0);
1831 hd0SPDany->SetLineStyle(i+1);
1832 hd0TPCITScuts->SetStats(0);
1833 hd0TPCITScuts->SetLineStyle(i+1);
1834 hd0fb4->SetStats(0);
1835 hd0fb4->SetLineStyle(i+1);
1837 hd0SPD1->Draw(
"sames");
1838 hd0SPDany->Draw(
"sames");
1839 hd0TPCITScuts->Draw(
"sames");
1840 hd0fb4->Draw(
"sames");
1841 leg3->AddEntry(hd0SPD1, legend[i],
"L");
1847 ctrsel->SaveAs(
"ImpactParameterTrackSel.eps");
1848 ctrsel->SaveAs(
"ImpactParameterTrackSel.pdf");
Bool_t ReadFileMore(TList *&list, TList *&hstat, AliRDHFCuts *&cutobj, TString listname, TString partname, TString path="./", TString filename="PWG3histograms.root", TString dirname="PWG3_D2H_QA")
void DrawOutputPID(TString partname="D00100", Int_t mode=0, TString textleg="", TString path="./", TString suffixdir="", TString filename="AnalysisResults.root")
void CompilationEvSelection(Int_t n, TList **lists, TString *legend)
Bool_t ReadFilesForCompilation(TString inputtextfile, TList **&lists, Int_t &numb, TString *&legend)
void DrawProjections(TString partname="D0", TString h2dname="hMultvsPercentile", Int_t groupnbins=5, Float_t fitmin=15, Float_t fitmax=50, TString direction="X", TString path="./", TString suffixdir="", TString filename="AnalysisResults.root", TString fitfunc="pol0")
Double_t GetSigma(Int_t idet) const
void DrawEventSelection(TString partname="D0", TString path="./", TString suffixdir="", TString filename="AnalysisResults.root")
AliAODPidHF * GetPidHF() const
void WriteTextFileForCompilation(TString inputtextfile, Int_t analysistype)
void DrawOutputCentrality(TString partname="D0", TString textleg="", TString path="./", Bool_t superimpose=kFALSE, TString suffixdir="", TString filename="PWG3histograms.root")
void SuperimposeBBToTPCSignal(Int_t period, TCanvas *cpid, Int_t set)
void DrawOutputTrack(TString partname="D00100", TString textleg="", TString path="./", Bool_t superimpose=kFALSE, TString suffixdir="", TString filename="AnalysisResults.root", Bool_t normint=kTRUE)
void GetPLimit(Double_t *plim) const
Bool_t ReadFile(TList *&list, TList *&hstat, TString listname, TString partname, TString path="./", TString filename="PWG3histograms.root", TString dirname="PWG3_D2H_QA")
void TPCBetheBloch(Int_t set)
void CompilationOfTriggeredEvents(TString inputtextfile, Int_t analysistype)
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
TObject * FindObject(int bin, const char *nameH, const TList *lst, Bool_t normPerEvent=kTRUE)
void CompilationTrackSelection(Int_t n, TList **lists, TString *legend)
TH2 * Scale(TH2 *h, TH1 *g)