AliPhysics  6f1d526 (6f1d526)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FastCentEstimators.C
Go to the documentation of this file.
1 #ifndef FASTCENTESTIMATOR_C
2 #define FASTCENTESTIMATOR_C
3 #ifndef __CINT__
4 # include <TObject.h>
5 # include <TString.h>
6 # include <TH1.h>
7 # include <TMath.h>
8 # include <TCollection.h>
9 # include <TTree.h>
10 # include <TParticle.h>
11 # include <TError.h>
12 # include "FastShortHeader.C"
13 # include <TH2.h>
14 #else
15 class TH1;
16 // class TH2;
17 class TCollection;
18 class TTree;
19 class TParticle;
20 class FastShortHeader;
21 #endif
22 
23 enum {
24  kNeutron = 2112,
25  kProton = 2212
26 };
27 
28 //====================================================================
32 struct FastCentEstimator : public TObject
33 {
41  FastCentEstimator(const char* name="")
42  : TObject(), fName(name), fVerbose(false)
43  {}
47  virtual ~FastCentEstimator() {}
53  const char* GetName() const { return fName.Data(); }
54  void SetVerbose(Bool_t verb) { fVerbose = verb; }
65  virtual void Setup(TCollection* out, TTree* tree, UShort_t sNN,
66  Bool_t tgtA, Bool_t projA) = 0;
71  virtual void PreEvent() {}
72  virtual void ProcessHeader(FastShortHeader&) {}
80  virtual void Process(const TParticle* p) = 0;
84  virtual void PostEvent() {}
90  virtual void Terminate(TCollection* out) = 0;
91  virtual void Print(Option_t* option="") const
92  {
93  Printf("%s: %s", ClassName(), GetName());
94  }
102  static Double_t Theta(const TParticle* p)
103  {
104  Double_t pT = p->Pt();
105  Double_t pZ = p->Pz();
106  Double_t theta = TMath::ATan2(pT, pZ);
107  return theta;
108  }
116  static Double_t Eta(const TParticle* p)
117  {
118  Double_t theta = Theta(p);
119  Double_t tanth = TMath::Tan(theta/2);
120  if (tanth < 1e-100) return +1e10;
121  if (tanth > 1e100) return -1e10;
122  Double_t eta = -TMath::Log(tanth);
123  return eta;
124  }
132  static Double_t Phi(const TParticle* p)
133  {
134  Double_t px = p->Px();
135  Double_t py = p->Py();
136  Double_t phi = TMath::ATan2(px, py);
137  return phi;
138  }
146  static Bool_t IsPrimary(const TParticle* p)
147  {
148  return p->TestBit(BIT(14));
149  }
157  static Bool_t IsWeakDecay(const TParticle* p)
158  {
159  return p->TestBit(BIT(15));
160  }
168  static Bool_t IsCharged(const TParticle* p)
169  {
170  return p->TestBit(BIT(16));
171  }
173 };
174 
175 
176 
177 
178 //____________________________________________________________________
183 {
185  ULong64_t fCache;
197  Fast1DCentEstimator(const char* name="")
198  : FastCentEstimator(name), fHistogram(0), fFromTop(true)
199  {}
203  virtual ~Fast1DCentEstimator() {}
204  virtual const char* MultSpec() const { return "l"; }
212  void Setup(TCollection* l, TTree* tree, UShort_t,
213  Bool_t, Bool_t)
214  {
215  if (fHistogram && l) l->Add(fHistogram);
216  TString leaves; leaves.Form("value/%s", MultSpec());
217  if (tree) tree->Branch(GetName(), &fCache, leaves.Data());
218  }
222  virtual void PreEvent()
223  {
224  fCache = 0;
225  }
229  virtual void PostEvent()
230  {
231  if (fVerbose) Info("PostEvent", " Got %lld %s particles",
232  fCache, GetName());
233  fHistogram->Fill(fCache);
234  }
235  virtual TH1* GetHistogram(TCollection* l) = 0;
245  virtual void Terminate(TCollection* out)
246  {
247  TH1* h = GetHistogram(out);
248  TH1* cent = static_cast<TH1*>(h->Clone(GetName()));
249  cent->SetDirectory(0);
250  cent->SetYTitle("Centrality [%]");
251  cent->SetTitle(Form("%s mapping", GetName()));
252  cent->Reset();
253  out->Add(cent);
254 
255  Int_t nX = h->GetNbinsX();
256  Double_t total = h->Integral(1,nX);
257  Int_t dBin = (fFromTop ? -1 : 1);
258  Int_t end = (fFromTop ? 0 : nX+1);
259  Int_t start = (fFromTop ? nX : 1);
260  if (fVerbose)
261  Info("Teminate", "Integrating %s from bin %d to 1",
262  h->GetName(), nX);
263  for (Int_t i = start; i != end; i += dBin) {
264  Double_t curInt = (fFromTop ?
265  h->Integral(i, start) :
266  h->Integral(start,i));
267  if (curInt < 0) continue;
268  Double_t curCent = curInt / total * 100;
269  cent->SetBinContent(i, curCent);
270  if (fVerbose)
271  Info("Terminate", "Bin %3d -> %9f/%9f -> %5.1f%%",
272  i, curInt, total, curCent);
273  }
274  }
275  virtual void Print(Option_t* option="nh") const
276  {
277  TString opt(option); opt.ToLower();
278  if (opt.Contains("n"))
279  Printf("1D Estimator: %s (%screasing)",
280  GetName(),(fFromTop ? "de" : "in"));
281  if (opt.Contains("h") && fHistogram) {
282  Int_t nBin = fHistogram->GetNbinsX();
283  Printf(" %d bins between %f and %f",nBin,
284  fHistogram->GetXaxis()->GetXmin(),
285  fHistogram->GetXaxis()->GetXmax());
286  }
287  }
289 };
290 
291 //____________________________________________________________________
293 {
294  // TH2* fBvsC;
297  : Fast1DCentEstimator("B"),
298  // fBvsC(0),
299  fkFactor(1000)
300  {}
310  virtual void Setup(TCollection* out, TTree* tree, UShort_t sNN,
311  Bool_t tgtA, Bool_t projA)
312  {
313  fHistogram = MakeHistogram(sNN, tgtA, projA);
314 #if 0
315  if (fHistogram &&
316  fHistogram->GetXaxis()) {
317  if (fHistogram->GetXaxis()->GetXbins() &&
318  fHistogram->GetXaxis()->GetXbins()->GetArray()) {
319  fBvsC = new TH2D("bVsC", "Impact parameter vs Centrality",
320  fHistogram->GetXaxis()->GetNbins(),
321  fHistogram->GetXaxis()->GetXbins()->GetArray(),
322  20, 0, 100);
323  }
324  else {
325  fBvsC = new TH2D("bVsC", "Impact parameter vs Centrality",
326  fHistogram->GetXaxis()->GetNbins(),
327  fHistogram->GetXaxis()->GetXmin(),
328  fHistogram->GetXaxis()->GetXmax(),
329  20, 0, 100);
330  }
331  }
332  if (fBvsC) {
333  fBvsC->SetDirectory(0);
334  fBvsC->SetXTitle("b [fm]");
335  fBvsC->SetYTitle("Centrality [%]");
336  out->Add(fBvsC);
337  }
338  else
339  Warning("BCentEstimator", "Couldn't make bVsC histogram");
340 #endif
341  Fast1DCentEstimator::Setup(out, tree, sNN, tgtA, projA);
342  // if (tree) tree->Branch(GetName(), &fB, "value/D");
343  }
350  {
351  return static_cast<TH1*>(l->FindObject(Form("raw%s",GetName())));
352  }
354  {
355  TArrayD cents;
356  TArrayD bins; // In B
357  if (tgtA && projA) { // Pb-Pb
358  if (sNN == 2760) {
359  // PbPb @ 2.76TeV only
360  // Updated 4th of November 2014 from
361  // cern.ch/twiki/bin/view/ALICE/CentStudies
362  // #Tables_with_centrality_bins_AN1
363  Double_t bs[] = { 0, 1.57, 2.22, 2.71, 3.13,
364  3.50, 4.94, 6.05, 6.98, 7.81,
365  8.55, 9.23, 9.88, 10.47, 11.04,
366  11.58, 12.09, 12.58, 13.05, 13.52,
367  13.97, 14.43, 14.96, 15.67, 20.00 };
368  Double_t cs[] = { 0.5, 1.5, 2.5, 3.5, 4.5,
369  7.5, 12.5, 17.5, 22.5, 27.5,
370  32.5, 37.5, 42.5, 47.5, 52.5,
371  57.5, 62.5, 67.5, 72.5, 77.5,
372  82.5, 87.5, 92.5, 97.5 };
373  cents.Set(24,cs);
374  bins.Set(25,bs);
375  }
376  else if (sNN == 5023) {
377  // PbPb @ 5.02TeV only
378  // https://twiki.cern.ch/twiki/bin/viewauth/ALICE/CentralityCodeSnippets
379  Double_t bs[] = { 0.00, 1.56, 2.22, 2.71, 3.13,
380  3.51, 3.84, 4.15, 4.43, 4.71,
381  4.96, 6.08, 7.01, 7.84, 8.59,
382  9.27, 9.92, 10.5, 11.1, 11.6,
383  12.1, 12.6, 13.1, 13.6, 14.0,
384  14.5, 15.0, 15.7, 19.6 }; // 29
385  Double_t cs[] = { 0.5, 1.5, 2.5, 3.5, 4.5,
386  5.5, 6.5, 7.5, 8.5, 9.5,
387  12.5, 17.5, 22.5, 27.5, 32.5,
388  37.5, 42.5, 47.5, 52.5, 57.5,
389  62.5, 67.5, 72.5, 77.5, 82.5,
390  87.5, 92.5, 97.5 };
391  cents.Set(28,cs);
392  bins.Set(29,bs);
393  }
394  }
395  else if (tgtA || projA) { // p-Pb or Pb-p
396  if (sNN == 5023) {
397  Double_t cs[] = { 2.5, 7.5, 15., 30.,
398  50., 70., 90. };
399  Double_t bs[] = { 0, 1.83675, 2.59375, 3.66875,
400  5.18625, 6.35475, 7.40225, 13.8577 };
401  cents.Set(7, cs);
402  bins.Set(8, bs);
403  }
404  }
405  if (bins.GetSize() <= 0 || cents.GetSize() <= 0 ) // Nothing defined
406  return 0;
407  printf("b bins: ");
408  for (Int_t i = 0; i < bins.GetSize(); i++) {
409  bins[i] *= fkFactor; // Scale to 1/1000 fm
410  printf("%s%7.1f", i!=0 ? "-" : "", bins[i]);
411  }
412  Printf("");
413  TH1* h = new TH1D(Form("raw%s",GetName()), "B to Centrality",
414  bins.GetSize()-1, bins.GetArray());
415  h->SetDirectory(0);
416  h->SetXTitle("b\\hbox{ [10^{3}fm]}");
417  h->SetYTitle("c\\hbox{ [\\%]}");
418  h->SetBinContent(0,1);
419  for (Int_t i = 1; i <= cents.GetSize(); i++) {
420  h->SetBinContent(i, cents[i-1]);
421  }
422  return h;
423  }
428  void PreEvent() { fCache = 100*fkFactor; };
435  {
436  // In Ap (EPOS) we have many spec in the target, meaning they will
437  // be detected on the C side (p is the projectile, A is the target)
438  // if (!fSpectators) return;
439  fCache = h.fB * fkFactor;
440  Info("", "Cache=%ld", fCache);
441  // if (fBvsC) fBvsC->Fill(fCache, h.fC);
442  }
446  virtual void Process(const TParticle*) {};
451  void PostEvent() {};
457  virtual void Terminate(TCollection* out)
458  {
459  TH1* h = GetHistogram(out);
460  if (!h) return;
461  TH1* cent = static_cast<TH1*>(h->Clone(GetName()));
462  cent->SetDirectory(0);
463  cent->SetYTitle("Centrality [%]");
464  cent->SetTitle(Form("%s mapping", GetName()));
465  out->Add(cent);
466  // Scale to number of workers
467  Double_t scale = cent->GetBinContent(0);
468  cent->Scale(1./scale);
469  }
477  {
478  Double_t ret = (fHistogram ?
479  fHistogram->GetBinContent(fHistogram->FindBin(b*fkFactor)) :
480  200);
481  // Info("", "Look-up of %f (%f) -> %5.1f%%", b*fkFactor, b, ret);
482  return ret;
483  }
485 };
486 
487 //____________________________________________________________________
492 {
498  FastNchCentEstimator(const char* name="")
499  : Fast1DCentEstimator(name)
500  {}
510  virtual void Process(const TParticle* p)
511  {
512  if (!IsCharged(p)) return;
513  if (!Accept(p)) return;
514  fCache++;
515  }
523  virtual Bool_t Accept(const TParticle* p) = 0;
524  virtual void Print(Option_t* option="nh") const
525  {
526  TString opt(option); opt.ToLower();
527  if (opt.Contains("n"))
528  Printf("1D Nch Estimator: %s (%screasing)",
529  GetName(),(fFromTop ? "de" : "in"));
530  opt.ReplaceAll("n", "");
532  }
534 };
535 
536 //____________________________________________________________________
541 {
555  V0CentEstimator(Short_t mode=0, Bool_t onlyPrimary=false)
556  : FastNchCentEstimator(Form("%s%s",
557  (mode < 0 ? "V0C" :
558  mode > 0 ? "V0A" : "V0M"),
559  (onlyPrimary ? "P" : ""))),
560  fMode(mode),
561  fOnlyPrimary(onlyPrimary)
562  {
563  fAEtaMin = +2.8;
564  fAEtaMax = +5.1;
565  fCEtaMin = -3.7;
566  fCEtaMax = -1.7;
567  }
568  void Flip(Bool_t onlySign=true)
569  {
570  if (!onlySign) {
571  std::swap(fAEtaMin, fCEtaMax); // a=[-1.7,*] c=[*,+2.8]
572  std::swap(fAEtaMax, fCEtaMin); // a=[*,-3.7] c=[+5.1,*]
573  }
574  else {
575  std::swap(fAEtaMin, fAEtaMax); // a=[+5.1,+2.8]
576  std::swap(fCEtaMin, fCEtaMax); // c=[-1.7,-3.7]
577  }
578  // onlySign !onlySign
579  fAEtaMin *= -1; // a=[-5.1,*] a=[+1.7,*]
580  fAEtaMax *= -1; // a=[*,-2.8] a=[*,+3.7]
581  fCEtaMin *= -1; // c=[+1.7,*] c=[-5.1,*]
582  fCEtaMax *= -1; // c=[*,+3.7] c=[*,-2.8]
583  Printf("Flipped %s", (onlySign ? "sign" : "acceptance"));
584  }
595  void Setup(TCollection* l, TTree* tree, UShort_t sNN,
596  Bool_t tgtA, Bool_t projA)
597  {
598  Bool_t isAA = (tgtA && projA);
599  Bool_t isPA = (tgtA ^ projA); // XOR
600  UInt_t max = (isAA ? 13000 : isPA ? 800 : 300);
601  UInt_t dBin = (isAA ? 10 : isPA ? 1 : 1);
602  Color_t color = (fMode < 0 ? kRed : fMode > 0 ? kBlue : kGreen)+2;
603  fHistogram = new TH1D(Form("raw%s",GetName()),
604  Form("%s #it{N}_{ch} distribution", GetName()),
605  max/dBin, 0, (fMode == 0 ? 2 : 1)*max);
606  fHistogram->SetXTitle("#it{N}_{ch}");
607  fHistogram->SetYTitle("Raw #it{P}(#it{N}_{ch})");
608  fHistogram->SetDirectory(0);
609  fHistogram->SetLineColor(color);
610  fHistogram->SetFillColor(color);
611  fHistogram->SetMarkerColor(color);
612  fHistogram->SetMarkerStyle(20);
613  fHistogram->SetFillStyle(3002);
614 
615  Fast1DCentEstimator::Setup(l, tree, sNN, tgtA, projA);
616  }
625  Bool_t Accept(const TParticle* p)
626  {
627  if (fOnlyPrimary && !IsPrimary(p)) return false;
628  Double_t eta = Eta(p);
629  Bool_t v0A = ((eta >= fAEtaMin) && (eta <= fAEtaMax));
630  Bool_t v0C = ((eta >= fCEtaMin) && (eta <= fCEtaMax));
631  if (fMode < 0) return v0C;
632  if (fMode > 0) return v0A;
633  return v0A || v0C;
634  }
641  {
642  return static_cast<TH1*>(l->FindObject(Form("raw%s",GetName())));
643  }
644  virtual void Print(Option_t* option="nah") const
645  {
646  TString opt(option); opt.ToLower();
647  if (opt.Contains("n"))
648  Printf("V0 Estimator: %s (%screasing) mode=%d",
649  GetName(),(fFromTop ? "de" : "in"), fMode);
650  if (opt.Contains("a"))
651  Printf(" A: eta=[%f,%f], C: eta=[%f,%f]",
653  opt.ReplaceAll("n", "");
655  }
657 };
658 //____________________________________________________________________
663 {
672  : FastNchCentEstimator(Form("RefMult%02dd%02d",
673  Int_t(etaCut), Int_t(100*etaCut)%100)),
674  fEtaCut(etaCut)
675  {}
686  void Setup(TCollection* l, TTree* tree, UShort_t sNN,
687  Bool_t tgtA, Bool_t projA)
688  {
689  Bool_t isAA = (tgtA && projA);
690  Bool_t isPA = (tgtA ^ projA); // XOR
691  UInt_t max = (isAA ? 15000 : isPA ? 900 : 200);
692  UInt_t dBin = (isAA ? 10 : isPA ? 1 : 1);
693  Color_t color = kMagenta;
694  fHistogram = new TH1D(Form("raw%s",GetName()),
695  Form("#it{N}_{ch} |#it{#eta}|<%5.2f distribution",
696  fEtaCut), max/dBin, 0, max);
697  fHistogram->SetXTitle("#it{N}_{ch}");
698  fHistogram->SetYTitle("Raw #it{P}(#it{N}_{ch})");
699  fHistogram->SetDirectory(0);
700  fHistogram->SetLineColor(color);
701  fHistogram->SetFillColor(color);
702  fHistogram->SetMarkerColor(color);
703  fHistogram->SetMarkerStyle(20);
704  fHistogram->SetFillStyle(3002);
705 
706  Fast1DCentEstimator::Setup(l, tree, sNN, tgtA, projA);
707  }
716  Bool_t Accept(const TParticle* p)
717  {
718  Double_t eta = Eta(p);
719  if (!IsPrimary(p)) return false;
720  if (TMath::Abs(eta) > fEtaCut) return false;
721  return true;
722  }
729  {
730  return static_cast<TH1*>(l->FindObject(Form("raw%s",GetName())));
731  }
733 };
734 //____________________________________________________________________
739 {
740  // What to put in
749  ULong64_t fNSpec;
759  Bool_t neutrons=true,
760  Bool_t spectators=false,
761  Bool_t primary=false)
762  : Fast1DCentEstimator(Form("Z%c%c%c%c",
763  (neutrons ? 'N' : 'P'),
764  (mode < 0 ? 'C' : (mode > 0 ? 'A' : 'M')),
765  (spectators ? 'S' : 'E'),
766  (primary ? 'P' : 'A'))),
767  fMode(mode),
768  fNeutrons(neutrons),
769  fSpectators(spectators),
770  fPrimary(primary),
771  fMinEta(0),
772  fMaxEta(0),
773  fMaxPhi(-1)
774  {
775  fFromTop = (fSpectators ? false : true);
776  if (fNeutrons) {
777  const Double_t zN = 1161.3; // distance to ZN cm
778  const Double_t dN = 7; // Area of ZN
779  const Double_t rN = TMath::Sqrt(2*dN*dN); // Radius of ZN
780  const Double_t tN = TMath::ATan2(rN,zN); // Largest angle ZN
781  fMinEta = -TMath::Log(TMath::Tan(tN/2));
782  fMaxEta = TMath::Infinity();
783  fMaxPhi = -1;
784  }
785  else {
786  const Double_t zP = 1156.3; // distance to ZC cm
787  const Double_t wP = 20.8; // Width of cal
788  const Double_t hP = 12; // Width of cal
789  const Double_t oP = 19;
790  const Double_t rO = TMath::Sqrt(TMath::Power(oP+wP/2,2)+hP*hP/4);
791  const Double_t rI = TMath::Sqrt(TMath::Power(oP-wP/2,2)+hP*hP/4);
792  const Double_t tO = TMath::ATan2(rO, zP);
793  const Double_t tI = TMath::ATan2(rI, zP);
794  fMinEta = -TMath::Log(TMath::Tan(tO/2));
795  fMaxEta = -TMath::Log(TMath::Tan(tI/2));
796  fMaxPhi = TMath::ATan2(hP/2,oP);
797  }
798  }
809  void Setup(TCollection* l, TTree* tree, UShort_t sNN,
810  Bool_t tgtA, Bool_t projA)
811  {
812  Bool_t isAA = (tgtA && projA);
813  Bool_t isPA = (tgtA ^ projA); // XOR
814  UInt_t max = (isAA ? 2000 : isPA ? 300 : 30);
815  UInt_t dBin = (isAA ? 10 : isPA ? 1 : 1);
816  Color_t color = (fMode < 0 ? kRed : fMode > 0 ? kBlue : kGreen)+2;
817 
818  TString nTxt;
819  nTxt.Form("#it{N}_{%s%c} (%s)",
820  fSpectators ? "spec," : "", fNeutrons ? 'n' : 'p',
821  fPrimary ? "primary" : "all");
822  fHistogram = new TH1D(Form("raw%s",GetName()),
823  Form("%s %s distribution", GetName(), nTxt.Data()),
824  max/dBin, 0, (fMode == 0 ? 2 : 1)*max);
825  fHistogram->SetXTitle(nTxt);
826  fHistogram->SetYTitle(Form("Raw #it{P}(%s)", nTxt.Data()));
827  fHistogram->SetDirectory(0);
828  fHistogram->SetLineColor(color);
829  fHistogram->SetFillColor(color);
830  fHistogram->SetMarkerColor(color);
831  fHistogram->SetMarkerStyle(20);
832  fHistogram->SetFillStyle(3002);
833 
834  Fast1DCentEstimator::Setup(l, tree, sNN, tgtA, projA);
835  }
841  virtual void Process(const TParticle* p)
842  {
843  // Check if we should count emitted
844  if (fSpectators) return;
845 
846  // Check if we should count only primaries
847  if (fPrimary && !IsPrimary(p)) return;
848  else if (!fPrimary && p->GetStatusCode()==4) return;
849  // if ((fFlags & kPrimary) != 0 && !IsPrimary(p)) return;
850 
851  // Check if this is a spectator
852  // Int_t status = p->GetStatusCode();
853  // if ((fFlags & kSpectators) == 0 && (status==13 || status==14)) return;
854 
855  // Check particle type
856  Int_t aPdg = TMath::Abs(p->GetPdgCode());
857  if (fNeutrons && aPdg != kNeutron)
858  // Looking for neutrons
859  return;
860  if (!fNeutrons && aPdg != kProton)
861  // Looking for protons
862  return;
863 
864  // Check side
865  Double_t eta = Eta(p);
866  if (fMode < 0 && eta > 0) return; // Wrong side
867  if (fMode > 0 && eta < 0) return; // Wrong side
868 
869  // Check acceptance
870  Double_t aeta = TMath::Abs(eta);
871  if (aeta > fMaxEta || aeta < fMinEta) return; // Not acceptance
872 
873  if (fMaxPhi > 0) {
874  Double_t phi = TMath::Abs(Phi(p) - (eta < 0 ? 0 : TMath::Pi()));
875  if (phi > fMaxPhi) return; // Not acceptance
876  }
877 
878  // Decrement
879  fCache++;
880  // Printf("%s: increment from %d (%f) -> %lld",
881  // GetName(), aPdg, eta, fCache);
882  }
884  {
885  // In Ap (EPOS) we have many spec in the target, meaning they will
886  // be detected on the C side (p is the projectile, A is the target)
887  // if (!fSpectators) return;
888  fCache = 0;
889  fNSpec = 0;
890  Int_t nC = 0;
891  Int_t nA = 0;
892  if (fNeutrons) {
893  nC = h.fNSpecNtgt;
894  nA = h.fNSpecNproj;
895  }
896  else {
897  nC = h.fNSpecPtgt;
898  nA = h.fNSpecPproj;
899  }
900  if (fMode < 0) fNSpec = nC;
901  else if (fMode > 0) fNSpec = nA;
902  else fNSpec = nC + nA;
903  // Printf("%s: Initial cache value: %d", GetName(), fNSpec);
904  }
905  virtual void PostEvent()
906  {
907  // Info(GetName(), "Nspec=%lld Nneu=%lld", fNSpec, fCache);
908  if (fSpectators) fCache = fNSpec;
909  else {
910  if (fNSpec > fCache) {
911  // Warning("PostEvent", "Nspec (%d) > Nneu (%d)", fNSpec, fCache);
912  fNSpec = fCache;
913  }
914  if (!fPrimary) fCache -= fNSpec;
915  }
917  }
924  {
925  return static_cast<TH1*>(l->FindObject(Form("raw%s",GetName())));
926  }
927  virtual void Print(Option_t* option="nah") const
928  {
929  TString opt(option); opt.ToLower();
930  if (opt.Contains("n"))
931  Printf("ZN Estimator: %s (%screasing) mode=%d - %s %s",
932  GetName(),(fFromTop ? "de" : "in"), fMode,
933  (fSpectators ? "spectator" : "emitted"),
934  (fPrimary ? "primary" : "all"),
935  (fNeutrons ? "neutrons" : "protons"));
936  if (opt.Contains("a"))
937  Printf(" eta=[%f,%f], phi=%f", fMinEta, fMaxEta, fMaxPhi);
938  opt.ReplaceAll("n", "");
940  }
942 };
943 #endif
944 //
945 // EOF
946 //
Int_t color[]
double Double_t
Definition: External.C:58
virtual void Terminate(TCollection *out)
virtual void PostEvent()
virtual void Setup(TCollection *out, TTree *tree, UShort_t sNN, Bool_t tgtA, Bool_t projA)
static Bool_t IsPrimary(const TParticle *p)
virtual void PostEvent()
static Double_t Eta(const TParticle *p)
virtual void Terminate(TCollection *out)=0
virtual void Process(const TParticle *p)
const char * GetName() const
virtual void ProcessHeader(FastShortHeader &)
virtual void Print(Option_t *option="nah") const
const Double_t fkFactor
virtual TH1 * GetHistogram(TCollection *l)=0
virtual void Print(Option_t *option="") const
TH1 * MakeHistogram(UShort_t sNN, Bool_t tgtA, Bool_t projA)
static Bool_t IsWeakDecay(const TParticle *p)
void ProcessHeader(FastShortHeader &h)
int Int_t
Definition: External.C:63
unsigned int UInt_t
Definition: External.C:33
ClassDef(V0CentEstimator, 1)
void Flip(Bool_t onlySign=true)
static Bool_t IsCharged(const TParticle *p)
virtual void Print(Option_t *option="nh") const
Double_t GetCentrality(Double_t b) const
Definition: External.C:228
Definition: External.C:212
virtual void Print(Option_t *option="nah") const
Bool_t Accept(const TParticle *p)
virtual TH1 * GetHistogram(TCollection *l)
void Setup(TCollection *l, TTree *tree, UShort_t, Bool_t, Bool_t)
V0CentEstimator(Short_t mode=0, Bool_t onlyPrimary=false)
Int_t mode
Definition: anaM.C:41
virtual Bool_t Accept(const TParticle *p)=0
virtual TH1 * GetHistogram(TCollection *l)
ClassDef(FastNchCentEstimator, 1)
short Short_t
Definition: External.C:23
ClassDef(RefMultEstimator, 1)
virtual void PostEvent()
void Setup(TCollection *l, TTree *tree, UShort_t sNN, Bool_t tgtA, Bool_t projA)
void SetVerbose(Bool_t verb)
ClassDef(FastCentEstimator, 1)
FastCentEstimator(const char *name="")
static Double_t Phi(const TParticle *p)
ZNCentEstimator(Short_t mode=0, Bool_t neutrons=true, Bool_t spectators=false, Bool_t primary=false)
virtual void Process(const TParticle *p)=0
virtual TH1 * GetHistogram(TCollection *l)
virtual const char * MultSpec() const
RefMultEstimator(Double_t etaCut=0.8)
virtual void Terminate(TCollection *out)
ClassDef(Fast1DCentEstimator, 1)
ClassDef(BCentEstimator, 2)
static Double_t Theta(const TParticle *p)
void Setup(TCollection *l, TTree *tree, UShort_t sNN, Bool_t tgtA, Bool_t projA)
void swap(AliEmcalContainerIndexMap< X, Y > &first, AliEmcalContainerIndexMap< X, Y > &second)
virtual ~FastCentEstimator()
unsigned short UShort_t
Definition: External.C:28
void Setup(TCollection *l, TTree *tree, UShort_t sNN, Bool_t tgtA, Bool_t projA)
const char Option_t
Definition: External.C:48
void ProcessHeader(FastShortHeader &h)
ClassDef(ZNCentEstimator, 1)
bool Bool_t
Definition: External.C:53
FastNchCentEstimator(const char *name="")
virtual void PreEvent()
Bool_t Accept(const TParticle *p)
virtual void Process(const TParticle *p)
virtual void Print(Option_t *option="nh") const
virtual void Setup(TCollection *out, TTree *tree, UShort_t sNN, Bool_t tgtA, Bool_t projA)=0
virtual void Process(const TParticle *)
Definition: External.C:196
virtual TH1 * GetHistogram(TCollection *l)
Fast1DCentEstimator(const char *name="")