81116b7a98c23865f74e4b1972f01dece91259a2
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / PiKaPr / TestAOD / AliAnalysisTaskV2AllChAOD.h
1 #ifndef ALIANALYSISTASKV2ALLCHAOD_H
2 #define ALIANALYSISTASKV2ALLCHAOD_H
3
4 /*  See cxx source for full Copyright notice */
5
6 //-------------------------------------------------------------------------
7 //                      AliAnalysisTaskV2AllChAOD
8 //
9 //
10 //
11 //
12 // Author: Leonardo Milano, CERN
13 //-------------------------------------------------------------------------
14
15 class AliAODEvent;
16 class AliSpectraAODTrackCuts;
17 class AliSpectraAODEventCuts;
18
19 #include "AliAnalysisTaskSE.h"
20 #include "TFile.h"
21 #include "TKey.h"
22 #include <TProfile.h>
23
24 class AliAnalysisTaskV2AllChAOD : public AliAnalysisTaskSE
25 {
26  public:
27   // constructors
28  AliAnalysisTaskV2AllChAOD() : AliAnalysisTaskSE(),
29     fAOD(0x0),
30     fTrackCuts(0x0),
31     fEventCuts(0x0),
32     fIsMC(0),
33     fCharge(0),
34     fVZEROside(0),
35     fOutput(0x0),
36     fOutput_lq(0x0),
37     fOutput_sq(0x0),
38     fnCentBins(20),
39     fnQvecBins(40),
40     fQvecUpperLim(100),
41     fCutLargeQperc(9.),
42     fCutSmallQperc(10.),
43     fEtaGapMin(-0.5),
44     fEtaGapMax(0.5),
45     fTrkBit(128),
46     fEtaCut(0.8),
47     fMinPt(0),
48     fMaxPt(20.0),
49     fMinTPCNcls(70),
50     fFillTHn(kTRUE),
51     fCentrality(0),
52     fQvector(0),
53     fQvector_lq(0),
54     fQvector_sq(0),
55     fResSP(0),
56     fResSP_vs_Cent(0),
57     f2partCumQA_vs_Cent(0),
58     f2partCumQB_vs_Cent(0),
59     fEta_vs_Phi_bef(0),
60     fEta_vs_PhiA(0),
61     fEta_vs_PhiB(0),
62     fResSP_lq(0),
63     fResSP_vs_Cent_lq(0),
64     f2partCumQA_vs_Cent_lq(0),
65     f2partCumQB_vs_Cent_lq(0),
66     fResSP_sq(0),
67     fResSP_vs_Cent_sq(0),
68     f2partCumQA_vs_Cent_sq(0),
69     f2partCumQB_vs_Cent_sq(0),
70     fResSP_inclusive(0),
71     fv2SPGap1A_inclusive_mb(0),
72     fv2SPGap1B_inclusive_mb(0),
73     fv2SPGap1A_inclusive_lq(0),
74     fv2SPGap1B_inclusive_lq(0),
75     fv2SPGap1A_inclusive_sq(0),
76     fv2SPGap1B_inclusive_sq(0),
77     fResSPmc_inclusive(0),
78     fv2SPGap1Amc_inclusive_mb(0),
79     fv2SPGap1Bmc_inclusive_mb(0),
80     fv2SPGap1Amc_inclusive_lq(0),
81     fv2SPGap1Bmc_inclusive_lq(0),
82     fv2SPGap1Amc_inclusive_sq(0),
83     fv2SPGap1Bmc_inclusive_sq(0),
84     fResGap1w(0),
85     fV2IntGap1w(0),
86     fIsRecoEff(0),
87     fRecoEffList(0),
88     fQvecGen(0),
89     fQgenType(0),
90     fnNchBins(400),
91         fDoCentrSystCentrality(0)
92       {}
93   AliAnalysisTaskV2AllChAOD(const char *name);
94   virtual ~AliAnalysisTaskV2AllChAOD() {
95     Printf("calling detructor of AliAnalysisTaskV2AllChAOD - To be implemented");
96   }
97   
98   void SetIsMC(Bool_t isMC = kFALSE)    {fIsMC = isMC; };
99   Bool_t GetIsMC()           const           { return fIsMC;};
100  
101   void SetCharge(Int_t charge = 0)    {fCharge = charge; };
102   Int_t GetCharge()           const           { return fCharge;};
103   
104   void SetVZEROside(Int_t side = 0)    {fVZEROside = side; };
105   Int_t GetVZEROside()           const           { return fVZEROside;};
106   
107   virtual void   UserCreateOutputObjects();
108   virtual void   UserExec(Option_t *option);
109   virtual void   Terminate(Option_t *);
110   
111   AliSpectraAODTrackCuts      * GetTrackCuts()         {  return fTrackCuts; }
112   AliSpectraAODEventCuts      * GetEventCuts()         {  return fEventCuts; }
113   TList                          * GetOutputList()         { return fOutput; }
114   
115   void SetTrackCuts(AliSpectraAODTrackCuts * tc)       { fTrackCuts = tc; }
116   void SetEventCuts(AliSpectraAODEventCuts * vc)       { fEventCuts = vc; }
117   void SetnCentBins(Int_t val)                             { fnCentBins = val; }
118   void SetnQvecBins(Int_t val)                             { fnQvecBins = val; }
119   void SetQvecUpperLimit(Double_t val)                { fQvecUpperLim = val; }
120   
121   void SetTrackBits(UInt_t TrackBits) {fTrkBit=TrackBits;}
122   void SetEtaCut(Double_t val) {fEtaCut=val;}
123   void SetMinPt(Double_t val) {fMinPt=val;}
124   void SetMaxPt(Double_t val) {fMaxPt=val;}
125   void SetMinTPCNcls(Double_t val) {fMinTPCNcls=val;}
126   
127   Bool_t GetDCA(const AliAODTrack* trk, Double_t * p);
128   void MCclosure(Double_t qvec);
129   
130   void EnableRecoEff (Bool_t val) { fIsRecoEff = val; }
131   Double_t GetRecoEff(Double_t pt, Int_t iC);
132   
133   void SetRecoEffFile(TFile *f)    {
134     TIter next(f->GetListOfKeys());
135     TKey *key;
136     while ((key = (TKey*)next())) {
137       TH1D * h=(TH1D*)key->ReadObj();
138       fRecoEffList->Add(h);
139     }
140   };
141
142   void     SetEtaGap(Float_t etamin,Float_t etamax)   { fEtaGapMin = etamin; fEtaGapMax = etamax; }
143   void     SetQvecCut(Float_t qmin,Float_t qmax)      { fCutSmallQperc = qmin; fCutLargeQperc = qmax; }
144   void     SetFillTHn (Bool_t val) { fFillTHn = val; }
145   
146   void SetQvecGen(Bool_t val) { fQvecGen = val; } //enable Qvec from generated
147   void SetQgenType(Int_t val) { fQgenType = val ; } // type==0 qgen from tracks - type==1 qgen from vzero
148
149   void SetnNchBins(Int_t val) { fnNchBins = val; }
150   
151   void SetDoCentrSystCentrality(Bool_t val) { fDoCentrSystCentrality = val; } //enable systematic for centrality
152
153  private:
154   
155   AliAODEvent                   * fAOD;                         //! AOD object
156   AliSpectraAODTrackCuts      * fTrackCuts;                   // Track Cuts
157   AliSpectraAODEventCuts      * fEventCuts;                   // Event Cuts
158   Bool_t                          fIsMC;                         // true if processing MC
159   Int_t                            fCharge;                      // charge to be selected
160   Int_t                            fVZEROside;                  // 0: VZERO-A 1: VZERO-C
161   TList                          * fOutput;                     // output list
162   TList                          * fOutput_lq;                  // output list large Q
163   TList                          * fOutput_sq;                  // output list small Q
164   Int_t                            fnCentBins;                  // number of bins for the centrality axis
165   Int_t                            fnQvecBins;                 // number of bins for the q vector axis
166   Double_t                         fQvecUpperLim;             //Upper limit for Qvector
167   
168   Int_t                            fCutLargeQperc; // cut on 10% large Q-vec events
169   Int_t                            fCutSmallQperc; // cut on 10% small Q-vec events
170   
171   Double_t fEtaGapMin;  // TBD
172   Double_t fEtaGapMax;   // TBD
173   
174   UInt_t    fTrkBit;   // TBD
175   Double_t  fEtaCut;   // TBD
176   Double_t  fMinPt;   // TBD
177   Double_t  fMaxPt;   // TBD
178   Double_t  fMinTPCNcls;   // TBD
179   
180   Bool_t fFillTHn;   // TBD
181   
182   TH1D * fCentrality;   //! TBD
183   TH1D * fQvector;   //! TBD
184   TH1D * fQvector_lq;   //! TBD
185   TH1D * fQvector_sq;   //! TBD
186
187   //output object
188   TProfile*     fResSP;             //! resolution
189   TProfile*     fResSP_vs_Cent;   //! TBD
190   TProfile*     f2partCumQA_vs_Cent;   //! TBD
191   TProfile*     f2partCumQB_vs_Cent;   //! TBD
192   TH2D*         fEta_vs_Phi_bef;        //! eta vs phi distribution before sub events cut 
193   TH2D*         fEta_vs_PhiA;            //! eta vs phi distribution after sub events cut 
194   TH2D*         fEta_vs_PhiB;            //! eta vs phi distribution after sub events cut 
195   TProfile*     fv2SPGap1A[9];         //! v2{2} eta gap 1 for all events
196   TProfile*     fv2SPGap1B[9];         //! v2{2} eta gap 1 for all events
197
198   TProfile*     fSinGap1Aq[9];      //! <sin> vs pT gap 1
199   TProfile*     fCosGap1Aq[9];      //! <cos> vs pT gap 1
200   TProfile*     fSinGap1Bq[9];      //! <sin> vs pT gap 1
201   TProfile*     fCosGap1Bq[9];      //! <cos> vs pT gap 1
202   
203   TProfile*     fSinGap1A[9];      //! <sin> vs pT gap 1
204   TProfile*     fCosGap1A[9];      //! <cos> vs pT gap 1
205   TProfile*     fSinGap1B[9];      //! <sin> vs pT gap 1
206   TProfile*     fCosGap1B[9];      //! <cos> vs pT gap 1
207
208   //large q
209   TProfile*     fResSP_lq;             //! resolution
210   TProfile*     fResSP_vs_Cent_lq;   //! TBD
211   TProfile*     f2partCumQA_vs_Cent_lq;   //! TBD
212   TProfile*     f2partCumQB_vs_Cent_lq;   //! TBD
213   TProfile*     fv2SPGap1A_lq[9];         //! v2{2} eta gap 1 for all events
214   TProfile*     fv2SPGap1B_lq[9];         //! v2{2} eta gap 1 for all events
215   TProfile*     fSinGap1Aq_lq[9];      //! <sin> vs pT gap 1
216   TProfile*     fCosGap1Aq_lq[9];      //! <cos> vs pT gap 1
217   TProfile*     fSinGap1Bq_lq[9];      //! <sin> vs pT gap 1
218   TProfile*     fCosGap1Bq_lq[9];      //! <cos> vs pT gap 1
219   TProfile*     fSinGap1A_lq[9];      //! <sin> vs pT gap 1
220   TProfile*     fCosGap1A_lq[9];      //! <cos> vs pT gap 1
221   TProfile*     fSinGap1B_lq[9];      //! <sin> vs pT gap 1
222   TProfile*     fCosGap1B_lq[9];      //! <cos> vs pT gap 1
223   
224   //small q
225   TProfile*     fResSP_sq;             //! resolution
226   TProfile*     fResSP_vs_Cent_sq;   //! TBD
227   TProfile*     f2partCumQA_vs_Cent_sq;   //! TBD
228   TProfile*     f2partCumQB_vs_Cent_sq;   //! TBD
229   TProfile*     fv2SPGap1A_sq[9];         //! v2{2} eta gap 1 for all events
230   TProfile*     fv2SPGap1B_sq[9];         //! v2{2} eta gap 1 for all events
231   TProfile*     fSinGap1Aq_sq[9];      //! <sin> vs pT gap 1
232   TProfile*     fCosGap1Aq_sq[9];      //! <cos> vs pT gap 1
233   TProfile*     fSinGap1Bq_sq[9];      //! <sin> vs pT gap 1
234   TProfile*     fCosGap1Bq_sq[9];      //! <cos> vs pT gap 1
235   TProfile*     fSinGap1A_sq[9];      //! <sin> vs pT gap 1
236   TProfile*     fCosGap1A_sq[9];      //! <cos> vs pT gap 1
237   TProfile*     fSinGap1B_sq[9];      //! <sin> vs pT gap 1
238   TProfile*     fCosGap1B_sq[9];      //! <cos> vs pT gap 1
239   
240   // MC closure test
241   
242   TProfile* fResSP_inclusive;   //! TBD
243   TProfile* fv2SPGap1A_inclusive_mb;   //! TBD
244   TProfile* fv2SPGap1B_inclusive_mb;   //! TBD
245   TProfile* fv2SPGap1A_inclusive_lq;   //! TBD
246   TProfile* fv2SPGap1B_inclusive_lq;   //! TBD
247   TProfile* fv2SPGap1A_inclusive_sq;   //! TBD
248   TProfile* fv2SPGap1B_inclusive_sq;   //! TBD
249   
250   TProfile* fResSPmc_inclusive;   //! TBD
251   TProfile* fv2SPGap1Amc_inclusive_mb;   //! TBD
252   TProfile* fv2SPGap1Bmc_inclusive_mb;   //! TBD
253   TProfile* fv2SPGap1Amc_inclusive_lq;   //! TBD
254   TProfile* fv2SPGap1Bmc_inclusive_lq;   //! TBD
255   TProfile* fv2SPGap1Amc_inclusive_sq;   //! TBD
256   TProfile* fv2SPGap1Bmc_inclusive_sq;   //! TBD
257   
258   // v2 vs qvec...
259   
260   TProfile*     fResGap1w;           //!
261   TProfile*     fV2IntGap1w;         //! integrated v2 for gap 0.8 w
262   TProfile*     fResSP_vs_Qvec[9];   //! TBD
263   TProfile*     fV2IntGap1wq[9];     //!
264   
265   Bool_t fIsRecoEff;   // TBD
266   TList * fRecoEffList; // reconstruction efficiency file
267   
268   Bool_t fQvecGen;  //enable Qvec from generated
269   Int_t  fQgenType; // type==0 qgen from tracks - type==1 qgen from vzero
270   Int_t  fnNchBins; //Ncharged
271   
272   Bool_t fDoCentrSystCentrality; //systematic check on centrality estimation
273
274   
275   AliAnalysisTaskV2AllChAOD(const AliAnalysisTaskV2AllChAOD&);
276   AliAnalysisTaskV2AllChAOD& operator=(const AliAnalysisTaskV2AllChAOD&);
277   
278   ClassDef(AliAnalysisTaskV2AllChAOD, 16);
279 };
280
281 #endif