1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. */
2 /* See cxx source for full Copyright notice */
5 // AliAnalysisTwoParticleResonanceFlowTask:
6 // origin: Redmer Alexander Bertens (rbertens@nikhef.nl)
7 // analyis task for Resonance-meson reconstruction and estimation of v_n
9 #ifndef ALIANALYSISTWOPARTICLERESONANCEFLOWTASK_H
10 #define ALIANALYSISTWOPARTICLERESONANCEFLOWTASK_H
15 class AliFlowTrackCuts;
17 class AliFlowTrackSimple;
18 class AliFlowEventSimple;
20 class AliFlowCandidateTrack;
21 class AliFlowBayesianPID;
22 class AliEventPoolManager;
23 class AliResonanceFlowHelperTrack;
25 #include "AliAnalysisTaskSE.h"
26 class AliResonanceFlowHelperTrack : public TObject
29 AliResonanceFlowHelperTrack(Double_t eta, Double_t phi, Double_t p, Double_t px, Double_t py, Double_t pz, Double_t pt, Int_t charge, Double_t mass, Int_t id, Int_t species) : fEta(eta), fPhi(phi), fp(p), fpX(px), fpY(py), fpZ(pz), fpT(pt), fCharge(charge), fMass(mass), fID(id), fSpecies(species) { }
30 ~AliResonanceFlowHelperTrack() {}
31 virtual Double_t P() const { return fp; }
32 virtual Double_t Px() const { return fpX; }
33 virtual Double_t Py() const { return fpY; }
34 virtual Double_t Pz() const { return fpZ; }
35 virtual Double_t Pt() const { return fpT; }
36 virtual Double_t Phi() const { return fPhi; }
37 virtual Double_t Eta() const { return fEta; }
38 virtual Int_t Charge() const { return fCharge; }
39 virtual Double_t Mass() const { return fMass; }
40 virtual Short_t ID() const { return fID; }
41 virtual Int_t Species() const { return fSpecies; }
42 void InitializeHelperTrack(Double_t eta, Double_t phi, Double_t p, Double_t px, Double_t py, Double_t pz, Double_t pt, Int_t charge, Double_t mass, Int_t id, Int_t species) { fEta = eta; fPhi = phi; fp = p; fpX = px; fpY = py; fpZ = pz; fpT = pt; fCharge = charge; fMass = mass; fID = id; fSpecies = species; }
51 Int_t fCharge; // charge
52 Double_t fMass; // mass
54 Int_t fSpecies; // species
55 ClassDef(AliResonanceFlowHelperTrack, 1); // lightweight helper track for phi reconstruction
58 class AliAnalysisTwoParticleResonanceFlowTask : public AliAnalysisTaskSE
61 AliAnalysisTwoParticleResonanceFlowTask();
62 AliAnalysisTwoParticleResonanceFlowTask(const char *name);
63 virtual ~AliAnalysisTwoParticleResonanceFlowTask();
64 // technical aspects of the analysis
65 void ForceExit(Int_t type, const char* message);
66 Bool_t SetIsMC(Bool_t ismc) {fIsMC = ismc; return fIsMC; }
68 Bool_t UseEventMixing(Bool_t mix) { fEventMixing = mix; return mix; }
69 Bool_t UsePhiMinusPsiMethod(Bool_t p) {fPhiMinusPsiMethod = p; return p;}
70 Bool_t SetVZEROSubEvents(Bool_t v0) { fV0 = v0; return v0; }
71 // configure the output of the analysis
72 TH1F* BookHistogram(const char * name);
73 TH2F* BookPIDHistogram(const char * name, Bool_t TPC);
74 TH1F* InitPtSpectraHistograms(Float_t nmin, Float_t nmax);
75 TH1F* BookPtHistogram(const char* name);
76 Bool_t InitializeAnalysis();
77 void AddResonanceIdentificationOutputObjects();
78 virtual void UserCreateOutputObjects();
80 void SetPtBins(Float_t bin[19], Int_t n) { for(Int_t i = 0; i < n+1; i++) fPtBins[i] = bin[i]; fNPtBins = n; }
81 void SetdPhiBins(Float_t bin[19], Int_t n) { for(Int_t i = 0; i < n+1; i++) fdPhiBins[i] = bin[i]; fNdPhiBins = n;}
82 void SetCentralityParameters(Float_t CentralityMin, Float_t CentralityMax, const char* CentralityMethod) {
83 fCentralityMin = CentralityMin;
84 fCentralityMax = CentralityMax;
85 fkCentralityMethod = CentralityMethod; }
86 void SetPOICuts(AliFlowTrackCuts *cutsPOI) { fPOICuts = cutsPOI; }
87 void SetRPCuts(AliFlowTrackCuts *cutsRP) { fCutsRP = cutsRP; }
88 void SetPIDConfiguration(Float_t prob[7]) { for(Int_t i = 0; i < 7; i++) fPIDConfig[i] = prob[i]; }
89 Bool_t SetQA(Bool_t qa) {fQA = qa; return fQA;}
90 void SetAddTaskMacroSummary(Float_t m[12]) {for(Int_t i(0); i < 12; i++) fAddTaskMacroSummary[i] = m[i];}
91 void SetPOIDCAXYZ(Float_t dca[5]) { for(Int_t i = 0; i < 5; i++) fDCAConfig[i] = dca[i]; }
92 void SetMixingParameters(Int_t p[3]) { for(Int_t i = 0; i < 3; i++) fMixingParameters[i] = p[i]; }
93 void SetPermissiveMixing(Bool_t p) { fPermissiveMixing = p; }
94 void SetupSpeciesA(Int_t species, Int_t charge, Float_t mass, Float_t minPtA, Float_t maxPtA) {fSpeciesA = species; fChargeA = charge; fMassA = mass; fMinPtA = minPtA; fMaxPtA = maxPtA;}
95 void SetupSpeciesB(Int_t species, Int_t charge, Float_t mass, Float_t minPtB, Float_t maxPtB) {fSpeciesB = species; fChargeB = charge; fMassB = mass; fMinPtB = minPtB; fMaxPtB = maxPtB;}
96 void SetCandidateEtaAndPt(Float_t mineta, Float_t maxeta, Float_t minpt, Float_t maxpt) { fCandidateMinEta = mineta;
97 fCandidateMaxEta = maxeta;
98 fCandidateMinPt = minpt;
99 fCandidateMaxPt = maxpt;
100 fCandidateEtaPtCut = kTRUE;}
101 void SetCommonConstants(Int_t massBins, Float_t minMass, Float_t maxMass) { fMassBins = massBins;
103 fMaxMass = maxMass; }
104 void SetVertexZ(Float_t z) { fVertexRange = z; }
105 void SetMaxDeltaDipAngleAndPt(Float_t a, Float_t pt) { fDeltaDipAngle = a;
107 fApplyDeltaDipCut = kTRUE; };
108 void SetMixingBins(Int_t c[20], Int_t v[20]) {for(Int_t i = 0; i < 20; i++) { fCentralityMixingBins[i] = c[i];
109 fVertexMixingBins[i] = v[i]; } }
111 void GetMixingParameters(Int_t p[3]) const { for(Int_t i = 0; i < 3; i++) p[i] = fMixingParameters[i]; }
112 Float_t GetCenMin() const {return fCentralityMin; }
113 Float_t GetCenMax() const {return fCentralityMax; }
114 const char* GetCentralityMethod() const {return fkCentralityMethod; }
115 Float_t GetVertexZ() const { return fVertexRange; }
116 Float_t GetDeltaDipAngle() const {return fDeltaDipAngle; }
117 Float_t GetDeltaDipPt() const {return fDeltaDipPt; }
118 void GetPIDConfiguration(Float_t prob[7]) const {for(Int_t i = 0; i < 7; i++) prob[i] = fPIDConfig[i]; }
119 void GetPOIDCZXYZ(Float_t dca[5]) const { for(Int_t i = 0; i < 5; i++) dca[i] = fDCAConfig[i]; }
120 void GetCandidateEtaAndPt(Float_t etapt[4]) const { etapt[0] = fCandidateMinEta;
121 etapt[1] = fCandidateMaxEta;
122 etapt[2] = fCandidateMinPt;
123 etapt[3] = fCandidateMaxPt; }
124 AliFlowEvent* GetFlowEvent() const {return fFlowEvent;}
125 // the analysis itself
126 AliEventPoolManager* InitializeEventMixing();
127 template <typename T> Float_t InvariantMass(const T* track1, const T* track2) const;
128 template <typename T> Float_t DeltaDipAngle(const T* track1, const T* track2) const;
129 template <typename T> Bool_t CheckDeltaDipAngle(const T* track1, const T* track2) const;
130 template <typename T> Bool_t CheckCandidateEtaPtCut(const T* track1, const T* track2) const;
131 template <typename T> Bool_t EventCut(T* event);
132 template <typename T> void PlotMultiplcities(const T* event) const;
133 template <typename T> Bool_t CheckVertex(const T* event);
134 template <typename T> Bool_t CheckCentrality(T* event);
135 void InitializeBayesianPID(AliAODEvent* event);
136 template <typename T> Bool_t PassesTPCbayesianCut(T* track, Int_t species) const;
137 Bool_t PassesDCACut(AliAODTrack* track) const;
138 Bool_t DoOwnPID(AliAODTrack* track, Int_t species) const;
139 Bool_t AcceptTrack(AliAODTrack* track, Int_t species) const;
140 template <typename T> Float_t PairPt(const T* track_1, const T* track_2, Bool_t phi = kFALSE) const;
141 template <typename T> Float_t PtSelector(Int_t _track_type, const T* track_1, const T* track_2, Float_t mass) const;
142 template <typename T> Bool_t QualityCheck(T* track) const;
143 void TrackQA(AliAODTrack* track, Int_t species, Bool_t allChargedParticles) const;
144 template <typename T> void SetNullCuts(T* esd);
145 void PrepareFlowEvent(Int_t iMulti);
146 void PhiMinusPsiMethod(TObjArray* MixingCandidates);
147 void PhiMinusPsiMethodWriteData(Bool_t signal, TObjArray* SpeciesA, TObjArray* SpeciesB, Float_t* abcPsi2);
148 void VZEROSubEventAnalysis();
149 void DoAnalysisOnTheFly(AliFlowEventSimple* event);
150 void DoAnalysisOnTheFly(TObjArray* MixingCandidates, TObjArray* SpeciesA, TObjArray* ocSpeciesA, TObjArray* SpeciesB, TObjArray* ocSpeciesB);
151 void DoAnalysisOnTheFly(TDirectoryFile* outputFile);
152 virtual void UserExec(Option_t *option);
153 void ResonanceSignal(TObjArray* SpeciesA, TObjArray* SpeciesB) const;
154 void ResonanceBackground(TObjArray* SpeciesA, TObjArray* SpeciesB, Bool_t checkAutoCorrelations = kTRUE) const;
155 void ReconstructionWithEventMixing(TObjArray* MixingCandidates) const;
156 virtual void Terminate(Option_t *);
160 Int_t fSpeciesA; // particle species a
161 Int_t fSpeciesB; // species b
162 Int_t fChargeA; // charge for species a
163 Int_t fChargeB; // charge for species b
164 Float_t fMassA; // mass for species a
165 Float_t fMassB; // mass for species b
166 Float_t fMinPtA; // min pt for species a
167 Float_t fMaxPtA; // max pt for species a
168 Float_t fMinPtB; // min pt for species b
169 Float_t fMaxPtB; // max pt for species b
170 Bool_t fIsMC; // use mc mode
171 Bool_t fEventMixing; // use event mixing
172 Bool_t fPhiMinusPsiMethod; // use phi minus psi method (default is invariant mass fit method)
173 Bool_t fQA; // make qa plots
174 Bool_t fV0; // use three subevents including vzero
175 Int_t fMassBins; // mass bins
176 Float_t fMinMass; // mass range
177 Float_t fMaxMass; // mass range
178 AliFlowTrackCuts *fCutsRP; // track cuts for reference particles
179 AliFlowTrackCuts *fNullCuts; // dummy cuts for flow event tracks
180 AliPIDResponse *fPIDResponse; //! pid response object
181 AliFlowEvent *fFlowEvent; //! flow events (one for each inv mass band)
182 AliFlowBayesianPID *fBayesianResponse; //!PID response object
183 TObjArray *fCandidates; // candidate array
184 Bool_t fCandidateEtaPtCut; // set eta and pt cut for candidate tracks and combinatorial background
185 Float_t fCandidateMinEta; // minimum eta for candidates
186 Float_t fCandidateMaxEta; // maximum eta for candidates
187 Float_t fCandidateMinPt; // minimum pt for candidates
188 Float_t fCandidateMaxPt; // maximum pt for candidates
189 Float_t fPIDConfig[7]; // configure pid routine
190 Float_t fDCAConfig[5]; // configure dca routine
191 Int_t fMixingParameters[3]; // mixing: poolsize, mixing tracks, pool buffer
192 Bool_t fPermissiveMixing; // skip event when pool manager fails - use with caution
193 Int_t fCentralityMixingBins[20]; // configure centrality bins for event mixing
194 Int_t fVertexMixingBins[20]; // configure vertex bins for event mixing
195 Float_t fPtBins[19]; // pt bin borders
196 Float_t fdPhiBins[19]; // dPhi bin borders
197 Int_t fNPtBins; // no of pt bins + 1
198 Int_t fNdPhiBins; // no of dphi bins + 1
199 Float_t fCentrality; // event centrality
200 Float_t fVertex; // event vertex z
201 AliAODEvent *fAOD; //! AOD oject
202 AliEventPoolManager *fPoolManager; //! event pool manager
203 TList *fOutputList; // ! Output list
204 TH1F *fEventStats; // ! Histogram for event statistics
205 TH1F *fCentralityPass; // ! QA histogram of events that pass centrality cut
206 TH1F *fCentralityNoPass; //! QA histogram of events that do not pass centrality cut
207 TH2F *fNOPID;//! QA histogram of TPC response of all charged particles
208 TH2F *fPIDk;//! QA histogram of TPC response of kaons
209 TH2F *fPIDp; //! QA histogram of TPC response of pions
210 TH1F *fResonanceSignal[18]; //! signal histograms
211 TH1F *fResonanceBackground[18]; //! like-sign kaon pairs
212 TH1F *fPtSpectra[18]; //! pt spectra
213 TH1F *fPtP; //! QA histogram of p_t distribution of positive particles
214 TH1F *fPtN; //! QA histogram of p_t distribution of negative particles
215 TH1F *fPtSpeciesA; //! QA histogram of p_t distribution of species A
216 TH1F *fPtSpeciesB; //! QA histogram of p_t distribution of species B
217 Float_t fCentralityMin; // lower bound of cenrality bin
218 Float_t fCentralityMax; // upper bound of centrality bin
219 const char *fkCentralityMethod; // method used to determine centrality (V0 by default)
220 AliFlowTrackCuts *fPOICuts; // cuts for particles of interest (flow package)
221 Float_t fVertexRange; // absolute value of maximum distance of vertex along the z-axis
222 TH1F *fPhi; //! QA plot of azimuthal distribution of POI daughters
223 TH1F *fEta; //! QA plot of eta distribution of POI daughters
224 TH1F *fVZEROA; //! QA plot vzeroa multiplicity (all tracks in event)
225 TH1F *fVZEROC; //! QA plot vzeroc multiplicity (all tracks in event)
226 TH1F *fTPCM; //! QA plot TPC multiplicity (tracks used for event plane estimation)
227 Float_t fDeltaDipAngle; // absolute value of delta dip angle to be excluded
228 Float_t fDeltaDipPt; // upper value of pt range in which delta dip angle must be applied
229 Bool_t fApplyDeltaDipCut; // enforce delta dip cut
230 TH2F *fDCAAll;//! qa dca of all charged particles
231 TH1F *fDCAXYQA; //! qa plot of dca xz
232 TH1F *fDCAZQA; //!qa plot of dca z
233 TH2F *fDCAPrim; //!dca of primaries (mc) or kaons (data)
234 TH2F *fDCASecondaryWeak; //! dca of weak (mc)
235 TH2F *fDCAMaterial; //!dca material (mc) all (data)
236 TProfile *fSubEventDPhiv2; //! subevent resolution info for v2
237 TProfile *fV0Data[18][2]; //! profiles for vzero vn(minv)
238 TH1F *fPhiMinusPsiDataContainer[18][18][2]; //! histograms for phi minus psi results
239 TH1F *fPhiMinusPsiBackgroundContainer[18][18][2]; //! histograms for phi minus psi background
240 TH1F *fAnalysisSummary; //! plot analysis flags
241 Float_t fAddTaskMacroSummary[12]; // add task macro summary
243 AliAnalysisTwoParticleResonanceFlowTask(const AliAnalysisTwoParticleResonanceFlowTask&); // Not implemented
244 AliAnalysisTwoParticleResonanceFlowTask& operator=(const AliAnalysisTwoParticleResonanceFlowTask&); // Not implemented
245 void MakeTrack(Float_t, Float_t, Float_t, Float_t, Int_t , Int_t[]) const;
247 ClassDef(AliAnalysisTwoParticleResonanceFlowTask, 3);