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),
90 for(
Int_t i(0); i < 3; i++) {
93 cout <<
"AliFlowEventSimple: Default constructor to be used only by root for io" << endl;
105 fReferenceMultiplicity(0),
107 fUseGlauberMCSymmetryPlanes(kFALSE),
108 fUseExternalSymmetryPlanes(kFALSE),
117 fMCReactionPlaneAngle(0.),
118 fMCReactionPlaneAngleIsSet(kFALSE),
119 fAfterBurnerPrecision(0.001),
120 fUserModified(kFALSE),
121 fNumberOfTracksWrap(NULL),
122 fNumberOfRPsWrap(NULL),
123 fNumberOfPOIsWrap(NULL),
124 fMCReactionPlaneAngleWrap(NULL),
125 fShuffledIndexes(NULL),
126 fShuffleTracks(kFALSE),
135 fNumberOfPOItypes(2),
136 fNumberOfPOIs(new
Int_t[fNumberOfPOItypes])
144 Generate(n,ptDist,phiMin,phiMax,etaMin,etaMax);
148 for(
Int_t i(0); i < 3; i++) {
156 fTrackCollection((
TObjArray*)(anEvent.fTrackCollection)->Clone()),
157 fReferenceMultiplicity(anEvent.fReferenceMultiplicity),
158 fNumberOfTracks(anEvent.fNumberOfTracks),
159 fUseGlauberMCSymmetryPlanes(anEvent.fUseGlauberMCSymmetryPlanes),
160 fUseExternalSymmetryPlanes(anEvent.fUseExternalSymmetryPlanes),
161 fPsi1(anEvent.fPsi1),
162 fPsi2(anEvent.fPsi2),
163 fPsi3(anEvent.fPsi3),
164 fPsi4(anEvent.fPsi4),
165 fPsi5(anEvent.fPsi5),
166 fPsi1Psi3(anEvent.fPsi1Psi3),
167 fPsi2Psi4(anEvent.fPsi2Psi4),
168 fPsi3Psi5(anEvent.fPsi3Psi5),
169 fMCReactionPlaneAngle(anEvent.fMCReactionPlaneAngle),
170 fMCReactionPlaneAngleIsSet(anEvent.fMCReactionPlaneAngleIsSet),
171 fAfterBurnerPrecision(anEvent.fAfterBurnerPrecision),
172 fUserModified(anEvent.fUserModified),
173 fNumberOfTracksWrap(anEvent.fNumberOfTracksWrap),
174 fNumberOfRPsWrap(anEvent.fNumberOfRPsWrap),
175 fNumberOfPOIsWrap(anEvent.fNumberOfPOIsWrap),
176 fMCReactionPlaneAngleWrap(anEvent.fMCReactionPlaneAngleWrap),
177 fShuffledIndexes(NULL),
178 fShuffleTracks(anEvent.fShuffleTracks),
180 fCentrality(anEvent.fCentrality),
181 fCentralityCL1(anEvent.fCentralityCL1),
182 fNITSCL1(anEvent.fNITSCL1),
183 fCentralityTRK(anEvent.fCentralityTRK),
185 fZNCQ(anEvent.fZNCQ),
186 fZNAQ(anEvent.fZNAQ),
187 fZNCM(anEvent.fZNCM),
188 fZNAM(anEvent.fZNAM),
189 fNumberOfPOItypes(anEvent.fNumberOfPOItypes),
190 fNumberOfPOIs(new
Int_t[fNumberOfPOItypes])
194 for(
Int_t i(0); i < 3; i++) {
209 for (
Int_t j=0; j<n; j++) { tmp[j]=0; }
231 if (&anEvent==
this)
return *
this;
269 for(
Int_t i(0); i < 3; i++) {
301 fPsi1Psi3 =
new TF1(
"fPsi1Psi3",
"[0]*x+[1]",0.,2.*TMath::Pi());
309 fPsi2Psi4 =
new TF1(
"fPsi2Psi4",
"[0]*x+[1]",0.,2.*TMath::Pi());
317 fPsi3Psi5 =
new TF1(
"fPsi3Psi5",
"[0]*x+[1]",0.,2.*TMath::Pi());
335 static TF1 ptdistribution(
"ptSpectra",
"x*TMath::Exp(-pow(0.13957*0.13957+x*x,0.5)/0.4)",0.1,10.);
336 ptDist=&ptdistribution;
339 for (
Int_t i=0; i<nParticles; i++)
344 track->
SetPt( ptDist->GetRandom() );
350 fPsi1Psi3->SetParameter(1,betaParameter);
352 betaParameter =
gRandom->Gaus(0.,0.9);
353 fPsi2Psi4->SetParameter(1,betaParameter);
355 betaParameter =
gRandom->Gaus(0.,1.5);
356 fPsi3Psi5->SetParameter(1,betaParameter);
362 else if(
fPsi3 > 2.*TMath::Pi())
fPsi3 -= 2.*TMath::Pi();
365 else if(
fPsi4 > 2.*TMath::Pi())
fPsi4 -= 2.*TMath::Pi();
368 else if(
fPsi5 > 2.*TMath::Pi())
fPsi5 -= 2.*TMath::Pi();
408 Printf(
"Tracks shuffled! tracks: %i",fNumberOfTracks);
415 if (fNumberOfTracks < fTrackCollection->GetEntriesFast())
484 TH1F *phiWeights = NULL;
485 TH1D *ptWeights = NULL;
486 TH1D *etaWeights = NULL;
492 phiWeights =
dynamic_cast<TH1F *
>(weightsList->FindObject(
"phi_weights"));
493 if(phiWeights) nBinsPhi = phiWeights->GetNbinsX();
497 ptWeights =
dynamic_cast<TH1D *
>(weightsList->FindObject(
"pt_weights"));
500 dBinWidthPt = ptWeights->GetBinWidth(1);
501 dPtMin = (ptWeights->GetXaxis())->GetXmin();
506 etaWeights =
dynamic_cast<TH1D *
>(weightsList->FindObject(
"eta_weights"));
509 dBinWidthEta = etaWeights->GetBinWidth(1);
510 dEtaMin = (etaWeights->GetXaxis())->GetXmin();
523 dPhi = pTrack->
Phi();
525 dEta = pTrack->
Eta();
526 dWeight = pTrack->
Weight();
529 if(phiWeights && nBinsPhi)
531 wPhi = phiWeights->GetBinContent(1+(
Int_t)(TMath::Floor(dPhi*nBinsPhi/TMath::TwoPi())));
534 if(ptWeights && dBinWidthPt)
536 wPt=ptWeights->GetBinContent(1+(
Int_t)(TMath::Floor((dPt-dPtMin)/dBinWidthPt)));
539 if(etaWeights && dBinWidthEta)
541 wEta=etaWeights->GetBinContent(1+(
Int_t)(TMath::Floor((dEta-dEtaMin)/dBinWidthEta)));
545 dQX += dWeight*wPhi*wPt*wEta*TMath::Cos(iOrder*dPhi);
546 dQY += dWeight*wPhi*wPt*wEta*TMath::Sin(iOrder*dPhi);
549 sumOfWeights += dWeight*wPhi*wPt*wEta;
555 cerr <<
"no particle!!!"<<endl;
591 Int_t iNbinsPhiSub0 = 0;
592 Int_t iNbinsPhiSub1 = 0;
602 TH1F* phiWeightsSub0 = NULL;
603 TH1F* phiWeightsSub1 = NULL;
604 TH1D* ptWeights = NULL;
605 TH1D* etaWeights = NULL;
611 phiWeightsSub0 =
dynamic_cast<TH1F *
>(weightsList->FindObject(
"phi_weights_sub0"));
613 iNbinsPhiSub0 = phiWeightsSub0->GetNbinsX();
615 phiWeightsSub1 =
dynamic_cast<TH1F *
>(weightsList->FindObject(
"phi_weights_sub1"));
617 iNbinsPhiSub1 = phiWeightsSub1->GetNbinsX();
622 ptWeights =
dynamic_cast<TH1D *
>(weightsList->FindObject(
"pt_weights"));
625 dBinWidthPt = ptWeights->GetBinWidth(1);
626 dPtMin = (ptWeights->GetXaxis())->GetXmin();
631 etaWeights =
dynamic_cast<TH1D *
>(weightsList->FindObject(
"eta_weights"));
634 dBinWidthEta = etaWeights->GetBinWidth(1);
635 dEtaMin = (etaWeights->GetXaxis())->GetXmin();
641 for (
Int_t s=0; s<2; s++)
649 cerr <<
"no particle!!!"<<endl;
654 dPhi = pTrack->
Phi();
656 dEta = pTrack->
Eta();
657 dWeight = pTrack->
Weight();
662 if(phiWeightsSub0 && iNbinsPhiSub0) {
663 Int_t phiBin = 1+(
Int_t)(TMath::Floor(dPhi*iNbinsPhiSub0/TMath::TwoPi()));
665 dPhi = phiWeightsSub0->GetBinCenter(phiBin);
666 dWphi = phiWeightsSub0->GetBinContent(phiBin);
671 if(phiWeightsSub1 && iNbinsPhiSub1) {
672 Int_t phiBin = 1+(
Int_t)(TMath::Floor(dPhi*iNbinsPhiSub1/TMath::TwoPi()));
674 dPhi = phiWeightsSub1->GetBinCenter(phiBin);
675 dWphi = phiWeightsSub1->GetBinContent(phiBin);
680 if(ptWeights && dBinWidthPt)
682 dWpt=ptWeights->GetBinContent(1+(
Int_t)(TMath::Floor((dPt-dPtMin)/dBinWidthPt)));
686 if(etaWeights && dBinWidthEta)
688 dWeta=etaWeights->GetBinContent(1+(
Int_t)(TMath::Floor((dEta-dEtaMin)/dBinWidthEta)));
692 dQX += dWeight*dWphi*dWpt*dWeta*TMath::Cos(iOrder*dPhi);
693 dQY += dWeight*dWphi*dWpt*dWeta*TMath::Sin(iOrder*dPhi);
696 sumOfWeights+=dWeight*dWphi*dWpt*dWeta;
701 Qarray[s].Set(dQX,dQY);
702 Qarray[s].
SetMult(sumOfWeights);
753 printf(
"Class.Print Name = %s, #tracks= %d, Number of RPs= %d, Number of POIs = %d, MC EventPlaneAngle= %f\n",
757 if (!optionstr.Contains(
"all"))
return;
764 printf(
"Empty track collection \n");
800 fTrackCollection(NULL),
801 fReferenceMultiplicity(0),
803 fUseGlauberMCSymmetryPlanes(kFALSE),
804 fUseExternalSymmetryPlanes(kFALSE),
813 fMCReactionPlaneAngle(0.),
814 fMCReactionPlaneAngleIsSet(kFALSE),
815 fAfterBurnerPrecision(0.001),
816 fUserModified(kFALSE),
817 fNumberOfTracksWrap(NULL),
818 fNumberOfRPsWrap(NULL),
819 fNumberOfPOIsWrap(NULL),
820 fMCReactionPlaneAngleWrap(NULL),
821 fShuffledIndexes(NULL),
822 fShuffleTracks(kFALSE),
831 fNumberOfPOItypes(2),
832 fNumberOfPOIs(new
Int_t[fNumberOfPOItypes])
837 Int_t numberOfInputTracks = inputTree->GetEntries() ;
840 TParticle* pParticle =
new TParticle();
841 inputTree->SetBranchAddress(
"Particles",&pParticle);
843 for (
Int_t i=0; i<numberOfInputTracks; i++)
845 inputTree->GetEntry(i);
847 if (!pParticle)
continue;
848 if (!pParticle->IsPrimary())
continue;
861 pTrack->
TagRP(kTRUE);
868 pTrack->
Tag(poiType);
870 printf(
"fNumberOfPOIs[%i] = %i",poiType,
fNumberOfPOIs[poiType]);
880 for(
Int_t i(0); i < 3; i++) {
892 for (
Int_t i=0; i<n; i++)
894 for (
Int_t itrack=0; itrack<ntracks; itrack++)
897 if (!track)
continue;
926 if (!track)
continue;
941 if (!track)
continue;
1042 if (track) track->
AddFlow(v1,v2,v3,v4,v5,rp1,rp2,rp3,rp4,rp5,
fAfterBurnerPrecision);
1066 if (!track)
continue;
1080 if (!track)
continue;
1094 if (!track)
continue;
1116 if (!track)
continue;
1127 track->
Tag(poiType,pass);
1151 if (eta>etaMin && eta<etaMax && phi>phiMin && phi<phiMax)
1172 if (!track)
continue;
1173 if (track->
IsDead()) {
delete track;track=NULL;ncleaned++;}
1176 fNumberOfTracks-=ncleaned;
1185 return new TF1(
"StandardPtDepV2",
"((x<1.0)*(0.05/1.0)*x+(x>=1.0)*0.05)");
1192 return new TF2 (
"f",
"((x<1)*.1*x+(x>=1)*.1)*(1-0.2*TMath::Abs(y))");
1199 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 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)
ClassImp(AliFlowEventSimple) AliFlowEventSimple
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
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)