]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGCF/Correlations/DPhi/AliLeadingV0Correlation.h
TriggerPID: Updates from Debojit
[u/mrichter/AliRoot.git] / PWGCF / Correlations / DPhi / AliLeadingV0Correlation.h
1 /* Leading Charged Track+V0 Correlation.(Works for Real,Monte Carlo Data)
2  *                            Sandun Jayarathna
3  *                          University of Houston
4  *                      sandun.pahula.hewage@cern.ch
5  *****************************************************************************************/
6
7 #ifndef SANDUNQAH
8 #define SANDUNQAH
9
10 #include "AliAnalysisTask.h"
11 #include "TString.h"
12 #include "AliVParticle.h"
13 #include "AliLog.h"
14 #include "AliPID.h"
15 #include "THnSparse.h"
16 #include "TH1.h"
17
18 class TList;
19 class AliAODEvent;
20 class AliEventPoolManager;
21 class AliVParticle;
22 class AliPIDResponse;
23 class AliPID;
24 class AliAODv0;
25 class AliAnalyseLeadingTrackUE;
26
27
28 #ifndef ALIANALYSISTASKSEH
29 #include "AliAnalysisTaskSE.h"
30 #endif
31
32 //---------------------------------------------------------------------------------------
33 class AliLeadingV0Correlation : public AliAnalysisTaskSE {
34 public:
35    AliLeadingV0Correlation();
36    AliLeadingV0Correlation(const char *name);
37    virtual ~AliLeadingV0Correlation();
38
39    virtual void     UserCreateOutputObjects();
40    virtual void     UserExec(Option_t *option);
41    virtual void     Terminate(Option_t *);
42         
43         void SetMaxNEventsInPool(Int_t events){fPoolMaxNEvents=events;}
44         void SetMinNTracksInPool(Int_t tracks){fPoolMinNTracks=tracks;}
45         void SetMinEventsToMix(Int_t events){fMinEventsToMix=events;}
46
47         void SetPoolPVzBinLimits(Int_t Nzvtxbins,const Double_t *ZvtxBins){
48                 fNzVtxBins = Nzvtxbins;
49                 for(int ix = 0;ix<fNzVtxBins+1;ix++){fZvtxBins[ix] = ZvtxBins[ix];}
50         }
51         
52         void SetPoolCentBinLimits(Int_t Ncentbins,const Double_t *CentBins){
53                 fNCentBins = Ncentbins;
54                 for(int ix = 0;ix<fNCentBins+1;ix++){fCentBins[ix] = CentBins[ix];}
55         }
56         
57         void SetCollidingSystem(TString system){fcollidingSys = system;}
58         void SetPrimeryVertexCut(Double_t pvzcut){fpvzcut = pvzcut;}
59         void SetFilterBit(UInt_t  filterBit){fFilterBit = filterBit;}
60         void SetMCAnalysis(Bool_t aAnalysisMC){fAnalysisMC=aAnalysisMC;}
61         void SetCase(Int_t aCase){fCase=aCase;}
62         void SetRemoveAutoCorr(Bool_t aRemoveAutoCorr){fRemoveAutoCorr=aRemoveAutoCorr;}
63         void SetCutRap(Double_t aRapidityCut){fRapidityCut=aRapidityCut;}
64         void SetV0Radius(Double_t aV0radius){fV0radius=aV0radius;}
65         void SetV0PostoPVz(Double_t aV0PostoPVz){fV0PostoPVz=aV0PostoPVz;}
66         void SetV0NegtoPVz(Double_t aV0NegtoPVz){fV0NegtoPVz=aV0NegtoPVz;}
67         void SetDCAV0Daughters(Double_t aDCAV0Daughters){fDCAV0Daughters=aDCAV0Daughters;}
68         void SetCPAK0(Double_t aCPAK0){fCPAK0=aCPAK0;}
69         void SetCPALam(Double_t aCPALam){fCPALam=aCPALam;}
70         void SetRejectLamK0(Double_t aRejectLamK0){fRejectLamK0=aRejectLamK0;}
71         void SetRejectK0Lam(Double_t aRejectK0Lam){fRejectK0Lam=aRejectK0Lam;}
72         void SetSigmaPID(Double_t aSigmaPID){fSigmaPID=aSigmaPID;}
73         void SetCTK0(Double_t aCutCTK0){fCutCTK0=aCutCTK0;}
74         void SetCTLa(Double_t aCutCTLa){fCutCTLa=aCutCTLa;}
75         void SetMassCutK0(Double_t aMassCutK0){fMassCutK0=aMassCutK0;}
76         void SetMassCutLa(Double_t aMassCutLambda){fMassCutLa=aMassCutLambda;}
77         void SetTrigLow(Double_t aTriglow){fTriglow=aTriglow;}
78         void SetTrigHigh(Double_t aTrighigh){fTrighigh=aTrighigh;}
79         
80 private:
81         AliLeadingV0Correlation(const  AliLeadingV0Correlation &det);
82     AliLeadingV0Correlation&   operator=(const  AliLeadingV0Correlation &det);
83         
84         Bool_t IsAcseptedDaughterTrack(const AliAODTrack *itrack);
85         Bool_t IsAcseptedV0(const AliAODv0* aodV0, const AliAODTrack* myTrackPos, const AliAODTrack* myTrackNeg);
86         Bool_t IsAcseptedK0(Double_t v0rad,
87                                                 Double_t dcaptp,
88                                                 Double_t dcantp,
89                                                 Double_t dcav0d,
90                                                 Double_t cpa,
91                                                 Double_t massLa,
92                                                 Double_t massALa);
93         Bool_t IsAcseptedLA(Double_t v0rad,
94                                                 Double_t dcaptp,
95                                                 Double_t dcantp,
96                                                 Double_t dcav0d,
97                                                 Double_t cpa,
98                                                 Double_t massK0);
99         Bool_t IsK0InvMass(const Double_t mass)const;
100         Bool_t IsLambdaInvMass(const Double_t mass) const;
101         Double_t RangePhi(Double_t DPhi);
102         Bool_t IsTrackFromV0(AliAODTrack* track);
103         void FillCorrelationSibling(Double_t MultipOrCent,
104                                                                 TObjArray*triggerArray,TObjArray*selectedV0Array,
105                                                                 THnSparse*triggerHist,THnSparse*associateHist);
106         void FillCorrelationMixing(Double_t MultipOrCentMix,Double_t pvxMix,
107                                                            Double_t poolmax,Double_t poolmin,
108                                                            TObjArray*triggerArray,TObjArray*selectedV0Array,
109                                                            THnSparse*triggerHist,THnSparse*associateHist);
110         Bool_t IsFeedDownV0(UInt_t lIdxPosV0,
111                                   UInt_t lIdxNegV0,
112                                   Double_t lInvMassXiMinus,
113                                   Double_t lInvMassXiPlus,
114                                   TH1F*HistXiMinus);
115         
116         AliAODEvent              * fAODEvent;        //  AOD Event
117         AliEventPoolManager      * fPoolMgr;         //  event pool manager for Event Mixing
118         AliPIDResponse           * fPIDResponse;     //  PID response
119         AliAnalyseLeadingTrackUE * fAnalyseUE;       //  Leading Track Underling Event
120         
121         Int_t fPoolMaxNEvents;                       // set maximum number of events in the pool
122         Int_t fPoolMinNTracks;                       // set minimum number of tracks in the pool
123         Int_t fMinEventsToMix;                       // set the minimum number of events want to mix
124         Int_t fNzVtxBins;                            // number of z vrtx bins
125         Double_t fZvtxBins[100];                     // [fNzVtxBinsDim]
126         Int_t fNCentBins;                            // number of centrality bins
127         Double_t fCentBins[100];                     // [fNCentBinsDim]
128         
129         TString         fcollidingSys;               // "PP" or "PbPb"
130         Double_t        fpvzcut;                     // PVz cut of event
131     Double_t            fTrackEtaCut;                // Eta cut on particles
132     UInt_t              fFilterBit;                  // Select tracks from an specific track cut (default 0xFF all track selected)
133         Bool_t          fAnalysisMC;                 // MC or Not
134         Int_t           fCase;                       // Case number
135         Bool_t          fRemoveAutoCorr;             // 1Remove or 0 Not Remove
136         
137         Double_t        fRapidityCut;                // Rapidity cut V0
138         Double_t        fV0radius;                   // Topological selection for systamatics
139         Double_t        fV0PostoPVz;                 // Topological selection for systamatics
140         Double_t        fV0NegtoPVz;                 // Topological selection for systamatics
141         Double_t        fDCAV0Daughters;             // Topological selection for systamatics
142         Double_t        fCPAK0;                      // Topological selection for systamatics
143         Double_t        fCPALam;                     // Topological selection for systamatics
144         Double_t        fRejectLamK0;                // selection for systamatics
145         Double_t        fRejectK0Lam;                // selection for systamatics
146         Double_t        fSigmaPID;                   // selection for systamatics
147         Double_t        fCutCTK0;                    // selection for systamatics
148         Double_t        fCutCTLa;                    // selection for systamatics
149         
150         Double_t        fMassCutK0;                  // selection for systamatics
151         Double_t        fMassCutLa;                  // selection for systamatics
152         Double_t        fTriglow;                  // selection for systamatics
153         Double_t        fTrighigh;// selection for systamatics
154         
155         Bool_t          fUseChargeHadrons;           // Only pi,k,and proton
156         Double_t        fPtMin;                      // 0.15 
157         
158         
159         TList       * fOutputList;                   // Output list
160         
161         TH1F        *fHist_Mult_B4_Trg_Sel;                                             //! multiplicity distribution
162         TH1F        *fHist_Mult_Af_Trg_Sel;                                             //! multiplicity distribution
163         TH1F        *fHist_Mult_PVz_Cut;                                                //! multiplicity distribution
164         TH1F        *fHist_Mult_SPD_PVz;
165         TH1F        *fHist_Mult_SPD_PVz_Pileup;
166         
167         TH1F       *fHistPVx;                                                                   //! multiplicity distribution
168         TH1F       *fHistPVy;                                                                   //! multiplicity distribution
169         TH1F       *fHistPVz;                                                                   //! multiplicity distribution
170         TH1F       *fHistPVxAnalysis;
171         TH1F       *fHistPVyAnalysis;
172         TH1F       *fHistPVzAnalysis;
173         
174         THnSparse   *fHistEventViceGen;
175         THnSparse   *fHistEventViceReconst;
176         THnSparse       *fHistMCGenK0;
177         THnSparse       *fHistMCGenLAM;
178         THnSparse       *fHistMCGenALAM;
179         THnSparse       *fHistReconstK0;
180         THnSparse       *fHistReconstLA;
181         THnSparse       *fHistReconstALA;
182         THnSparse       *fHistMCAssoK0;
183         THnSparse       *fHistMCAssoLA;
184         THnSparse       *fHistMCAssoALA;
185         
186         THnSparse   *fHistReconstSib;
187         THnSparse   *fHistReconstMix;
188         THnSparse   *fHistTriggerSib;
189         THnSparse   *fHistTriggerMix;
190
191         ClassDef(AliLeadingV0Correlation, 1); 
192 };
193 //---------------------------------------------------------------------------------------
194 class V0Correlationparticle : public AliVParticle
195 {
196 public:
197     V0Correlationparticle(Float_t eta, 
198                                                         Float_t phi, 
199                                                         Float_t pt, 
200                                                         Short_t candidate):
201           fEta(eta), 
202           fPhi(phi), 
203           fpT(pt), 
204           fCandidate(candidate)
205     {
206     }
207     virtual ~V0Correlationparticle(){}
208         
209     virtual Double_t Px()                 const { AliFatal("Not implemented"); return 0;}
210     virtual Double_t Py()                 const { AliFatal("Not implemented"); return 0;}
211     virtual Double_t Pz()                 const { AliFatal("Not implemented"); return 0;}
212     virtual Double_t Pt()                 const { return fpT;}
213     virtual Double_t P()                  const { AliFatal("Not implemented"); return 0;}
214     virtual Bool_t   PxPyPz(Double_t[3])  const { AliFatal("Not implemented"); return 0;}
215     virtual Double_t Xv()                 const { AliFatal("Not implemented"); return 0;}
216     virtual Double_t Yv()                 const { AliFatal("Not implemented"); return 0;}
217     virtual Double_t Zv()                 const { AliFatal("Not implemented"); return 0;}
218     virtual Bool_t   XvYvZv(Double_t[3])  const { AliFatal("Not implemented"); return 0;}
219     virtual Double_t OneOverPt()          const { AliFatal("Not implemented"); return 0;}
220     virtual Double_t Phi()                const { return fPhi;}
221     virtual Double_t Theta()              const { AliFatal("Not implemented"); return 0;}
222     virtual Double_t E()                  const { AliFatal("Not implemented"); return 0;}
223     virtual Double_t M()                  const { AliFatal("Not implemented"); return 0;}
224     virtual Double_t Eta()                const { return fEta;}
225     virtual Double_t Y()                  const { AliFatal("Not implemented"); return 0;}
226     virtual Short_t  Charge()             const { AliFatal("Not implemented"); return 0;}
227     virtual Int_t    GetLabel()           const { AliFatal("Not implemented"); return 0;}
228     virtual Int_t    PdgCode()            const { AliFatal("Not implemented"); return 0;}
229     virtual const    Double_t *PID()      const { AliFatal("Not implemented"); return 0;}
230     virtual Short_t  WhichCandidate()     const { return fCandidate;}
231
232         
233 private:
234     Float_t  fEta;            // Eta
235     Float_t  fPhi;            // Phi
236     Float_t  fpT;             // pT
237     Short_t  fCandidate;      // 1-K0,2-Lam,3-Alam
238         
239         
240     ClassDef( V0Correlationparticle, 1);
241 };
242
243 #endif