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";
361 const char* cuts[] = {
"fmd1i",
"fmd2i",
"fmd2o",
"fmd3i",
"fmd3o", 0 };
362 const char** pcut = cuts;
366 if (pcut != cuts) params.Append(
", ");
367 params.Append(Form(
"%5.2f", cut));
370 if (params.IsNull()) {
373 params = Form(
"%f", frac);
382 THStack* stack =
new THStack(cuts,
"x");
383 stack->SetTitle(cuts->GetTitle());
384 for (
Int_t i = 1; i <= cuts->GetNbinsY(); i++) {
385 TH1* hist =
static_cast<TH1*
>(stack->GetHists()->At(i-1));
386 TString name(cuts->GetYaxis()->GetBinLabel(i));
390 hist->SetDirectory(0);
391 hist->SetTitle(name);
392 hist->SetMarkerStyle(20);
393 hist->SetMarkerColor(col);
394 hist->SetLineColor(col);
395 hist->SetFillColor(col);
396 hist->SetLineWidth(0);
397 hist->SetFillStyle(0);
398 hist->SetXTitle(
"#eta");
399 hist->SetYTitle(cuts->GetZaxis()->GetTitle());
406 Info(
"DrawSharingFilter",
"Drawing sharing filter");
413 fBody->Divide(1, 3, 0, 0);
417 Bool_t angle=
false, lowSignal=
false, disabled=
false;
422 DrawParameter(y,
"Lower signal", (lowSignal ?
"yes" :
"no"));
426 nFiles = pnFiles->GetVal();
430 DrawParameter(y,
"Merging disabled", (disabled ?
"yes" :
"no"));
437 Bool_t simple=
false, three=
false;
447 hLow =
GetH2(c,
"lowCuts");
448 hHigh =
GetH2(c,
"highCuts");
449 if (hLow && nFiles > 0 && !hLow->TestBit(BIT(20)))
450 hLow->Scale(1. / nFiles);
451 if (hHigh && nFiles > 0 && !hHigh->TestBit(BIT(20)))
452 hHigh->Scale(1. / nFiles);
468 if (!sc) { ptr++; iq++;
continue; }
471 else fBody->Divide(2,3);
473 TH1* esdELoss =
GetH1(sc,
"esdEloss");
474 TH1* anaELoss =
GetH1(sc,
"anaEloss");
477 Double_t ignCut = TMath::Max(lowCut->GetX()[3],0.);
478 Int_t esdLow = esdELoss->FindBin(ignCut);
479 Int_t anaLow = anaELoss->FindBin(ignCut);
480 Double_t esdInt = esdELoss->Integral(esdLow,esdELoss->GetNbinsX()+1);
481 Double_t anaInt = anaELoss->Integral(anaLow,anaELoss->GetNbinsX()+1);
482 Double_t frac = esdInt > 0 ? (esdInt-anaInt)/esdInt : 1;
483 esdELoss->GetXaxis()->SetRangeUser(-.1, 2);
486 "#Delta/#Delta_{mip} reconstructed and merged");
490 TVirtualPad* p =
fBody->GetPad(1);
492 TLatex* l =
new TLatex(1-p->GetRightMargin(),
493 0.5, Form(
"Loss: %5.1f%%", frac*100));
497 l->DrawLatex(1-p->GetRightMargin(), 0.45,
498 Form(
"%f #rightarrow #infty", ignCut));
500 TH1* singles =
GetH1(sc,
"singleEloss");
501 TH1* doubles =
GetH1(sc,
"doubleEloss");
502 TH1* tripples =
GetH1(sc,
"tripleEloss");
503 Double_t int1 = singles->Integral(0,singles->GetNbinsX()+1);
504 Double_t int2 = doubles->Integral(0,doubles->GetNbinsX()+1);
505 Double_t int3 = tripples->Integral(0,tripples->GetNbinsX()+1);
507 Double_t f1 = intT > 0 ? int1 / intT : 0;
508 Double_t f2 = intT > 0 ? int2 / intT : 0;
509 Double_t f3 = intT > 0 ? int3 / intT : 0;
511 singles->GetXaxis()->SetRangeUser(-.1, 2);
513 "#Delta/#Delta_{mip} for single, double, and tripple hits");
525 DrawParameter(intY,
"Singles", Form(
"%5.1f%%", 100*f1), 0.05);
526 DrawParameter(intY,
"Doubles", Form(
"%5.1f%%", 100*f2), 0.05);
527 DrawParameter(intY,
"Tripples", Form(
"%5.1f%%", 100*f3), 0.05);
536 TH2* nB =
GetH2(sc,
"neighborsBefore");
538 nB->GetXaxis()->SetRangeUser(0,2);
539 nB->GetYaxis()->SetRangeUser(0,2);
542 "Correlation of neighbors before merging");
544 TH2* nA =
GetH2(sc,
"neighborsAfter");
546 nA->GetXaxis()->SetRangeUser(0,2);
547 nA->GetYaxis()->SetRangeUser(0,2);
550 "Correlation of neighbors after merging");
572 TString nam(Form(
"%s_corr", *ptr));
575 nam[4] = (nam[4] ==
'I' ?
'i' :
'o');
576 hc =
GetH2(cc, nam,
false);
608 TAxis* indep = (inY ? h->GetXaxis() : h->GetYaxis());
609 TAxis* dep = (inY ? h->GetYaxis() : h->GetXaxis());
616 Int_t minB = dep->FindBin(0.)+1;
617 Int_t maxB = dep->GetNbins();
618 Info(
"",
"Bin range: %d - %d", minB, maxB);
619 if (inY) h->FitSlicesY(0, minB, maxB, 10,
"QN", fits);
620 else h->FitSlicesX(0, minB, maxB, 10,
"QN", fits);
622 Warning(
"ShowSliceFit",
"No fits returned");
627 TH1* mean =
static_cast<TH1*
>(fits->At(1));
628 TH1* var =
static_cast<TH1*
>(fits->At(2));
630 Warning(
"ShowSliceFit",
"Didn't get histograms");
635 TH1* hh[] = { mean, var, 0 };
636 for (
Int_t ib=1; ib<=mean->GetNbinsX();ib++) {
639 if ((*hp)->GetBinContent(ib) <= 0) {
640 (*hp)->SetBinContent(ib,0);
641 (*hp)->SetBinError(ib,0);
649 TF1* fmean =
new TF1(
"mean",
"pol1");
650 TF1* fvar =
new TF1(
"var",
"pol1");
651 mean->Fit(fmean,
"Q0+");
652 var->Fit(fvar,
"Q0+");
653 if (!fmean || !fvar) {
654 Warning(
"ShowSliceFit",
"No functions returned");
660 g->SetName(Form(
"g%s", h->GetName()));
661 TString xTit = indep->GetTitle();
662 TString yTit = dep->GetTitle();
663 g->SetTitle(Form(
"Correlation of %s and %s",xTit.Data(),yTit.Data()));
664 g->SetFillColor(kBlue-10);
665 g->SetFillStyle(3001);
666 TGraph* up = (cut > 0 ?
new TGraph(indep->GetNbins()) : 0);
667 TGraph* low = (cut > 0 ?
new TGraph(indep->GetNbins()) : 0);
669 up ->SetLineColor(kBlack);
670 up ->SetLineWidth(2);
671 up ->SetLineStyle(2);
674 low->SetLineColor(kBlack);
675 low->SetLineWidth(2);
676 low->SetLineStyle(2);
678 for (
Int_t i = 1; i <= h->GetNbinsX(); i++) {
679 Double_t x = indep->GetBinCenter(i);
685 if (flags & 0x8000) ee *= e > 0 ? TMath::Log10(e) : 1;
687 g->SetPoint(i-1, x, y);
688 g->SetPointError(i-1, 0, ee);
691 g->SetPoint(i-1, y, x);
692 g->SetPointError(i-1, ee, 0);
695 if (inY) up->SetPoint(i-1,x,x+cut*x);
696 else up->SetPoint(i-1,y+cut*y,y);
699 if (inY) low->SetPoint(i-1,x,x-cut*x);
700 else low->SetPoint(i-1,y-cut*y,y);
704 if (up)
DrawInPad(p, sub, up,
"l", flags);
705 if (low)
DrawInPad(p, sub, low,
"l", flags);
706 fmean->SetRange(indep->GetXmin(), indep->GetXmax());
707 fmean->SetLineWidth(2);
710 TVirtualPad* pp = p->GetPad(sub);
711 Double_t y = 1-pp->GetTopMargin()-.01;
712 TLatex* l =
new TLatex(.15, y,
713 Form(
"#LT%s#GT(%s) = "
715 yTit.Data(), xTit.Data(),
716 fmean->GetParameter(0),
717 fmean->GetParameter(1), xTit.Data()));
720 l->SetTextSize(
fParVal->GetTextSize());
723 l->DrawLatex(0.15, y-0.07,
724 Form(
"#sigma_{%s}(%s) = "
726 yTit.Data(), xTit.Data(),
727 fvar->GetParameter(0),
728 fvar->GetParameter(1), xTit.Data()));
729 l->DrawLatex(0.15, y-0.14, Form(
"#delta = %3.1f %s #sigma",
731 flags & 0x8000 ?
"log_{10}(#sigma)" :
""));
738 Info(
"DrawDensityCalculator",
"Drawing density calculator");
746 Int_t maxParticles=0, phiAcceptance=0, etaLumping=0, phiLumping=0;
748 Double_t maxOutliers=0, outlierCut=-1;
755 (phiAcceptance == 1 ?
"N_{ch}" :
756 phiAcceptance == 2 ?
"#DeltaE" :
"none"), size);
760 Form(
"%2d #times %2d", phiLumping, etaLumping), size);
762 DrawParameter(y,
"Method", (method ?
"Poisson" :
"#DeltaE"), size);
764 DrawParameter(y,
"Recalculate #phi",(recalcPhi ?
"yes" :
"no"),size);
767 Form(
"%5.3f",maxOutliers),size);
769 if ((hasOutCut =
GetParameter(c,
"outlierCut", outlierCut,
false)))
770 DrawParameter(y,
"Max relative deviation",Form(
"%5.3f",outlierCut),size);
776 DrawParameter(y,
"# files merged", Form(
"%d", nFiles->GetVal()), size);
781 TVirtualPad* p =
fBody;
787 Double_t scale = 1./accI->GetMaximum();
791 accI->SetMaximum(1.3);
795 if (lCuts) lCuts->SetTitle(
"Thresholds");
796 if (nFiles && lCuts) lCuts->Scale(1. / nFiles->GetVal());
797 if (nFiles && maxW) maxW->Scale(1. / nFiles->GetVal());
811 if (!sc) { ptr++;
continue; }
814 else fBody->Divide(2,3);
816 TH2* corr =
GetH2(sc,
"elossVsPoisson");
817 TH2* corrOut =
GetH2(sc,
"elossVsPoissonOutlier",
false);
818 TH1* diff =
GetH1(sc,
"diffElossPoisson");
819 TH1* diffOut =
GetH1(sc,
"diffElossPoissonOutlier",
false);
821 TH1* elossUsed =
GetH1(sc,
"elossUsed");
823 if (eloss) eloss ->SetLineWidth(1);
824 if (elossUsed) elossUsed->SetLineWidth(1);
825 if (eloss) eloss->GetXaxis()->SetRangeUser(0.05, 2);
827 corr->SetXTitle(
"N_{ch,#Delta}");
828 corr->SetYTitle(
"N_{ch,Poisson}");
839 "#Delta/#Delta_{mip} before and after cuts");
844 if (eloss && elossUsed) {
845 Int_t lowBin = eloss->GetXaxis()->FindBin(0.)+1;
846 Int_t upBin = eloss->GetNbinsX()+1;
847 Double_t beforeInt = eloss->Integral(lowBin,upBin);
848 Double_t afterInt = elossUsed->Integral(lowBin,upBin);
849 Double_t frac = beforeInt > 0 ? (beforeInt-afterInt)/beforeInt : 1;
850 TVirtualPad* pp =
fBody->GetPad(4);
852 TLatex* l =
new TLatex(1-pp->GetRightMargin(),
853 0.5, Form(
"Loss: %5.1f%%", frac*100));
862 TH1* outliers =
GetH1(sc,
"outliers",
false);
865 else if (phiB && phiA) {
868 phiA->SetTitle(
"#Delta#phi from Ip (x,y) correction");
869 phiA->SetYTitle(
"(#phi_{after}-#phi_{before})/#phi_{before}");
874 TLatex* ltx =
new TLatex(0.5, 0.5,
"No outliers or #phi corrections");
875 ltx->SetTextAlign(22);
876 ltx->SetTextSize(0.07);
883 if (diff && diffOut) {
886 Double_t out = diffOut->GetEntries();
888 TLatex* ltx =
new TLatex(0.11, 0.89,
889 Form(
"Fraction: %7.3f%%",
892 ltx->SetTextAlign(13);
893 ltx->SetTextSize(0.06);
897 PrintCanvas(Form(
"Density calculator - %s", *ptr));
909 THStack* profiles =
new THStack(
"profiles",
"MC-ESD");
914 TH2* corr =
GetH2(cc, Form(
"%s_corr_mc_esd", *ptr));
918 corr->SetXTitle(
"MC");
919 corr->SetYTitle(
"ANA");
920 TH1* h =
new TH1F(
"",Form(
"Correlation of N_{ch,incl} for %s", *ptr),
922 corr->GetXaxis()->GetXmin(),
923 corr->GetXaxis()->GetXmax());
924 h->SetMinimum(corr->GetYaxis()->GetXmin());
925 h->SetMaximum(1.2*corr->GetYaxis()->GetXmax());
927 h->SetYTitle(corr->GetYaxis()->GetTitle());
932 TH1* diff =
GetH1(cc, Form(
"%s_diff_mc_esd", *ptr));
933 if (diff && diff->GetEntries() > 0) {
936 diff->Scale(1./diff->GetEntries(),
"width");
937 TF1* f =
new TF1(Form(
"%s_tri", *ptr),
938 "[0]*TMath::Exp(-TMath::Abs(x-[1])/[2])",-20,20);
939 f->SetParNames(
"A",
"x_{0}",
"w");
940 f->SetParameters(1, diff->GetMean(), diff->GetRMS());
945 TLatex* l =
new TLatex(.89, py,
"Ae^{-|x-x_{0}|/w}");
947 l->SetTextSize(
fParVal->GetTextSize());
952 l->DrawLatex(.89, py, Form(
"#chi^{2}/#nu=%f", f->GetNDF()>0 ?
953 f->GetChisquare()/f->GetNDF() : 0));
954 for (
Int_t i = 0; i < 3; i++) {
956 l->DrawLatex(.89, py, Form(
"%s: %f #pm %f", f->GetParName(i),
957 f->GetParameter(i), f->GetParError(i)));
960 TH2* vs =
GetH2(cc, Form(
"%s_esd_vs_mc", *ptr));
964 Int_t nX = vs->GetNbinsX();
965 Int_t nY = vs->GetNbinsY();
966 TProfile* vsp =
new TProfile(Form(
"%s_esd_vs_mc_px", *ptr), *ptr,
967 nX, vs->GetXaxis()->GetXmin(),
968 vs->GetXaxis()->GetXmax());
969 vsp->SetXTitle(vs->GetXaxis()->GetTitle());
970 vsp->SetYTitle(
"#LT#deltaN_{ch}#GT");
971 vsp->SetLineColor(diff->GetLineColor());
972 vsp->SetMarkerColor(diff->GetLineColor());
973 vsp->SetFillColor(diff->GetLineColor());
974 vsp->SetDirectory(0);
976 for (
Int_t ix = 1; ix <= nX; ix++) {
977 Double_t vsx = vs->GetXaxis()->GetBinCenter(ix);
978 for (
Int_t iy = 1; iy <= nY; iy++) {
979 Double_t vsc = vs->GetBinContent(ix, iy);
980 Double_t vse = vs->GetBinError(ix, iy);
981 if (vsc < lVs || vsc > hVs)
continue;
983 vsp->Fill(vsx, vsc, vse);
986 if (hasSome) profiles->Add(vsp);
989 PrintCanvas(Form(
"Density calculator - MC vs Reco - %s", *ptr));
993 if (profiles->GetHists() && profiles->GetHists()->GetEntries() > 0) {
994 Double_t pmax = profiles->GetMaximum(
"nostack")*1.3;
995 profiles->SetMaximum(+pmax);
996 profiles->SetMinimum(-pmax);
998 PrintCanvas(
"Density calculator - MC vs Reco - All");
1007 Info(
"DrawCorrector",
"Drawing corrector");
1014 Bool_t secondary=
false, vertexBias=
false, acceptance=
false, merging=
false;
1016 DrawParameter(y,
"Secondary corr.", secondary ?
"yes" :
"no");
1018 DrawParameter(y,
"Acceptance corr.", acceptance ?
"yes" :
"no");
1020 DrawParameter(y,
"Vertex bias corr.", vertexBias ?
"yes" :
"no");
1042 Info(
"DrawHistCollector",
"Drawing histogram collector");
1046 fBody->Divide(2, 1);
1047 TVirtualPad* p =
fBody->cd(1);
1052 Int_t nCutBins=0, fiducial=0, merge=0, skipRings=0;
1057 DrawParameter(y,
"# of bins to cut", Form(
"%d", nCutBins),size);
1061 if (skipRings & 0x05) skipped.Append(
"FMD1i ");
1062 if (skipRings & 0x09) skipped.Append(
"FMD2i ");
1063 if (skipRings & 0x0a) skipped.Append(
"FMD2o ");
1064 if (skipRings & 0x11) skipped.Append(
"FMD3i ");
1065 if (skipRings & 0x12) skipped.Append(
"FMD3o ");
1066 if (skipped.IsNull()) skipped =
"none";
1070 DrawParameter(y,
"Bg & hit maps stored.", bgAndHits?
"yes":
"no",size);
1073 (merge == 0 ?
"straight mean" :
1074 merge == 1 ?
"straight mean, no zeroes" :
1075 merge == 2 ?
"weighted mean" :
1076 merge == 3 ?
"least error" :
1077 merge == 4 ?
"sum" :
"unknown"),size);
1080 fiducial == 0 ?
"cut" :
"distance", size);
1082 DrawParameter(y,
"Fiducial cut.", Form(
"%f", fiducialCut), size);
1086 TH1* skipped =
GetH1(c,
"skipped",
false);
1088 skipped->SetFillColor(kRed+1);
1089 skipped->SetFillStyle(3001);
1106 TRegexp regexp(
"[pm][0-9]+_[pm][0-9]+");
1107 while ((o = next())) {
1109 if (name.Index(regexp) == kNPOS)
continue;
1121 PrintCanvas(Form(
"Histogram Collector - Vertex bin %s", vl->GetName()));
1124 o = c->FindObject(
"byCentrality");
1138 Info(
"DrawCentral",
"Drawing central (SPD)");
1142 fBody->Divide(2, 2);
1145 Bool_t secondary=
false, acceptance=
false;
1147 DrawParameter(y,
"Secondary corr.", secondary ?
"yes" :
"no");
1149 DrawParameter(y,
"Acceptance corr.", acceptance ?
"yes" :
"no");
1153 "#eta coverage per v_{z}");
1154 TH2* cvst =
GetH2(c,
"nClusterVsnTracklet");
1157 cvst->GetXaxis()->SetTitle(
"N_{free cluster}");
1158 cvst->GetYaxis()->SetTitle(
"N_{tracklet}");
1159 cvst->GetXaxis()->SetRangeUser(1,10000);
1160 cvst->GetYaxis()->SetRangeUser(1,10000);
1163 "Correlation of # of tracklets and clusters");
1165 "# clusters per tracklet vs #eta");
1168 fBody->cd(1)->Modified();
1169 fBody->cd(2)->Modified();
1170 fBody->cd(3)->Modified();
1171 fBody->cd(4)->Modified();
1172 fBody->cd(1)->Update();
1173 fBody->cd(2)->Update();
1174 fBody->cd(3)->Update();
1175 fBody->cd(4)->Update();
1181 TRegexp regexp(
"[pm][0-9]+_[pm][0-9]+");
1182 while ((o = next())) {
1184 if (name.Index(regexp) == kNPOS)
continue;
1188 fBody->Divide(1, 3);
1193 sec->SetMarkerStyle(21);
1194 sec->SetMarkerSize(1.2);
1200 fBody->cd(1)->Modified();
1201 fBody->cd(2)->Modified();
1202 fBody->cd(3)->Modified();
1203 fBody->cd(1)->Update();
1204 fBody->cd(2)->Update();
1205 fBody->cd(3)->Update();
1206 PrintCanvas(Form(
"Central - Vertex bin %s", vl->GetName()));
1216 TIter next(stack->GetHists());
1218 while ((h = static_cast<TH1*>(next()))) {
1219 TH1* copy =
static_cast<TH1*
>(h->Clone(Form(
"%s_copy", h->GetName())));
1220 copy->SetDirectory(0);
1222 copy->SetMarkerColor(kGray);
1223 copy->SetLineColor(kGray);
1233 TIter next(stack->GetHists());
1235 while ((h = static_cast<TH1*>(next()))) {
1236 TH1* copy =
static_cast<TH1*
>(h->Clone(Form(
"%s_copy", h->GetName())));
1237 copy->SetDirectory(0);
1238 copy->SetMarkerColor(kGray);
1239 copy->SetLineColor(kGray);
1254 if (all->GetHists()->GetEntries() <= 0 || !cur)
return;
1257 Bool_t left = sub % nCol == 1;
1258 Bool_t right= sub % nCol == 0;
1259 Bool_t top = (sub-1) / nCol == 0;
1260 TVirtualPad* p = can->cd(sub);
1261 gStyle->SetOptTitle(0);
1262 p->SetTitle(Form(
"Step # %d", step));
1263 p->SetFillColor(kWhite);
1264 p->SetRightMargin(right ? 0.02 : 0);
1265 p->SetTopMargin(top ? 0.02 : 0);
1270 all->Draw(
"nostack");
1271 all->GetHistogram()->SetXTitle(
"#eta");
1272 all->GetHistogram()->SetYTitle(
"signal");
1275 static_cast<TLegendEntry*
>(leg->GetListOfPrimitives()->At(step-1));
1277 e->SetMarkerColor(kBlack);
1278 e->SetLineColor(kBlack);
1279 e->SetTextColor(kBlack);
1283 gROOT->SetSelectedPad(p);
1284 cur->DrawClone(
"same nostack");
1287 TLatex* ltx =
new TLatex(.97, .97, title);
1289 ltx->SetTextSize(.06);
1290 ltx->SetTextAlign(33);
1293 ltx =
new TLatex((left ? .12 : .02), .97, p->GetTitle());
1295 ltx->SetTextSize(.06);
1296 ltx->SetTextAlign(13);
1300 Double_t x1 = 0.5*(p->GetUxmax()+p->GetUxmin());
1306 x1 = 0.99*p->GetUxmin();
1308 y1 = .5*(p->GetUymax()+p->GetUymin());
1313 TArrow* a =
new TArrow(x1, y1, x2, y2, sz,
"|>");
1315 a->SetFillColor(kGray+1);
1316 a->SetLineColor(kGray+1);
1324 e->SetMarkerColor(kGray);
1325 e->SetLineColor(kGray);
1326 e->SetTextColor(kGray);
1328 gStyle->SetOptTitle(1);
1336 stack->SetTitle(title);
1337 TIter next(stack->GetHists());
1339 while ((h = static_cast<TH1*>(next()))) {
1340 h->SetMarkerStyle(marker);
1342 tit.ReplaceAll(
"cache",
"");
1353 TLegendEntry* e = l->AddEntry(
"dummy", title.Data(),
"pl");
1354 e->SetMarkerStyle(h->GetMarkerStyle());
1355 e->SetMarkerColor(kGray);
1356 e->SetLineColor(kGray);
1357 e->SetTextColor(kGray);
1367 "sumsESD",
"summedESD",
false);
1369 "sums",
"summed",
false);
1371 "fmdDensityCalculator"),
1372 "sums",
"inclDensity",
false);
1374 "sums",
"primaryDensity",
false);
1378 "all",
"dndeta_eta",
false);
1380 if (dndeta) dndeta->SetMarkerColor(kBlack);
1381 if (!(esds || deltas || nchs || prims || rings))
return;
1383 FixStack(esds,
"#sum_{s} #Delta/#Delta_{mip}",
"", 20);
1384 FixStack(deltas,
"#sum_{c} #Delta/#Delta_{mip}",
"", 21);
1385 FixStack(nchs,
"#sum_{b} N_{ch,incl}",
"", 22);
1386 FixStack(prims,
"#sum_{b} N_{ch,primary}",
"", 23);
1387 FixStack(rings,
"dN/d#eta per ring",
"", 33);
1388 FixStack(mcRings,
"dN/d#eta per ring (MC)",
"(MC)", 34);
1390 THStack* all =
new THStack;
1400 res =
static_cast<TH1*
>(dndeta->Clone(
"dNdeta"));
1401 res->SetTitle(
"dN/d#eta");
1402 res->SetMarkerColor(kGray);
1403 res->SetLineColor(kGray);
1404 res->SetDirectory(0);
1408 TLegend* l =
new TLegend(.35, .2, .55, .9);
1409 l->SetFillColor(kWhite);
1411 l->SetBorderSize(0);
1412 TLegendEntry* e = 0;
1414 THStack* stacks[] = { mcRings,
1422 for (
Int_t i = 0; i < 6; i++) {
1423 if (!stacks[i])
continue;
1424 TH1* h =
static_cast<TH1*
>(stacks[i]->GetHists()->At(0));
1433 TObject* objs[] = { stacks[0],
1440 const char* titles[] = {
"MC",
1443 "After particle counting",
1444 "After corrections",
1445 "After normalization",
1446 "After combining" };
1447 Int_t nY = nHist > 6 ? 4 : 3;
1454 fBody->Divide(nX, nY, 0, 0);
1457 for (
Int_t i = 0; i < 7; i++) {
1465 case 1: padNo = 1;
break;
1466 case 2: padNo = 3;
break;
1467 case 3: padNo = 5;
break;
1468 case 4: padNo = (mcRings ? 7 : 2);
break;
1469 case 5: padNo = (mcRings ? 2 : 4);
break;
1470 case 6: padNo = (mcRings ? 4 : 6);
break;
1471 case 7: padNo = (mcRings ? 6 : 8);
break;
1478 if (!esds && !mcRings && deltas) {
1480 TLegend* ll =
new TLegend(0.01, 0.11, 0.99, 0.99);
1482 ll->SetFillColor(kWhite);
1483 ll->SetFillStyle(0);
1484 ll->SetBorderSize(0);
1486 TIter next(deltas->GetHists());
1488 while ((hh = static_cast<TH1*>(next()))) {
1489 e = ll->AddEntry(
"dummy", hh->GetTitle(),
"pl");
1490 e->SetMarkerColor(hh->GetMarkerColor());
1491 e->SetMarkerStyle(hh->GetMarkerStyle());
1492 e->SetLineColor(kBlack);
1512 "all",
"dndeta_eta",
false);
1516 dndeta_phi->SetTitle(
"1/N_{ev}dN_{ch}/d#eta (#varphi norm)");
1517 dndeta_eta->SetTitle(
"1/N_{ev}dN_{ch}/d#eta (#eta norm)");
1518 dndeta_eta->SetMarkerSize(0.7);
1520 THStack* allPhi =
new THStack(
"phiAcc",
"#varphi Acceptance");
1521 THStack* allEta =
new THStack(
"etaCov",
"#eta Coverage");
1528 TH1* dndeta =
GetH1(cc,
"dndeta_phi");
1530 if (dndeta) color = dndeta->GetMarkerColor();
1532 etaCov->SetTitle(*pring);
1533 etaCov->SetFillColor(color);
1534 etaCov->SetLineColor(color);
1535 allEta->Add(etaCov);
1538 phiAcc->SetFillColor(color);
1539 phiAcc->SetLineColor(color);
1540 allPhi->Add(phiAcc);
1548 TVirtualPad* p =
fBody->cd(1);
1551 "Individual ring results");
1553 DrawInPad(p, 2, allEta,
"nostack hist", kLegend,
1554 "#phi acceptance and #eta coverage per ring");
1555 DrawInPad(p, 2, allPhi,
"nostack hist same", 0x0);
1560 "1/#it{N}_{ev} d#it{N}_{ch}/d#it{#eta}");
1561 DrawInPad(p, 1, dndeta_eta,
"Same", kLegend);
1563 "Total #phi acceptance and #eta coverage");
1588 Info(
"DrawCentralResults",
"Drawing central results");
1590 fBody->Divide(1,2,0,0);
1594 THStack* stack =
new THStack(
"dndetas",
1595 "d#it{N}_{ch}/d#it{#eta} - central");
1596 stack->Add(dndeta_);
1600 TH1* h = stack->GetHistogram();
1602 h->SetXTitle(
"#it{#eta}");
1603 h->SetYTitle(
"#frac{d#it{N}_{ch}}{d#it{#eta}}");
1606 TLegend* l =
new TLegend(.3, .05, .7, .4);
1609 l->SetBorderSize(0);
1610 l->AddEntry(dndeta_,
"Normalized to coverage",
"lp");
1611 l->AddEntry(dndeta,
"Normalized to #phi acceptance",
"lp");
1622 Info(
"DrawBoth",
"Drawing central & forward results");
1626 if (!central || !forward) {
1627 Warning(
"DrawBoth",
"central %p or forward %p results not found",
1632 TH1* f1 =
GetH1(forward,
"dNdeta_");
1633 TH1* c1 =
GetH1(central,
"dNdeta_");
1634 TH1* f2 =
GetH1(forward,
"dNdeta");
1635 TH1* c2 =
GetH1(central,
"dNdeta");
1636 if (!f1 || !c1 || !f2 || !c2)
return;
1637 f1->SetLineColor(kBlack);
1638 f2->SetLineColor(kBlack);
1639 c1->SetLineColor(kBlack);
1640 c2->SetLineColor(kBlack);
1641 f1->SetMarkerColor(f2->GetMarkerColor());
1642 f1->SetMarkerStyle(24);
1643 c1->SetMarkerStyle(24);
1644 c2->SetMarkerStyle(20);
1645 c2->SetMarkerColor(c1->GetMarkerColor());
1646 THStack* s =
new THStack(
"dndetas",
"d#it{N}_{ch}/d#it{#eta}");
1652 fBody->Divide(1, 2, 0, 0);
1654 s->GetHistogram()->SetXTitle(
"#it{#eta}");
1655 s->GetHistogram()->SetYTitle(
"#frac{d#it{N}_{ch}}{d#it{#eta}}");
1658 TLegend* l =
new TLegend(.4, .05, .8, .4);
1661 l->SetBorderSize(0);
1662 TLegendEntry* entry = l->AddEntry(
"dummy",
"Forward",
"f");
1663 entry->SetFillColor(f1->GetMarkerColor());
1664 entry->SetLineColor(f1->GetMarkerColor());
1665 entry->SetFillStyle(1001);
1666 entry->SetLineWidth(0);
1667 entry = l->AddEntry(
"dummy",
"Central",
"f");
1668 entry->SetFillColor(c1->GetMarkerColor());
1669 entry->SetLineColor(c1->GetMarkerColor());
1670 entry->SetLineWidth(0);
1671 entry->SetFillStyle(1001);
1672 entry = l->AddEntry(
"dummy",
"Normalized to coverage",
"lp");
1673 entry->SetMarkerStyle(f1->GetMarkerStyle());
1674 entry = l->AddEntry(
"dummy",
"Normalized to #phi acceptance",
"lp");
1675 entry->SetMarkerStyle(f2->GetMarkerStyle());
1682 f3->SetFillColor(f1->GetMarkerColor());
1683 f4->SetFillColor(f1->GetMarkerColor());
1684 c3->SetFillColor(c1->GetMarkerColor());
1685 c4->SetFillColor(c1->GetMarkerColor());
1686 f3->SetLineColor(f1->GetMarkerColor());
1687 f4->SetLineColor(f1->GetMarkerColor());
1688 c3->SetLineColor(c1->GetMarkerColor());
1689 c4->SetLineColor(c1->GetMarkerColor());
1691 THStack* a =
new THStack(
"norms",
"Normalizations");
1697 a->SetMaximum(a->GetMaximum(
"nostack")*1.2);
1699 a->GetHistogram()->SetXTitle(
"#it{#eta}");
1700 a->GetHistogram()->SetYTitle(
"Normalization (coverage or acceptance)");
1703 l =
new TLegend(.2, .94, .9, .99);
1706 l->SetBorderSize(0);
1718 entry = l->AddEntry(
"dummy",
"#eta Coverage",
"f");
1719 entry->SetFillStyle(f3->GetFillStyle());
1720 entry->SetFillColor(kBlack);
1721 entry = l->AddEntry(
"dummy",
"#phi Acceptance",
"f");
1722 entry->SetFillStyle(f4->GetFillStyle());
1723 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)