1 #include "SummaryDrawer.C"
4 * Class to draw a summary of the AOD production
7 * - The merged <tt>forward.root</tt> file.
8 * If the file isn't merged, it should still work.
11 * - A PDF file named after the input, but with <tt>.root</tt>
12 * replaced with <tt>pdf</tt>
15 class SummaryAODDrawer : public SummaryDrawer
19 kEventInspector = 0x001,
20 kSharingFilter = 0x002,
21 kDensityCalculator = 0x004,
23 kHistCollector = 0x010,
37 //__________________________________________________________________
44 void Run(const char* fname, UShort_t what=kNormal)
46 // --- Open the file ---------------------------------------------
47 TString filename(fname);
48 TFile* file = TFile::Open(filename, "READ");
50 Error("Run", "Failed to open \"%s\"", filename.Data());
55 // --- Get top-level collection ----------------------------------
56 fSums = GetCollection(file, "Forward");
59 // --- Do the results ----------------------------------------------
60 fResults = GetCollection(file, "ForwardResults");
61 if (!fResults) fResults = fSums; // Old-style
63 // --- Make our canvas -------------------------------------------
64 TString pdfName(filename);
65 pdfName.ReplaceAll(".root", ".pdf");
66 CreateCanvas(pdfName, what & kLandscape);
69 // --- Possibly make a chapter here ------------------------------
70 if (what & kCentral && GetCollection(file, "Central"))
71 MakeChapter("Forward");
73 // --- Set pause flag --------------------------------------------
74 fPause = what & kPause;
76 // --- Do each sub-algorithm -------------------------------------
77 if (what & kEventInspector) DrawEventInspector(fSums);
78 if (what & kSharingFilter) DrawSharingFilter();
79 if (what & kDensityCalculator) DrawDensityCalculator();
80 if (what & kCorrector) DrawCorrector();
81 if (what & kHistCollector) DrawHistCollector();
84 if (what & kSteps) DrawSteps();
85 if (what & kResults) DrawResults();
87 // --- SPD clusters ----------------------------------------------
88 if (what & kCentral) {
89 // --- Get top-level collection --------------------------------
90 fSums = GetCollection(file, "Central");
92 MakeChapter("Central");
94 if (what & kEventInspector) DrawEventInspector(fSums);
96 fResults = GetCollection(file, "CentralResults");
97 if (fResults && (what & kResults)) {
101 if (what & kResults) DrawBoth(file);
108 //____________________________________________________________________
109 void DrawTitlePage(TFile* f)
113 TLatex* ltx = new TLatex(.5, .7, "ESD #rightarrow AOD filtering");
115 ltx->SetTextSize(0.07);
116 ltx->SetTextAlign(22);
119 TCollection* fwd = GetCollection(f, "Forward");
120 TCollection* cen = GetCollection(f, "Central");
123 Double_t save = fParName->GetTextSize();
124 fParName->SetTextSize(0.03);
125 fParVal->SetTextSize(0.03);
127 DrawParameter(y, "Tasks", (fwd ? "Forward" : ""));
128 DrawParameter(y, "", (cen ? "Central" : ""));
131 TCollection* ei = GetCollection(fwd, "fmdEventInspector");
134 Int_t sys=0, sNN=0, field=0, runNo=0;
137 if (GetParameter(ei, "sys", sys))
138 DrawParameter(y, "System", (sys == 1 ? "pp" : sys == 2 ? "PbPb" :
139 sys == 3 ? "pPb" : "unknown"));
140 if (GetParameter(ei, "sNN", sNN)) {
141 TString tsNN = TString::Format("%dGeV", sNN);
143 tsNN = TString::Format("%5.2f", float(sNN)/1000);
144 else if (sNN >= 1000)
145 tsNN = TString::Format("%4.2f", float(sNN)/1000);
146 DrawParameter(y, "#sqrt{s_{NN}}", tsNN);
149 if (GetParameter(ei, "field", field))
150 DrawParameter(y, "L3 B field", Form("%+2dkG", field));
152 if (GetParameter(ei, "runNo", runNo))
153 DrawParameter(y, "Run #", Form("%6d", runNo));
155 if (!GetParameter(ei, "mc", mc)) mc = false;
156 DrawParameter(y, "Simulation", (mc ? "yes" : "no"));
159 PrintCanvas("Title page");
160 fParName->SetTextSize(save);
161 fParVal->SetTextSize(save);
163 //____________________________________________________________________
164 void DrawSharingFilter()
166 Info("DrawSharingFilter", "Drawing sharing filter");
167 TCollection* c = GetCollection(fSums, "fmdSharingFilter");
169 TCollection* rc = GetCollection(fResults, "fmdSharingFilter");
176 Bool_t angle=false, lowSignal=false, simple=false;
178 if (GetParameter(c, "angle", angle))
179 DrawParameter(y, "Angle correct", (angle ? "yes" : "no"));
180 if (GetParameter(c, "lowSignal", lowSignal))
181 DrawParameter(y, "Lower signal", (lowSignal ? "yes" : "no"));
183 if (GetParameter(c, "simple", simple))
184 DrawParameter(y, "Simple method", (simple ? "yes" : "no"));
185 TParameter<int>* nFiles =
186 static_cast<TParameter<int>*>(GetObject(c, "nFiles"));
188 DrawParameter(y, "# files merged", Form("%d", nFiles->GetVal()));
191 TCollection* lc = GetCollection(c, "lCuts");
192 TCollection* hc = GetCollection(c, "hCuts");
194 if (GetParameter(lc, "method", lm))
195 DrawParameter(y, "Low cut method", (lm == 0 ? "fixed" :
196 lm == 1 ? "fraction of MPV" :
197 lm == 2 ? "fit range" :
198 lm == 3 ? "Landau width" :
200 if (GetParameter(hc, "method", hm))
201 DrawParameter(y, "High cut method", (hm == 0 ? "fixed" :
202 hm == 1 ? "fraction of MPV" :
203 hm == 2 ? "fit range" :
204 hm == 3 ? "Landau width" :
208 TH2* hLow = GetH2(c, "lowCuts");
209 TH2* hHigh = GetH2(c, "highCuts");
210 if (hLow && nFiles) hLow->Scale(1. / nFiles->GetVal());
211 if (hHigh && nFiles) hHigh->Scale(1. / nFiles->GetVal());
212 DrawInPad(fBody, 2, hLow, "colz");
213 DrawInPad(fBody, 3, hHigh, "colz");
215 PrintCanvas("Sharing filter");
217 const char* subs[] = { "FMD1I", "FMD2I", "FMD2O", "FMD3O", "FMD3I", 0 };
218 const char** ptr = subs;
220 TCollection* sc = GetCollection(c, *ptr);
221 if (!sc) { ptr++; continue; }
224 DrawInPad(fBody, 1, GetH1(sc, "esdEloss"), "", 0x2);
225 DrawInPad(fBody, 1, GetH1(sc, "anaEloss"), "same", 0x12);
226 DrawInPad(fBody, 2, GetH1(sc, "singleEloss"), "", 0x2);
227 DrawInPad(fBody, 2, GetH1(sc, "doubleEloss"), "same", 0x2);
228 DrawInPad(fBody, 2, GetH1(sc, "tripleEloss"), "same", 0x12);
229 DrawInPad(fBody, 3, GetH2(sc, "singlePerStrip"), "colz", 0x4);
230 // DrawInPad(fBody, 4, GetH1(sc, "distanceBefore"), "", 0x2);
231 // DrawInPad(fBody, 4, GetH1(sc, "distanceAfter"), "same", 0x12);
232 DrawInPad(fBody, 4, GetH2(sc, "summed"), "colz", 0x0);
234 TH2* nB = GetH2(sc, "neighborsBefore");
236 nB->GetXaxis()->SetRangeUser(0,8);
237 nB->GetYaxis()->SetRangeUser(0,8);
239 DrawInPad(fBody, 5, nB, "colz", 0x4);
240 DrawInPad(fBody, 5, GetH2(sc, "neighborsAfter"), "p same", 0x4);
241 DrawInPad(fBody, 6, GetH2(sc, "beforeAfter"), "colz", 0x4);
243 PrintCanvas(Form("Sharing filter - %s", *ptr));
247 // --- MC --------------------------------------------------------
248 TCollection* cc = GetCollection(c, "esd_mc_comparion", false); // Spelling!
249 if (!cc) return; // Not MC
251 DivideForRings(false, false);
252 DrawInRingPad(1, 'I', GetH2(cc, "FMD1i_corr"), "colz", 0x4);
253 DrawInRingPad(2, 'I', GetH2(cc, "FMD2i_corr"), "colz", 0x4);
254 DrawInRingPad(2, 'O', GetH2(cc, "FMD2o_corr"), "colz", 0x4);
255 DrawInRingPad(3, 'I', GetH2(cc, "FMD3i_corr"), "colz", 0x4);
256 DrawInRingPad(3, 'O', GetH2(cc, "FMD3o_corr"), "colz", 0x4);
258 PrintCanvas("Sharing filter - MC vs Reco");
260 // --- MC --------------------------------------------------------
264 //____________________________________________________________________
265 void DrawDensityCalculator()
267 Info("DrawDensityCalculator", "Drawing density calculator");
268 TCollection* c = GetCollection(fSums, "fmdDensityCalculator");
275 Int_t maxParticles=0, phiAcceptance=0, etaLumping=0, phiLumping=0;
276 Bool_t method=false, recalcEta=false, recalcPhi=false;
277 Double_t size = fLandscape ? 0.06 : 0.04;
279 GetParameter(c, "maxParticle", maxParticles);
281 if (GetParameter(c, "phiAcceptance", phiAcceptance))
282 DrawParameter(y, "#phi acceptance method",
283 (phiAcceptance == 1 ? "N_{ch}" :
284 phiAcceptance == 2 ? "#DeltaE" : "none"), size);
286 if (GetParameter(c, "etaLumping", etaLumping) &&
287 GetParameter(c, "phiLumping", phiLumping))
288 DrawParameter(y, "Region size (sector#timesstrip)",
289 Form("%2d #times %2d", phiLumping, etaLumping), size);
291 if (GetParameter(c, "method", method))
292 DrawParameter(y, "Method", (method ? "Poisson" : "#DeltaE"), size);
294 if (GetParameter(c, "recalcEta", recalcEta))
295 DrawParameter(y, "Recalculate #eta",(recalcEta ? "yes" : "no"),size);
297 if (GetParameter(c, "recalcPhi", recalcPhi))
298 DrawParameter(y, "Recalculate #phi",(recalcPhi ? "yes" : "no"),size);
299 TParameter<int>* nFiles =
300 static_cast<TParameter<int>*>(GetObject(c, "nFiles"));
302 DrawParameter(y, "# files merged", Form("%d", nFiles->GetVal()));
304 TCollection* lc = GetCollection(c, "lCuts");
306 if (GetParameter(lc, "method", lm))
307 DrawParameter(y, "Low cut method", (lm == 0 ? "fixed" :
308 lm == 1 ? "fraction of MPV" :
309 lm == 2 ? "fit range" :
310 lm == 3 ? "Landau width" :
314 TVirtualPad* p = fBody; // fBody->cd(2);
317 TH1* accI = GetH1(c, "accI");
318 TH1* accO = GetH1(c, "accO");
320 Double_t scale = 1./accI->GetMaximum();
325 TH2* lCuts = GetH2(c, "lowCuts");
326 TH2* maxW = GetH2(c, "maxWeights");
327 if (nFiles && lCuts) lCuts->Scale(1. / nFiles->GetVal());
328 if (nFiles && maxW) maxW->Scale(1. / nFiles->GetVal());
329 DrawInPad(p, 2, accI);
330 DrawInPad(p, 2, accO, "same", 0x10);
331 DrawInPad(p, 3, lCuts, "colz");
332 DrawInPad(p, 4, maxW, "colz");
334 PrintCanvas("Density calculator");
336 const char* subs[] = { "FMD1I", "FMD2I", "FMD2O", "FMD3O", "FMD3I", 0 };
337 const char** ptr = subs;
339 TCollection* sc = GetCollection(c, *ptr);
340 if (!sc) { ptr++; continue; }
344 DrawInPad(fBody, 1, GetH2(sc, "elossVsPoisson"), "colz", 0x4);
345 DrawInPad(fBody, 2, GetH1(sc, "diffElossPoisson"), "HIST E", 0x2);
346 DrawInPad(fBody, 3, GetH1(sc, "occupancy"), "", 0x2);
347 DrawInPad(fBody, 4, GetH1(sc, "eloss"), "", 0x2);
348 DrawInPad(fBody, 4, GetH1(sc, "elossUsed"), "same", 0x12);
349 TH1* phiB = GetH1(sc, "phiBefore");
350 TH1* phiA = GetH1(sc, "phiAfter");
354 phiA->SetTitle("#Delta#phi from Ip (x,y) correction");
355 phiA->SetYTitle("(#phi_{after}-#phi_{before})/#phi_{before}");
357 DrawInPad(fBody, 5, phiA);
358 DrawInPad(fBody, 6, GetH2(sc, "phiAcc"), "colz", 0x4);
360 PrintCanvas(Form("Density calculator - %s", *ptr));
364 TCollection* cc = GetCollection(c, "esd_mc_comparison", false);
365 if (!cc) return; // Not MC
368 DrawInPad(fBody, 1, GetH2(cc, "FMD1I_corr_mc_esd"), "colz", 0x4);
369 DrawInPad(fBody, 3, GetH2(cc, "FMD2I_corr_mc_esd"), "colz", 0x4);
370 DrawInPad(fBody, 5, GetH2(cc, "FMD2O_corr_mc_esd"), "colz", 0x4);
371 DrawInPad(fBody, 7, GetH2(cc, "FMD3O_corr_mc_esd"), "colz", 0x4);
372 DrawInPad(fBody, 9, GetH2(cc, "FMD3I_corr_mc_esd"), "colz", 0x4);
373 DrawInPad(fBody, 2, GetH1(cc, "FMD1I_diff_mc_esd"), "", 0x2);
374 DrawInPad(fBody, 4, GetH1(cc, "FMD2I_diff_mc_esd"), "", 0x2);
375 DrawInPad(fBody, 6, GetH1(cc, "FMD2O_diff_mc_esd"), "", 0x2);
376 DrawInPad(fBody, 8, GetH1(cc, "FMD3O_diff_mc_esd"), "", 0x2);
377 DrawInPad(fBody, 10, GetH1(cc, "FMD3I_diff_mc_esd"), "", 0x2);
379 PrintCanvas("Density calculator - MC vs Reco");
382 //____________________________________________________________________
385 Info("DrawCorrector", "Drawing corrector");
386 TCollection* c = GetCollection(fSums, "fmdCorrector");
392 Bool_t secondary=false, vertexBias=false, acceptance=false, merging=false;
393 if (GetParameter(c, "secondary", secondary))
394 DrawParameter(y, "Secondary corr.", secondary ? "yes" : "no");
395 if (GetParameter(c, "acceptance", acceptance))
396 DrawParameter(y, "Acceptance corr.", acceptance ? "yes" : "no");
397 if (GetParameter(c, "vertexBias", vertexBias))
398 DrawParameter(y, "Vertex bias corr.", vertexBias ? "yes" : "no");
399 if (GetParameter(c, "merging", merging))
400 DrawParameter(y, "Merging eff.", merging ? "yes" : "no");
402 PrintCanvas("Corrector");
404 TCollection* cc = GetCollection(c, "esd_mc_comparison", false);
405 if (!cc) return; // Not MC
407 DivideForRings(false, false);
409 DrawInRingPad(1, 'I', GetH2(cc, "FMD1I_esd_vs_mc"), "colz", 0x0);
410 DrawInRingPad(2, 'I', GetH2(cc, "FMD2I_esd_vs_mc"), "colz", 0x0);
411 DrawInRingPad(2, 'O', GetH2(cc, "FMD2O_esd_vs_mc"), "colz", 0x0);
412 DrawInRingPad(3, 'O', GetH2(cc, "FMD3O_esd_vs_mc"), "colz", 0x0);
413 DrawInRingPad(3, 'I', GetH2(cc, "FMD3I_esd_vs_mc"), "colz", 0x0);
415 PrintCanvas("Corrector - MC vs Reco");
418 //____________________________________________________________________
419 void DrawHistCollector()
421 Info("DrawHistCollector", "Drawing histogram collector");
422 TCollection* c = GetCollection(fSums, "fmdHistCollector");
429 Int_t nCutBins=0, fiducial=0, merge=0, skipRings=0;
430 Double_t fiducialCut=0.;
431 Bool_t bgAndHits=false;
433 if (GetParameter(c, "nCutBins", nCutBins))
434 DrawParameter(y, "# of bins to cut", Form("%d", nCutBins));
436 if (GetParameter(c, "skipRings", skipRings)) {
438 if (skipRings & 0x05) skipped.Append("FMD1i ");
439 if (skipRings & 0x09) skipped.Append("FMD2i ");
440 if (skipRings & 0x0a) skipped.Append("FMD2o ");
441 if (skipRings & 0x11) skipped.Append("FMD3i ");
442 if (skipRings & 0x12) skipped.Append("FMD3o ");
443 DrawParameter(y, "Skipped rings", skipped);
446 if (GetParameter(c, "bgAndHits", bgAndHits))
447 DrawParameter(y, "Bg & hit maps stored.", bgAndHits?"yes":"no");
449 if (GetParameter(c, "merge", merge))
450 DrawParameter(y, "Merge method",
451 (merge == 0 ? "straight mean" :
452 merge == 1 ? "straight mean, no zeroes" :
453 merge == 2 ? "weighted mean" :
454 merge == 3 ? "least error" :
455 merge == 4 ? "sum" : "unknown"));
457 if (GetParameter(c, "fiducial", fiducial))
458 DrawParameter(y, "Fiducial method.",
459 fiducial == 0 ? "cut" : "distance");
461 if (GetParameter(c, "fiducialCut", fiducialCut))
462 DrawParameter(y, "Fiducial cut.", Form("%f", fiducialCut));
465 DrawInPad(fBody, 2, GetH2(c, "sumRings"), "colz");
466 DrawInPad(fBody, 3, GetH2(c, "coverage"), "colz");
468 fBody->cd(1)->Modified();
469 fBody->cd(2)->Modified();
470 fBody->cd(3)->Modified();
471 fBody->cd(1)->Update();
472 fBody->cd(2)->Update();
473 fBody->cd(3)->Update();
474 PrintCanvas("Histogram collector");
479 TRegexp regexp("[pm][0-9]+_[pm][0-9]+");
480 while ((o = next())) {
481 TString name(o->GetName());
482 if (name.Index(regexp) == kNPOS) continue;
484 TList* vl = static_cast<TList*>(o);
486 DivideForRings(false, false);
488 DrawInRingPad(1, 'I', GetH2(vl, "secMapFMD1I"), "colz", 0x0);
489 DrawInRingPad(2, 'I', GetH2(vl, "secMapFMD2I"), "colz", 0x0);
490 DrawInRingPad(2, 'O', GetH2(vl, "secMapFMD2O"), "colz", 0x0);
491 DrawInRingPad(3, 'O', GetH2(vl, "secMapFMD3O"), "colz", 0x0);
492 DrawInRingPad(3, 'I', GetH2(vl, "secMapFMD3I"), "colz", 0x0);
493 DrawInRingPad(1, 'I', GetH2(vl, "hitMapFMD1I"), "box same", 0x0);
494 DrawInRingPad(2, 'I', GetH2(vl, "hitMapFMD2I"), "box same", 0x0);
495 DrawInRingPad(2, 'O', GetH2(vl, "hitMapFMD2O"), "box same", 0x0);
496 DrawInRingPad(3, 'O', GetH2(vl, "hitMapFMD3O"), "box same", 0x0);
497 DrawInRingPad(3, 'I', GetH2(vl, "hitMapFMD3I"), "box same", 0x0);
499 PrintCanvas(Form("Histogram Collector - Vertex bin %s", vl->GetName()));
502 o = c->FindObject("byCentrality");
504 TList* bc = static_cast<TList*>(o);
506 DrawInPad(fBody, GetH3(bc, "FMD1I"), "box", 0);
507 DrawInPad(fBody, GetH3(bc, "FMD2I"), "box same", 0);
508 DrawInPad(fBody, GetH3(bc, "FMD2O"), "box same", 0);
509 DrawInPad(fBody, GetH3(bc, "FMD3O"), "box same", 0);
510 DrawInPad(fBody, GetH3(bc, "FMD3I"), "box same", 0x10);
513 //____________________________________________________________________
516 Info("DrawCentral", "Drawing central (SPD)");
517 TCollection* c = fSums;
524 DrawInPad(fBody, 1, GetH2(c, "coverage"), "col", 0);
525 DrawInPad(fBody, 2, GetH2(c, "nClusterVsnTracklet"), "colz", 0x03);
526 DrawInPad(fBody, 3, GetH2(c, "clusterPerTracklet"), "colz", 0x0);
528 fBody->cd(1)->Modified();
529 fBody->cd(2)->Modified();
530 fBody->cd(3)->Modified();
531 fBody->cd(1)->Update();
532 fBody->cd(2)->Update();
533 fBody->cd(3)->Update();
534 PrintCanvas("Central - overview");
539 TRegexp regexp("[pm][0-9]+_[pm][0-9]+");
540 while ((o = next())) {
541 TString name(o->GetName());
542 if (name.Index(regexp) == kNPOS) continue;
544 TList* vl = static_cast<TList*>(o);
548 DrawInPad(fBody, 1, GetH1(vl, "acceptance"), "", 0);
550 TH1* sec = GetH1(vl, "secondary");
551 sec->SetMarkerStyle(21);
552 sec->SetMarkerSize(1.2);
553 DrawInPad(fBody, 2, sec, "", 0);
554 DrawInPad(fBody, 2, GetH1(vl, "secondaryFiducial"), "same", 0x0);
555 DrawInPad(fBody, 3, GetH2(vl, "secondaryMapFiducial"), "colz", 0);
556 DrawInPad(fBody, 3, GetH2(vl, "hitMap"), "box same", 0x0);
558 fBody->cd(1)->Modified();
559 fBody->cd(2)->Modified();
560 fBody->cd(3)->Modified();
561 fBody->cd(1)->Update();
562 fBody->cd(2)->Update();
563 fBody->cd(3)->Update();
564 PrintCanvas(Form("Central - Vertex bin %s", vl->GetName()));
569 //____________________________________________________________________
570 void AddToAll(THStack* all, const THStack* stack, Int_t curr, Int_t step)
574 TIter next(stack->GetHists());
576 while ((h = static_cast<TH1*>(next()))) {
577 TH1* copy = static_cast<TH1*>(h->Clone(Form("%s_copy", h->GetName())));
578 copy->SetDirectory(0);
580 copy->SetMarkerColor(kGray);
581 copy->SetLineColor(kGray);
586 //____________________________________________________________________
587 void AddToAll(THStack* all, const THStack* stack)
591 TIter next(stack->GetHists());
593 while ((h = static_cast<TH1*>(next()))) {
594 TH1* copy = static_cast<TH1*>(h->Clone(Form("%s_copy", h->GetName())));
595 copy->SetDirectory(0);
596 copy->SetMarkerColor(kGray);
597 copy->SetLineColor(kGray);
602 //____________________________________________________________________
603 void DrawStep(Int_t step,
610 if (all->GetHists()->GetEntries() <= 0 || !cur) return;
612 // Info("", "Drawing step # %d", step);
613 Bool_t left = (step % 2) == 1;
614 TVirtualPad* p = can->cd(step);
615 gStyle->SetOptTitle(0);
616 p->SetTitle(Form("Step # %d", step));
617 p->SetFillColor(kWhite);
618 p->SetRightMargin(left ? 0 : 0.02);
619 p->SetTopMargin(0); // 0.02);
622 all->Draw("nostack");
623 all->GetHistogram()->SetXTitle("#eta");
624 all->GetHistogram()->SetYTitle("signal");
627 gROOT->SetSelectedPad(p);
628 cur->DrawClone("same nostack");
631 TLatex* ltx = new TLatex(.97, .97, title);
633 ltx->SetTextSize(.06);
634 ltx->SetTextAlign(33);
637 ltx = new TLatex((left ? .12 : .02), .97, p->GetTitle());
639 ltx->SetTextSize(.06);
640 ltx->SetTextAlign(13);
648 //____________________________________________________________________
649 void FixStack(THStack* stack, const TString& title,
650 const TString& extra, Int_t marker)
653 stack->SetTitle(title);
654 TIter next(stack->GetHists());
656 while ((h = static_cast<TH1*>(next()))) {
657 h->SetMarkerStyle(marker);
658 TString tit(h->GetTitle());
659 tit.ReplaceAll("cache", "");
664 void AddLegendEntry(TLegend* l,
666 const TString& title)
670 TLegendEntry* e = l->AddEntry("dummy", title.Data(), "pl");
671 e->SetMarkerStyle(h->GetMarkerStyle());
672 e->SetMarkerColor(kGray);
673 e->SetLineColor(kGray);
674 e->SetTextColor(kGray);
678 //____________________________________________________________________
681 // MakeChapter(can, "Steps");
683 THStack* deltas = GetStack(GetCollection(fResults, "fmdSharingFilter"),
685 THStack* nchs = GetStack(GetCollection(fResults,
686 "fmdDensityCalculator"),
687 "sums", "inclDensity");
688 THStack* prims = GetStack(GetCollection(fResults, "fmdCorrector"),
689 "sums", "primaryDensity");
690 THStack* rings = GetStack(GetCollection(fResults, "ringResults"), "all");
691 THStack* mcRings = GetStack(GetCollection(fResults, "mcRingResults", false),
692 "all","dndeta_eta", false);
693 TH1* dndeta = GetH1(fResults, "dNdeta");
694 if (dndeta) dndeta->SetMarkerColor(kBlack);
696 FixStack(deltas, "#sum_{} #Delta/#Delta_{mip}", "", 20);
697 FixStack(nchs, "#sum_{} N_{ch,incl}", "", 21);
698 FixStack(prims, "#sum_{} N_{ch,primary}", "", 22);
699 FixStack(rings, "dN/d#eta per ring", "", 23);
700 FixStack(mcRings,"dN/d#eta per ring (MC)", "(MC)", 34);
702 THStack* all = new THStack;
703 AddToAll(all, mcRings);
704 AddToAll(all, deltas);
706 AddToAll(all, prims);
707 AddToAll(all, rings);
711 res = static_cast<TH1*>(dndeta->Clone("dNdeta"));
712 res->SetTitle("dN/d#eta");
713 res->SetMarkerColor(kGray);
714 res->SetLineColor(kGray);
715 res->SetDirectory(0);
719 TLegend* l = new TLegend(.35, .2, .55, .9);
720 l->SetFillColor(kWhite);
727 h = static_cast<TH1*>(mcRings->GetHists()->At(0));
728 AddLegendEntry(l, h, mcRings->GetTitle());
732 h = static_cast<TH1*>(deltas->GetHists()->At(0));
733 AddLegendEntry(l, h, deltas->GetTitle());
737 h = static_cast<TH1*>(nchs->GetHists()->At(0));
738 AddLegendEntry(l, h, nchs->GetTitle());
742 h = static_cast<TH1*>(prims->GetHists()->At(0));
743 AddLegendEntry(l, h, prims->GetTitle());
747 h = static_cast<TH1*>(rings->GetHists()->At(0));
748 AddLegendEntry(l, h, rings->GetTitle());
753 AddLegendEntry(l, h, h->GetTitle());
756 TObject* objs[] = { mcRings,
762 const char* titles[] = { "MC",
764 "After particle counting",
766 "After normalization",
769 fBody->Divide(2, 3, 0, 0); // mcRings ? 4 : 3, 0, 0);
771 for (Int_t i = 0; i < 6; i++) {
772 TObject* obj = objs[i];
774 e = static_cast<TLegendEntry*>(l->GetListOfPrimitives()->At(step));
775 e->SetMarkerColor(kBlack);
776 e->SetLineColor(kBlack);
777 e->SetTextColor(kBlack);
780 DrawStep(step, all, obj, l, titles[i], fBody);
781 e->SetMarkerColor(kGray);
782 e->SetLineColor(kGray);
783 e->SetTextColor(kGray);
786 if (!mcRings && deltas) {
788 TLegend* ll = new TLegend(0.01, 0.11, 0.99, 0.99);
790 ll->SetFillColor(kWhite);
792 ll->SetBorderSize(0);
794 TIter next(deltas->GetHists());
796 while ((hh = static_cast<TH1*>(next()))) {
797 e = ll->AddEntry("dummy", hh->GetTitle(), "pl");
798 e->SetMarkerColor(hh->GetMarkerColor());
799 e->SetMarkerStyle(hh->GetMarkerStyle());
800 e->SetLineColor(kBlack);
804 PrintCanvas("Steps");
808 //____________________________________________________________________
811 // MakeChapter(can, "Results");
815 TCollection* c = GetCollection(fResults, "ringResults");
818 THStack* mcRings = GetStack(GetCollection(fResults, "mcRingResults", false),
819 "all", "dndeta_eta", false);
821 TH1* dndeta_phi = GetH1(fResults, "dNdeta");
822 TH1* dndeta_eta = GetH1(fResults, "dNdeta_");
823 dndeta_phi->SetTitle("1/N_{ev}dN_{ch}/d#eta (#varphi norm)");
824 dndeta_eta->SetTitle("1/N_{ev}dN_{ch}/d#eta (#eta norm)");
825 dndeta_eta->SetMarkerSize(0.7);
827 THStack* allPhi = new THStack("phiAcc", "#varphi Acceptance");
828 THStack* allEta = new THStack("etaCov", "#eta Coverage");
829 const char* rings[] = { "FMD1I", "FMD2I", "FMD2O", "FMD3I", "FMD3O", 0 };
830 const char** pring = rings;
833 TCollection* cc = GetCollection(c, *pring);
834 TH1* etaCov = GetH1(cc, "etaCov");
835 TH1* phiAcc = GetH1(cc, "phiAcc");
836 TH1* dndeta = GetH1(cc, "dndeta_phi");
837 Int_t color = kBlack;
838 if (dndeta) color = dndeta->GetMarkerColor();
840 etaCov->SetTitle(*pring);
841 etaCov->SetFillColor(color);
842 etaCov->SetLineColor(color);
846 phiAcc->SetFillColor(color);
847 phiAcc->SetLineColor(color);
852 DrawInPad(fBody, 1, GetStack(c, "all"), "nostack", mcRings ? 0 : 0x10);
853 DrawInPad(fBody, 2, dndeta_phi);
854 DrawInPad(fBody, 2, dndeta_eta, "Same", 0x10);
855 DrawInPad(fBody, 3, allEta, "nostack hist", 0x10);
856 DrawInPad(fBody, 3, allPhi, "nostack hist same", 0x0);
857 DrawInPad(fBody, 4, GetH1(fResults, "norm"));
858 DrawInPad(fBody, 4, GetH1(fResults, "phi"), "same", 0x10);
859 // DrawInPad(fBody, 4, GetH1(fSums, "d2Ndetadphi"), "colz");
860 DrawInPad(fBody, 1, mcRings, "nostack same", 0x10);
863 TLatex* l = new TLatex(.5, .2, "Ring results");
869 l->DrawLatex(.5, .2, "1/N_{ev}dN_{ch}/d#eta");
872 // l->DrawLatex(.5, .2, "1/N_{ev}dN_{ch}/d#eta (#vta norm.)");
874 PrintCanvas("Results");
877 //____________________________________________________________________
878 void DrawCentralResults()
880 // MakeChapter(can, "Results");
881 Info("DrawCentralResults", "Drawing central results");
883 fBody->Divide(1,2,0,0);
885 TH1* dndeta_ = GetH1(fResults, "dNdeta_");
886 TH1* dndeta = GetH1(fResults, "dNdeta");
887 THStack* stack = new THStack("dndetas",
888 "d#it{N}_{ch}/d#it{#eta} - central");
892 DrawInPad(fBody, 1, stack, "nostack");
893 stack->GetHistogram()->SetXTitle("#it{#eta}");
894 stack->GetHistogram()->SetYTitle("#frac{d#it{N}_{ch}}{d#it{#eta}}");
896 TLegend* l = new TLegend(.3, .05, .7, .4);
900 l->AddEntry(dndeta_, "Normalized to coverage", "lp");
901 l->AddEntry(dndeta, "Normalized to #phi acceptance", "lp");
904 DrawInPad(fBody, 2, GetH1(fResults, "norm"));
905 DrawInPad(fBody, 2, GetH1(fResults, "phi"), "same", kLegend);
907 PrintCanvas("Central Results");
910 void DrawBoth(TFile* file)
912 Info("DrawBoth", "Drawing central & forward results");
913 TCollection* central = GetCollection(file, "CentralResults");
914 TCollection* forward = GetCollection(file, "ForwardResults");
916 if (!central || !forward) {
917 Warning("DrawBoth", "central %p or forward %p results not found",
922 TH1* f1 = GetH1(forward, "dNdeta_");
923 TH1* c1 = GetH1(central, "dNdeta_");
924 TH1* f2 = GetH1(forward, "dNdeta");
925 TH1* c2 = GetH1(central, "dNdeta");
926 f1->SetLineColor(kBlack);
927 f2->SetLineColor(kBlack);
928 c1->SetLineColor(kBlack);
929 c2->SetLineColor(kBlack);
930 f1->SetMarkerColor(f2->GetMarkerColor());
931 f1->SetMarkerStyle(24);
932 c1->SetMarkerStyle(24);
933 c2->SetMarkerStyle(20);
934 c2->SetMarkerColor(c1->GetMarkerColor());
935 THStack* s = new THStack("dndetas", "d#it{N}_{ch}/d#it{#eta}");
941 fBody->Divide(1, 2, 0, 0);
942 DrawInPad(fBody, 1, s, "nostack");
943 s->GetHistogram()->SetXTitle("#it{#eta}");
944 s->GetHistogram()->SetYTitle("#frac{d#it{N}_{ch}}{d#it{#eta}}");
947 TLegend* l = new TLegend(.4, .05, .8, .4);
951 TLegendEntry* entry = l->AddEntry("dummy", "Forward", "f");
952 entry->SetFillColor(f1->GetMarkerColor());
953 entry->SetLineColor(f1->GetMarkerColor());
954 entry->SetFillStyle(1001);
955 entry->SetLineWidth(0);
956 entry = l->AddEntry("dummy", "Central", "f");
957 entry->SetFillColor(c1->GetMarkerColor());
958 entry->SetLineColor(c1->GetMarkerColor());
959 entry->SetLineWidth(0);
960 entry->SetFillStyle(1001);
961 entry = l->AddEntry("dummy", "Normalized to coverage", "lp");
962 entry->SetMarkerStyle(f1->GetMarkerStyle());
963 entry = l->AddEntry("dummy", "Normalized to #phi acceptance", "lp");
964 entry->SetMarkerStyle(f2->GetMarkerStyle());
967 TH1* f3 = GetH1(forward, "norm");
968 TH1* c3 = GetH1(central, "norm");
969 TH1* f4 = GetH1(forward, "phi");
970 TH1* c4 = GetH1(central, "phi");
971 f3->SetFillColor(f1->GetMarkerColor());
972 f4->SetFillColor(f1->GetMarkerColor());
973 c3->SetFillColor(c1->GetMarkerColor());
974 c4->SetFillColor(c1->GetMarkerColor());
975 f3->SetLineColor(f1->GetMarkerColor());
976 f4->SetLineColor(f1->GetMarkerColor());
977 c3->SetLineColor(c1->GetMarkerColor());
978 c4->SetLineColor(c1->GetMarkerColor());
980 THStack* a = new THStack("norms", "Normalizations");
986 a->SetMaximum(a->GetMaximum("nostack")*1.2);
987 DrawInPad(fBody, 2, a, "nostack");
988 a->GetHistogram()->SetXTitle("#it{#eta}");
989 a->GetHistogram()->SetYTitle("Normalization (coverage or acceptance)");
992 l = new TLegend(.2, .94, .9, .99);
997 // entry = l->AddEntry("dummy", "Forward", "f");
998 // entry->SetFillColor(f1->GetMarkerColor());
999 // entry->SetLineColor(f1->GetMarkerColor());
1000 // entry->SetFillStyle(1001);
1001 // entry->SetLineWidth(0);
1002 // entry = l->AddEntry("dummy", "Central", "f");
1003 // entry->SetFillColor(c1->GetMarkerColor());
1004 // entry->SetLineColor(c1->GetMarkerColor());
1005 // entry->SetLineWidth(0);
1006 // entry->SetFillStyle(1001);
1007 entry = l->AddEntry("dummy", "#eta Coverage", "f");
1008 entry->SetFillStyle(f3->GetFillStyle());
1009 entry->SetFillColor(kBlack);
1010 entry = l->AddEntry("dummy", "#phi Acceptance", "f");
1011 entry->SetFillStyle(f4->GetFillStyle());
1012 entry->SetFillColor(kBlack);
1015 PrintCanvas("Both results");
1018 TCollection* fResults;