]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG/FLOW/Tasks/AliAnalysisTaskVnV0.h
merging trunk to TPCdev
[u/mrichter/AliRoot.git] / PWG / FLOW / Tasks / AliAnalysisTaskVnV0.h
1 #ifndef ALIANALYSISTASKVNV0_H
2 #define ALIANALYSISTASKVNV0_H
3
4 // ROOT includes
5 #include <TObject.h>
6 #include <TClonesArray.h>
7 #include "TTree.h"
8 #include <TList.h>
9 #include <TProfile.h>
10
11 // AliRoot includes
12 #include <AliAnalysisTaskSE.h>
13 #include <AliAODEvent.h>
14 #include "AliFlowBayesianPID.h"
15 #include "AliFlowVZEROResults.h"
16 #include "AliFlowVZEROQA.h"
17
18 class TH2F;
19 class AliESDtrackCuts;
20 class TProfile2D;
21
22 class AliAnalysisTaskVnV0 : public AliAnalysisTaskSE {
23  public:
24   AliAnalysisTaskVnV0();
25   AliAnalysisTaskVnV0(const char *name);
26
27   virtual ~AliAnalysisTaskVnV0();
28
29   virtual void   UserCreateOutputObjects();
30   virtual void   UserExec(Option_t *option);
31   virtual void   Terminate(Option_t *); 
32   
33   Double_t GetVtxCut() { return fVtxCut; }   
34   Double_t GetEtaCut() { return fEtaCut; }     
35   Double_t GetMinPt() { return fMinPt; }   
36
37   virtual void  SetVtxCut(Double_t vtxCut){fVtxCut = vtxCut;}
38   virtual void  SetEtaCut(Double_t etaCut){fEtaCut = etaCut;}
39   virtual void  SetMinPt(Double_t value) {fMinPt = value;}   
40   virtual void  SetMinDistV0(Double_t value){fMinDistV0=value;}
41   virtual void  SetMaxDistV0(Double_t value){fMaxDistV0=value;}
42   virtual void SetV2(Bool_t val){fV2 = val;};
43   virtual void SetV3(Bool_t val){fV3 = val;};
44
45   virtual void SetMC(Bool_t flag = kTRUE){fIsMC = flag;};
46   virtual void SetQA(Bool_t flag = kTRUE){fQAsw = flag;};
47
48   void OpenInfoCalbration(Int_t run);
49
50   void SetFillDCAinfo(Bool_t flag=kTRUE){fFillDCA = flag;};
51
52   void SetModulationDEDx(Bool_t flag=kTRUE){fModulationDEDx=flag;};
53
54   void SetAfter2011(Bool_t stat=kTRUE){fIsAfter2011=stat;};
55   Bool_t GetAfter2011() const {return fIsAfter2011;};
56
57   void SetTPCclusterN(Int_t ncl){fNcluster=ncl;};
58   static Bool_t IsPsiComputed(){return fgIsPsiComputed;};
59   static Float_t GetPsi2V0A(){return fgPsi2v0a;};
60   static Float_t GetPsi2V0C(){return fgPsi2v0c;};
61   static Float_t GetPsi2TPC(){return fgPsi2tpc;};
62   static Float_t GetPsi3V0A(){return fgPsi3v0a;};
63   static Float_t GetPsi3V0C(){return fgPsi3v0c;};
64   static Float_t GetPsi3TPC(){return fgPsi3tpc;};
65   static Float_t GetPsi2V0AMC(){return fgPsi2v0aMC;};
66   static Float_t GetPsi2V0CMC(){return fgPsi2v0cMC;};
67   static Float_t GetPsi2TPCMC(){return fgPsi2tpcMC;};
68   static Float_t GetPsi3V0AMC(){return fgPsi3v0aMC;};
69   static Float_t GetPsi3V0CMC(){return fgPsi3v0cMC;};
70   static Float_t GetPsi3TPCMC(){return fgPsi3tpcMC;};
71
72  private:
73   AliAnalysisTaskVnV0(const AliAnalysisTaskVnV0 &old); 
74   AliAnalysisTaskVnV0& operator=(const AliAnalysisTaskVnV0 &source); 
75
76   Int_t PassesAODCuts(AliAODv0 *myV0, AliAODEvent *tAOD,Int_t specie);
77
78   static Bool_t fgIsPsiComputed; // flag which return if event was processed
79   static Float_t fgPsi2v0a,fgPsi2v0c,fgPsi2tpc; // current Psi2
80   static Float_t fgPsi3v0a,fgPsi3v0c,fgPsi3tpc; // current Psi3
81   static Float_t fgPsi2v0aMC,fgPsi2v0cMC,fgPsi2tpcMC; // current Psi2
82   static Float_t fgPsi3v0aMC,fgPsi3v0cMC,fgPsi3tpcMC; // current Psi3
83
84   virtual Float_t GetVertex(AliAODEvent* aod) const;
85   virtual void Analyze(AliAODEvent* aodEvent, Float_t v0Centr); 
86   virtual void SelectK0s();
87
88   Double_t     fVtxCut;             // Vtx cut on z position in cm
89   Double_t     fEtaCut;             // Eta cut used to select particles
90   Double_t     fMinPt;              // Min pt - for histogram limits
91   Double_t     fMinDistV0;          // Minimal distance for V0s
92   Double_t     fMaxDistV0;          // Maximal distance for V0s
93
94   Bool_t fV2; // switch to set the armonics
95   Bool_t fV3; // switch to set the armonics
96   Bool_t fIsMC; // if MC
97   Bool_t fQAsw;   // if QA
98   Bool_t fIsAfter2011; // switch for 2011 and later runs
99
100   static const Int_t nCentrBin = 9;          //! # cenrality bins
101
102   //
103   // Cuts and options
104   //
105
106   Int_t fRun;                       //! current run checked to load VZERO calibrations
107
108   Int_t fNcluster;           // Numer of TPC cluster required
109   TList *fList;              //! List for output objects
110   TList *fList2;             //! List for output objects
111   TList *fList3;             //! List for output objects
112   TList *fList4;             //! List for output objects
113   //
114   // Output objects
115   TProfile *fMultV0;                //! object containing VZERO calibration information
116   Float_t fV0Cpol;          //! loaded by OADB
117   Float_t fV0Apol;          //! loaded by OADB
118   Float_t fMeanQ[nCentrBin][2][2];           //! and recentering
119   Float_t fWidthQ[nCentrBin][2][2];          //! ...
120   Float_t fMeanQv3[nCentrBin][2][2];         //! also for v3
121   Float_t fWidthQv3[nCentrBin][2][2];        //! ...
122
123   TProfile *fHResTPCv0A2;   //! TProfile for subevent resolution (output)
124   TProfile *fHResTPCv0C2;   //! TProfile for subevent resolution (output)
125   TProfile *fHResv0Cv0A2;   //! TProfile for subevent resolution (output)
126   TProfile *fHResTPCv0A3;    //! also for v3
127   TProfile *fHResTPCv0C3;   //! also for v3
128   TProfile *fHResv0Cv0A3;   //! also for v3
129
130   TH2F *fPhiRPv0A;          //! EP distribution vs. centrality (v2)
131   TH2F *fPhiRPv0C;          //! EP distribution vs. centrality (v2)
132   TH2F *fPhiRPv0Av3;      //! EP distribution vs. centrality (v3)
133   TH2F *fPhiRPv0Cv3;      //! EP distribution vs. centrality (v3)
134
135   AliFlowVZEROQA *fQA;            //! QA histos (v2)
136   AliFlowVZEROQA *fQA2;           //! QA histos (v2)
137   AliFlowVZEROQA *fQAv3;        //! QA histos (v3)
138   AliFlowVZEROQA *fQA2v3;       //! QA histos (v3)
139
140   AliFlowBayesianPID *fPID;            //! PID class for the Bayesian probabilities
141  
142   TTree *fTree;                        //! tree to debug EP (if needed)
143
144   Float_t fCentrality;  //! current centrality for the tree
145   Float_t evPlAngV0ACor2;   //! subevent EPs (v2)
146   Float_t evPlAngV0CCor2;   //! subevent EPs (v2)
147   Float_t evPlAng2;   //! subevent EPs (v2)
148   Float_t evPlAngV0ACor3;   //! subevent EPs (v3)
149   Float_t evPlAngV0CCor3;   //! subevent EPs (v3)
150   Float_t evPlAng3;   //! subevent EPs (v3)
151
152   AliFlowVZEROResults *fContAllChargesV0A; //! results
153   AliFlowVZEROResults *fContAllChargesV0C; //! results
154   AliFlowVZEROResults *fContAllChargesV0Av3; //! results
155   AliFlowVZEROResults *fContAllChargesV0Cv3; //! results
156   AliFlowVZEROResults *fContAllChargesMC; //! results
157
158   // MC
159   TProfile *fHResMA2;   //! TProfile for subevent resolution (output)
160   TProfile *fHResMC2;   //! TProfile for subevent resolution (output)
161   TProfile *fHResAC2;   //! TProfile for subevent resolution (output)
162   TProfile *fHResMA3;    //! also for v3
163   TProfile *fHResMC3;   //! also for v3
164   TProfile *fHResAC3;   //! also for v3
165
166   AliFlowVZEROResults *fContAllChargesMCA; //! results
167   AliFlowVZEROResults *fContAllChargesMCC; //! results
168   AliFlowVZEROResults *fContAllChargesMCAv3; //! results
169   AliFlowVZEROResults *fContAllChargesMCCv3; //! results
170
171   Bool_t fFillDCA; // require to fill also DCA info
172   TH2D *fHdcaPt[nCentrBin][7]; //! DCA distribution (for MC primary)
173   TH2D *fHdcaPtSec[nCentrBin][7]; //! DCA distribution (for MC secondary, not used for data)
174   AliFlowVZEROResults *fContQApid; //! QA pid object
175
176   Bool_t fModulationDEDx; //add a modulation on the dE/dx response w.r.t. EP (kFALSE default)
177
178   Float_t fZvtx; //! primary vertex z coordinate
179   Int_t fNK0s; //! number of K0s in my private selection
180   Float_t fPhiK0s[1000]; //! phi of K0s in my private selection
181   Float_t fPtK0s[1000];//! pt of K0s in my private selection
182   Int_t fNpiPos; //! number of positive pions for K0s selection
183   Int_t fNpiNeg; //! number of negative pions for K0s selection
184   Int_t fIPiPos[1000]; //! position in the AOD stack of positive pions for K0s
185   Int_t fIPiNeg[1000]; //! position in the AOD stack of negative pions for K0s
186
187   TH2D *fHKsPhi; //! Ks phi distribution
188   TH2D *fHKsPhiEP; //! EP distribution
189   TH2D *fHK0sMass; //! K0s mass vs. pt (private selection)
190   TH2D *fHK0sMass2; //! K0s mass vs. pt (standard selection)
191   TH2D *fHK0vsLambda; //! K0s vs lambda mass (in private K0s selection)
192   TProfile2D *fHctauPtEP; //! ctau vs DeltaPhi,pt
193   TH2F *fHctauAt1EP;    //! ctau vs. DeltaPhi at 1 GeV/c
194
195   AliESDtrackCuts *fCutsDaughter; // daughter cut for K0s standard selection
196   ClassDef(AliAnalysisTaskVnV0, 8);    //Analysis task v2 and v3 analysis on AOD
197 };
198
199 #endif