6 # include <TCollection.h>
8 # include <TParticle.h>
78 virtual void Process(
const TParticle* p) = 0;
91 Printf(
"%s: %s", ClassName(),
GetName());
104 Double_t theta = TMath::ATan2(pT, pZ);
117 Double_t tanth = TMath::Tan(theta/2);
118 if (tanth < 1e-100)
return +1e10;
119 if (tanth > 1e100)
return -1e10;
134 Double_t phi = TMath::ATan2(px, py);
146 return p->TestBit(BIT(14));
157 return p->TestBit(BIT(15));
168 return p->TestBit(BIT(16));
202 virtual const char*
MultSpec()
const {
return "l"; }
229 if (
fVerbose) Info(
"PostEvent",
" Got %lld %s particles",
247 cent->SetDirectory(0);
248 cent->SetYTitle(
"Centrality [%]");
249 cent->SetTitle(Form(
"%s mapping",
GetName()));
253 Int_t nX = h->GetNbinsX();
259 Info(
"Teminate",
"Integrating %s from bin %d to 1",
261 for (
Int_t i = start; i != end; i += dBin) {
263 h->Integral(i, start) :
264 h->Integral(start,i));
265 if (curInt < 0)
continue;
266 Double_t curCent = curInt / total * 100;
267 cent->SetBinContent(i, curCent);
269 Info(
"Terminate",
"Bin %3d -> %9f/%9f -> %5.1f%%",
270 i, curInt, total, curCent);
275 TString opt(option); opt.ToLower();
276 if (opt.Contains(
"n"))
277 Printf(
"1D Estimator: %s (%screasing)",
281 Printf(
" %d bins between %f and %f",nBin,
316 fHistogram->GetXaxis()->GetXbins()->GetArray()) {
317 fBvsC =
new TH2D(
"bVsC",
"Impact parameter vs Centrality",
319 fHistogram->GetXaxis()->GetXbins()->GetArray(),
323 fBvsC =
new TH2D(
"bVsC",
"Impact parameter vs Centrality",
331 fBvsC->SetDirectory(0);
332 fBvsC->SetXTitle(
"b [fm]");
333 fBvsC->SetYTitle(
"Centrality [%]");
337 Warning(
"BCentEstimator",
"Couldn't make bVsC histogram");
349 return static_cast<TH1*
>(l->FindObject(Form(
"raw%s",
GetName())));
361 Double_t bs[] = { 0, 1.57, 2.22, 2.71, 3.13,
362 3.50, 4.94, 6.05, 6.98, 7.81,
363 8.55, 9.23, 9.88, 10.47, 11.04,
364 11.58, 12.09, 12.58, 13.05, 13.52,
365 13.97, 14.43, 14.96, 15.67, 20.00 };
366 Double_t cs[] = { 0.5, 1.5, 2.5, 3.5, 4.5,
367 7.5, 12.5, 17.5, 22.5, 27.5,
368 32.5, 37.5, 42.5, 47.5, 52.5,
369 57.5, 62.5, 67.5, 72.5, 77.5,
370 82.5, 87.5, 92.5, 97.5 };
374 else if (sNN == 5023) {
377 Double_t bs[] = { 0.00, 1.56, 2.22, 2.71, 3.13,
378 3.51, 3.84, 4.15, 4.43, 4.71,
379 4.96, 6.08, 7.01, 7.84, 8.59,
380 9.27, 9.92, 10.5, 11.1, 11.6,
381 12.1, 12.6, 13.1, 13.6, 14.0,
382 14.5, 15.0, 15.7, 19.6 };
383 Double_t cs[] = { 0.5, 1.5, 2.5, 3.5, 4.5,
384 5.5, 6.5, 7.5, 8.5, 9.5,
385 12.5, 17.5, 22.5, 27.5, 32.5,
386 37.5, 42.5, 47.5, 52.5, 57.5,
387 62.5, 67.5, 72.5, 77.5, 82.5,
393 else if (tgtA || projA) {
395 Double_t cs[] = { 2.5, 7.5, 15., 30.,
397 Double_t bs[] = { 0, 1.83675, 2.59375, 3.66875,
398 5.18625, 6.35475, 7.40225, 13.8577 };
403 if (bins.GetSize() <= 0 || cents.GetSize() <= 0 )
406 for (
Int_t i = 0; i < bins.GetSize(); i++) {
408 printf(
"%s%7.1f", i!=0 ?
"-" :
"", bins[i]);
412 bins.GetSize()-1, bins.GetArray());
414 h->SetXTitle(
"b\\hbox{ [10^{3}fm]}");
415 h->SetYTitle(
"c\\hbox{ [\\%]}");
416 h->SetBinContent(0,1);
417 for (
Int_t i = 1; i <= cents.GetSize(); i++) {
418 h->SetBinContent(i, cents[i-1]);
438 Info(
"",
"Cache=%ld",
fCache);
459 cent->SetDirectory(0);
460 cent->SetYTitle(
"Centrality [%]");
461 cent->SetTitle(Form(
"%s mapping",
GetName()));
464 Double_t scale = cent->GetBinContent(0);
465 cent->Scale(1./scale);
523 TString opt(option); opt.ToLower();
524 if (opt.Contains(
"n"))
525 Printf(
"1D Nch Estimator: %s (%screasing)",
527 opt.ReplaceAll(
"n",
"");
555 mode > 0 ?
"V0A" :
"V0M"),
556 (onlyPrimary ?
"P" :
""))),
580 Printf(
"Flipped %s", (onlySign ?
"sign" :
"acceptance"));
595 Bool_t isAA = (tgtA && projA);
596 Bool_t isPA = (tgtA ^ projA);
597 UInt_t max = (isAA ? 13000 : isPA ? 800 : 300);
598 UInt_t dBin = (isAA ? 10 : isPA ? 1 : 1);
599 Color_t
color = (fMode < 0 ? kRed : fMode > 0 ? kBlue : kGreen)+2;
601 Form(
"%s #it{N}_{ch} distribution",
GetName()),
602 max/dBin, 0, (
fMode == 0 ? 2 : 1)*max);
604 fHistogram->SetYTitle(
"Raw #it{P}(#it{N}_{ch})");
628 if (
fMode < 0)
return v0C;
629 if (
fMode > 0)
return v0A;
639 return static_cast<TH1*
>(l->FindObject(Form(
"raw%s",
GetName())));
643 TString opt(option); opt.ToLower();
644 if (opt.Contains(
"n"))
645 Printf(
"V0 Estimator: %s (%screasing) mode=%d",
647 if (opt.Contains(
"a"))
648 Printf(
" A: eta=[%f,%f], C: eta=[%f,%f]",
650 opt.ReplaceAll(
"n",
"");
686 Bool_t isAA = (tgtA && projA);
687 Bool_t isPA = (tgtA ^ projA);
688 UInt_t max = (isAA ? 15000 : isPA ? 900 : 200);
689 UInt_t dBin = (isAA ? 10 : isPA ? 1 : 1);
690 Color_t
color = kMagenta;
692 Form(
"#it{N}_{ch} |#it{#eta}|<%5.2f distribution",
695 fHistogram->SetYTitle(
"Raw #it{P}(#it{N}_{ch})");
717 if (TMath::Abs(eta) >
fEtaCut)
return false;
727 return static_cast<TH1*
>(l->FindObject(Form(
"raw%s",
GetName())));
760 (neutrons ?
'N' :
'P'),
761 (
mode < 0 ?
'C' : (
mode > 0 ?
'A' :
'M')),
762 (spectators ?
'S' :
'E'),
763 (primary ?
'P' :
'A'))),
776 const Double_t rN = TMath::Sqrt(2*dN*dN);
777 const Double_t tN = TMath::ATan2(rN,zN);
778 fMinEta = -TMath::Log(TMath::Tan(tN/2));
787 const Double_t rO = TMath::Sqrt(TMath::Power(oP+wP/2,2)+hP*hP/4);
788 const Double_t rI = TMath::Sqrt(TMath::Power(oP-wP/2,2)+hP*hP/4);
789 const Double_t tO = TMath::ATan2(rO, zP);
790 const Double_t tI = TMath::ATan2(rI, zP);
791 fMinEta = -TMath::Log(TMath::Tan(tO/2));
792 fMaxEta = -TMath::Log(TMath::Tan(tI/2));
793 fMaxPhi = TMath::ATan2(hP/2,oP);
809 Bool_t isAA = (tgtA && projA);
810 Bool_t isPA = (tgtA ^ projA);
811 UInt_t max = (isAA ? 2000 : isPA ? 300 : 30);
812 UInt_t dBin = (isAA ? 10 : isPA ? 1 : 1);
813 Color_t
color = (fMode < 0 ? kRed : fMode > 0 ? kBlue : kGreen)+2;
816 nTxt.Form(
"#it{N}_{%s%c} (%s)",
820 Form(
"%s %s distribution",
GetName(), nTxt.Data()),
821 max/dBin, 0, (
fMode == 0 ? 2 : 1)*max);
823 fHistogram->SetYTitle(Form(
"Raw #it{P}(%s)", nTxt.Data()));
845 else if (!
fPrimary && p->GetStatusCode()==4)
return;
853 Int_t aPdg = TMath::Abs(p->GetPdgCode());
863 if (fMode < 0 && eta > 0)
return;
864 if (
fMode > 0 && eta < 0)
return;
871 Double_t phi = TMath::Abs(
Phi(p) - (eta < 0 ? 0 : TMath::Pi()));
922 return static_cast<TH1*
>(l->FindObject(Form(
"raw%s",
GetName())));
926 TString opt(option); opt.ToLower();
927 if (opt.Contains(
"n"))
928 Printf(
"ZN Estimator: %s (%screasing) mode=%d - %s %s",
933 if (opt.Contains(
"a"))
935 opt.ReplaceAll(
"n",
"");
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)
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
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)
ClassDef(FastNchCentEstimator, 1)
ClassDef(RefMultEstimator, 1)
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 ~FastNchCentEstimator()
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)
virtual ~FastCentEstimator()
void Setup(TCollection *l, TTree *tree, UShort_t sNN, Bool_t tgtA, Bool_t projA)
void ProcessHeader(FastShortHeader &h)
ClassDef(ZNCentEstimator, 1)
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="")