AliPhysics  c7b8e89 (c7b8e89)
SummaryAODDrawer.C
Go to the documentation of this file.
1 #include "SummaryDrawer.C"
2 #ifndef __CINT__
3 # include <TGraph.h>
4 # include <TGraphErrors.h>
5 # include <TF1.h>
6 # include <TArrow.h>
7 #else
8 class TGraph;
9 class TFile;
10 #endif
11 
25 {
26 public:
27  enum EFlags {
28  kEventInspector = 0x001,
29  kSharingFilter = 0x002,
31  kCorrector = 0x008,
32  kHistCollector = 0x010,
33  kSteps = 0x020,
34  kResults = 0x040,
35  kCentral = 0x080,
36  kESDFixer = 0x100,
37  kNormal = 0x1FF
38  };
40  : SummaryDrawer(),
41  fSums(0),
42  fResults(0)
43  {}
44  //__________________________________________________________________
45  TFile* Init(const char* fname)
46  {
47  // --- Open the file ---------------------------------------------
48  TString filename(fname);
49  TFile* file = TFile::Open(filename, "READ");
50  if (!file) {
51  Error("Run", "Failed to open \"%s\"", filename.Data());
52  return 0;
53  }
54 
55  // --- Get top-level collection ----------------------------------
56  fSums = GetCollection(file, "ForwardSums");
57  if (!fSums) {
58  Info("Run", "Trying old name Forward");
59  fSums = GetCollection(file, "Forward");
60  if (!fSums) return 0;
61  }
62 
63  // --- Do the results ----------------------------------------------
64  fResults = GetCollection(file, "ForwardResults");
65  if (!fResults) fResults = fSums; // Old-style
66 
67  return file;
68  }
69  void SummarizeSharing(const char* fname, UShort_t what=0)
70  {
71  // --- Initialize ------------------------------------------------
72  TFile* file = 0;
73  if (!(file = Init(fname))) return;
74 
75  // --- Make our canvas -------------------------------------------
76  TString pdfName("sharing.pdf");
77  pdfName.ReplaceAll(".root", ".pdf");
78  CreateCanvas(pdfName, what & kLandscape, true, false);
79 
80  TCollection* c = GetCollection(fSums, "fmdSharingFilter");
81  if (!c) return;
82  TCollection* rc = GetCollection(fResults, "fmdSharingFilter");
83  if (!rc) rc = c;
84 
85  Int_t nFiles = 0;
86  TParameter<int>* pnFiles =
87  static_cast<TParameter<int>*>(GetObject(c, "nFiles"));
88  if (pnFiles) {
89  nFiles = pnFiles->GetVal();
90  }
91 
92  TCollection* lc = GetCollection(c, "lCuts");
93  TCollection* hc = GetCollection(c, "hCuts");
94  Int_t lm = 0;
95  Int_t hm = 0;
96  TH2* hLow = GetH2(c, "lowCuts");
97  TH2* hHigh = GetH2(c, "highCuts");
98  GetParameter(lc, "method", lm);
99  GetParameter(hc, "method", hm);
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);
104 
105  DivideForRings(true,true);
106  const char** ptr = GetRingNames(false);
107  UShort_t iq = 1;
108  while (*ptr) {
109  TCollection* sc = GetCollection(c, *ptr);
110  if (!sc) { ptr++; iq++; continue; }
111  UShort_t d = Int_t((*ptr)[3])-48;
112  Char_t r = (*ptr)[4];
113 
114  TH1* esdELoss = GetH1(sc, "esdEloss");
115  TH1* anaELoss = GetH1(sc, "anaEloss");
116  TGraph* lowCut = CreateCutGraph(lm, iq, hLow, esdELoss, kYellow+1);
117  TGraph* highCut = CreateCutGraph(hm, iq, hHigh, esdELoss, kCyan+1);
118  // Double_t ignCut = TMath::Max(lowCut->GetX()[3],0.);
119  // Int_t esdLow = esdELoss->FindBin(ignCut);
120  // Int_t anaLow = anaELoss->FindBin(ignCut);
121  // Double_t esdInt = esdELoss->Integral(esdLow,esdELoss->GetNbinsX()+1);
122  // Double_t anaInt = anaELoss->Integral(anaLow,anaELoss->GetNbinsX()+1);
123  // Double_t frac = esdInt > 0 ? (esdInt-anaInt)/esdInt : 1;
124  esdELoss->GetXaxis()->SetRangeUser(-.1, 2);
125 
126  DrawInRingPad(d,r, esdELoss, "", kLogy, *ptr);
127  // "#Delta/#Delta_{mip} reconstructed and merged");
128  DrawInRingPad(d, r, anaELoss, "same");
129  DrawInRingPad(d, r, lowCut, "lf same");
130  DrawInRingPad(d, r, highCut, "lf same");
131  ptr++;
132  iq++;
133  }
134  TVirtualPad* p = RingPad(0,0);
135  p->cd();
136  TLegend* l = new TLegend(0.1, 0.1, 0.98, 0.98, "");
137  l->SetFillStyle(0);
138  l->SetFillColor(0);
139  l->SetBorderSize(0);
140  TLegendEntry* e = 0;
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);
150  e->SetLineWidth(0);
151  e->SetLineColor(kWhite);
152  e = l->AddEntry("dummy", "High cut", "f");
153  e->SetFillStyle(3002);
154  e->SetFillColor(kCyan+1);
155  e->SetLineWidth(0);
156  e->SetLineColor(kWhite);
157  l->Draw();
158 
159  PrintCanvas("Summary of sharing filter");
160  CloseCanvas();
161 
162  }
163  void SummarizeSteps(const char* fname, UShort_t what=0)
164  {
165  // --- Initialize ------------------------------------------------
166  TFile* file = 0;
167  if (!(file = Init(fname))) return;
168 
169  // --- Make our canvas -------------------------------------------
170  TString pdfName("steps.pdf");
171  pdfName.ReplaceAll(".root", ".pdf");
172  CreateCanvas(pdfName, what & kLandscape, true, false);
173  DrawSteps();
174  CloseCanvas();
175  }
176 
177  //__________________________________________________________________
184  void Run(const char* fname, UShort_t what=kNormal)
185  {
186  // --- Initialize ------------------------------------------------
187  TFile* file = 0;
188  if (!(file = Init(fname))) return;
189 
190  // --- Make our canvas -------------------------------------------
191  TString pdfName(fname);
192  pdfName.ReplaceAll(".root", ".pdf");
193  CreateCanvas(pdfName, what & kLandscape);
194  DrawTitlePage(file);
195 
196  // --- Possibly make a chapter here ------------------------------
197  TCollection* centralSums = GetCollection(file, "CentralSums", false);
198  if (!centralSums) {
199  Info("Run", "Trying old name \"Central\"");
200  centralSums = GetCollection(file, "Central", false);
201  }
202  if (what & kCentral && centralSums)
203  MakeChapter("Forward");
204 
205  // --- Set pause flag --------------------------------------------
206  fPause = what & kPause;
207 
208  // Plot status if found
209  TH1* hStatus = GetH1(fSums, "status", false);
210  if (hStatus) {
211  hStatus->SetMaximum(hStatus->GetMaximum()*1.2);
212  fBody->SetRightMargin(0.10);
213  DrawInPad(fBody,0,hStatus, "hist text30");
214  PrintCanvas("Status");
215  }
216 
217  // --- Do each sub-algorithm -------------------------------------
219  if (what & kESDFixer) DrawESDFixer(fSums);
220  if (what & kSharingFilter) DrawSharingFilter();
222  if (what & kCorrector) DrawCorrector();
223  if (what & kHistCollector) DrawHistCollector();
224 
225 
226  if (what & kSteps) DrawSteps();
227  if (what & kResults) DrawResults();
228 
229  // --- SPD clusters ----------------------------------------------
230  if (what & kCentral) {
231  // --- Get top-level collection --------------------------------
232  fSums = GetCollection(file, "CentralSums");
233  if (!fSums)
234  fSums = GetCollection(file, "Central");
235  if (fSums) {
236  MakeChapter("Central");
237  DrawCentral();
238  if (what & kEventInspector) DrawEventInspector(fSums);
239  }
240  fResults = GetCollection(file, "CentralResults");
241  if (fResults && (what & kResults)) {
243  }
244 
245  if (what & kResults) DrawBoth(file);
246  }
247 
248 
249  CloseCanvas();
250  }
251 protected:
252  //____________________________________________________________________
253  void DrawTitlePage(TFile* f)
254  {
255  fBody->cd();
256 
257  TLatex* ltx = new TLatex(.5, .7, "ESD #rightarrow AOD filtering");
258  ltx->SetNDC();
259  ltx->SetTextSize(0.07);
260  ltx->SetTextAlign(22);
261  ltx->Draw();
262 
263  TCollection* fwd = fSums; // GetCollection(f, "ForwardSums");
264  TCollection* cen = GetCollection(f, "CentralSums");
265  Double_t y = .6;
266 
267  Double_t save = fParName->GetTextSize();
268  fParName->SetTextSize(0.03);
269  fParVal->SetTextSize(0.03);
270 
271  DrawParameter(y, "Tasks", (fwd ? "Forward" : ""));
272  DrawParameter(y, "", (cen ? "Central" : ""));
273 
274  if (fwd) {
275  TCollection* ei = GetCollection(fwd, "fmdEventInspector");
276  if (ei) {
277 
278  UShort_t sys=0, sNN=0;
279  Int_t field=0;
280  ULong_t runNo=0;
281  Bool_t mc=false;
282  GetParameter(ei, "sys", sys);
283  GetParameter(ei, "sNN", sNN);
284  GetParameter(ei, "field", field);
285  GetParameter(ei, "runNo", runNo);
286  if (!GetParameter(ei, "mc", mc, false)) mc = false;
287 
288  TString sysString; SysString(sys, sysString);
289  TString sNNString; SNNString(sNN, sNNString);
290 
291  DrawParameter(y, "System", sysString);
292  DrawParameter(y, "#sqrt{s_{NN}}", sNNString);
293  DrawParameter(y, "L3 B field", Form("%+2dkG", field));
294  DrawParameter(y, "Run #", Form("%6lu", runNo));
295  DrawParameter(y, "Simulation", (mc ? "yes" : "no"));
296  }
297  }
298  PrintCanvas("Title page");
299  fParName->SetTextSize(save);
300  fParVal->SetTextSize(save);
301  }
303  Int_t color)
304  {
305  TGraph* ret = new TGraph(4);
306  Double_t y0 = TMath::Max(eloss->GetMinimum(),1.);
307  Double_t y1 = eloss->GetMaximum();
308  Double_t min = 1000;
309  Double_t max = 0;
310  Int_t iiy = (iy == 4 ? 5 : iy == 5 ? 4 : iy);
311  if (method == 0) { // Fixed value
312  max = cuts->GetBinContent(1, iiy);
313  min = eloss->GetXaxis()->GetXmin();
314  }
315  else {
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);
321  }
322  }
323  // Printf("Cuts between %f,%f @%f, %f", min, max, y0,y1);
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());
334 
335  return ret;
336  }
337  //____________________________________________________________________
338  const Char_t* CutMethodName(Int_t lm) const
339  {
340  switch (lm) {
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}";
348  }
349  return "unknown";
350  }
351  //____________________________________________________________________
352  Int_t PrintCut(const TCollection* c, Double_t& y, const Char_t* name,
353  Double_t size=0)
354  {
355  if (!c) return -1;
356 
357  Int_t method = 0;
358  if (!GetParameter(c, "method", method)) return -1;
359  DrawParameter(y, name, CutMethodName(method), size);
360 
361  TString params;
362  const char* cuts[] = { "fmd1i", "fmd2i", "fmd2o", "fmd3i", "fmd3o", 0 };
363  const char** pcut = cuts;
364  while (*pcut) {
365  Double_t cut;
366  GetParameter(c, *pcut, cut, false);
367  if (pcut != cuts) params.Append(", ");
368  params.Append(Form("%5.2f", cut));
369  pcut++;
370  }
371  if (params.IsNull()) {
372  Double_t frac = 0;
373  GetParameter(c, "frac", frac);
374  params = Form("%f", frac);
375  }
376  DrawParameter(y, "Parameters", params, size);
377  return method;
378  }
379  //____________________________________________________________________
380  void DrawCut(TVirtualPad* parent, Int_t sub, TH2* cuts)
381  {
382  if (!cuts) return;
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));
388  UShort_t det = UShort_t(name[3]-48);
389  Char_t rng = name[4];
390  Color_t col = RingColor(det, rng);
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());
401  }
402  DrawInPad(parent, sub, stack, "nostack p", kLegend|kCenter|kSouth);
403  }
404  //____________________________________________________________________
406  {
407  Info("DrawSharingFilter", "Drawing sharing filter");
408  TCollection* c = GetCollection(fSums, "fmdSharingFilter");
409  if (!c) return;
410  TCollection* rc = GetCollection(fResults, "fmdSharingFilter");
411  if (!rc) rc = c;
412 
413  // --- Draw summary information ----------------------------------
414  fBody->Divide(1, 3, 0, 0);
415  fBody->cd(1);
416 
417  Double_t y = .95;
418  Bool_t angle=false, lowSignal=false, disabled=false;
419  Int_t nFiles = 0;
420  if (GetParameter(c, "angle", angle))
421  DrawParameter(y, "Angle correct", (angle ? "yes" : "no"));
422  if (GetParameter(c, "lowSignal", lowSignal))
423  DrawParameter(y, "Lower signal", (lowSignal ? "yes" : "no"));
424  TParameter<int>* pnFiles =
425  static_cast<TParameter<int>*>(GetObject(c, "nFiles"));
426  if (pnFiles) {
427  nFiles = pnFiles->GetVal();
428  DrawParameter(y, "# files merged", Form("%d", nFiles));
429  }
430  if (GetParameter(c, "disabled", disabled, false))
431  DrawParameter(y, "Merging disabled", (disabled ? "yes" : "no"));
432 
433  Int_t lm = 0;
434  Int_t hm = 0;
435  TH2* hLow = 0;
436  TH2* hHigh = 0;
437  if (!disabled) {
438  Bool_t simple=false, three=false;
439  if (GetParameter(c, "simple", simple))
440  DrawParameter(y, "Simple method", (simple ? "yes" : "no"));
441  if (GetParameter(c, "sumThree", three))
442  DrawParameter(y, "3-strip merging", (three ? "yes" : "no"));
443 
444  TCollection* lc = GetCollection(c, "lCuts");
445  TCollection* hc = GetCollection(c, "hCuts");
446  lm = PrintCut(lc, y, "Low cut");
447  hm = PrintCut(hc, y, "High cut");
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);
454  DrawCut(fBody, 2, hLow);
455  DrawCut(fBody, 3, hHigh);
456  }
457  PrintCanvas("Sharing filter");
458 
459  if (!disabled) {
460  // --- Draw rings individually -----------------------------------
461  Double_t savX = fParVal->GetX();
462  Double_t savY = fParVal->GetY();
463  fParVal->SetX(0.6);
464  fParVal->SetY(0.6);
465  const char** ptr = GetRingNames(false);
466  UShort_t iq = 1;
467  while (*ptr) {
468  TCollection* sc = GetCollection(c, *ptr);
469  if (!sc) { ptr++; iq++; continue; }
470 
471  if (fLandscape) fBody->Divide(3, 2);
472  else fBody->Divide(2,3);
473 
474  TH1* esdELoss = GetH1(sc, "esdEloss");
475  TH1* anaELoss = GetH1(sc, "anaEloss");
476  TGraph* lowCut = CreateCutGraph(lm, iq, hLow, esdELoss, kYellow+1);
477  TGraph* highCut = CreateCutGraph(hm, iq, hHigh, esdELoss, kCyan+1);
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);
485 
486  DrawInPad(fBody, 1, esdELoss, "", kLogy,
487  "#Delta/#Delta_{mip} reconstructed and merged");
488  DrawInPad(fBody, 1, anaELoss, "same");
489  DrawInPad(fBody, 1, lowCut, "lf same");
490  DrawInPad(fBody, 1, highCut, "lf same", kLogy|kLegend|kNorth|kWest);
491  TVirtualPad* p = fBody->GetPad(1);
492  p->cd();
493  TLatex* l = new TLatex(1-p->GetRightMargin(),
494  0.5, Form("Loss: %5.1f%%", frac*100));
495  l->SetNDC();
496  l->SetTextAlign(32);
497  l->Draw();
498  l->DrawLatex(1-p->GetRightMargin(), 0.45,
499  Form("%f #rightarrow #infty", ignCut));
500 
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);
507  Double_t intT = int1 + int2 + int3;
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;
511 
512  singles->GetXaxis()->SetRangeUser(-.1, 2);
513  DrawInPad(fBody, 2, singles, "", kLogy,
514  "#Delta/#Delta_{mip} for single, double, and tripple hits");
515  DrawInPad(fBody, 2, doubles, "same", kLogy);
516  DrawInPad(fBody, 2, tripples, "same", kLogy);
517  DrawInPad(fBody, 2, lowCut, "lf same", kLogy);
518  DrawInPad(fBody, 2, highCut, "lf same", kLogy|kLegend|kNorth|kWest);
519 
520  fBody->cd(2);
521  Double_t nameX = fParName->GetX();
522  Double_t valX = fParVal->GetX();
523  Double_t intY = 0.4;
524  fParName->SetX(0.5);
525  fParVal->SetX(0.7);
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);
529  fParName->SetX(nameX);
530  fParVal->SetX(valX);
531 
532  DrawInPad(fBody, 3, GetH2(sc, "singlePerStrip"), "colz",kLogz);
533  // DrawInPad(fBody, 4, GetH1(sc, "distanceBefore"), "", 0x2);
534  // DrawInPad(fBody, 4, GetH1(sc, "distanceAfter"), "same", 0x12);
535  DrawInPad(fBody, 4, GetH2(sc, "summed"), "colz",0x0);
536 
537  TH2* nB = GetH2(sc, "neighborsBefore");
538  if (nB) {
539  nB->GetXaxis()->SetRangeUser(0,2);
540  nB->GetYaxis()->SetRangeUser(0,2);
541  }
542  DrawInPad(fBody, 5, nB, "colz cont3", kLogz,
543  "Correlation of neighbors before merging");
544 
545  TH2* nA = GetH2(sc, "neighborsAfter");
546  if (nA) {
547  nA->GetXaxis()->SetRangeUser(0,2);
548  nA->GetYaxis()->SetRangeUser(0,2);
549  }
550  DrawInPad(fBody, 6, nA, "colz cont3", kLogz,
551  "Correlation of neighbors after merging");
552 
553  // DrawInPad(fBody, 6, GetH2(sc, "beforeAfter"), "colz", kLogz);
554 
555  PrintCanvas(Form("Sharing filter - %s", *ptr));
556  ptr++;
557  iq++;
558  }
559  fParVal->SetX(savX);
560  fParVal->SetY(savY);
561  }
562 
563  // --- MC --------------------------------------------------------
564  TCollection* cc = GetCollection(c, "esd_mc_comparion", false); // Spelling!
565  if (!cc) {
566  cc = GetCollection(c, "esd_mc_comparison", false); // Spelling!
567  if (!cc) return; // Not MC
568  }
569 
570  DivideForRings(false, false);
571  const char** ptr = GetRingNames(false);
572  while (*ptr) {
573  TString nam(Form("%s_corr", *ptr));
574  TH2* hc = GetH2(cc, nam, false);
575  if (!hc) {
576  nam[4] = (nam[4] == 'I' ? 'i' : 'o');
577  hc = GetH2(cc, nam, false);
578  if (!hc) {
579  ptr++;
580  continue;
581  }
582  }
583  DrawInRingPad(hc, "colz", kLogz);
584  ptr++;
585  }
586 
587  PrintCanvas("Sharing filter - MC vs Reco");
588 
589  // --- MC --------------------------------------------------------
590  DrawTrackDensity(c);
591  }
592  //__________________________________________________________________
604  void ShowSliceFit(Bool_t inY, TH2* h, Double_t nVar,
605  TVirtualPad* p, Int_t sub, UShort_t flags=0,
606  Double_t cut=-1)
607  {
608  if (!h) return;
609  TAxis* indep = (inY ? h->GetXaxis() : h->GetYaxis());
610  TAxis* dep = (inY ? h->GetYaxis() : h->GetXaxis());
611 
612 
613  TObjArray* fits = new TObjArray;
614  fits->SetOwner();
615  // FitSlicesX sets onX to true. If onX is true, then it calls
616  // ProjectionX for each Y bin. That is, we fit each X slice.
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);
622  if (!fits) {
623  Warning("ShowSliceFit", "No fits returned");
624  return;
625  }
626 
627  // If inY is true then this is the mean,variance as a function of X
628  TH1* mean = static_cast<TH1*>(fits->At(1));
629  TH1* var = static_cast<TH1*>(fits->At(2));
630  if (!mean || !var) {
631  Warning("ShowSliceFit", "Didn't get histograms");
632  fits->Delete();
633  return;
634  }
635 #if 0
636  TH1* hh[] = { mean, var, 0 };
637  for (Int_t ib=1; ib<=mean->GetNbinsX();ib++) {
638  TH1** hp = hh;
639  while (*hp) {
640  if ((*hp)->GetBinContent(ib) <= 0) {
641  (*hp)->SetBinContent(ib,0);
642  (*hp)->SetBinError(ib,0);
643  }
644  hp++;
645  }
646  }
647 #endif
648 
649  // If inY is true then this is the mean,variance as a function of X
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");
656  fits->Delete();
657  return;
658  }
659 
660  TGraphErrors* g = new TGraphErrors(h->GetNbinsX());
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);
669  if (up) {
670  up ->SetLineColor(kBlack);
671  up ->SetLineWidth(2);
672  up ->SetLineStyle(2);
673  }
674  if (low) {
675  low->SetLineColor(kBlack);
676  low->SetLineWidth(2);
677  low->SetLineStyle(2);
678  }
679  for (Int_t i = 1; i <= h->GetNbinsX(); i++) {
680  Double_t x = indep->GetBinCenter(i);
681  Double_t y = fmean->Eval(x);
682  Double_t e = fvar->Eval(x);
683  // Double_t y = mean->GetBinContent(i);
684  // Double_t e = var->GetBinContent(i);
685  Double_t ee = nVar * e;
686  if (flags & 0x8000) ee *= e > 0 ? TMath::Log10(e) : 1;
687  if (inY) {
688  g->SetPoint(i-1, x, y);
689  g->SetPointError(i-1, 0, ee);
690  }
691  else {
692  g->SetPoint(i-1, y, x);
693  g->SetPointError(i-1, ee, 0);
694  }
695  if (up) {
696  if (inY) up->SetPoint(i-1,x,x+cut*x);
697  else up->SetPoint(i-1,y+cut*y,y);
698  }
699  if (low) {
700  if (inY) low->SetPoint(i-1,x,x-cut*x);
701  else low->SetPoint(i-1,y-cut*y,y);
702  }
703  }
704  DrawInPad(p, sub, g, "3", flags);
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);
709  DrawInPad(p, sub, fmean, "same", flags);
710 
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) = "
715  "%f + %f %s",
716  yTit.Data(), xTit.Data(),
717  fmean->GetParameter(0),
718  fmean->GetParameter(1), xTit.Data()));
719  l->SetNDC();
720  l->SetTextAlign(13);
721  l->SetTextSize(fParVal->GetTextSize());
722  l->SetTextFont(42);
723  l->Draw();
724  l->DrawLatex(0.15, y-0.07,
725  Form("#sigma_{%s}(%s) = "
726  "%f + %f %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",
731  nVar,
732  flags & 0x8000 ? "log_{10}(#sigma)" : ""));
733  fits->Delete();
734  }
735 
736  //____________________________________________________________________
738  {
739  Info("DrawDensityCalculator", "Drawing density calculator");
740  TCollection* c = GetCollection(fSums, "fmdDensityCalculator");
741  if (!c) return;
742 
743  fBody->Divide(2, 2);
744  fBody->cd(1);
745 
746  Double_t y = .9;
747  Int_t maxParticles=0, phiAcceptance=0, etaLumping=0, phiLumping=0;
748  Bool_t method=false, recalcPhi=false;
749  Double_t maxOutliers=0, outlierCut=-1;
750  Double_t size = fLandscape ? 0.05 : 0.03;
751 
752  GetParameter(c, "maxParticle", maxParticles);
753 
754  if (GetParameter(c, "phiAcceptance", phiAcceptance))
755  DrawParameter(y, "#phi acceptance method",
756  (phiAcceptance == 1 ? "N_{ch}" :
757  phiAcceptance == 2 ? "#DeltaE" : "none"), size);
758  if (GetParameter(c, "etaLumping", etaLumping) &&
759  GetParameter(c, "phiLumping", phiLumping))
760  DrawParameter(y, "Region size (sector#timesstrip)",
761  Form("%2d #times %2d", phiLumping, etaLumping), size);
762  if (GetParameter(c, "method", method))
763  DrawParameter(y, "Method", (method ? "Poisson" : "#DeltaE"), size);
764  if (GetParameter(c, "recalcPhi", recalcPhi))
765  DrawParameter(y, "Recalculate #phi",(recalcPhi ? "yes" : "no"),size);
766  if (GetParameter(c, "maxOutliers", maxOutliers, false))
767  DrawParameter(y, "Max relative N_{outlier}",
768  Form("%5.3f",maxOutliers),size);
769  Bool_t hasOutCut = false;
770  if ((hasOutCut = GetParameter(c, "outlierCut", outlierCut, false)))
771  DrawParameter(y, "Max relative deviation",Form("%5.3f",outlierCut),size);
772 
773 
774  TParameter<int>* nFiles =
775  static_cast<TParameter<int>*>(GetObject(c, "nFiles"));
776  if (nFiles)
777  DrawParameter(y, "# files merged", Form("%d", nFiles->GetVal()), size);
778 
779  TCollection* lc = GetCollection(c, "lCuts");
780  Int_t tm = PrintCut(lc, y, "Threshold", size);
781 
782  TVirtualPad* p = fBody; // fBody->cd(2);
783  // p->Divide(3,1);
784 
785  TH1* accI = GetH1(c, "accI");
786  TH1* accO = GetH1(c, "accO");
787  if (accI) {
788  Double_t scale = 1./accI->GetMaximum();
789  accI->Scale(scale);
790  accO->Scale(scale);
791  accI->SetMinimum(0);
792  accI->SetMaximum(1.3);
793  }
794  TH2* lCuts = GetH2(c, "lowCuts");
795  TH2* maxW = GetH2(c, "maxWeights");
796  if (lCuts) lCuts->SetTitle("Thresholds");
797  if (nFiles && lCuts) lCuts->Scale(1. / nFiles->GetVal());
798  if (nFiles && maxW) maxW->Scale(1. / nFiles->GetVal());
799  DrawInPad(p, 2, accI);
800  DrawInPad(p, 2, accO, "same", kLegend|kNorth|kCenter);
801  DrawCut(p, 3, lCuts);
802  DrawCut(p, 4, maxW);
803 
804  PrintCanvas("Density calculator");
805  Float_t save = fParVal->GetTextSize();
806  fParVal->SetTextSize(0.03);
807 
808  UShort_t iq = 1;
809  const char** ptr = GetRingNames(false);
810  while (*ptr) {
811  TCollection* sc = GetCollection(c, *ptr);
812  if (!sc) { ptr++; continue; }
813 
814  if (fLandscape) fBody->Divide(3,2);
815  else fBody->Divide(2,3);
816 
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);
821  TH1* eloss = GetH1(sc, "eloss");
822  TH1* elossUsed = GetH1(sc, "elossUsed");
823  TH1* occ = GetH1(sc, "occupancy");
824  if (eloss) eloss ->SetLineWidth(1);
825  if (elossUsed) elossUsed->SetLineWidth(1);
826  if (eloss) eloss->GetXaxis()->SetRangeUser(0.05, 2);
827 
828  corr->SetXTitle("N_{ch,#Delta}");
829  corr->SetYTitle("N_{ch,Poisson}");
830  DrawInPad(fBody, 1, corr, "colz", kLogz);
831  if (corrOut)
832  DrawInPad(fBody,1, corrOut, "same", kLogz);
833  ShowSliceFit(true, corr, 10, fBody, 1, kLogz, outlierCut);
834 
835  DrawInPad(fBody, 2, diff, "HIST E", kLogy);
836  if (diffOut)
837  DrawInPad(fBody,2, diffOut, "HIST E SAME", kLogy|kLegend|kNorth|kWest);
838  DrawInPad(fBody, 3, occ, "", kLogy);
839  DrawInPad(fBody, 4, eloss, "", kLogy,
840  "#Delta/#Delta_{mip} before and after cuts");
841  DrawInPad(fBody, 4, elossUsed, "same", kLogy);
842  TGraph* thres = CreateCutGraph(tm, iq, lCuts, eloss, kYellow+1);
843  DrawInPad(fBody, 4, thres, "lf same", kLogy|kLegend|kNorth|kWest);
844 
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);
852  pp->cd();
853  TLatex* l = new TLatex(1-pp->GetRightMargin(),
854  0.5, Form("Loss: %5.1f%%", frac*100));
855  l->SetNDC();
856  l->SetTextAlign(32);
857  l->Draw();
858  }
859 
860 
861  TH1* phiB = GetH1(sc, "phiBefore");
862  TH1* phiA = GetH1(sc, "phiAfter");
863  TH1* outliers = GetH1(sc, "outliers", false);
864  if (outliers)
865  DrawInPad(fBody, 5, outliers, "hist", kLogy);
866  else if (phiB && phiA) {
867  phiA->Add(phiB, -1);
868  phiA->Divide(phiB);
869  phiA->SetTitle("#Delta#phi from Ip (x,y) correction");
870  phiA->SetYTitle("(#phi_{after}-#phi_{before})/#phi_{before}");
871  DrawInPad(fBody, 5, phiA);
872  }
873  else {
874  fBody->cd(5);
875  TLatex* ltx = new TLatex(0.5, 0.5, "No outliers or #phi corrections");
876  ltx->SetTextAlign(22);
877  ltx->SetTextSize(0.07);
878  ltx->SetNDC();
879  ltx->Draw();
880  }
881  DrawInPad(fBody, 6, GetH2(sc, "phiAcc"), "colz", kLogz);
882 
883 
884  if (diff && diffOut) {
885  fBody->cd(2);
886  Double_t in = diff->GetEntries();
887  Double_t out = diffOut->GetEntries();
888  if ((in+out) > 0) {
889  TLatex* ltx = new TLatex(0.11, 0.89,
890  Form("Fraction: %7.3f%%",
891  100*out/(in+out)));
892  ltx->SetNDC();
893  ltx->SetTextAlign(13);
894  ltx->SetTextSize(0.06);
895  ltx->Draw();
896  }
897  }
898  PrintCanvas(Form("Density calculator - %s", *ptr));
899  ptr++;
900  iq++;
901  }
902 
903  TCollection* cc = GetCollection(c, "esd_mc_comparison", false);
904  if (!cc) {
905  fParVal->SetTextSize(save);
906  return; // Not MC
907  }
908 
909  ptr = GetRingNames(false);
910  THStack* profiles = new THStack("profiles", "MC-ESD");
911  // Int_t cnt = 0;
912  while (*ptr) {
913  fBody->Divide(2,1);
914 
915  TH2* corr = GetH2(cc, Form("%s_corr_mc_esd", *ptr));
916  if (corr) {
917  // corr->GetXaxis()->SetRangeUser(-1,51);
918  // corr->GetYaxis()->SetRangeUser(-1,51);
919  corr->SetXTitle("MC");
920  corr->SetYTitle("ANA");
921  TH1* h = new TH1F("",Form("Correlation of N_{ch,incl} for %s", *ptr),
922  corr->GetNbinsX(),
923  corr->GetXaxis()->GetXmin(),
924  corr->GetXaxis()->GetXmax());
925  h->SetMinimum(corr->GetYaxis()->GetXmin());
926  h->SetMaximum(1.2*corr->GetYaxis()->GetXmax());
927  h->SetXTitle("MC"); // corr->GetXaxis()->GetTitle());
928  h->SetYTitle(corr->GetYaxis()->GetTitle());
929  DrawInPad(fBody, 1, h, "", kLogz);
930  DrawInPad(fBody, 1, corr, "colz same", kLogz);
931  ShowSliceFit(true, corr, 1, fBody, 1, 0, -1);
932  }
933  TH1* diff = GetH1(cc, Form("%s_diff_mc_esd", *ptr));
934  if (diff && diff->GetEntries() > 0) {
935  // diff->Rebin(2);
936  diff->Smooth(3);
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());
942  diff->Fit(f,"RQ0+");
943  DrawInPad(fBody, 2, diff, "", kLogy);
944  DrawInPad(fBody, 2, f, "same", kLogy);
945  Double_t py = .88;
946  TLatex* l = new TLatex(.89, py, "Ae^{-|x-x_{0}|/w}");
947  l->SetTextAlign(33);
948  l->SetTextSize(fParVal->GetTextSize());
949  l->SetTextFont(42);
950  l->SetNDC();
951  l->Draw();
952  py -= 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++) {
956  py -= fParVal->GetTextSize();
957  l->DrawLatex(.89, py, Form("%s: %f #pm %f", f->GetParName(i),
958  f->GetParameter(i), f->GetParError(i)));
959  }
960  }
961  TH2* vs = GetH2(cc, Form("%s_esd_vs_mc", *ptr));
962  if (vs) {
963  const Double_t lVs = -0.3;
964  const Double_t hVs = +0.4;
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);
976  Bool_t hasSome = false;
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;
983  hasSome = true;
984  vsp->Fill(vsx, vsc, vse);
985  }
986  }
987  if (hasSome) profiles->Add(vsp);
988  else delete vsp;
989  }
990  PrintCanvas(Form("Density calculator - MC vs Reco - %s", *ptr));
991  ptr++;
992  // cnt++;
993  }
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);
998  DrawInPad(fBody, 0, profiles, "nostack");
999  PrintCanvas("Density calculator - MC vs Reco - All");
1000  }
1001 
1002  fParVal->SetTextSize(save);
1003  }
1004 
1005  //____________________________________________________________________
1007  {
1008  Info("DrawCorrector", "Drawing corrector");
1009  TCollection* c = GetCollection(fSums, "fmdCorrector");
1010  if (!c) return;
1011 
1012  fBody->cd();
1013 
1014  Double_t y = .8;
1015  Bool_t secondary=false, vertexBias=false, acceptance=false, merging=false;
1016  if (GetParameter(c, "secondary", secondary))
1017  DrawParameter(y, "Secondary corr.", secondary ? "yes" : "no");
1018  if (GetParameter(c, "acceptance", acceptance))
1019  DrawParameter(y, "Acceptance corr.", acceptance ? "yes" : "no");
1020  if (GetParameter(c, "vertexBias", vertexBias))
1021  DrawParameter(y, "Vertex bias corr.", vertexBias ? "yes" : "no");
1022  if (GetParameter(c, "merging", merging))
1023  DrawParameter(y, "Merging eff.", merging ? "yes" : "no");
1024 
1025  PrintCanvas("Corrector");
1026 
1027  TCollection* cc = GetCollection(c, "esd_mc_comparison", false);
1028  if (!cc) return; // Not MC
1029 
1030  DivideForRings(false, false);
1031  const char** ptr = GetRingNames(false);
1032  while (*ptr) {
1033  DrawInRingPad(GetH2(cc, Form("%s_esd_vs_mc", *ptr)), "colz", 0x0);
1034  ptr++;
1035  }
1036 
1037  PrintCanvas("Corrector - MC vs Reco");
1038  }
1039 
1040  //____________________________________________________________________
1042  {
1043  Info("DrawHistCollector", "Drawing histogram collector");
1044  TCollection* c = GetCollection(fSums, "fmdHistCollector");
1045  if (!c) return;
1046 
1047  fBody->Divide(2, 1);
1048  TVirtualPad* p = fBody->cd(1);
1049  p->Divide(1,2);
1050  p->cd(1);
1051 
1052  Double_t y = .8;
1053  Int_t nCutBins=0, fiducial=0, merge=0, skipRings=0;
1054  Double_t fiducialCut=0.;
1055  Bool_t bgAndHits=false;
1056  Double_t size = fLandscape ? 0.06 : 0.04;
1057  if (GetParameter(c, "nCutBins", nCutBins))
1058  DrawParameter(y, "# of bins to cut", Form("%d", nCutBins),size);
1059 
1060  if (GetParameter(c, "skipRings", skipRings)) {
1061  TString skipped;
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";
1068  DrawParameter(y, "Skipped rings", skipped, size);
1069  }
1070  if (GetParameter(c, "bgAndHits", bgAndHits))
1071  DrawParameter(y, "Bg & hit maps stored.", bgAndHits?"yes":"no",size);
1072  if (GetParameter(c, "merge", merge))
1073  DrawParameter(y, "Merge method",
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);
1079  if (GetParameter(c, "fiducial", fiducial))
1080  DrawParameter(y, "Fiducial method.",
1081  fiducial == 0 ? "cut" : "distance", size);
1082  if (GetParameter(c, "fiducialCut", fiducialCut))
1083  DrawParameter(y, "Fiducial cut.", Form("%f", fiducialCut), size);
1084 
1085  // p->cd(2);
1086  // Printf("Drawing skipped");
1087  TH1* skipped = GetH1(c, "skipped", false);
1088  if (skipped) {
1089  skipped->SetFillColor(kRed+1);
1090  skipped->SetFillStyle(3001);
1091  }
1092  DrawInPad(p, 2, skipped, "hist");
1093 
1094  p = fBody->cd(2);
1095  p->Divide(1,2,0,0);
1096 
1097  // Printf("Drawing sumRings");
1098  DrawInPad(p, 1, GetH2(c, "sumRings"), "colz");
1099  // Printf("Drawing coverage");
1100  DrawInPad(p, 2, GetH2(c, "coverage"), "colz");
1101  // Printf("Done drawing for now");
1102  PrintCanvas("Histogram collector");
1103 
1104 
1105  TIter next(c);
1106  TObject* o = 0;
1107  TRegexp regexp("[pm][0-9]+_[pm][0-9]+");
1108  while ((o = next())) {
1109  TString name(o->GetName());
1110  if (name.Index(regexp) == kNPOS) continue;
1111 
1112  TList* vl = static_cast<TList*>(o);
1113  if (!vl) continue;
1114 
1115  DivideForRings(false, false);
1116  const char** ptr = GetRingNames(false);
1117  while (*ptr) {
1118  DrawInRingPad(GetH2(vl, Form("secMap%s", *ptr)), "colz", 0x0);
1119  DrawInRingPad(GetH2(vl, Form("hitMap%s", *ptr)), "box same", 0x0);
1120  ptr++;
1121  }
1122  PrintCanvas(Form("Histogram Collector - Vertex bin %s", vl->GetName()));
1123  }
1124 
1125  o = c->FindObject("byCentrality");
1126  if (!o) return;
1127  TList* bc = static_cast<TList*>(o);
1128 
1129  DrawInPad(fBody, GetH3(bc, "FMD1I"), "box", 0);
1130  DrawInPad(fBody, GetH3(bc, "FMD2I"), "box same", 0);
1131  DrawInPad(fBody, GetH3(bc, "FMD2O"), "box same", 0);
1132  DrawInPad(fBody, GetH3(bc, "FMD3O"), "box same", 0);
1133  DrawInPad(fBody, GetH3(bc, "FMD3I"), "box same", kLegend);
1134  }
1135 
1136  //____________________________________________________________________
1138  {
1139  Info("DrawCentral", "Drawing central (SPD)");
1140  TCollection* c = fSums;
1141  if (!c) return;
1142 
1143  fBody->Divide(2, 2);
1144  fBody->cd(1);
1145  Double_t y = .7;
1146  Bool_t secondary=false, acceptance=false;
1147  if (GetParameter(c, "secondary", secondary))
1148  DrawParameter(y, "Secondary corr.", secondary ? "yes" : "no");
1149  if (GetParameter(c, "acceptance", acceptance))
1150  DrawParameter(y, "Acceptance corr.", acceptance ? "yes" : "no");
1151 
1152 
1153  DrawInPad(fBody, 2, GetH2(c, "coverage"), "col", 0,
1154  "#eta coverage per v_{z}");
1155  TH2* cvst = GetH2(c, "nClusterVsnTracklet");
1156  if (cvst) {
1157  // cvst->Scale(1, "width");
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);
1162  }
1163  DrawInPad(fBody, 3, cvst, "colz", kLogx|kLogy|kLogz,
1164  "Correlation of # of tracklets and clusters");
1165  DrawInPad(fBody, 4, GetH2(c, "clusterPerTracklet"), "colz", 0x0,
1166  "# clusters per tracklet vs #eta");
1167  ShowSliceFit(true, cvst, 3, fBody, 3, 0x8000|kLogz);
1168 
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();
1177  PrintCanvas("Central - overview");
1178 
1179 
1180  TIter next(c);
1181  TObject* o = 0;
1182  TRegexp regexp("[pm][0-9]+_[pm][0-9]+");
1183  while ((o = next())) {
1184  TString name(o->GetName());
1185  if (name.Index(regexp) == kNPOS) continue;
1186 
1187  TList* vl = static_cast<TList*>(o);
1188 
1189  fBody->Divide(1, 3);
1190 
1191  DrawInPad(fBody, 1, GetH1(vl, "acceptance"), "", 0);
1192 
1193  TH1* sec = GetH1(vl, "secondary");
1194  sec->SetMarkerStyle(21);
1195  sec->SetMarkerSize(1.2);
1196  DrawInPad(fBody, 2, sec, "", 0);
1197  DrawInPad(fBody, 2, GetH1(vl, "secondaryFiducial"), "same", 0x0);
1198  DrawInPad(fBody, 3, GetH2(vl, "secondaryMapFiducial"), "colz", 0);
1199  DrawInPad(fBody, 3, GetH2(vl, "hitMap"), "box same", 0x0);
1200 
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()));
1208  }
1209  }
1210 
1211 
1212  //____________________________________________________________________
1213  void AddToAll(THStack* all, const THStack* stack, Int_t curr, Int_t step)
1214  {
1215  if (!stack) return;
1216 
1217  TIter next(stack->GetHists());
1218  TH1* h = 0;
1219  while ((h = static_cast<TH1*>(next()))) {
1220  TH1* copy = static_cast<TH1*>(h->Clone(Form("%s_copy", h->GetName())));
1221  copy->SetDirectory(0);
1222  if (curr != step) {
1223  copy->SetMarkerColor(kGray);
1224  copy->SetLineColor(kGray);
1225  }
1226  all->Add(copy);
1227  }
1228  }
1229  //____________________________________________________________________
1230  void AddToAll(THStack* all, const THStack* stack)
1231  {
1232  if (!stack) return;
1233 
1234  TIter next(stack->GetHists());
1235  TH1* h = 0;
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);
1241  all->Add(copy);
1242  }
1243  }
1244 
1245  //____________________________________________________________________
1246  void DrawStep(Int_t step,
1247  THStack* all,
1248  TObject* cur,
1249  TLegend* leg,
1250  const char* title,
1251  TVirtualPad* can,
1252  Int_t sub,
1253  Int_t nCol)
1254  {
1255  if (all->GetHists()->GetEntries() <= 0 || !cur) return;
1256 
1257  // Info("", "Drawing step # %d", step);
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); // 0.02);
1267  // Info("", "Drawing step %d in sub-pad %d (%s)",
1268  // step, sub, (left?"left":"right"));
1269 
1270  p->cd();
1271  all->Draw("nostack");
1272  all->GetHistogram()->SetXTitle("#eta");
1273  all->GetHistogram()->SetYTitle("signal");
1274 
1275  TLegendEntry* e =
1276  static_cast<TLegendEntry*>(leg->GetListOfPrimitives()->At(step-1));
1277  if (e) {
1278  e->SetMarkerColor(kBlack);
1279  e->SetLineColor(kBlack);
1280  e->SetTextColor(kBlack);
1281  }
1282 
1283  // p->cd();
1284  gROOT->SetSelectedPad(p);
1285  cur->DrawClone("same nostack");
1286  leg->DrawClone("");
1287 
1288  TLatex* ltx = new TLatex(.97, .97, title);
1289  ltx->SetNDC();
1290  ltx->SetTextSize(.06);
1291  ltx->SetTextAlign(33);
1292  ltx->Draw();
1293 
1294  ltx = new TLatex((left ? .12 : .02), .97, p->GetTitle());
1295  ltx->SetNDC();
1296  ltx->SetTextSize(.06);
1297  ltx->SetTextAlign(13);
1298  ltx->Draw();
1299 
1300  if (step > 1) {
1301  Double_t x1 = 0.5*(p->GetUxmax()+p->GetUxmin());
1302  Double_t x2 = x1;
1303  Double_t y1 = p->GetUymax();
1304  Double_t y2 = 0.92*y1;
1305  Double_t sz = 0.05;
1306  if (fLandscape) {
1307  x1 = 0.99*p->GetUxmin();
1308  x2 = 0.80*x1;
1309  y1 = .5*(p->GetUymax()+p->GetUymin());
1310  y2 = y1;
1311  sz = 0.034;
1312  }
1313  // Info("", "Arrow at (x1,y1)=%f,%f (x2,y2)=%f,%f", x1, y1, x2, y2);
1314  TArrow* a = new TArrow(x1, y1, x2, y2, sz, "|>");
1315  // (fLandscape ? "<|" : "|>"));
1316  a->SetFillColor(kGray+1);
1317  a->SetLineColor(kGray+1);
1318  a->Draw();
1319  }
1320  p->Modified();
1321  p->Update();
1322  p->cd();
1323 
1324  if (e) {
1325  e->SetMarkerColor(kGray);
1326  e->SetLineColor(kGray);
1327  e->SetTextColor(kGray);
1328  }
1329  gStyle->SetOptTitle(1);
1330  }
1331 
1332  //____________________________________________________________________
1333  void FixStack(THStack* stack, const TString& title,
1334  const TString& extra, Int_t marker)
1335  {
1336  if (!stack) return;
1337  stack->SetTitle(title);
1338  TIter next(stack->GetHists());
1339  TH1* h = 0;
1340  while ((h = static_cast<TH1*>(next()))) {
1341  h->SetMarkerStyle(marker);
1342  TString tit(h->GetTitle());
1343  tit.ReplaceAll("cache", "");
1344  tit.Append(extra);
1345  h->SetTitle(tit);
1346  }
1347  }
1348  void AddLegendEntry(TLegend* l,
1349  const TH1* h,
1350  const TString& title)
1351  {
1352  if (!h) return;
1353 
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);
1359  }
1360 
1361 
1362  //____________________________________________________________________
1363  void DrawSteps()
1364  {
1365  // MakeChapter(can, "Steps");
1366 
1367  THStack* esds = GetStack(GetCollection(fResults, "fmdSharingFilter"),
1368  "sumsESD", "summedESD",false);
1369  THStack* deltas = GetStack(GetCollection(fResults, "fmdSharingFilter"),
1370  "sums", "summed",false);
1371  THStack* nchs = GetStack(GetCollection(fResults,
1372  "fmdDensityCalculator"),
1373  "sums", "inclDensity",false);
1374  THStack* prims = GetStack(GetCollection(fResults, "fmdCorrector"),
1375  "sums", "primaryDensity",false);
1376  THStack* rings = GetStack(GetCollection(fResults, "ringResults"),
1377  "all",0, false);
1378  THStack* mcRings = GetStack(GetCollection(fResults, "mcRingResults", false),
1379  "all","dndeta_eta", false);
1380  TH1* dndeta = GetH1(fResults, "dNdeta", false);
1381  if (dndeta) dndeta->SetMarkerColor(kBlack);
1382  if (!(esds || deltas || nchs || prims || rings)) return;
1383 
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);
1390 
1391  THStack* all = new THStack;
1392  AddToAll(all, mcRings);
1393  AddToAll(all, esds);
1394  AddToAll(all, deltas);
1395  AddToAll(all, nchs);
1396  AddToAll(all, prims);
1397  AddToAll(all, rings);
1398 
1399  TH1* res = 0;
1400  if (dndeta) {
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);
1406  all->Add(res);
1407  }
1408 
1409  TLegend* l = new TLegend(.35, .2, .55, .9);
1410  l->SetFillColor(kWhite);
1411  l->SetFillStyle(0);
1412  l->SetBorderSize(0);
1413  TLegendEntry* e = 0;
1414 
1415  THStack* stacks[] = { mcRings,
1416  esds,
1417  deltas,
1418  nchs,
1419  prims,
1420  rings };
1421 
1422  Int_t nHist = 0;
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));
1426  AddLegendEntry(l, h, stacks[i]->GetTitle());
1427  nHist++;
1428  }
1429  if (res) {
1430  AddLegendEntry(l, res, res->GetTitle());
1431  nHist++;
1432  }
1433 
1434  TObject* objs[] = { stacks[0],
1435  stacks[1],
1436  stacks[2],
1437  stacks[3],
1438  stacks[4],
1439  stacks[5],
1440  dndeta };
1441  const char* titles[] = { /* 1 */ "MC",
1442  /* 2 */ "ESD input",
1443  /* 3 */ "After merging",
1444  /* 4 */ "After particle counting",
1445  /* 5 */ "After corrections",
1446  /* 6 */ "After normalization",
1447  /* 7 */ "After combining" };
1448  Int_t nY = nHist > 6 ? 4 : 3;
1449  Int_t nX = 2;
1450  if (fLandscape) {
1451  Int_t tmp = nX;
1452  nX = nY;
1453  nY = tmp;
1454  }
1455  fBody->Divide(nX, nY, 0, 0);
1456 
1457  Int_t step = 0;
1458  for (Int_t i = 0; i < 7; i++) {
1459  TObject* obj = objs[i];
1460  if (!obj) continue;
1461 
1462  step++;
1463  Int_t padNo = step;
1464  if (!fLandscape) {
1465  switch (step) {
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;
1473  }
1474  }
1475  //Printf("Drawing step %d in sub-pad %d (%s)",step,padNo,obj->GetTitle());
1476  DrawStep(step, all, obj, l, titles[i], fBody, padNo, nX);
1477  }
1478 
1479  if (!esds && !mcRings && deltas) {
1480  fBody->cd(6);
1481  TLegend* ll = new TLegend(0.01, 0.11, 0.99, 0.99);
1482  // ll->SetNDC();
1483  ll->SetFillColor(kWhite);
1484  ll->SetFillStyle(0);
1485  ll->SetBorderSize(0);
1486 
1487  TIter next(deltas->GetHists());
1488  TH1* hh = 0;
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);
1494  }
1495  ll->Draw();
1496  }
1497  // Printf("Done drawing steps");
1498  PrintCanvas("Steps");
1499  }
1500 
1501 
1502  //____________________________________________________________________
1504  {
1505  // MakeChapter(can, "Results");
1506 
1507  fBody->Divide(2,1);
1508 
1509  TCollection* c = GetCollection(fResults, "ringResults");
1510  if (!c) return;
1511 
1512  THStack* mcRings = GetStack(GetCollection(fResults, "mcRingResults", false),
1513  "all", "dndeta_eta", false);
1514 
1515  TH1* dndeta_phi = GetH1(fResults, "dNdeta");
1516  TH1* dndeta_eta = GetH1(fResults, "dNdeta_");
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);
1520 
1521  THStack* allPhi = new THStack("phiAcc", "#varphi Acceptance");
1522  THStack* allEta = new THStack("etaCov", "#eta Coverage");
1523  const char** pring = GetRingNames(false);
1524 
1525  while ((*pring)) {
1526  TCollection* cc = GetCollection(c, *pring);
1527  TH1* etaCov = GetH1(cc, "etaCov");
1528  TH1* phiAcc = GetH1(cc, "phiAcc");
1529  TH1* dndeta = GetH1(cc, "dndeta_phi");
1530  Int_t color = kBlack;
1531  if (dndeta) color = dndeta->GetMarkerColor();
1532  if (etaCov) {
1533  etaCov->SetTitle(*pring);
1534  etaCov->SetFillColor(color);
1535  etaCov->SetLineColor(color);
1536  allEta->Add(etaCov);
1537  }
1538  if (phiAcc) {
1539  phiAcc->SetFillColor(color);
1540  phiAcc->SetLineColor(color);
1541  allPhi->Add(phiAcc);
1542  }
1543  pring++;
1544  }
1545  Double_t savX = fParVal->GetX();
1546  Double_t savY = fParVal->GetY();
1547  fParVal->SetX(.3);
1548  fParVal->SetY(.2);
1549  TVirtualPad* p = fBody->cd(1);
1550  p->Divide(1,2,0,0);
1551  DrawInPad(p, 1, GetStack(c, "all"), "nostack", mcRings ? 0 : kLegend,
1552  "Individual ring results");
1553  DrawInPad(p, 1, mcRings, "nostack same", kLegend|kSilent);
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);
1557 
1558  p = fBody->cd(2);
1559  p->Divide(1,2,0,0);
1560  DrawInPad(p, 1, dndeta_phi, "", 0x0,
1561  "1/#it{N}_{ev} d#it{N}_{ch}/d#it{#eta}");
1562  DrawInPad(p, 1, dndeta_eta, "Same", kLegend);
1563  DrawInPad(p, 2, GetH1(fResults, "norm"), "", 0x0,
1564  "Total #phi acceptance and #eta coverage");
1565  DrawInPad(p, 2, GetH1(fResults, "phi"), "same", kLegend);
1566  // DrawInPad(fBody, 4, GetH1(fSums, "d2Ndetadphi"), "colz");
1567 
1568  // fBody->cd(1);
1569  // TLatex* l = new TLatex(.5, .2, "Ring results");
1570  // l->SetNDC();
1571  // l->SetTextAlign(21);
1572  // l->Draw();
1573 
1574  // fBody->cd(2);
1575  // l->DrawLatex(.5, .2, "1/N_{ev}dN_{ch}/d#eta");
1576 
1577  // fBody->cd(3);
1578  // l->DrawLatex(.5, .2, "1/N_{ev}dN_{ch}/d#eta (#vta norm.)");
1579 
1580  fParVal->SetX(savX);
1581  fParVal->SetY(savY);
1582  PrintCanvas("Results");
1583  }
1584 
1585  //____________________________________________________________________
1587  {
1588  // MakeChapter(can, "Results");
1589  Info("DrawCentralResults", "Drawing central results");
1590 
1591  fBody->Divide(1,2,0,0);
1592 
1593  TH1* dndeta_ = GetH1(fResults, "dNdeta_");
1594  TH1* dndeta = GetH1(fResults, "dNdeta");
1595  THStack* stack = new THStack("dndetas",
1596  "d#it{N}_{ch}/d#it{#eta} - central");
1597  stack->Add(dndeta_);
1598  stack->Add(dndeta);
1599 
1600  DrawInPad(fBody, 1, stack, "nostack");
1601  TH1* h = stack->GetHistogram();
1602  if (h) {
1603  h->SetXTitle("#it{#eta}");
1604  h->SetYTitle("#frac{d#it{N}_{ch}}{d#it{#eta}}");
1605  }
1606  fBody->cd(1);
1607  TLegend* l = new TLegend(.3, .05, .7, .4);
1608  l->SetFillColor(0);
1609  l->SetFillStyle(0);
1610  l->SetBorderSize(0);
1611  l->AddEntry(dndeta_, "Normalized to coverage", "lp");
1612  l->AddEntry(dndeta, "Normalized to #phi acceptance", "lp");
1613  l->Draw();
1614 
1615  DrawInPad(fBody, 2, GetH1(fResults, "norm"));
1616  DrawInPad(fBody, 2, GetH1(fResults, "phi"), "same", kLegend);
1617 
1618  PrintCanvas("Central Results");
1619 
1620  }
1621  void DrawBoth(TFile* file)
1622  {
1623  Info("DrawBoth", "Drawing central & forward results");
1624  TCollection* central = GetCollection(file, "CentralResults");
1625  TCollection* forward = GetCollection(file, "ForwardResults");
1626 
1627  if (!central || !forward) {
1628  Warning("DrawBoth", "central %p or forward %p results not found",
1629  central, forward);
1630  return;
1631  }
1632 
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}");
1648  s->Add(f1);
1649  s->Add(c1);
1650  s->Add(f2);
1651  s->Add(c2);
1652 
1653  fBody->Divide(1, 2, 0, 0);
1654  DrawInPad(fBody, 1, s, "nostack");
1655  s->GetHistogram()->SetXTitle("#it{#eta}");
1656  s->GetHistogram()->SetYTitle("#frac{d#it{N}_{ch}}{d#it{#eta}}");
1657 
1658  fBody->cd(1);
1659  TLegend* l = new TLegend(.4, .05, .8, .4);
1660  l->SetFillColor(0);
1661  l->SetFillStyle(0);
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());
1677  l->Draw();
1678 
1679  TH1* f3 = GetH1(forward, "norm");
1680  TH1* c3 = GetH1(central, "norm");
1681  TH1* f4 = GetH1(forward, "phi");
1682  TH1* c4 = GetH1(central, "phi");
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());
1691 
1692  THStack* a = new THStack("norms", "Normalizations");
1693  a->Add(f3);
1694  a->Add(c3);
1695  a->Add(f4);
1696  a->Add(c4);
1697 
1698  a->SetMaximum(a->GetMaximum("nostack")*1.2);
1699  DrawInPad(fBody, 2, a, "nostack");
1700  a->GetHistogram()->SetXTitle("#it{#eta}");
1701  a->GetHistogram()->SetYTitle("Normalization (coverage or acceptance)");
1702 
1703  fBody->cd(2);
1704  l = new TLegend(.2, .94, .9, .99);
1705  l->SetFillColor(0);
1706  l->SetFillStyle(0);
1707  l->SetBorderSize(0);
1708  l->SetNColumns(2);
1709  // entry = l->AddEntry("dummy", "Forward", "f");
1710  // entry->SetFillColor(f1->GetMarkerColor());
1711  // entry->SetLineColor(f1->GetMarkerColor());
1712  // entry->SetFillStyle(1001);
1713  // entry->SetLineWidth(0);
1714  // entry = l->AddEntry("dummy", "Central", "f");
1715  // entry->SetFillColor(c1->GetMarkerColor());
1716  // entry->SetLineColor(c1->GetMarkerColor());
1717  // entry->SetLineWidth(0);
1718  // entry->SetFillStyle(1001);
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);
1725  l->Draw();
1726 
1727  PrintCanvas("Both results");
1728  }
1731 };
1732 
1733 // #endif
Int_t color[]
print message on plot with ok/not ok
const Char_t * CutMethodName(Int_t lm) const
void SummarizeSharing(const char *fname, UShort_t what=0)
const char * filename
Definition: TestFCM.C:1
TLatex * fParName
const Color_t cc[]
Definition: DrawKs.C:1
double Double_t
Definition: External.C:58
Base class for classes to draw summaries.
const char * title
Definition: MakeQAPdf.C:27
TGraph * CreateCutGraph(Int_t method, Int_t iy, TH2 *cuts, TH1 *eloss, Int_t color)
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")
char Char_t
Definition: External.C:18
TFile * Init(const char *fname)
TCanvas * c
Definition: TestFitELoss.C:172
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)
AliStack * stack
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)
int Int_t
Definition: External.C:63
float Float_t
Definition: External.C:68
Int_t method
TCollection * fResults
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)
unsigned long ULong_t
Definition: External.C:38
const char * pdfName
Definition: DrawAnaELoss.C:30
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)
const char * fwd
TCollection * fSums
static void SNNString(UShort_t sNN, TString &str)
void CloseCanvas()
virtual void DrawEventInspector(TCollection *parent)
void DivideForRings(Bool_t commonX, Bool_t commonY)
TLatex * fParVal
Definition: External.C:220
TFile * file
TList with histograms for a given trigger.
unsigned short UShort_t
Definition: External.C:28
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="")
bool Bool_t
Definition: External.C:53
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)
Definition: External.C:196
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)