1 #ifndef FASTCENTESTIMATOR_C
2 #define FASTCENTESTIMATOR_C
8 # include <TCollection.h>
10 # include <TParticle.h>
80 virtual void Process(
const TParticle* p) = 0;
93 Printf(
"%s: %s", ClassName(),
GetName());
106 Double_t theta = TMath::ATan2(pT, pZ);
119 Double_t tanth = TMath::Tan(theta/2);
120 if (tanth < 1e-100)
return +1e10;
121 if (tanth > 1e100)
return -1e10;
136 Double_t phi = TMath::ATan2(px, py);
148 return p->TestBit(BIT(14));
159 return p->TestBit(BIT(15));
170 return p->TestBit(BIT(16));
204 virtual const char*
MultSpec()
const {
return "l"; }
231 if (
fVerbose) Info(
"PostEvent",
" Got %lld %s particles",
249 cent->SetDirectory(0);
250 cent->SetYTitle(
"Centrality [%]");
251 cent->SetTitle(Form(
"%s mapping",
GetName()));
255 Int_t nX = h->GetNbinsX();
261 Info(
"Teminate",
"Integrating %s from bin %d to 1",
263 for (
Int_t i = start; i != end; i += dBin) {
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);
271 Info(
"Terminate",
"Bin %3d -> %9f/%9f -> %5.1f%%",
272 i, curInt, total, curCent);
277 TString opt(option); opt.ToLower();
278 if (opt.Contains(
"n"))
279 Printf(
"1D Estimator: %s (%screasing)",
283 Printf(
" %d bins between %f and %f",nBin,
318 fHistogram->GetXaxis()->GetXbins()->GetArray()) {
319 fBvsC =
new TH2D(
"bVsC",
"Impact parameter vs Centrality",
321 fHistogram->GetXaxis()->GetXbins()->GetArray(),
325 fBvsC =
new TH2D(
"bVsC",
"Impact parameter vs Centrality",
333 fBvsC->SetDirectory(0);
334 fBvsC->SetXTitle(
"b [fm]");
335 fBvsC->SetYTitle(
"Centrality [%]");
339 Warning(
"BCentEstimator",
"Couldn't make bVsC histogram");
351 return static_cast<TH1*
>(l->FindObject(Form(
"raw%s",
GetName())));
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 };
376 else if (sNN == 5023) {
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 };
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,
395 else if (tgtA || projA) {
397 Double_t cs[] = { 2.5, 7.5, 15., 30.,
399 Double_t bs[] = { 0, 1.83675, 2.59375, 3.66875,
400 5.18625, 6.35475, 7.40225, 13.8577 };
405 if (bins.GetSize() <= 0 || cents.GetSize() <= 0 )
408 for (
Int_t i = 0; i < bins.GetSize(); i++) {
410 printf(
"%s%7.1f", i!=0 ?
"-" :
"", bins[i]);
414 bins.GetSize()-1, bins.GetArray());
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]);
440 Info(
"",
"Cache=%ld",
fCache);
462 cent->SetDirectory(0);
463 cent->SetYTitle(
"Centrality [%]");
464 cent->SetTitle(Form(
"%s mapping",
GetName()));
467 Double_t scale = cent->GetBinContent(0);
468 cent->Scale(1./scale);
526 TString opt(option); opt.ToLower();
527 if (opt.Contains(
"n"))
528 Printf(
"1D Nch Estimator: %s (%screasing)",
530 opt.ReplaceAll(
"n",
"");
558 mode > 0 ?
"V0A" :
"V0M"),
559 (onlyPrimary ?
"P" :
""))),
583 Printf(
"Flipped %s", (onlySign ?
"sign" :
"acceptance"));
598 Bool_t isAA = (tgtA && projA);
599 Bool_t isPA = (tgtA ^ projA);
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;
604 Form(
"%s #it{N}_{ch} distribution",
GetName()),
605 max/dBin, 0, (
fMode == 0 ? 2 : 1)*max);
607 fHistogram->SetYTitle(
"Raw #it{P}(#it{N}_{ch})");
631 if (
fMode < 0)
return v0C;
632 if (
fMode > 0)
return v0A;
642 return static_cast<TH1*
>(l->FindObject(Form(
"raw%s",
GetName())));
646 TString opt(option); opt.ToLower();
647 if (opt.Contains(
"n"))
648 Printf(
"V0 Estimator: %s (%screasing) mode=%d",
650 if (opt.Contains(
"a"))
651 Printf(
" A: eta=[%f,%f], C: eta=[%f,%f]",
653 opt.ReplaceAll(
"n",
"");
689 Bool_t isAA = (tgtA && projA);
690 Bool_t isPA = (tgtA ^ projA);
691 UInt_t max = (isAA ? 15000 : isPA ? 900 : 200);
692 UInt_t dBin = (isAA ? 10 : isPA ? 1 : 1);
693 Color_t
color = kMagenta;
695 Form(
"#it{N}_{ch} |#it{#eta}|<%5.2f distribution",
698 fHistogram->SetYTitle(
"Raw #it{P}(#it{N}_{ch})");
720 if (TMath::Abs(eta) >
fEtaCut)
return false;
730 return static_cast<TH1*
>(l->FindObject(Form(
"raw%s",
GetName())));
763 (neutrons ?
'N' :
'P'),
764 (
mode < 0 ?
'C' : (
mode > 0 ?
'A' :
'M')),
765 (spectators ?
'S' :
'E'),
766 (primary ?
'P' :
'A'))),
779 const Double_t rN = TMath::Sqrt(2*dN*dN);
780 const Double_t tN = TMath::ATan2(rN,zN);
781 fMinEta = -TMath::Log(TMath::Tan(tN/2));
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);
812 Bool_t isAA = (tgtA && projA);
813 Bool_t isPA = (tgtA ^ projA);
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;
819 nTxt.Form(
"#it{N}_{%s%c} (%s)",
823 Form(
"%s %s distribution",
GetName(), nTxt.Data()),
824 max/dBin, 0, (
fMode == 0 ? 2 : 1)*max);
826 fHistogram->SetYTitle(Form(
"Raw #it{P}(%s)", nTxt.Data()));
848 else if (!
fPrimary && p->GetStatusCode()==4)
return;
856 Int_t aPdg = TMath::Abs(p->GetPdgCode());
866 if (fMode < 0 && eta > 0)
return;
867 if (
fMode > 0 && eta < 0)
return;
874 Double_t phi = TMath::Abs(
Phi(p) - (eta < 0 ? 0 : TMath::Pi()));
925 return static_cast<TH1*
>(l->FindObject(Form(
"raw%s",
GetName())));
929 TString opt(option); opt.ToLower();
930 if (opt.Contains(
"n"))
931 Printf(
"ZN Estimator: %s (%screasing) mode=%d - %s %s",
936 if (opt.Contains(
"a"))
938 opt.ReplaceAll(
"n",
"");
Int_t color[]
option to what and if export to output file
virtual void Terminate(TCollection *out)
virtual void Setup(TCollection *out, TTree *tree, UShort_t sNN, Bool_t tgtA, Bool_t projA)
static Bool_t IsPrimary(const TParticle *p)
virtual ~Fast1DCentEstimator()
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
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)
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
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)
virtual Bool_t Accept(const TParticle *p)=0
virtual TH1 * GetHistogram(TCollection *l)
void Setup(TCollection *l, TTree *tree, UShort_t sNN, Bool_t tgtA, Bool_t projA)
void SetVerbose(Bool_t verb)
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 ~FastNchCentEstimator()
virtual void Terminate(TCollection *out)
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()
void Setup(TCollection *l, TTree *tree, UShort_t sNN, Bool_t tgtA, Bool_t projA)
void ProcessHeader(FastShortHeader &h)
FastNchCentEstimator(const char *name="")
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 *)
virtual TH1 * GetHistogram(TCollection *l)
Fast1DCentEstimator(const char *name="")