4 # include <TGraphErrors.h>
45 TFile*
Init(
const char* fname)
49 TFile*
file = TFile::Open(filename,
"READ");
51 Error(
"Run",
"Failed to open \"%s\"", filename.Data());
58 Info(
"Run",
"Trying old name Forward");
73 if (!(file =
Init(fname)))
return;
77 pdfName.ReplaceAll(
".root",
".pdf");
89 nFiles = pnFiles->GetVal();
100 if (hLow && nFiles > 0 && !hLow->TestBit(BIT(20)))
101 hLow->Scale(1. / nFiles);
102 if (hHigh && nFiles > 0 && !hHigh->TestBit(BIT(20)))
103 hHigh->Scale(1. / nFiles);
110 if (!sc) { ptr++; iq++;
continue; }
114 TH1* esdELoss =
GetH1(sc,
"esdEloss");
115 TH1* anaELoss =
GetH1(sc,
"anaEloss");
124 esdELoss->GetXaxis()->SetRangeUser(-.1, 2);
136 TLegend* l =
new TLegend(0.1, 0.1, 0.98, 0.98,
"");
141 e = l->AddEntry(
"dummy",
"ESD signal",
"f");
142 e->SetFillStyle(3002);
143 e->SetFillColor(kBlack);
144 e = l->AddEntry(
"dummy",
"Merged signal",
"f");
145 e->SetFillStyle(3001);
146 e->SetFillColor(kBlack);
147 e = l->AddEntry(
"dummy",
"Low cut",
"f");
148 e->SetFillStyle(3002);
149 e->SetFillColor(kYellow+1);
151 e->SetLineColor(kWhite);
152 e = l->AddEntry(
"dummy",
"High cut",
"f");
153 e->SetFillStyle(3002);
154 e->SetFillColor(kCyan+1);
156 e->SetLineColor(kWhite);
167 if (!(file =
Init(fname)))
return;
171 pdfName.ReplaceAll(
".root",
".pdf");
188 if (!(file =
Init(fname)))
return;
192 pdfName.ReplaceAll(
".root",
".pdf");
199 Info(
"Run",
"Trying old name \"Central\"");
211 hStatus->SetMaximum(hStatus->GetMaximum()*1.2);
212 fBody->SetRightMargin(0.10);
241 if (
fResults && (what & kResults)) {
245 if (what & kResults)
DrawBoth(file);
257 TLatex* ltx =
new TLatex(.5, .7,
"ESD #rightarrow AOD filtering");
259 ltx->SetTextSize(0.07);
260 ltx->SetTextAlign(22);
306 Double_t y0 = TMath::Max(eloss->GetMinimum(),1.);
310 Int_t iiy = (iy == 4 ? 5 : iy == 5 ? 4 : iy);
312 max = cuts->GetBinContent(1, iiy);
313 min = eloss->GetXaxis()->GetXmin();
316 for (
Int_t ix=1; ix <= cuts->GetNbinsX(); ix++) {
317 Double_t c = cuts->GetBinContent(ix, iiy);
318 if (c <= 0.0001)
continue;
319 min = TMath::Min(c, min);
320 max = TMath::Max(c, max);
324 ret->SetPoint(0, min, y0);
325 ret->SetPoint(1, min, y1);
326 ret->SetPoint(2, max, y1);
327 ret->SetPoint(3, max, y0);
328 ret->SetFillColor(color);
329 ret->SetFillStyle(3002);
330 ret->SetLineColor(kBlack);
331 ret->SetLineStyle(2);
332 ret->SetName(Form(
"g%s", cuts->GetName()));
333 ret->SetTitle(cuts->GetTitle());
341 case 0:
return "c=X";
342 case 1:
return "c=X#times#Delta_{p}";
343 case 2:
return "c:Lower bound of fit range";
344 case 3:
return "c=#Delta_{p}-X#times#xi";
345 case 4:
return "c=#Delta_{p}-X#times(#xi+#sigma)";
346 case 5:
return "c:P(#Delta<c)<X";
347 case 6:
return "c:#Delta_{p}-X#times#bar#xi+#sigma}";
362 const char* cuts[] = {
"fmd1i",
"fmd2i",
"fmd2o",
"fmd3i",
"fmd3o", 0 };
363 const char** pcut = cuts;
367 if (pcut != cuts) params.Append(
", ");
368 params.Append(Form(
"%5.2f", cut));
371 if (params.IsNull()) {
374 params = Form(
"%f", frac);
383 THStack* stack =
new THStack(cuts,
"x");
384 stack->SetTitle(cuts->GetTitle());
385 for (
Int_t i = 1; i <= cuts->GetNbinsY(); i++) {
386 TH1* hist =
static_cast<TH1*
>(stack->GetHists()->At(i-1));
387 TString name(cuts->GetYaxis()->GetBinLabel(i));
391 hist->SetDirectory(0);
392 hist->SetTitle(name);
393 hist->SetMarkerStyle(20);
394 hist->SetMarkerColor(col);
395 hist->SetLineColor(col);
396 hist->SetFillColor(col);
397 hist->SetLineWidth(0);
398 hist->SetFillStyle(0);
399 hist->SetXTitle(
"#eta");
400 hist->SetYTitle(cuts->GetZaxis()->GetTitle());
407 Info(
"DrawSharingFilter",
"Drawing sharing filter");
414 fBody->Divide(1, 3, 0, 0);
418 Bool_t angle=
false, lowSignal=
false, disabled=
false;
423 DrawParameter(y,
"Lower signal", (lowSignal ?
"yes" :
"no"));
427 nFiles = pnFiles->GetVal();
431 DrawParameter(y,
"Merging disabled", (disabled ?
"yes" :
"no"));
438 Bool_t simple=
false, three=
false;
448 hLow =
GetH2(c,
"lowCuts");
449 hHigh =
GetH2(c,
"highCuts");
450 if (hLow && nFiles > 0 && !hLow->TestBit(BIT(20)))
451 hLow->Scale(1. / nFiles);
452 if (hHigh && nFiles > 0 && !hHigh->TestBit(BIT(20)))
453 hHigh->Scale(1. / nFiles);
469 if (!sc) { ptr++; iq++;
continue; }
472 else fBody->Divide(2,3);
474 TH1* esdELoss =
GetH1(sc,
"esdEloss");
475 TH1* anaELoss =
GetH1(sc,
"anaEloss");
478 Double_t ignCut = TMath::Max(lowCut->GetX()[3],0.);
479 Int_t esdLow = esdELoss->FindBin(ignCut);
480 Int_t anaLow = anaELoss->FindBin(ignCut);
481 Double_t esdInt = esdELoss->Integral(esdLow,esdELoss->GetNbinsX()+1);
482 Double_t anaInt = anaELoss->Integral(anaLow,anaELoss->GetNbinsX()+1);
483 Double_t frac = esdInt > 0 ? (esdInt-anaInt)/esdInt : 1;
484 esdELoss->GetXaxis()->SetRangeUser(-.1, 2);
487 "#Delta/#Delta_{mip} reconstructed and merged");
491 TVirtualPad* p =
fBody->GetPad(1);
493 TLatex* l =
new TLatex(1-p->GetRightMargin(),
494 0.5, Form(
"Loss: %5.1f%%", frac*100));
498 l->DrawLatex(1-p->GetRightMargin(), 0.45,
499 Form(
"%f #rightarrow #infty", ignCut));
501 TH1* singles =
GetH1(sc,
"singleEloss");
502 TH1* doubles =
GetH1(sc,
"doubleEloss");
503 TH1* tripples =
GetH1(sc,
"tripleEloss");
504 Double_t int1 = singles->Integral(0,singles->GetNbinsX()+1);
505 Double_t int2 = doubles->Integral(0,doubles->GetNbinsX()+1);
506 Double_t int3 = tripples->Integral(0,tripples->GetNbinsX()+1);
508 Double_t f1 = intT > 0 ? int1 / intT : 0;
509 Double_t f2 = intT > 0 ? int2 / intT : 0;
510 Double_t f3 = intT > 0 ? int3 / intT : 0;
512 singles->GetXaxis()->SetRangeUser(-.1, 2);
514 "#Delta/#Delta_{mip} for single, double, and tripple hits");
526 DrawParameter(intY,
"Singles", Form(
"%5.1f%%", 100*f1), 0.05);
527 DrawParameter(intY,
"Doubles", Form(
"%5.1f%%", 100*f2), 0.05);
528 DrawParameter(intY,
"Tripples", Form(
"%5.1f%%", 100*f3), 0.05);
537 TH2* nB =
GetH2(sc,
"neighborsBefore");
539 nB->GetXaxis()->SetRangeUser(0,2);
540 nB->GetYaxis()->SetRangeUser(0,2);
543 "Correlation of neighbors before merging");
545 TH2* nA =
GetH2(sc,
"neighborsAfter");
547 nA->GetXaxis()->SetRangeUser(0,2);
548 nA->GetYaxis()->SetRangeUser(0,2);
551 "Correlation of neighbors after merging");
573 TString nam(Form(
"%s_corr", *ptr));
576 nam[4] = (nam[4] ==
'I' ?
'i' :
'o');
577 hc =
GetH2(cc, nam,
false);
609 TAxis* indep = (inY ? h->GetXaxis() : h->GetYaxis());
610 TAxis* dep = (inY ? h->GetYaxis() : h->GetXaxis());
617 Int_t minB = dep->FindBin(0.)+1;
618 Int_t maxB = dep->GetNbins();
619 Info(
"",
"Bin range: %d - %d", minB, maxB);
620 if (inY) h->FitSlicesY(0, minB, maxB, 10,
"QN", fits);
621 else h->FitSlicesX(0, minB, maxB, 10,
"QN", fits);
623 Warning(
"ShowSliceFit",
"No fits returned");
628 TH1* mean =
static_cast<TH1*
>(fits->At(1));
629 TH1* var =
static_cast<TH1*
>(fits->At(2));
631 Warning(
"ShowSliceFit",
"Didn't get histograms");
636 TH1* hh[] = { mean, var, 0 };
637 for (
Int_t ib=1; ib<=mean->GetNbinsX();ib++) {
640 if ((*hp)->GetBinContent(ib) <= 0) {
641 (*hp)->SetBinContent(ib,0);
642 (*hp)->SetBinError(ib,0);
650 TF1* fmean =
new TF1(
"mean",
"pol1");
651 TF1* fvar =
new TF1(
"var",
"pol1");
652 mean->Fit(fmean,
"Q0+");
653 var->Fit(fvar,
"Q0+");
654 if (!fmean || !fvar) {
655 Warning(
"ShowSliceFit",
"No functions returned");
661 g->SetName(Form(
"g%s", h->GetName()));
662 TString xTit = indep->GetTitle();
663 TString yTit = dep->GetTitle();
664 g->SetTitle(Form(
"Correlation of %s and %s",xTit.Data(),yTit.Data()));
665 g->SetFillColor(kBlue-10);
666 g->SetFillStyle(3001);
667 TGraph* up = (cut > 0 ?
new TGraph(indep->GetNbins()) : 0);
668 TGraph* low = (cut > 0 ?
new TGraph(indep->GetNbins()) : 0);
670 up ->SetLineColor(kBlack);
671 up ->SetLineWidth(2);
672 up ->SetLineStyle(2);
675 low->SetLineColor(kBlack);
676 low->SetLineWidth(2);
677 low->SetLineStyle(2);
679 for (
Int_t i = 1; i <= h->GetNbinsX(); i++) {
680 Double_t x = indep->GetBinCenter(i);
686 if (flags & 0x8000) ee *= e > 0 ? TMath::Log10(e) : 1;
688 g->SetPoint(i-1, x, y);
689 g->SetPointError(i-1, 0, ee);
692 g->SetPoint(i-1, y, x);
693 g->SetPointError(i-1, ee, 0);
696 if (inY) up->SetPoint(i-1,x,x+cut*x);
697 else up->SetPoint(i-1,y+cut*y,y);
700 if (inY) low->SetPoint(i-1,x,x-cut*x);
701 else low->SetPoint(i-1,y-cut*y,y);
705 if (up)
DrawInPad(p, sub, up,
"l", flags);
706 if (low)
DrawInPad(p, sub, low,
"l", flags);
707 fmean->SetRange(indep->GetXmin(), indep->GetXmax());
708 fmean->SetLineWidth(2);
711 TVirtualPad* pp = p->GetPad(sub);
712 Double_t y = 1-pp->GetTopMargin()-.01;
713 TLatex* l =
new TLatex(.15, y,
714 Form(
"#LT%s#GT(%s) = "
716 yTit.Data(), xTit.Data(),
717 fmean->GetParameter(0),
718 fmean->GetParameter(1), xTit.Data()));
721 l->SetTextSize(
fParVal->GetTextSize());
724 l->DrawLatex(0.15, y-0.07,
725 Form(
"#sigma_{%s}(%s) = "
727 yTit.Data(), xTit.Data(),
728 fvar->GetParameter(0),
729 fvar->GetParameter(1), xTit.Data()));
730 l->DrawLatex(0.15, y-0.14, Form(
"#delta = %3.1f %s #sigma",
732 flags & 0x8000 ?
"log_{10}(#sigma)" :
""));
739 Info(
"DrawDensityCalculator",
"Drawing density calculator");
747 Int_t maxParticles=0, phiAcceptance=0, etaLumping=0, phiLumping=0;
749 Double_t maxOutliers=0, outlierCut=-1;
756 (phiAcceptance == 1 ?
"N_{ch}" :
757 phiAcceptance == 2 ?
"#DeltaE" :
"none"), size);
761 Form(
"%2d #times %2d", phiLumping, etaLumping), size);
763 DrawParameter(y,
"Method", (method ?
"Poisson" :
"#DeltaE"), size);
765 DrawParameter(y,
"Recalculate #phi",(recalcPhi ?
"yes" :
"no"),size);
768 Form(
"%5.3f",maxOutliers),size);
770 if ((hasOutCut =
GetParameter(c,
"outlierCut", outlierCut,
false)))
771 DrawParameter(y,
"Max relative deviation",Form(
"%5.3f",outlierCut),size);
777 DrawParameter(y,
"# files merged", Form(
"%d", nFiles->GetVal()), size);
782 TVirtualPad* p =
fBody;
788 Double_t scale = 1./accI->GetMaximum();
792 accI->SetMaximum(1.3);
796 if (lCuts) lCuts->SetTitle(
"Thresholds");
797 if (nFiles && lCuts) lCuts->Scale(1. / nFiles->GetVal());
798 if (nFiles && maxW) maxW->Scale(1. / nFiles->GetVal());
812 if (!sc) { ptr++;
continue; }
815 else fBody->Divide(2,3);
817 TH2* corr =
GetH2(sc,
"elossVsPoisson");
818 TH2* corrOut =
GetH2(sc,
"elossVsPoissonOutlier",
false);
819 TH1* diff =
GetH1(sc,
"diffElossPoisson");
820 TH1* diffOut =
GetH1(sc,
"diffElossPoissonOutlier",
false);
822 TH1* elossUsed =
GetH1(sc,
"elossUsed");
824 if (eloss) eloss ->SetLineWidth(1);
825 if (elossUsed) elossUsed->SetLineWidth(1);
826 if (eloss) eloss->GetXaxis()->SetRangeUser(0.05, 2);
828 corr->SetXTitle(
"N_{ch,#Delta}");
829 corr->SetYTitle(
"N_{ch,Poisson}");
840 "#Delta/#Delta_{mip} before and after cuts");
845 if (eloss && elossUsed) {
846 Int_t lowBin = eloss->GetXaxis()->FindBin(0.)+1;
847 Int_t upBin = eloss->GetNbinsX()+1;
848 Double_t beforeInt = eloss->Integral(lowBin,upBin);
849 Double_t afterInt = elossUsed->Integral(lowBin,upBin);
850 Double_t frac = beforeInt > 0 ? (beforeInt-afterInt)/beforeInt : 1;
851 TVirtualPad* pp =
fBody->GetPad(4);
853 TLatex* l =
new TLatex(1-pp->GetRightMargin(),
854 0.5, Form(
"Loss: %5.1f%%", frac*100));
863 TH1* outliers =
GetH1(sc,
"outliers",
false);
866 else if (phiB && phiA) {
869 phiA->SetTitle(
"#Delta#phi from Ip (x,y) correction");
870 phiA->SetYTitle(
"(#phi_{after}-#phi_{before})/#phi_{before}");
875 TLatex* ltx =
new TLatex(0.5, 0.5,
"No outliers or #phi corrections");
876 ltx->SetTextAlign(22);
877 ltx->SetTextSize(0.07);
884 if (diff && diffOut) {
887 Double_t out = diffOut->GetEntries();
889 TLatex* ltx =
new TLatex(0.11, 0.89,
890 Form(
"Fraction: %7.3f%%",
893 ltx->SetTextAlign(13);
894 ltx->SetTextSize(0.06);
898 PrintCanvas(Form(
"Density calculator - %s", *ptr));
910 THStack* profiles =
new THStack(
"profiles",
"MC-ESD");
915 TH2* corr =
GetH2(cc, Form(
"%s_corr_mc_esd", *ptr));
919 corr->SetXTitle(
"MC");
920 corr->SetYTitle(
"ANA");
921 TH1* h =
new TH1F(
"",Form(
"Correlation of N_{ch,incl} for %s", *ptr),
923 corr->GetXaxis()->GetXmin(),
924 corr->GetXaxis()->GetXmax());
925 h->SetMinimum(corr->GetYaxis()->GetXmin());
926 h->SetMaximum(1.2*corr->GetYaxis()->GetXmax());
928 h->SetYTitle(corr->GetYaxis()->GetTitle());
933 TH1* diff =
GetH1(cc, Form(
"%s_diff_mc_esd", *ptr));
934 if (diff && diff->GetEntries() > 0) {
937 diff->Scale(1./diff->GetEntries(),
"width");
938 TF1* f =
new TF1(Form(
"%s_tri", *ptr),
939 "[0]*TMath::Exp(-TMath::Abs(x-[1])/[2])",-20,20);
940 f->SetParNames(
"A",
"x_{0}",
"w");
941 f->SetParameters(1, diff->GetMean(), diff->GetRMS());
946 TLatex* l =
new TLatex(.89, py,
"Ae^{-|x-x_{0}|/w}");
948 l->SetTextSize(
fParVal->GetTextSize());
953 l->DrawLatex(.89, py, Form(
"#chi^{2}/#nu=%f", f->GetNDF()>0 ?
954 f->GetChisquare()/f->GetNDF() : 0));
955 for (
Int_t i = 0; i < 3; i++) {
957 l->DrawLatex(.89, py, Form(
"%s: %f #pm %f", f->GetParName(i),
958 f->GetParameter(i), f->GetParError(i)));
961 TH2* vs =
GetH2(cc, Form(
"%s_esd_vs_mc", *ptr));
965 Int_t nX = vs->GetNbinsX();
966 Int_t nY = vs->GetNbinsY();
967 TProfile* vsp =
new TProfile(Form(
"%s_esd_vs_mc_px", *ptr), *ptr,
968 nX, vs->GetXaxis()->GetXmin(),
969 vs->GetXaxis()->GetXmax());
970 vsp->SetXTitle(vs->GetXaxis()->GetTitle());
971 vsp->SetYTitle(
"#LT#deltaN_{ch}#GT");
972 vsp->SetLineColor(diff->GetLineColor());
973 vsp->SetMarkerColor(diff->GetLineColor());
974 vsp->SetFillColor(diff->GetLineColor());
975 vsp->SetDirectory(0);
977 for (
Int_t ix = 1; ix <= nX; ix++) {
978 Double_t vsx = vs->GetXaxis()->GetBinCenter(ix);
979 for (
Int_t iy = 1; iy <= nY; iy++) {
980 Double_t vsc = vs->GetBinContent(ix, iy);
981 Double_t vse = vs->GetBinError(ix, iy);
982 if (vsc < lVs || vsc > hVs)
continue;
984 vsp->Fill(vsx, vsc, vse);
987 if (hasSome) profiles->Add(vsp);
990 PrintCanvas(Form(
"Density calculator - MC vs Reco - %s", *ptr));
994 if (profiles->GetHists() && profiles->GetHists()->GetEntries() > 0) {
995 Double_t pmax = profiles->GetMaximum(
"nostack")*1.3;
996 profiles->SetMaximum(+pmax);
997 profiles->SetMinimum(-pmax);
999 PrintCanvas(
"Density calculator - MC vs Reco - All");
1008 Info(
"DrawCorrector",
"Drawing corrector");
1015 Bool_t secondary=
false, vertexBias=
false, acceptance=
false, merging=
false;
1017 DrawParameter(y,
"Secondary corr.", secondary ?
"yes" :
"no");
1019 DrawParameter(y,
"Acceptance corr.", acceptance ?
"yes" :
"no");
1021 DrawParameter(y,
"Vertex bias corr.", vertexBias ?
"yes" :
"no");
1043 Info(
"DrawHistCollector",
"Drawing histogram collector");
1047 fBody->Divide(2, 1);
1048 TVirtualPad* p =
fBody->cd(1);
1053 Int_t nCutBins=0, fiducial=0, merge=0, skipRings=0;
1058 DrawParameter(y,
"# of bins to cut", Form(
"%d", nCutBins),size);
1062 if (skipRings & 0x05) skipped.Append(
"FMD1i ");
1063 if (skipRings & 0x09) skipped.Append(
"FMD2i ");
1064 if (skipRings & 0x0a) skipped.Append(
"FMD2o ");
1065 if (skipRings & 0x11) skipped.Append(
"FMD3i ");
1066 if (skipRings & 0x12) skipped.Append(
"FMD3o ");
1067 if (skipped.IsNull()) skipped =
"none";
1071 DrawParameter(y,
"Bg & hit maps stored.", bgAndHits?
"yes":
"no",size);
1074 (merge == 0 ?
"straight mean" :
1075 merge == 1 ?
"straight mean, no zeroes" :
1076 merge == 2 ?
"weighted mean" :
1077 merge == 3 ?
"least error" :
1078 merge == 4 ?
"sum" :
"unknown"),size);
1081 fiducial == 0 ?
"cut" :
"distance", size);
1083 DrawParameter(y,
"Fiducial cut.", Form(
"%f", fiducialCut), size);
1087 TH1* skipped =
GetH1(c,
"skipped",
false);
1089 skipped->SetFillColor(kRed+1);
1090 skipped->SetFillStyle(3001);
1107 TRegexp regexp(
"[pm][0-9]+_[pm][0-9]+");
1108 while ((o = next())) {
1110 if (name.Index(regexp) == kNPOS)
continue;
1122 PrintCanvas(Form(
"Histogram Collector - Vertex bin %s", vl->GetName()));
1125 o = c->FindObject(
"byCentrality");
1139 Info(
"DrawCentral",
"Drawing central (SPD)");
1143 fBody->Divide(2, 2);
1146 Bool_t secondary=
false, acceptance=
false;
1148 DrawParameter(y,
"Secondary corr.", secondary ?
"yes" :
"no");
1150 DrawParameter(y,
"Acceptance corr.", acceptance ?
"yes" :
"no");
1154 "#eta coverage per v_{z}");
1155 TH2* cvst =
GetH2(c,
"nClusterVsnTracklet");
1158 cvst->GetXaxis()->SetTitle(
"N_{free cluster}");
1159 cvst->GetYaxis()->SetTitle(
"N_{tracklet}");
1160 cvst->GetXaxis()->SetRangeUser(1,10000);
1161 cvst->GetYaxis()->SetRangeUser(1,10000);
1164 "Correlation of # of tracklets and clusters");
1166 "# clusters per tracklet vs #eta");
1169 fBody->cd(1)->Modified();
1170 fBody->cd(2)->Modified();
1171 fBody->cd(3)->Modified();
1172 fBody->cd(4)->Modified();
1173 fBody->cd(1)->Update();
1174 fBody->cd(2)->Update();
1175 fBody->cd(3)->Update();
1176 fBody->cd(4)->Update();
1182 TRegexp regexp(
"[pm][0-9]+_[pm][0-9]+");
1183 while ((o = next())) {
1185 if (name.Index(regexp) == kNPOS)
continue;
1189 fBody->Divide(1, 3);
1194 sec->SetMarkerStyle(21);
1195 sec->SetMarkerSize(1.2);
1201 fBody->cd(1)->Modified();
1202 fBody->cd(2)->Modified();
1203 fBody->cd(3)->Modified();
1204 fBody->cd(1)->Update();
1205 fBody->cd(2)->Update();
1206 fBody->cd(3)->Update();
1207 PrintCanvas(Form(
"Central - Vertex bin %s", vl->GetName()));
1217 TIter next(stack->GetHists());
1219 while ((h = static_cast<TH1*>(next()))) {
1220 TH1* copy =
static_cast<TH1*
>(h->Clone(Form(
"%s_copy", h->GetName())));
1221 copy->SetDirectory(0);
1223 copy->SetMarkerColor(kGray);
1224 copy->SetLineColor(kGray);
1234 TIter next(stack->GetHists());
1236 while ((h = static_cast<TH1*>(next()))) {
1237 TH1* copy =
static_cast<TH1*
>(h->Clone(Form(
"%s_copy", h->GetName())));
1238 copy->SetDirectory(0);
1239 copy->SetMarkerColor(kGray);
1240 copy->SetLineColor(kGray);
1255 if (all->GetHists()->GetEntries() <= 0 || !cur)
return;
1258 Bool_t left = sub % nCol == 1;
1259 Bool_t right= sub % nCol == 0;
1260 Bool_t top = (sub-1) / nCol == 0;
1261 TVirtualPad* p = can->cd(sub);
1262 gStyle->SetOptTitle(0);
1263 p->SetTitle(Form(
"Step # %d", step));
1264 p->SetFillColor(kWhite);
1265 p->SetRightMargin(right ? 0.02 : 0);
1266 p->SetTopMargin(top ? 0.02 : 0);
1271 all->Draw(
"nostack");
1272 all->GetHistogram()->SetXTitle(
"#eta");
1273 all->GetHistogram()->SetYTitle(
"signal");
1276 static_cast<TLegendEntry*
>(leg->GetListOfPrimitives()->At(step-1));
1278 e->SetMarkerColor(kBlack);
1279 e->SetLineColor(kBlack);
1280 e->SetTextColor(kBlack);
1284 gROOT->SetSelectedPad(p);
1285 cur->DrawClone(
"same nostack");
1288 TLatex* ltx =
new TLatex(.97, .97, title);
1290 ltx->SetTextSize(.06);
1291 ltx->SetTextAlign(33);
1294 ltx =
new TLatex((left ? .12 : .02), .97, p->GetTitle());
1296 ltx->SetTextSize(.06);
1297 ltx->SetTextAlign(13);
1301 Double_t x1 = 0.5*(p->GetUxmax()+p->GetUxmin());
1307 x1 = 0.99*p->GetUxmin();
1309 y1 = .5*(p->GetUymax()+p->GetUymin());
1314 TArrow* a =
new TArrow(x1, y1, x2, y2, sz,
"|>");
1316 a->SetFillColor(kGray+1);
1317 a->SetLineColor(kGray+1);
1325 e->SetMarkerColor(kGray);
1326 e->SetLineColor(kGray);
1327 e->SetTextColor(kGray);
1329 gStyle->SetOptTitle(1);
1337 stack->SetTitle(title);
1338 TIter next(stack->GetHists());
1340 while ((h = static_cast<TH1*>(next()))) {
1341 h->SetMarkerStyle(marker);
1343 tit.ReplaceAll(
"cache",
"");
1354 TLegendEntry* e = l->AddEntry(
"dummy", title.Data(),
"pl");
1355 e->SetMarkerStyle(h->GetMarkerStyle());
1356 e->SetMarkerColor(kGray);
1357 e->SetLineColor(kGray);
1358 e->SetTextColor(kGray);
1368 "sumsESD",
"summedESD",
false);
1370 "sums",
"summed",
false);
1372 "fmdDensityCalculator"),
1373 "sums",
"inclDensity",
false);
1375 "sums",
"primaryDensity",
false);
1379 "all",
"dndeta_eta",
false);
1381 if (dndeta) dndeta->SetMarkerColor(kBlack);
1382 if (!(esds || deltas || nchs || prims || rings))
return;
1384 FixStack(esds,
"#sum_{s} #Delta/#Delta_{mip}",
"", 20);
1385 FixStack(deltas,
"#sum_{c} #Delta/#Delta_{mip}",
"", 21);
1386 FixStack(nchs,
"#sum_{b} N_{ch,incl}",
"", 22);
1387 FixStack(prims,
"#sum_{b} N_{ch,primary}",
"", 23);
1388 FixStack(rings,
"dN/d#eta per ring",
"", 33);
1389 FixStack(mcRings,
"dN/d#eta per ring (MC)",
"(MC)", 34);
1391 THStack* all =
new THStack;
1401 res =
static_cast<TH1*
>(dndeta->Clone(
"dNdeta"));
1402 res->SetTitle(
"dN/d#eta");
1403 res->SetMarkerColor(kGray);
1404 res->SetLineColor(kGray);
1405 res->SetDirectory(0);
1409 TLegend* l =
new TLegend(.35, .2, .55, .9);
1410 l->SetFillColor(kWhite);
1412 l->SetBorderSize(0);
1413 TLegendEntry* e = 0;
1415 THStack* stacks[] = { mcRings,
1423 for (
Int_t i = 0; i < 6; i++) {
1424 if (!stacks[i])
continue;
1425 TH1* h =
static_cast<TH1*
>(stacks[i]->GetHists()->At(0));
1434 TObject* objs[] = { stacks[0],
1441 const char* titles[] = {
"MC",
1444 "After particle counting",
1445 "After corrections",
1446 "After normalization",
1447 "After combining" };
1448 Int_t nY = nHist > 6 ? 4 : 3;
1455 fBody->Divide(nX, nY, 0, 0);
1458 for (
Int_t i = 0; i < 7; i++) {
1466 case 1: padNo = 1;
break;
1467 case 2: padNo = 3;
break;
1468 case 3: padNo = 5;
break;
1469 case 4: padNo = (mcRings ? 7 : 2);
break;
1470 case 5: padNo = (mcRings ? 2 : 4);
break;
1471 case 6: padNo = (mcRings ? 4 : 6);
break;
1472 case 7: padNo = (mcRings ? 6 : 8);
break;
1479 if (!esds && !mcRings && deltas) {
1481 TLegend* ll =
new TLegend(0.01, 0.11, 0.99, 0.99);
1483 ll->SetFillColor(kWhite);
1484 ll->SetFillStyle(0);
1485 ll->SetBorderSize(0);
1487 TIter next(deltas->GetHists());
1489 while ((hh = static_cast<TH1*>(next()))) {
1490 e = ll->AddEntry(
"dummy", hh->GetTitle(),
"pl");
1491 e->SetMarkerColor(hh->GetMarkerColor());
1492 e->SetMarkerStyle(hh->GetMarkerStyle());
1493 e->SetLineColor(kBlack);
1513 "all",
"dndeta_eta",
false);
1517 dndeta_phi->SetTitle(
"1/N_{ev}dN_{ch}/d#eta (#varphi norm)");
1518 dndeta_eta->SetTitle(
"1/N_{ev}dN_{ch}/d#eta (#eta norm)");
1519 dndeta_eta->SetMarkerSize(0.7);
1521 THStack* allPhi =
new THStack(
"phiAcc",
"#varphi Acceptance");
1522 THStack* allEta =
new THStack(
"etaCov",
"#eta Coverage");
1529 TH1* dndeta =
GetH1(cc,
"dndeta_phi");
1531 if (dndeta) color = dndeta->GetMarkerColor();
1533 etaCov->SetTitle(*pring);
1534 etaCov->SetFillColor(color);
1535 etaCov->SetLineColor(color);
1536 allEta->Add(etaCov);
1539 phiAcc->SetFillColor(color);
1540 phiAcc->SetLineColor(color);
1541 allPhi->Add(phiAcc);
1549 TVirtualPad* p =
fBody->cd(1);
1552 "Individual ring results");
1554 DrawInPad(p, 2, allEta,
"nostack hist", kLegend,
1555 "#phi acceptance and #eta coverage per ring");
1556 DrawInPad(p, 2, allPhi,
"nostack hist same", 0x0);
1561 "1/#it{N}_{ev} d#it{N}_{ch}/d#it{#eta}");
1562 DrawInPad(p, 1, dndeta_eta,
"Same", kLegend);
1564 "Total #phi acceptance and #eta coverage");
1589 Info(
"DrawCentralResults",
"Drawing central results");
1591 fBody->Divide(1,2,0,0);
1595 THStack* stack =
new THStack(
"dndetas",
1596 "d#it{N}_{ch}/d#it{#eta} - central");
1597 stack->Add(dndeta_);
1601 TH1* h = stack->GetHistogram();
1603 h->SetXTitle(
"#it{#eta}");
1604 h->SetYTitle(
"#frac{d#it{N}_{ch}}{d#it{#eta}}");
1607 TLegend* l =
new TLegend(.3, .05, .7, .4);
1610 l->SetBorderSize(0);
1611 l->AddEntry(dndeta_,
"Normalized to coverage",
"lp");
1612 l->AddEntry(dndeta,
"Normalized to #phi acceptance",
"lp");
1623 Info(
"DrawBoth",
"Drawing central & forward results");
1627 if (!central || !forward) {
1628 Warning(
"DrawBoth",
"central %p or forward %p results not found",
1633 TH1* f1 =
GetH1(forward,
"dNdeta_");
1634 TH1* c1 =
GetH1(central,
"dNdeta_");
1635 TH1* f2 =
GetH1(forward,
"dNdeta");
1636 TH1* c2 =
GetH1(central,
"dNdeta");
1637 if (!f1 || !c1 || !f2 || !c2)
return;
1638 f1->SetLineColor(kBlack);
1639 f2->SetLineColor(kBlack);
1640 c1->SetLineColor(kBlack);
1641 c2->SetLineColor(kBlack);
1642 f1->SetMarkerColor(f2->GetMarkerColor());
1643 f1->SetMarkerStyle(24);
1644 c1->SetMarkerStyle(24);
1645 c2->SetMarkerStyle(20);
1646 c2->SetMarkerColor(c1->GetMarkerColor());
1647 THStack* s =
new THStack(
"dndetas",
"d#it{N}_{ch}/d#it{#eta}");
1653 fBody->Divide(1, 2, 0, 0);
1655 s->GetHistogram()->SetXTitle(
"#it{#eta}");
1656 s->GetHistogram()->SetYTitle(
"#frac{d#it{N}_{ch}}{d#it{#eta}}");
1659 TLegend* l =
new TLegend(.4, .05, .8, .4);
1662 l->SetBorderSize(0);
1663 TLegendEntry* entry = l->AddEntry(
"dummy",
"Forward",
"f");
1664 entry->SetFillColor(f1->GetMarkerColor());
1665 entry->SetLineColor(f1->GetMarkerColor());
1666 entry->SetFillStyle(1001);
1667 entry->SetLineWidth(0);
1668 entry = l->AddEntry(
"dummy",
"Central",
"f");
1669 entry->SetFillColor(c1->GetMarkerColor());
1670 entry->SetLineColor(c1->GetMarkerColor());
1671 entry->SetLineWidth(0);
1672 entry->SetFillStyle(1001);
1673 entry = l->AddEntry(
"dummy",
"Normalized to coverage",
"lp");
1674 entry->SetMarkerStyle(f1->GetMarkerStyle());
1675 entry = l->AddEntry(
"dummy",
"Normalized to #phi acceptance",
"lp");
1676 entry->SetMarkerStyle(f2->GetMarkerStyle());
1683 f3->SetFillColor(f1->GetMarkerColor());
1684 f4->SetFillColor(f1->GetMarkerColor());
1685 c3->SetFillColor(c1->GetMarkerColor());
1686 c4->SetFillColor(c1->GetMarkerColor());
1687 f3->SetLineColor(f1->GetMarkerColor());
1688 f4->SetLineColor(f1->GetMarkerColor());
1689 c3->SetLineColor(c1->GetMarkerColor());
1690 c4->SetLineColor(c1->GetMarkerColor());
1692 THStack* a =
new THStack(
"norms",
"Normalizations");
1698 a->SetMaximum(a->GetMaximum(
"nostack")*1.2);
1700 a->GetHistogram()->SetXTitle(
"#it{#eta}");
1701 a->GetHistogram()->SetYTitle(
"Normalization (coverage or acceptance)");
1704 l =
new TLegend(.2, .94, .9, .99);
1707 l->SetBorderSize(0);
1719 entry = l->AddEntry(
"dummy",
"#eta Coverage",
"f");
1720 entry->SetFillStyle(f3->GetFillStyle());
1721 entry->SetFillColor(kBlack);
1722 entry = l->AddEntry(
"dummy",
"#phi Acceptance",
"f");
1723 entry->SetFillStyle(f4->GetFillStyle());
1724 entry->SetFillColor(kBlack);
const Char_t * CutMethodName(Int_t lm) const
void SummarizeSharing(const char *fname, UShort_t what=0)
Base class for classes to draw summaries.
TGraph * CreateCutGraph(Int_t method, Int_t iy, TH2 *cuts, TH1 *eloss, Int_t color)
void DrawCentralResults()
static TH1 * GetH1(const TObject *parent, const TString &name, Bool_t verb=true)
static TH2 * GetH2(const TObject *parent, const TString &name, Bool_t verb=true)
void DrawCut(TVirtualPad *parent, Int_t sub, TH2 *cuts)
void DrawInRingPad(UShort_t d, Char_t r, TObject *h, Option_t *opts="", UShort_t flags=0x0, const char *title="")
void DrawBoth(TFile *file)
void Run(const char *fname, UShort_t what=kNormal)
void DrawTrackDensity(TCollection *parent, const char *folderName="mcTrackDensity")
TFile * Init(const char *fname)
void ShowSliceFit(Bool_t inY, TH2 *h, Double_t nVar, TVirtualPad *p, Int_t sub, UShort_t flags=0, Double_t cut=-1)
Int_t PrintCut(const TCollection *c, Double_t &y, const Char_t *name, Double_t size=0)
void DrawTitlePage(TFile *f)
void AddToAll(THStack *all, const THStack *stack, Int_t curr, Int_t step)
void MakeChapter(const TString &title)
static void SysString(UShort_t sys, TString &str)
static TH3 * GetH3(const TCollection *parent, const TString &name, Bool_t verb=true)
static Bool_t GetParameter(const TObject *c, const TString &name, Short_t &value, Bool_t verb=true)
void DrawStep(Int_t step, THStack *all, TObject *cur, TLegend *leg, const char *title, TVirtualPad *can, Int_t sub, Int_t nCol)
static TObject * GetObject(const TObject *parent, const TString &name, Bool_t verb=true)
void CreateCanvas(const TString &pname, Bool_t landscape=false, Bool_t pdf=true, Bool_t useTop=true)
void SummarizeSteps(const char *fname, UShort_t what=0)
void DrawParameter(Double_t &y, const TString &name, const TString &value, Double_t size=0)
static const Char_t ** GetRingNames(Bool_t lower=false)
void PrintCanvas(const TString &title, Float_t size=.7)
static void SNNString(UShort_t sNN, TString &str)
virtual void DrawEventInspector(TCollection *parent)
void DivideForRings(Bool_t commonX, Bool_t commonY)
void DrawDensityCalculator()
void AddLegendEntry(TLegend *l, const TH1 *h, const TString &title)
TObject * DrawInPad(TVirtualPad *c, Int_t padNo, TObject *h, Option_t *opts="", UInt_t flags=0x0, const char *title="")
virtual void DrawESDFixer(TCollection *parent)
TVirtualPad * RingPad(UShort_t d, Char_t r) const
static TCollection * GetCollection(const TObject *parent, const TString &name, Bool_t verb=true)
void FixStack(THStack *stack, const TString &title, const TString &extra, Int_t marker)
static Color_t RingColor(UShort_t d, Char_t r)
static THStack * GetStack(const TObject *parent, const TString &name, const char *sub=0, Bool_t verb=true)
void AddToAll(THStack *all, const THStack *stack)