AliPhysics  95775ff (95775ff)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Trend.C
Go to the documentation of this file.
1 #ifndef __TREND_C_
2 #define __TREND_C_
3 #include "SummaryDrawer.C"
4 #include <TH1.h>
5 #include <THStack.h>
6 #include <TMultiGraph.h>
7 #include <TGraphAsymmErrors.h>
8 #include <TTree.h>
9 #include <TList.h>
10 #include <TLegend.h>
11 
16 struct Trend : public SummaryDrawer
17 {
18  //__________________________________________________________________
22  Trend()
23  {
24  fSLCuts.SetName("sl");
25  fSHCuts.SetName("sh");
26  fDCCuts.SetName("dc");
27  fOrder[0] = &fSLCuts;
28  fOrder[1] = &fSHCuts;
29  fOrder[2] = &fDCCuts;
30  }
31  //=== Customization member function ================================
38  void AddSLCut(const TString& name, const TString& values)
39  {
40  fSLCuts.Add(new TNamed(name, values));
41  }
42  //__________________________________________________________________
49  void AddSHCut(const TString& name, const TString& values)
50  {
51  fSHCuts.Add(new TNamed(name, values));
52  }
53  //__________________________________________________________________
60  void AddDCCut(const TString& name, const TString& values)
61  {
62  fDCCuts.Add(new TNamed(name, values));
63  }
64  //__________________________________________________________________
70  void AddRun(const TString& name)
71  {
72  fRuns.Add(new TNamed(name, name));
73  }
74  //__________________________________________________________________
82  {
83  TObjString* n = 0;
84  if (l <= 0 && h >= 100) n = new TObjString("all");
85  else n = new TObjString(Form("cent%03d_%03d", l, h));
86  n->SetUniqueID((h & 0xFFFF) << 16 | (l & 0xFFFF));
87  fCents.Add(n);
88  }
89  //__________________________________________________________________
96  void SetOrder(const TString& order)
97  {
98  TObjArray* a = order.Tokenize(" ");
99  if (a->GetEntries() < 3) {
100  Error("SetOrder", "Order must contain a pertubation of "
101  "\"sl\", \"sh\", and \"dc\", separated by spaces");
102  fOrder[0] = fOrder[1] = fOrder[2] = 0;
103  return;
104  }
105  for (Int_t i = 0; i < 3; i++) {
106  const TString& n = static_cast<TObjString*>(a->At(i))->String();
107  TList* l = 0;
108  if (n.EqualTo("sl", TString::kIgnoreCase)) l = &fSLCuts;
109  else if (n.EqualTo("sh", TString::kIgnoreCase)) l = &fSHCuts;
110  else if (n.EqualTo("dc", TString::kIgnoreCase)) l = &fDCCuts;
111  if (!l) {
112  Error("SetOrder", "Unknown cut \"%s\"", n.Data());
113  fOrder[0] = fOrder[1] = fOrder[2] = 0;
114  return;
115  }
116  fOrder[i] = l;
117  }
118  a->Delete();
119  }
120  //=== Processing member functions ==================================
129  void Run(const char* output="trending.root",
130  UShort_t sys=2,
131  UShort_t sNN=2760,
132  UShort_t trg=1)
133  {
134  TString outName(output);
135  outName.ReplaceAll(".pdf", ".root");
136  if (!outName.EndsWith(".root")) outName.Append(".root");
137  TString pdfName(outName);
138  pdfName.ReplaceAll(".root", ".pdf");
139 
140  CreateCanvas(pdfName, true);
141 
142  TFile* out = TFile::Open(outName, "RECREATE");
143  TDirectory* refDir = out->mkdir("reference");
144 
145  TIter iCent(&fCents);
146  TObject* pCent = 0;
147  while ((pCent = iCent())) {
148  UShort_t low = (pCent->GetUniqueID() & 0xFFFF);
149  UShort_t high = (pCent->GetUniqueID() >> 16) & 0xFFFF;
150  TGraph* graph = GetOther(sys, sNN, trg, low, high);
151  if (!graph) break;
152 
153  TString name(graph->GetName());
154  name.Append(Form("_%s", pCent->GetName()));
155  graph->SetName(name);
156 
157  fOthers.Add(graph);
158  refDir->Add(graph);
159  }
160 
161  TIter iRun(&fRuns);
162  TObject* pRun = 0;
163  while ((pRun = iRun())) {
164  TString sRun = pRun->GetName();
165  TDirectory* dRun = out->mkdir(sRun);
166 
167  MakeChapter(sRun);
168 
169  for (Int_t i = 0; i < 1/*2*/; i++) {
170  TString three(Form("%dstrip", i+2));
171  TDirectory* dStrip = dRun->mkdir(three);
172 
173  MakeChapter(Form("_%s", three.Data()));
174 
175  three.Append("_slX_shX_dcX");
176 
177  LoopCuts(sRun, three, fOrder[0], fOrder[1], fOrder[2], dStrip);
178  }
179  }
180  out->Write();
181  out->Close();
182  CloseCanvas();
183  }
184  //__________________________________________________________________
198  void LoopCuts(const TString& run,
199  const TString& cur,
200  const TList* cuts1,
201  const TList* cuts2,
202  const TList* cuts3,
203  TDirectory* out,
204  Int_t upBin=0,
205  THStack* upMean=0,
206  THStack* upRatios=0)
207  {
208  TString pre(Form("%s%s",(cuts3 ? "" : "_"), (cuts2 ? "" : "_")));
209  Printf("%s%s", pre.Data(), cur.Data());
210 
211  TDirectory* dCut = out->mkdir(cuts1->GetName());
212  TIter iCut(cuts1);
213  TObject* pCut = 0;
214  dCut->cd();
215  while ((pCut = iCut())) {
216  TString sMethod = pCut->GetName();
217  TDirectory* dMethod = dCut->mkdir(sMethod);
218  TString sValues = pCut->GetTitle();
219  TObjArray* aValues = sValues.Tokenize(" ");
220  TIter iValue(aValues);
221  TObjString* pValue = 0;
222  TString templ(Form("%s%s", cuts1->GetName(), sMethod.Data()));
223  TString base(cur);
224  base.ReplaceAll(Form("%sX", cuts1->GetName()), templ);
225  aValues->SetName(cuts1->GetName());
226 
227  THStack* mean = 0;
228  THStack* ratios = 0;
229  dMethod->cd();
230  MakeStacks(base, aValues, mean, ratios);
231  dMethod->Add(mean);
232  dMethod->Add(ratios);
233 
234  Int_t xbin = 1;
235  while ((pValue = static_cast<TObjString*>(iValue()))) {
236  TString sValue(Form("%05.2f", pValue->String().Atof()));
237  sValue.ReplaceAll(".", "d");
238  TDirectory* dValue = dMethod->mkdir(sValue);
239  TString now(base);
240  TString sub(Form("%s%s", templ.Data(), sValue.Data()));
241  now.ReplaceAll(templ.Data(), sub.Data());
242  // now.Append(sValue);
243  dValue->cd();
244 
245  if (cuts2) {
246  // Loop over sub-cut.
247  LoopCuts(run, now, cuts2, cuts3, 0,
248  dValue, xbin, mean, ratios);
249  }
250  else {
251  // Process for a given cut with the current value of that cut.
252  if (!NextFile(run, now, dValue, xbin,
253  mean, ratios)) {
254  // xbin++;
255  dMethod->cd();
256  continue;
257  }
258  // After this, we have points for the current cut value
259  // stored in the stacks mean and wSpread, and added ratios
260  // for the current cut to the stack ratios. Since we're not
261  // done with the cut values just yet, we should wait to
262  // update the parent stacks.
263  }
264 
265  if (upMean /*&& upWSpread*/) {
266  // For each centrality extract
267  // - mean of mean of ...
268  // - var of var of ...
269  // - spread of spread of ...
270  TIter iCent(&fCents);
271  TObject* pCent = 0;
272  Int_t jCent = 0;
273  while ((pCent = iCent())) {
274  TH1* h = static_cast<TH1*>(mean->GetHists()->At(jCent));
275  // Info("", "Updating parent %s with %s @ %d",
276  // upMean->GetTitle(), h->GetTitle(),upBin);
277  UpdateStacks(h, jCent, upBin, upMean);
278  jCent++;
279  }
280  } // if ups
281 
282  xbin++;
283  dMethod->cd();
284  } // for values
285 
286  if (upRatios) {
287  TIter nextHist(ratios->GetHists());
288  TH1* hist = 0;
289  while ((hist = static_cast<TH1*>(nextHist())))
290  upRatios->Add(hist);
291  }
292  dCut->cd();
293 
294  FixMinMax(ratios);
295  FixMinMax(mean);
296 
297  if (mean && mean->GetHists()->GetEntries() > 0 &&
298  ratios && ratios->GetHists() &&
299  ratios->GetHists()->GetEntries() > 0) {
300  fBody->Divide(2,1);
301  DrawStacks(fBody->GetPad(1), mean, kNorth|kWest);
302  DrawStacks(fBody->GetPad(2), ratios, kNorth|kCenter, kSouth|kCenter);
303  PrintCanvas(Form("%s_%s", pre.Data(), base.Data()), 0.5);
304  }
305  } // for methods
306  out->cd();
307  }
308  //__________________________________________________________________
321  Bool_t NextFile(const TString& run, const TString& now,
322  TDirectory* out, Int_t binx,
323  THStack* mean, THStack* ratios)
324  {
325  TString dir(Form("%s_dndeta_%s", run.Data(), now.Data()));
326  TString path(Form("%s/forward_dndeta.root", dir.Data()));
327  if (gSystem->AccessPathName(path.Data())) {
328  Warning("NextFile", "%s not found", path.Data());
329  return false;
330  }
331  TFile* file = TFile::Open(path, "READ");
332  if (!file) {
333  Warning("NextFile", "Failed to open %s", path.Data());
334  return false;
335  }
336  // Info("NextFile", "Opened %s", path.Data());
337 
338  TCollection* results = GetCollection(file, "ForwarddNdetaResults");
339  if (!results) return false;
340 
341  TCollection* mcResults = GetCollection(file, "MCTruthdNdetaResults");
342 
343  THStack* all = new THStack("all", "All");
344  THStack* rat = new THStack("ratios", "Ratios");
345 
346  TIter iCent(&fCents);
347  TObject* pCent = 0;
348  Int_t jCent = 0;
349  while ((pCent = iCent())) {
350  TString folderName(pCent->GetName());
351  TCollection* centFolder = GetCollection(results, folderName);
352  if (!centFolder) {
353  Warning("", "Didn't get the centrality %s folder from %s",
354  folderName.Data(), results->GetName());
355  // results->ls();
356  break;
357  }
358 
359  TCollection* mcCentFolder = 0;
360  if (mcResults) mcCentFolder = GetCollection(mcResults, folderName);
361 
362  TH1* dNdeta = GetH1(centFolder, Form("dndetaForward%s",
363  fRebinned ? "_rebin05" : ""));
364  if (!dNdeta) {
365  Warning("", "Didn't get histogram for jCent=%d in %s",
366  jCent, path.Data());
367  // results->ls();
368  break;
369  }
370  dNdeta->SetDirectory(out);
371  dNdeta->SetName(folderName);
372  dNdeta->SetMarkerColor(jCent+1);
373  dNdeta->SetLineColor(jCent+1);
374 
375  TH1* other = 0;
376  if (mcCentFolder)
377  other = GetH1(mcCentFolder, Form("dndetaMCTruth%s",
378  fRebinned ? "_rebin05" : ""));
379  if (!other) {
380  TGraph* graph = static_cast<TGraph*>(fOthers.At(jCent));
381  if (!graph) break;
382 
383  other = G2H(graph, *(dNdeta->GetXaxis()));
384  }
385 
386  if (!other) {
387  Warning("", "No other data found for %s", path.Data());
388  break;
389  }
390 
391  other->SetMarkerColor(dNdeta->GetMarkerColor());
392  other->SetMarkerSize(dNdeta->GetMarkerSize());
393  other->SetLineColor(dNdeta->GetLineColor());
394  other->SetDirectory(out);
395  folderName.ReplaceAll("cent", "other");
396  folderName.ReplaceAll("all", "other");
397  other->SetName(folderName);
398 
399  all->Add(other);
400  all->Add(dNdeta);
401 
402  folderName.ReplaceAll("other", "ratio");
403  TH1* ratio = static_cast<TH1*>(dNdeta->Clone(folderName));
404  ratio->SetTitle(Form("%s %s", dir.Data(), pCent->GetName()));
405  ratio->SetDirectory(out);
406  ratio->Divide(other);
407  ratio->SetMarkerStyle(20+binx-1);
408  ratio->SetMarkerColor(jCent+1);
409  ratio->SetLineColor(kGray);
410  ratio->SetLineWidth(0);
411  ratios->Add(ratio);
412 
413  rat->Add(ratio);
414 
415  UpdateStacks(ratio, jCent, binx, mean);
416  jCent++;
417  }
418  out->Add(all);
419  out->Add(rat);
420 
421  FixMinMax(all);
422  FixMinMax(rat);
423 
424  fBody->Divide(1,2,0,0);
425  DrawStacks(fBody->GetPad(1), all/*, 21*/);
426  DrawStacks(fBody->GetPad(2), rat, kNorth|kCenter);
427  PrintCanvas(Form("____%s", now.Data()), .4);
428 
429  file->Close();
430  if (jCent <= 0) return false;
431 
432  return true;
433  }
434  //=== Stack functions ==============================================
443  void MakeStacks(const TString& run,
444  const TObjArray* values,
445  THStack*& mean,
446  THStack*& ratios)
447  {
448  mean = new THStack("mean", run);
449  ratios = new THStack("ratios", run);
450 
451  // --- Create histograms and graphs ------------------------
452  Int_t nValues = values->GetEntriesFast();
453  TIter nextCent(&fCents);
454  TObject* pcent = 0;
455  Int_t col = 1;
456  while ((pcent = nextCent())) {
457  UShort_t low = (pcent->GetUniqueID() & 0xFFFF);
458  UShort_t high = (pcent->GetUniqueID() >> 16) & 0xFFFF;
459 
460  TH1* hMean = new TH1D(pcent->GetName(),
461  Form("%s %d%%-%d%% central", run.Data(),
462  low, high),
463  nValues, .5, nValues+.5);
464  hMean->SetMarkerColor(col);
465  hMean->SetMarkerStyle(20);
466  hMean->SetLineColor(col);
467  hMean->SetXTitle(Form("Cut parameter X_{%s}", values->GetName()));
468  hMean->SetYTitle("Average, spread, and min/max of ratio");
469  hMean->SetDirectory(0);
470  TIter nextV(values);
471  TObjString* pvalue = 0;
472  Int_t xbin = 1;
473  while ((pvalue = static_cast<TObjString*>(nextV()))) {
474  TString& value = pvalue->String();
475  hMean->GetXaxis()->SetBinLabel(xbin, value);
476  xbin++;
477  }
478 
479  TGraphAsymmErrors* gWSpread = new TGraphAsymmErrors(nValues);
480  gWSpread->SetName("minmax");
481  gWSpread->SetTitle(hMean->GetTitle());
482  gWSpread->SetMarkerColor(col);
483  gWSpread->SetLineColor(col);
484  gWSpread->SetFillColor(0);
485  gWSpread->SetFillStyle(0);
486 
487  hMean->GetListOfFunctions()->Add(gWSpread, "[]pl same");
488  mean->Add(hMean, "x0 e1");
489  col++;
490  }
491  }
492  //__________________________________________________________________
501  void UpdateStacks(TH1* h,
502  Int_t i,
503  Int_t binx,
504  THStack* stack)
505  {
506  Double_t avg = 0;
507  Double_t var = 0;
508  Double_t min = +100000;
509  Double_t max = -100000;
510  HistStatistics(h, avg, var, min, max);
511  h->SetMinimum(0.95*min);
512  h->SetMaximum(1.1*max);
513 
514  TH1* hMean = static_cast<TH1*>(stack->GetHists()->At(i));
515  hMean->SetBinContent(binx, avg);
516  hMean->SetBinError(binx,var);
517 
518  TObject* pG = hMean->GetListOfFunctions()->FindObject("minmax");
519  if (!pG) {
520  hMean->GetListOfFunctions()->ls();
521  return;
522  }
523  TGraphAsymmErrors* gWSpread = static_cast<TGraphAsymmErrors*>(pG);
524  gWSpread->SetPoint(binx-1, binx, avg);
525  gWSpread->SetPointError(binx-1,0, 0, /*0.5,0.5,*/
526  TMath::Abs(avg-min), TMath::Abs(max-avg));
527  }
528  //=== Graphics member functions ====================================
529  //__________________________________________________________________
537  void BuildCentLegend(TVirtualPad* p, UInt_t where, THStack* stack=0)
538  {
539  TLegend* l = MakeLegend(p, where, false);
540  TIter iCent(&fCents);
541  TObject* pCent = 0;
542  Int_t col = 1;
543  while ((pCent = iCent())) {
544  UShort_t low = (pCent->GetUniqueID() & 0xFFFF);
545  UShort_t high = (pCent->GetUniqueID() >> 16) & 0xFFFF;
546 
547  TLegendEntry* e = l->AddEntry("dummy",
548  Form("%2d%% - %2d%% central", low, high),
549  "pl");
550  e->SetFillColor(col);
551  e->SetMarkerColor(col);
552  e->SetLineColor(col);
553  e->SetMarkerStyle(20);
554  col++;
555  }
556  if (stack && stack->GetHistogram()) {
557  stack->GetHistogram()->GetListOfFunctions()->Add(l);
558  }
559  else
560  l->Draw();
561 
562  }
563  //__________________________________________________________________
571  void BuildCutLegend(TVirtualPad* p, UInt_t where, THStack* stack)
572  {
573  TLegend* l = MakeLegend(p, where, false);
574  l->SetX1(p->GetLeftMargin());
575  l->SetX2(1-p->GetRightMargin());
576  // l->SetBorderSize(1);
577  l->SetNColumns(1);
578 
579  TList seen;
580  TIter iHist(stack->GetHists());
581  TH1* pHist = 0;
582  while ((pHist = static_cast<TH1*>(iHist()))) {
583  TString title(pHist->GetTitle());
584 
585  Int_t idx = title.Index(" cent");
586  if (idx != kNPOS) title.Remove(idx, 5+3+3+1);
587 
588  idx = title.Index("_dndeta");
589  if (idx != kNPOS) title.Remove(0, idx+6+1+1);
590 
591  TObject* before = seen.FindObject(title);
592  if (before) continue;
593 
594  seen.Add(new TObjString(title));
595 
596  TLegendEntry* e = l->AddEntry("dummy", title, "p");
597  e->SetMarkerColor(kBlack);
598  e->SetMarkerStyle(pHist->GetMarkerStyle());
599  }
600  seen.IsOwner();
601  if (stack->GetHistogram()) {
602  stack->GetHistogram()->GetListOfFunctions()->Add(l);
603  }
604  else
605  l->Draw();
606 
607  }
608  //__________________________________________________________________
617  void DrawStacks(TVirtualPad* p,
618  THStack* stack,
619  UInt_t cent=0,
620  UInt_t cuts=0)
621  {
622  if (!stack) {
623  Warning("DrawStacks", "Stack is missing!");
624  return;
625  }
626  if (!stack->GetHists() || stack->GetHists()->GetEntries() <= 0) {
627  Warning("DrawStacks", "Stack is empty");
628  return;
629  }
630  TH1* first = static_cast<TH1*>(stack->GetHists()->At(0));
631  TString xT = first->GetXaxis()->GetTitle();
632 
633  p->cd();
634  stack->Draw("nostack");
635  // DrawInPad(p, 0, stack, "nostack", flags);
636  stack->GetXaxis()->SetTitle(xT);
637  FixMinMax(stack);
638 
639  if (cent > 0) BuildCentLegend(p, cent, stack);
640  if (cuts > 0) BuildCutLegend(p, cuts, stack);
641 
642  p->Modified();
643  p->Update();
644  p->cd();
645  }
646  //=== Utility static member functions ==============================
655  static void Statistics(Double_t y,
656  Int_t& cnt,
657  Double_t& mean,
658  Double_t& var)
659  {
660  cnt += 1;
661  mean += (y - mean) / cnt;
662  var += (cnt > 1 ? (TMath::Power(y-mean,2)/(cnt-1)-var/cnt) : 0);
663  }
664  //__________________________________________________________________
674  static void HistStatistics(const TH1* h,
675  Double_t& mean,
676  Double_t& var,
677  Double_t& min,
678  Double_t& max)
679  {
680  mean = 0;
681  var = 0;
682  min = +100000;
683  max = -100000;
684  Int_t cnt = 0;
685  for (Int_t i = 1; i <= h->GetNbinsX(); i++) {
686  Double_t y = h->GetBinContent(i);
687  if (TMath::Abs(y) <= 1e-9) continue;
688  min = TMath::Min(min, y);
689  max = TMath::Max(max, y);
690  Statistics(y, cnt, mean, var);
691  }
692  // Info("", "Stats for %s: mean=%f +/- %f [%f,%f]",
693  // h->GetTitle(), mean, var, min, max);
694  }
695  //__________________________________________________________________
701  static void FixMinMax(THStack* stack)
702  {
703  TIter iHist(stack->GetHists());
704  TH1* pHist = 0;
705  Double_t m1 = 10000000;
706  Double_t m2 = -10000000;
707  while((pHist = static_cast<TH1*>(iHist()))) {
708  m1 = TMath::Min(m1, pHist->GetMinimum(1e-6));
709  m2 = TMath::Max(m2, pHist->GetMaximum());
710  }
711  // Double_t m1 = stack->GetMinimum("nostack e");
712  // Double_t m2 = stack->GetMaximum("nostack e");
713  // Printf("Stack %s minimum: %f", stack->GetTitle(), m1);
714  stack->SetMinimum((m1 < 0 ? 1.05 : 0.95) * m1);
715  stack->SetMaximum((m2 > 0 ? 1.05 : 0.95) * m2);
716  }
717  //__________________________________________________________________
726  static TH1* G2H(const TGraph* g, const TAxis& axis)
727  {
728  TH1* h = 0;
729  if (axis.GetXbins()->GetArray())
730  h = new TH1D(g->GetName(), g->GetTitle(),
731  axis.GetNbins(), axis.GetXbins()->GetArray());
732  else
733  h = new TH1D(g->GetName(), g->GetTitle(),
734  axis.GetNbins(), axis.GetXmin(), axis.GetXmax());
735  h->SetMarkerColor(g->GetMarkerColor());
736  h->SetMarkerStyle(g->GetMarkerStyle());
737  h->SetMarkerSize(g->GetMarkerSize());
738  h->SetLineColor(g->GetLineColor());
739  h->SetLineStyle(g->GetLineStyle());
740  h->SetLineWidth(g->GetLineWidth());
741  h->SetFillColor(g->GetFillColor());
742  h->SetFillStyle(g->GetFillStyle());
743  h->SetDirectory(0);
744 
745  for (Int_t i = 1; i <= h->GetNbinsX(); i++) {
746  Double_t x = h->GetXaxis()->GetBinCenter(i);
747  Double_t y = g->Eval(x); // , 0, "S");
748  h->SetBinContent(i, y);
749  }
750  return h;
751  }
752  //__________________________________________________________________
764  static TGraph* GetOther(UShort_t sys,
765  UShort_t sNN,
766  UShort_t trg,
767  UShort_t lowC,
768  UShort_t highC)
769  {
770  return 0;
771 #if 0
772  // --- Set the macro pathand load other data script --------------
773  // Always recompile
774  if (!gROOT->GetClass("RefData")) {
775  TString savPath(gROOT->GetMacroPath());
776  gROOT->SetMacroPath(Form("%s:$(ALICE_PHYSICS)/PWGLF/FORWARD/analysis2",
777  gROOT->GetMacroPath()));
778  gROOT->LoadMacro("OtherData.C++");
779  gROOT->SetMacroPath(savPath);
780  }
781  Long_t ret = gROOT->ProcessLine(Form("RefData::GetData(%d,%d,%d,%d,%d,0x4)",
782  sys, sNN, trg, lowC, highC));
783  if (!ret) {
784  Warning("GetOther", "No other data for %d %d %d %d%%-%d%% central",
785  sys, sNN, trg, lowC, highC);
786  return 0;
787  }
788  TMultiGraph* others = reinterpret_cast<TMultiGraph*>(ret);
789  TGraph* other =static_cast<TGraph*>(others->GetListOfGraphs()->At(0));
790  if (!other) {
791  Warning("GetOther", "No ALICE data for %d %d %d %d%%-%d%% central",
792  sys, sNN, trg, lowC, highC);
793  return 0;
794  }
795 
796  // Info("", "Got graph %s/%s", other->GetName(), other->GetTitle());
797 
798  return other;
799 #endif
800  }
801 
802  //__________________________________________________________________
809  TList* fOrder[3];
811 };
812 
813 #endif
TList fCents
Definition: Trend.C:807
void Run(const char *output="trending.root", UShort_t sys=2, UShort_t sNN=2760, UShort_t trg=1)
Definition: Trend.C:129
void AddSLCut(const TString &name, const TString &values)
Definition: Trend.C:38
double Double_t
Definition: External.C:58
Base class for classes to draw summaries.
TList fDCCuts
Definition: Trend.C:805
const char * title
Definition: MakeQAPdf.C:26
static TH1 * GetH1(const TObject *parent, const TString &name, Bool_t verb=true)
void AddCentrality(UShort_t l, UShort_t h)
Definition: Trend.C:81
TList fOthers
Definition: Trend.C:808
TSystem * gSystem
void MakeStacks(const TString &run, const TObjArray *values, THStack *&mean, THStack *&ratios)
Definition: Trend.C:443
Bool_t fRebinned
Definition: Trend.C:810
TList fSHCuts
Definition: Trend.C:804
static void Statistics(Double_t y, Int_t &cnt, Double_t &mean, Double_t &var)
Definition: Trend.C:655
void BuildCutLegend(TVirtualPad *p, UInt_t where, THStack *stack)
Definition: Trend.C:571
void LoopCuts(const TString &run, const TString &cur, const TList *cuts1, const TList *cuts2, const TList *cuts3, TDirectory *out, Int_t upBin=0, THStack *upMean=0, THStack *upRatios=0)
Definition: Trend.C:198
Trend()
Definition: Trend.C:22
void MakeChapter(const TString &title)
void UpdateStacks(TH1 *h, Int_t i, Int_t binx, THStack *stack)
Definition: Trend.C:501
void AddDCCut(const TString &name, const TString &values)
Definition: Trend.C:60
int Int_t
Definition: External.C:63
unsigned int UInt_t
Definition: External.C:33
Definition: External.C:212
Definition: Trend.C:16
TList fSLCuts
Definition: Trend.C:803
static TGraph * GetOther(UShort_t sys, UShort_t sNN, UShort_t trg, UShort_t lowC, UShort_t highC)
Definition: Trend.C:764
static void HistStatistics(const TH1 *h, Double_t &mean, Double_t &var, Double_t &min, Double_t &max)
Definition: Trend.C:674
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 BuildCentLegend(TVirtualPad *p, UInt_t where, THStack *stack=0)
Definition: Trend.C:537
TLegend * MakeLegend(TVirtualPad *p, UInt_t flags, Bool_t autoFill)
void AddRun(const TString &name)
Definition: Trend.C:70
static TH1 * G2H(const TGraph *g, const TAxis &axis)
Definition: Trend.C:726
void PrintCanvas(const TString &title, Float_t size=.7)
Bool_t NextFile(const TString &run, const TString &now, TDirectory *out, Int_t binx, THStack *mean, THStack *ratios)
Definition: Trend.C:321
void CloseCanvas()
void AddSHCut(const TString &name, const TString &values)
Definition: Trend.C:49
void SetOrder(const TString &order)
Definition: Trend.C:96
static void FixMinMax(THStack *stack)
Definition: Trend.C:701
TFile * file
unsigned short UShort_t
Definition: External.C:28
void DrawStacks(TVirtualPad *p, THStack *stack, UInt_t cent=0, UInt_t cuts=0)
Definition: Trend.C:617
TList fRuns
Definition: Trend.C:806
bool Bool_t
Definition: External.C:53
TList * fOrder[3]
Definition: Trend.C:809
static TCollection * GetCollection(const TObject *parent, const TString &name, Bool_t verb=true)
Definition: External.C:196