AliPhysics  9b6b435 (9b6b435)
AliAnalysisTaskPhiFlow.h
Go to the documentation of this file.
1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. */
2 /* See cxx source for full Copyright notice */
3 /* $Id$ */
4 
5 // AliAnalysisTaskPhiFlow:
6 // origin: Redmer Alexander Bertens (rbertens@nikhef.nl)
7 // analyis task for phi-meson reconstruction and estimation of v_n
8 
9 #ifndef ALIANALYSISTASKPHIFLOW_H
10 #define ALIANALYSISTASKPHIFLOW_H
11 
12 class TH1F;
13 class TH2F;
14 class TProfile;
15 class AliESDEvent;
16 class AliESDtrackCuts;
17 class AliFlowTrackCuts;
18 class AliFlowEvent;
20 class AliFlowBayesianPID;
21 class AliEventPoolManager;
22 class AliPIDCombined;
23 class AliVVertex;
24 
25 #include "AliAnalysisTaskSE.h"
26 
28 {
29  public:
30  AliPhiMesonHelperTrack(Float_t eta, Float_t phi, Float_t p, Float_t px, Float_t py, Float_t pz, Float_t pt, Int_t charge) : fEta(eta), fPhi(phi), fp(p), fpX(px), fpY(py), fpZ(pz), fpT(pt), fCharge(charge) { }
32  virtual Double_t P() const { return fp; }
33  virtual Double_t Px() const { return fpX; }
34  virtual Double_t Py() const { return fpY; }
35  virtual Double_t Pz() const { return fpZ; }
36  virtual Double_t Pt() const { return fpT; }
37  virtual Double_t Phi() const { return fPhi; }
38  virtual Double_t Eta() const { return fEta; }
39  virtual Int_t Charge() const { return fCharge; }
40  void InitializeHelperTrack(Float_t eta, Float_t phi, Float_t p, Float_t px, Float_t py, Float_t pz, Float_t pt, Int_t charge) { fEta = eta; fPhi = phi; fp = p; fpX = px; fpY = py; fpZ = pz; fpT = pt; fCharge = charge; }
41  private:
42  Float_t fEta; // eta
43  Float_t fPhi; // phi
44  Float_t fp; // p
45  Float_t fpX; // pX
46  Float_t fpY; // pY
47  Float_t fpZ; // pZ
48  Float_t fpT; // pT
49  Int_t fCharge; // charge
50  ClassDef(AliPhiMesonHelperTrack, 1); // lightweight helper track for phi reconstruction
51 };
52 
54 {
55  public:
57  AliAnalysisTaskPhiFlow(const char *name);
58  virtual ~AliAnalysisTaskPhiFlow();
59  Int_t SetDebugLevelPhiTask(Int_t debug) {fDebug = debug; return fDebug; }
60  Bool_t SetIsMC(Bool_t ismc) {fIsMC = ismc; return fIsMC; }
61  Bool_t UseEventMixing(Bool_t mix, Bool_t type) {fEventMixing = mix; fTypeMixing = type; return mix; }
62  TH1F* BookHistogram(const char * name);
63  TH2F* BookPIDHistogram(const char * name, Bool_t TPC);
64  TH1F* InitPtSpectraHistograms(Float_t nmin, Float_t nmax);
65  TH1F* BookPtHistogram(const char* name);
66  void AddPhiIdentificationOutputObjects();
67  virtual void UserCreateOutputObjects();
68  AliEventPoolManager* InitializeEventMixing();
69  void SetPtBins(Float_t bin[19], Int_t n) { for(Int_t i = 0; i < n+1; i++) fPtBins[i] = bin[i]; fNPtBins = n; }
70  template <typename T> Double_t InvariantMass(const T* track1, const T* track2) const;
71  // template <typename T> Double_t DeltaDipAngle(const T* track1, const T* track2) const;
72  // template <typename T> Bool_t CheckDeltaDipAngle(const T* track1, const T* track2) const;
73  template <typename T> Bool_t CheckCandidateEtaPtCut(const T* track1, const T* track2) const;
74  void SetCentralityWeights(TH1* hist) {fHistCentralityWeights = hist;}
75  void SetCentralityParameters(Double_t min, Double_t max, const char* a, const char* b, Bool_t c, Bool_t d) {
76  fCentralityMin = min;
77  fCentralityMax = max;
78  fkCentralityMethodA = a;
79  fkCentralityMethodB = b;
80  fCentralityCut2010 = c;
81  fCentralityCut2011 = d;}
82  void SetCentralityEstimator(TString name) {fCentralityEstimator = name;}
83  void SetCurrentCentralityBin(Double_t c) {fCentrality = c; }
84  Double_t GetCenMin() const {return fCentralityMin; }
85  Double_t GetCenMax() const {return fCentralityMax; }
86  const char* GetCentralityMethod() const {return fkCentralityMethodA; }
87  void SetVertexZ(Float_t z) { fVertexRange = z; }
88  void SetHarmonic(Float_t h) {fHarmonic = h; }
89  Float_t GetVertexZ() const { return fVertexRange; }
90  // void SetMaxDeltaDipAngleAndPt(Float_t a, Float_t pt) { fDeltaDipAngle = a;
91  // fDeltaDipPt = pt;
92  // fApplyDeltaDipCut = kTRUE; };
93  // Float_t GetDeltaDipAngle() const {return fDeltaDipAngle; }
94  // Float_t GetDeltaDipPt() const {return fDeltaDipPt; }
95  template <typename T> Bool_t EventCut(T* event);
96  template <typename T> void PlotMultiplcities(const T* event) const;
97  template <typename T> Bool_t CheckVertex(const T* event);
98  template <typename T> Bool_t CheckCentrality(T* event);
99  void InitializeBayesianPID(AliAODEvent* event);
100  template <typename T> Bool_t PassesTPCbayesianCut(T* track) const;
101  Bool_t PassesDCACut(AliAODTrack* track) const;
102  Bool_t IsKaon(AliAODTrack* track) const;
103  template <typename T> Double_t PhiPt(const T* track_1, const T* track_2) const;
104  template <typename T> void PtSelector(Int_t _track_type, const T* track_1, const T* track_2) const;
105  template <typename T> Bool_t PhiTrack(T* track) const;
106  template <typename T> void SetNullCuts(T* esd);
107  void PrepareFlowEvent(Int_t iMulti);
108  virtual void UserExec(Option_t *option);
109  virtual void Exec(Option_t *);
110  void ReconstructionWithEventMixing(TObjArray* MixingCandidates) const;
111  virtual void Terminate(Option_t *);
112  void SetPOICuts(AliFlowTrackCuts *cutsPOI) { fPOICuts = cutsPOI; }
113  void SetRPCuts(AliFlowTrackCuts *cutsRP) { fCutsRP = cutsRP; }
114  AliFlowTrackCuts* GetPOICuts() const {return fPOICuts;}
115  AliFlowTrackCuts* GetRPCuts() const {return fCutsRP;}
116  void SetPIDConfiguration(Double_t prob[7]) { for(Int_t i = 0; i < 7; i++) fPIDConfig[i] = prob[i]; }
117  void GetPIDConfiguration(Double_t prob[7]) const {for(Int_t i = 0; i < 7; i++) prob[i] = fPIDConfig[i]; }
118  void SetPOIDCAXYZ(Double_t dca[5]) { for(Int_t i = 0; i < 5; i++) fDCAConfig[i] = dca[i]; }
119  void GetPOIDCZXYZ(Double_t dca[5]) const { for(Int_t i = 0; i < 5; i++) dca[i] = fDCAConfig[i]; }
120  void SetMixingBins(Int_t c[20], Int_t v[20]) {for(Int_t i = 0; i < 20; i++) { fCentralityMixingBins[i] = c[i];
121  fVertexMixingBins[i] = v[i]; } }
122  void SetMixingParameters(Int_t p[3]) { for(Int_t i = 0; i < 3; i++) fMixingParameters[i] = p[i]; }
123  void GetMixingParameters(Int_t p[3]) const { for(Int_t i = 0; i < 3; i++) p[i] = fMixingParameters[i]; }
124  void SetCandidateEtaAndPt(Double_t mineta, Double_t maxeta, Double_t minpt, Double_t maxpt) { fCandidateMinEta = mineta;
125  fCandidateMaxEta = maxeta;
126  fCandidateMinPt = minpt;
127  fCandidateMaxPt = maxpt;
128  fCandidateEtaPtCut = kTRUE;}
130  fCandidateMinY = min;
131  fCandidateMaxY = max;
132  fCandidateYCut = kTRUE;
133  }
134  void GetCandidateEtaAndPt(Double_t etapt[4]) const { etapt[0] = fCandidateMinEta;
135  etapt[1] = fCandidateMaxEta;
136  etapt[2] = fCandidateMinPt;
137  etapt[3] = fCandidateMaxPt; }
138  void SetCommonConstants(Int_t massBins, Double_t minMass, Double_t maxMass) { fMassBins = massBins;
139  fMinMass = minMass;
140  fMaxMass= maxMass; }
141  void IsMC();
142  Bool_t SetQA(Bool_t qa) {fQA = qa; return fQA;}
144  fSkipEventSelection = s;
145  fUsePidResponse = kTRUE; // bayesian pid object will require some event info
146  fCentrality = 5.;} // should be set by user, skipping event selection will also forego centrality selection
147  void SetUsePidResponse(Bool_t s) {fUsePidResponse = s;}
148  Double_t GetWDist(const AliVVertex* v0, const AliVVertex* v1);
149  Bool_t plpMV(const AliAODEvent* aod);
150  void SetRemovePileup(Bool_t p) {fPileUp = p;}
151  void SetMultESDTPCdif(Int_t m) {fMultESDTPCdif = m;}
152  Short_t FindMinNSigma(Double_t nSpi, Double_t nSk, Double_t nSp) const;
153  Bool_t GetDoubleCountingK(Double_t nSk, Short_t minNSigma) const;
154 
155  private:
156 
157  Int_t fDebug; // debug level (0 none, 1 fcn calls, 2 verbose)
158  Bool_t fIsMC; // use mc mode
159  Bool_t fEventMixing; // use event mixing
160  Bool_t fTypeMixing; // select type: kTRUE for unlike sign background, kFALSE for like sign background
161  Bool_t fQA; // make qa plots
162  Bool_t fV0; // use three subevents including vzero
163  Int_t fMassBins; // mass bins
164  Double_t fMinMass; // mass range
165  Double_t fMaxMass; // mass range
166  AliFlowTrackCuts *fCutsRP; // track cuts for reference particles
167  AliFlowTrackCuts *fNullCuts; // dummy cuts for flow event tracks
168  AliPIDResponse *fPIDResponse;
171  TObjArray *fCandidates; // candidate array
172  Bool_t fCandidateEtaPtCut; // set eta and pt cut for candidate tracks and combinatorial background
173  Double_t fCandidateMinEta; // minimum eta for candidates
174  Double_t fCandidateMaxEta; // maximum eta for candidates
175  Double_t fCandidateMinPt; // minimum pt for candidates
176  Double_t fCandidateMaxPt; // maximum pt for candidates
177  Bool_t fCandidateYCut; // y cut on candidates
178  Double_t fCandidateMinY; // min y value for candidate
179  Double_t fCandidateMaxY; // max y value for canddiates
180  Double_t fPIDConfig[7]; // configure pid routine
181  Double_t fDCAConfig[5]; // configure dca routine
182  Int_t fMixingParameters[3]; // mixing: poolsize, mixing tracks, pool buffer
183  Int_t fCentralityMixingBins[20]; // configure centrality bins for event mixing
184  Int_t fVertexMixingBins[20]; // configure vertex bins for event mixing
185  Float_t fPtBins[19]; // pt bin borders
186  Int_t fNPtBins; // no of pt bins + 1
187  Double_t fCentrality; // event centrality
188  Double_t fVertex; // event vertex z
190  AliEventPoolManager *fPoolManager;
191  TList *fOutputList; // ! Output list
192  TH1F *fEventStats; // ! Histogram for event statistics
193  TH1F *fCentralityPass; // ! QA histogram of events that pass centrality cut
199  TH1F *fInvMNP[18];
200  TH1F *fInvMNN[18];
201  TH1F *fInvMPP[18];
202  TH1F *fPtSpectra[18];
203  TH1F *fPtP;
204  TH1F *fPtN;
205  TH1F *fPtKP;
206  TH1F *fPtKN;
209  Double_t fCentralityMin; // lower bound of cenrality bin
210  Double_t fCentralityMax; // upper bound of centrality bin
211  const char *fkCentralityMethodA; // method used to determine centrality, default
212  const char *fkCentralityMethodB; // method used to determine centrality, fallback
213  Bool_t fCentralityCut2010; // cut away the multiplicity outliers 2010
214  Bool_t fCentralityCut2011; // cut away the multiplicity outliers 2011
215  TString fCentralityEstimator; // centrality estimator for mult selection framework
216  AliFlowTrackCuts *fPOICuts; // cuts for particles of interest (flow package)
217  Float_t fVertexRange; // absolute value of maximum distance of vertex along the z-axis
218  TH1F *fPhi;
219  TH1F *fPt;
220  TH1F *fEta;
221  TH1F *fVZEROA;
222  TH1F *fVZEROC;
223  TH1F *fTPCM;
224  // Float_t fDeltaDipAngle; // absolute value of delta dip angle to be excluded
225  // Float_t fDeltaDipPt; // upper value of pt range in which delta dip angle must be applied
226  // Bool_t fApplyDeltaDipCut; // enforce delta dip cut
228  TH1F *fDCAXYQA;
229  TH1F *fDCAZQA;
233  TProfile *fSubEventDPhiv2;
234  TProfile *fV0Data[18][2];
235  Bool_t fSkipEventSelection;// skip event selection and set bayesian pid object to MC mode
236  Bool_t fUsePidResponse;//use pid response instead of aliflowbayesianpid object for pid
237  AliPIDCombined* fPIDCombined; // pid combined
238  Bool_t fPileUp; // cut pile up
239  Int_t fMultESDTPCdif; // cut esd and barrel track divergence
240  TF1 *fLowCut;
241  TF1 *fHighCut;
246  TH1F *fVertexZ;
247  Float_t fHarmonic; // which harmonic to take
248 
249  AliAnalysisTaskPhiFlow(const AliAnalysisTaskPhiFlow&); // Not implemented
250  AliAnalysisTaskPhiFlow& operator=(const AliAnalysisTaskPhiFlow&); // Not implemented
251  void MakeTrack(Double_t, Double_t, Double_t, Double_t, Int_t , Int_t[], Double_t p = 0., Double_t pz = 0.) const;
252 
253  ClassDef(AliAnalysisTaskPhiFlow, 10);
254 };
255 
256 #endif
257 
258 
259 
Int_t charge
TH1F * fEta
QA plot of p_t sectrum of tracks used for event plane estimation.
virtual Double_t Pt() const
TH1F * fVZEROA
QA plot of eta distribution of tracks used for event plane estimation.
Double_t fCentralityMin
QA profile of centralty vs multiplicity.
double Double_t
Definition: External.C:58
Definition: External.C:236
TH2F * fDCAAll
QA plot TPC multiplicity (tracks used for event plane estimation)
void SetCentralityEstimator(TString name)
void SetCurrentCentralityBin(Double_t c)
AliFlowEvent * fFlowEvent
pid response object
TCanvas * c
Definition: TestFitELoss.C:172
TH2F * fPIDk
QA histogram of TPC response of all charged particles.
TH1F * fDCAXYQA
qa dca of all charged particles
TH2F * fDCASecondaryWeak
dca of primaries (mc) or kaons (data)
AliFlowTrackCuts * GetRPCuts() const
TH1F * fPtN
QA histogram of p_t distribution of positive particles.
void SetMixingParameters(Int_t p[3])
void SetPOICuts(AliFlowTrackCuts *cutsPOI)
TH2F * fNOPIDTOF
QA histogram of TPC response of kaons.
TList * fOutputList
event pool manager
UShort_t T(UShort_t m, UShort_t t)
Definition: RingBits.C:60
TH2F * fNOPID
QA histogram of events that do not pass centrality cut.
Bool_t fSkipEventSelection
profiles for vzero vn(minv)
void SetPOIDCAXYZ(Double_t dca[5])
void GetMixingParameters(Int_t p[3]) const
int Int_t
Definition: External.C:63
float Float_t
Definition: External.C:68
virtual Double_t Pz() const
void GetPIDConfiguration(Double_t prob[7]) const
virtual Double_t P() const
const char * GetCentralityMethod() const
AliPhiMesonHelperTrack(Float_t eta, Float_t phi, Float_t p, Float_t px, Float_t py, Float_t pz, Float_t pt, Int_t charge)
TH2F * fPIDTOF
QA histo of TOF repsonse charged particles.
Bool_t SetIsMC(Bool_t ismc)
virtual Double_t Eta() const
AliFlowBayesianPID * fBayesianResponse
flow events (one for each inv mass band)
TProfile * fSubEventDPhiv2
dca material (mc) all (data)
void InitializeHelperTrack(Float_t eta, Float_t phi, Float_t p, Float_t px, Float_t py, Float_t pz, Float_t pt, Int_t charge)
TH2F * fMultvsCentr
QA profile global and tpc multiplicity after outlier cut.
virtual Double_t Px() const
TH1F * fTPCM
QA plot vzeroc multiplicity (all tracks in event)
short Short_t
Definition: External.C:23
TH2F * fDCAPrim
qa plot of dca z
TObjArray * fCandidates
PID response object.
void SetRPCuts(AliFlowTrackCuts *cutsRP)
virtual Double_t Phi() const
void SetCentralityWeights(TH1 *hist)
Float_t fHarmonic
z vertex position
void SetCommonConstants(Int_t massBins, Double_t minMass, Double_t maxMass)
TH1F * fPtKN
QA histogram of p_t distribution of positive kaons.
void GetCandidateEtaAndPt(Double_t etapt[4]) const
Double_t minMass
TH1F * fDCAZQA
qa plot of dca xz
void SetCandidateEtaAndPt(Double_t mineta, Double_t maxeta, Double_t minpt, Double_t maxpt)
AliEventPoolManager * fPoolManager
AOD oject.
TH2F * fDCAMaterial
dca of weak (mc)
TH2F * fMultCorAfterCuts
QA histogram of p_t distribution of negative kaons.
virtual Int_t Charge() const
void SetCentralityParameters(Double_t min, Double_t max, const char *a, const char *b, Bool_t c, Bool_t d)
const char Option_t
Definition: External.C:48
Double_t maxMass
bool Bool_t
Definition: External.C:53
void SetPIDConfiguration(Double_t prob[7])
TH1F * fVZEROC
QA plot vzeroa multiplicity (all tracks in event)
void GetPOIDCZXYZ(Double_t dca[5]) const
TH1F * fPtKP
QA histogram of p_t distribution of negative particles.
void SetMixingBins(Int_t c[20], Int_t v[20])
Bool_t UseEventMixing(Bool_t mix, Bool_t type)
Definition: External.C:196
virtual Double_t Py() const
AliFlowTrackCuts * GetPOICuts() const
void SetCandidateMinMaxY(Double_t min, Double_t max)
TH1F * fPt
QA plot of azimuthal distribution of tracks used for event plane estimation.
Int_t SetDebugLevelPhiTask(Int_t debug)
void SetPtBins(Float_t bin[19], Int_t n)