27 #include "Riostream.h" 28 #include "TObjArray.h" 32 #include "TParticle.h" 39 #include "TParameter.h" 54 fTrackCollection(NULL),
55 fReferenceMultiplicity(0),
57 fUseGlauberMCSymmetryPlanes(kFALSE),
58 fUseExternalSymmetryPlanes(kFALSE),
67 fMCReactionPlaneAngle(0.),
68 fMCReactionPlaneAngleIsSet(kFALSE),
69 fAfterBurnerPrecision(0.001),
70 fUserModified(kFALSE),
71 fNumberOfTracksWrap(NULL),
72 fNumberOfRPsWrap(NULL),
73 fNumberOfPOIsWrap(NULL),
74 fMCReactionPlaneAngleWrap(NULL),
75 fShuffledIndexes(NULL),
76 fShuffleTracks(kFALSE),
77 fMothersCollection(NULL),
95 for(
Int_t i(0); i < 3; i++) {
98 for(
Int_t i=0; i < 4; i++) {
102 cout <<
"AliFlowEventSimple: Default constructor to be used only by root for io" << endl;
114 fReferenceMultiplicity(0),
116 fUseGlauberMCSymmetryPlanes(kFALSE),
117 fUseExternalSymmetryPlanes(kFALSE),
126 fMCReactionPlaneAngle(0.),
127 fMCReactionPlaneAngleIsSet(kFALSE),
128 fAfterBurnerPrecision(0.001),
129 fUserModified(kFALSE),
130 fNumberOfTracksWrap(NULL),
131 fNumberOfRPsWrap(NULL),
132 fNumberOfPOIsWrap(NULL),
133 fMCReactionPlaneAngleWrap(NULL),
134 fShuffledIndexes(NULL),
135 fShuffleTracks(kFALSE),
149 fNumberOfPOItypes(2),
150 fNumberOfPOIs(new
Int_t[fNumberOfPOItypes])
158 Generate(n,ptDist,phiMin,phiMax,etaMin,etaMax);
162 for(
Int_t i(0); i < 3; i++) {
165 for(
Int_t i=0; i < 4; i++) {
217 for(
Int_t i(0); i < 3; i++) {
220 for(
Int_t i=0; i < 4; i++) {
236 for (
Int_t j=0; j<n; j++) { tmp[j]=0; }
258 if (&anEvent==
this)
return *
this;
301 for(
Int_t i(0); i < 3; i++) {
304 for(
Int_t i=0; i < 4; i++) {
337 fPsi1Psi3 =
new TF1(
"fPsi1Psi3",
"[0]*x+[1]",0.,2.*TMath::Pi());
345 fPsi2Psi4 =
new TF1(
"fPsi2Psi4",
"[0]*x+[1]",0.,2.*TMath::Pi());
353 fPsi3Psi5 =
new TF1(
"fPsi3Psi5",
"[0]*x+[1]",0.,2.*TMath::Pi());
371 static TF1 ptdistribution(
"ptSpectra",
"x*TMath::Exp(-pow(0.13957*0.13957+x*x,0.5)/0.4)",0.1,10.);
372 ptDist=&ptdistribution;
375 for (
Int_t i=0; i<nParticles; i++)
380 track->
SetPt( ptDist->GetRandom() );
386 fPsi1Psi3->SetParameter(1,betaParameter);
388 betaParameter =
gRandom->Gaus(0.,0.9);
389 fPsi2Psi4->SetParameter(1,betaParameter);
391 betaParameter =
gRandom->Gaus(0.,1.5);
392 fPsi3Psi5->SetParameter(1,betaParameter);
398 else if(
fPsi3 > 2.*TMath::Pi())
fPsi3 -= 2.*TMath::Pi();
401 else if(
fPsi4 > 2.*TMath::Pi())
fPsi4 -= 2.*TMath::Pi();
404 else if(
fPsi5 > 2.*TMath::Pi())
fPsi5 -= 2.*TMath::Pi();
444 Printf(
"Tracks shuffled! tracks: %i",fNumberOfTracks);
451 if (fNumberOfTracks < fTrackCollection->GetEntriesFast())
520 TH1F *phiWeights = NULL;
521 TH1D *ptWeights = NULL;
522 TH1D *etaWeights = NULL;
528 phiWeights =
dynamic_cast<TH1F *
>(weightsList->FindObject(
"phi_weights"));
529 if(phiWeights) nBinsPhi = phiWeights->GetNbinsX();
533 ptWeights =
dynamic_cast<TH1D *
>(weightsList->FindObject(
"pt_weights"));
536 dBinWidthPt = ptWeights->GetBinWidth(1);
537 dPtMin = (ptWeights->GetXaxis())->GetXmin();
542 etaWeights =
dynamic_cast<TH1D *
>(weightsList->FindObject(
"eta_weights"));
545 dBinWidthEta = etaWeights->GetBinWidth(1);
546 dEtaMin = (etaWeights->GetXaxis())->GetXmin();
559 dPhi = pTrack->
Phi();
561 dEta = pTrack->
Eta();
562 dWeight = pTrack->
Weight();
565 if(phiWeights && nBinsPhi)
567 wPhi = phiWeights->GetBinContent(1+(
Int_t)(TMath::Floor(dPhi*nBinsPhi/TMath::TwoPi())));
570 if(ptWeights && dBinWidthPt)
572 wPt=ptWeights->GetBinContent(1+(
Int_t)(TMath::Floor((dPt-dPtMin)/dBinWidthPt)));
575 if(etaWeights && dBinWidthEta)
577 wEta=etaWeights->GetBinContent(1+(
Int_t)(TMath::Floor((dEta-dEtaMin)/dBinWidthEta)));
581 dQX += dWeight*wPhi*wPt*wEta*TMath::Cos(iOrder*dPhi);
582 dQY += dWeight*wPhi*wPt*wEta*TMath::Sin(iOrder*dPhi);
585 sumOfWeights += dWeight*wPhi*wPt*wEta;
591 cerr <<
"no particle!!!"<<endl;
627 Int_t iNbinsPhiSub0 = 0;
628 Int_t iNbinsPhiSub1 = 0;
638 TH1F* phiWeightsSub0 = NULL;
639 TH1F* phiWeightsSub1 = NULL;
640 TH1D* ptWeights = NULL;
641 TH1D* etaWeights = NULL;
647 phiWeightsSub0 =
dynamic_cast<TH1F *
>(weightsList->FindObject(
"phi_weights_sub0"));
649 iNbinsPhiSub0 = phiWeightsSub0->GetNbinsX();
651 phiWeightsSub1 =
dynamic_cast<TH1F *
>(weightsList->FindObject(
"phi_weights_sub1"));
653 iNbinsPhiSub1 = phiWeightsSub1->GetNbinsX();
658 ptWeights =
dynamic_cast<TH1D *
>(weightsList->FindObject(
"pt_weights"));
661 dBinWidthPt = ptWeights->GetBinWidth(1);
662 dPtMin = (ptWeights->GetXaxis())->GetXmin();
667 etaWeights =
dynamic_cast<TH1D *
>(weightsList->FindObject(
"eta_weights"));
670 dBinWidthEta = etaWeights->GetBinWidth(1);
671 dEtaMin = (etaWeights->GetXaxis())->GetXmin();
677 for (
Int_t s=0; s<2; s++)
685 cerr <<
"no particle!!!"<<endl;
690 dPhi = pTrack->
Phi();
692 dEta = pTrack->
Eta();
693 dWeight = pTrack->
Weight();
698 if(phiWeightsSub0 && iNbinsPhiSub0) {
699 Int_t phiBin = 1+(
Int_t)(TMath::Floor(dPhi*iNbinsPhiSub0/TMath::TwoPi()));
701 dPhi = phiWeightsSub0->GetBinCenter(phiBin);
702 dWphi = phiWeightsSub0->GetBinContent(phiBin);
707 if(phiWeightsSub1 && iNbinsPhiSub1) {
708 Int_t phiBin = 1+(
Int_t)(TMath::Floor(dPhi*iNbinsPhiSub1/TMath::TwoPi()));
710 dPhi = phiWeightsSub1->GetBinCenter(phiBin);
711 dWphi = phiWeightsSub1->GetBinContent(phiBin);
716 if(ptWeights && dBinWidthPt)
718 dWpt=ptWeights->GetBinContent(1+(
Int_t)(TMath::Floor((dPt-dPtMin)/dBinWidthPt)));
722 if(etaWeights && dBinWidthEta)
724 dWeta=etaWeights->GetBinContent(1+(
Int_t)(TMath::Floor((dEta-dEtaMin)/dBinWidthEta)));
728 dQX += dWeight*dWphi*dWpt*dWeta*TMath::Cos(iOrder*dPhi);
729 dQY += dWeight*dWphi*dWpt*dWeta*TMath::Sin(iOrder*dPhi);
732 sumOfWeights+=dWeight*dWphi*dWpt*dWeta;
737 Qarray[s].Set(dQX,dQY);
738 Qarray[s].
SetMult(sumOfWeights);
772 Qarray[0] =
fV0C[har-1];
773 Qarray[1] =
fV0A[har-1];
775 printf(
"WARNING: harmonic %d not available \n",har);
813 printf(
"Class.Print Name = %s, #tracks= %d, Number of RPs= %d, Number of POIs = %d, MC EventPlaneAngle= %f\n",
817 if (!optionstr.Contains(
"all"))
return;
824 printf(
"Empty track collection \n");
902 Int_t numberOfInputTracks = inputTree->GetEntries() ;
905 TParticle* pParticle =
new TParticle();
906 inputTree->SetBranchAddress(
"Particles",&pParticle);
908 for (
Int_t i=0; i<numberOfInputTracks; i++)
910 inputTree->GetEntry(i);
912 if (!pParticle)
continue;
913 if (!pParticle->IsPrimary())
continue;
926 pTrack->
TagRP(kTRUE);
933 pTrack->
Tag(poiType);
935 printf(
"fNumberOfPOIs[%i] = %i",poiType,
fNumberOfPOIs[poiType]);
945 for(
Int_t i(0); i < 3; i++) {
948 for(
Int_t i=0; i < 4; i++) {
961 for (
Int_t i=0; i<n; i++)
963 for (
Int_t itrack=0; itrack<ntracks; itrack++)
966 if (!track)
continue;
995 if (!track)
continue;
1010 if (!track)
continue;
1111 if (track) track->
AddFlow(v1,v2,v3,v4,v5,rp1,rp2,rp3,rp4,rp5,
fAfterBurnerPrecision);
1135 if (!track)
continue;
1149 if (!track)
continue;
1163 if (!track)
continue;
1185 if (!track)
continue;
1196 track->
Tag(poiType,pass);
1220 if (eta>etaMin && eta<etaMax && phi>phiMin && phi<phiMax)
1241 if (!track)
continue;
1242 if (track->
IsDead()) {
delete track;track=NULL;ncleaned++;}
1245 fNumberOfTracks-=ncleaned;
1254 return new TF1(
"StandardPtDepV2",
"((x<1.0)*(0.05/1.0)*x+(x>=1.0)*0.05)");
1261 return new TF2 (
"f",
"((x<1)*.1*x+(x>=1)*.1)*(1-0.2*TMath::Abs(y))");
1268 return new TF1(
"StandardPtSpectrum",
"x*TMath::Exp(-pow(0.13957*0.13957+x*x,0.5)/0.4)",0.1,10.);
void SetCharge(Int_t charge)
void Print(Option_t *option="") const
void SetForSubevent(Int_t i)
virtual void SetV02Qsub(Double_t QVCx, Double_t QVCy, Double_t MC, Double_t QVAx, Double_t QVAy, Double_t MA, Int_t har)
virtual AliFlowVector GetQ(Int_t n=2, TList *weightsList=NULL, Bool_t usePhiWeights=kFALSE, Bool_t usePtWeights=kFALSE, Bool_t useEtaWeights=kFALSE)
void SetEta(Double_t eta)
virtual ~AliFlowEventSimple()
virtual Int_t GetNDaughters() const
virtual void GetVertexPosition(Double_t *pos)
AliFlowTrackSimple * GetTrack(Int_t i)
void AddV1(Double_t v1, Double_t reactionPlaneAngle, Double_t precision, Int_t maxNumberOfIterations=100)
Bool_t InSubevent(Int_t i) const
Int_t GetNumberOfRPs() const
virtual void SetZDC2Qsub(Double_t *QVC, Double_t MC, Double_t *QVA, Double_t MA)
void AddV5(Double_t v5, Double_t reactionPlaneAngle, Double_t precision, Int_t maxNumberOfIterations=100)
void AddFlow(Double_t v1, Double_t v2, Double_t v3, Double_t v4, Double_t v5)
virtual AliFlowTrackSimple * Clone(const char *option="") const
void TagSubeventsByCharge()
TParameter< Int_t > * fNumberOfRPsWrap
number of tracks in TBrowser
void TagRP(const AliFlowTrackSimpleCuts *cuts)
static TF2 * SimplePtEtaDepV2()
void TagTracks(const AliFlowTrackSimpleCuts *cutsRP, const AliFlowTrackSimpleCuts *cutsPOI)
AliFlowEventSimple & operator=(const AliFlowEventSimple &anEvent)
static TF1 * SimplePtSpectrum()
Int_t fReferenceMultiplicity
void SetSubeventNumber(Int_t n)
void AddTrack(AliFlowTrackSimple *track)
void TagPOI(const AliFlowTrackSimpleCuts *cuts, Int_t poiType=1)
Bool_t PassesCuts(const AliFlowTrackSimple *track) const
void SetUserModified(Bool_t s=kTRUE)
Double_t fMCReactionPlaneAngle
void TagRP(Bool_t b=kTRUE)
Bool_t InRPSelection() const
virtual void SetVertexPosition(Double_t *pos)
void IncrementNumberOfPOIs(Int_t poiType=1)
Int_t * fShuffledIndexes
the angle of the reaction plane from the MC truth in TBrowser
TParameter< Double_t > * fMCReactionPlaneAngleWrap
number of tracks that have passed the POI selection in TBrowser
void SetForRPSelection(Bool_t b=kTRUE)
void SetHarmonic(Int_t h)
void CloneTracks(Int_t n)
TParameter< Int_t > * fNumberOfPOIsWrap
number of tracks that have passed the RP selection in TBrowser
void SetNumberOfPOIs(Int_t nubmerOfPOIs, Int_t poiType=1)
Bool_t fUseGlauberMCSymmetryPlanes
void AddV4(Double_t v4, Double_t reactionPlaneAngle, Double_t precision, Int_t maxNumberOfIterations=100)
void ResolutionPt(Double_t res)
void SetMult(Double_t mult)
Int_t GetNumberOfPOIs(Int_t i=1) const
void Tag(Int_t n, Bool_t b=kTRUE)
void ResolutionPt(Double_t resolution)
virtual void Generate(Int_t nParticles, TF1 *ptDist=NULL, Double_t phiMin=0.0, Double_t phiMax=TMath::TwoPi(), Double_t etaMin=-1.0, Double_t etaMax=1.0)
Bool_t fShuffleTracks
placeholder for randomized indexes
TObjArray * fTrackCollection
virtual void Get2Qsub(AliFlowVector *Qarray, Int_t n=2, TList *weightsList=NULL, Bool_t usePhiWeights=kFALSE, Bool_t usePtWeights=kFALSE, Bool_t useEtaWeights=kFALSE)
void SetPhi(Double_t phi)
void DefineDeadZone(Double_t etaMin, Double_t etaMax, Double_t phiMin, Double_t phiMax)
AliFlowTrackSimple * MakeNewTrack()
void AddV2(Double_t v2, Double_t reactionPlaneAngle, Double_t precision, Int_t maxNumberOfIterations=100)
virtual void GetZDC2Qsub(AliFlowVector *Qarray)
void AddFlow(Double_t v1, Double_t v2, Double_t v3, Double_t v4, Double_t reactionPlaneAngle, Double_t precision, Int_t maxNumberOfIterations=100)
void AddV3(Double_t v3, Double_t reactionPlaneAngle, Double_t precision, Int_t maxNumberOfIterations=100)
TParameter< Int_t > * fNumberOfTracksWrap
Double_t fAfterBurnerPrecision
Bool_t fUseExternalSymmetryPlanes
virtual void GetV02Qsub(AliFlowVector *Qarray, Int_t har)
TObjArray * fMothersCollection
Bool_t fMCReactionPlaneAngleIsSet
void TagSubeventsInEta(Double_t etaMinA, Double_t etaMaxA, Double_t etaMinB, Double_t etaMaxB)
void SetUseExternalSymmetryPlanes(TF1 *gPsi1Psi3=0x0, TF1 *gPsi2Psi4=0x0, TF1 *gPsi3Psi5=0x0)
static TF1 * SimplePtDepV2()
Bool_t InPOISelection(Int_t poiType=1) const
Double_t fCentrality
cache the particles with daughters
Int_t CleanUpDeadTracks()
Bool_t MC(TH1F *hs, TH1F *hb, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmaused, Int_t &status)