Changed AddTasks
[u/mrichter/AliRoot.git] / PWGGA / GammaConv / AliAnalysisTaskGammaConvV1.h
1 #ifndef ALIANLYSISTASKGAMMACONVV1_cxx
2 #define ALIANLYSISTASKGAMMACONVV1_cxx
3
4 #include "AliAnalysisTaskSE.h"
5 #include "AliESDtrack.h"
6 #include "AliV0ReaderV1.h"
7 #include "AliKFConversionPhoton.h"
8 #include "AliGammaConversionAODBGHandler.h"
9 #include "AliConversionAODBGHandlerRP.h"
10 #include "AliConversionMesonCuts.h"
11 #include "AliAnalysisManager.h"
12 #include "TProfile2D.h"
13 #include "TH3.h"
14 #include "TH3F.h"
15
16 class AliAnalysisTaskGammaConvV1 : public AliAnalysisTaskSE {
17  public:
18
19    AliAnalysisTaskGammaConvV1();
20    AliAnalysisTaskGammaConvV1(const char *name);
21    virtual ~AliAnalysisTaskGammaConvV1();
22
23    virtual void   UserCreateOutputObjects();
24    virtual Bool_t Notify();
25    virtual void   UserExec(Option_t *);
26    virtual void   Terminate(const Option_t*);
27    void InitBack();
28
29    void SetIsHeavyIon(Int_t flag){
30       fIsHeavyIon = flag;    
31       
32    }
33
34    void SetIsMC(Bool_t isMC){fIsMC=isMC;}
35    void SetDoMesonAnalysis(Bool_t flag){fDoMesonAnalysis = flag;}
36    void SetDoMesonQA(Int_t flag){fDoMesonQA = flag;}
37    void SetDoPhotonQA(Int_t flag){fDoPhotonQA = flag;}
38    void ProcessPhotonCandidates();
39    void CalculatePi0Candidates();
40    void CalculateBackground();
41    void CalculateBackgroundRP();
42    void ProcessMCParticles();
43    void ProcessAODMCParticles();
44    void RelabelAODPhotonCandidates(Bool_t mode);
45    void ProcessTruePhotonCandidates( AliAODConversionPhoton* TruePhotonCandidate);
46    void ProcessTruePhotonCandidatesAOD( AliAODConversionPhoton* TruePhotonCandidate);
47    void ProcessTrueMesonCandidates( AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate0, AliAODConversionPhoton *TrueGammaCandidate1);
48    void ProcessTrueMesonCandidatesAOD(AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate0, AliAODConversionPhoton *TrueGammaCandidate1);
49    void RotateParticle(AliAODConversionPhoton *gamma);
50    void RotateParticleAccordingToEP(AliAODConversionPhoton *gamma, Double_t previousEventEP, Double_t thisEventEP);
51    void SetConversionCutList(Int_t nCuts, TList *CutArray){
52       fnCuts = nCuts;
53       fCutArray = CutArray;
54    }
55    void SetMesonCutList(Int_t nCuts, TList *CutArray){
56       fnCuts = nCuts;
57       fMesonCutArray = CutArray;
58    }
59
60    // BG HandlerSettings
61    void SetMoveParticleAccordingToVertex(Bool_t flag){fMoveParticleAccordingToVertex = flag;}
62    void FillPhotonCombinatorialBackgroundHist(AliAODConversionPhoton *TruePhotonCandidate, Int_t pdgCode[]);
63    void MoveParticleAccordingToVertex(AliAODConversionPhoton* particle,const AliGammaConversionAODBGHandler::GammaConversionVertex *vertex);
64    void UpdateEventByEventData();
65    void SetLogBinningXTH2(TH2* histoRebin);
66    
67  protected:
68    AliV0ReaderV1 *fV0Reader;
69    AliGammaConversionAODBGHandler **fBGHandler;
70    AliConversionAODBGHandlerRP    **fBGHandlerRP;
71    AliVEvent *fInputEvent;
72    AliMCEvent *fMCEvent;
73    AliStack *fMCStack;
74    TList **fCutFolder;
75    TList **fESDList;
76    TList **fBackList;
77    TList **fMotherList;
78    TList **fPhotonDCAList;
79    TList **fMesonDCAList;        
80    TList **fTrueList;
81    TList **fMCList;
82    TList **fHeaderNameList;
83    TList *fOutputContainer;
84    TClonesArray *fReaderGammas;
85    TList *fGammaCandidates;
86    TList *fCutArray;
87    AliConversionCuts *fConversionCuts;
88    TList *fMesonCutArray;
89    AliConversionMesonCuts *fMesonCuts;
90    TH1F **hESDConvGammaPt;
91    TH1F **hESDConvGammaR;
92    TH1F **hESDConvGammaEta;
93    TTree **tESDConvGammaPtDcazCat;
94    Float_t fPtGamma;
95    Float_t fDCAzPhoton;
96    Float_t fRConvPhoton;
97    Float_t fEtaPhoton;
98    UChar_t iCatPhoton;
99    UChar_t iPhotonMCInfo; // 0: garbage,
100                          // 1: background
101                          // 2: secondary photon not from eta or k0s,
102                          // 3: secondary photon from eta, 
103                          // 4: secondary photon from k0s, 
104                          // 5: dalitz
105                          // 6: primary gamma
106    TH2F **hESDMotherInvMassPt;
107    THnSparseF **sESDMotherInvMassPtZM;
108    TH2F **hESDMotherBackInvMassPt;
109    THnSparseF **sESDMotherBackInvMassPtZM;
110    TH2F **hESDMotherInvMassEalpha;
111    TH2F **hESDMotherPi0PtY;
112    TH2F **hESDMotherEtaPtY;
113    TH2F **hESDMotherPi0PtAlpha;
114    TH2F **hESDMotherEtaPtAlpha;
115    TH2F **hESDMotherPi0PtOpenAngle;
116    TH2F **hESDMotherEtaPtOpenAngle;
117    TH1I **hMCHeaders;
118    TH1F **hMCAllGammaPt;
119    TH1F **hMCDecayGammaPi0Pt;
120    TH1F **hMCDecayGammaRhoPt;
121    TH1F **hMCDecayGammaEtaPt;
122    TH1F **hMCDecayGammaOmegaPt;
123    TH1F **hMCDecayGammaEtapPt;
124    TH1F **hMCDecayGammaPhiPt;
125    TH1F **hMCDecayGammaSigmaPt;
126    TH1F **hMCConvGammaPt;
127    TH1F **hMCConvGammaR;
128    TH1F **hMCConvGammaEta;
129    TH1F **hMCPi0Pt;
130    TH1F **hMCPi0WOWeightPt;
131    TH1F **hMCEtaPt;
132    TH1F **hMCEtaWOWeightPt;
133    TH1F **hMCPi0InAccPt;
134    TH1F **hMCEtaInAccPt;
135    TH2F **hMCPi0PtY;
136    TH2F **hMCEtaPtY;
137    TH1F **hMCK0sPt;
138    TH1F **hMCK0sWOWeightPt;
139    TH2F **hMCK0sPtY;
140    TH2F **hESDTrueMotherInvMassPt;
141    TH2F **hESDTruePrimaryMotherInvMassPt;
142    TH2F **hESDTruePrimaryMotherW0WeightingInvMassPt;
143    TProfile2D **pESDTruePrimaryMotherWeightsInvMassPt;
144    TH2F **hESDTruePrimaryPi0MCPtResolPt;
145    TH2F **hESDTruePrimaryEtaMCPtResolPt;
146    TH2F **hESDTrueSecondaryMotherInvMassPt;
147    TH2F **hESDTrueSecondaryMotherFromK0sInvMassPt;
148    TH1F **hESDTrueK0sWithPi0DaughterMCPt;
149    TH2F **hESDTrueSecondaryMotherFromEtaInvMassPt;
150    TH1F **hESDTrueEtaWithPi0DaughterMCPt;
151    TH2F **hESDTrueBckGGInvMassPt;
152    TH2F **hESDTrueBckContInvMassPt;
153    TH2F **hESDTruePi0PtY;
154    TH2F **hESDTrueEtaPtY;
155    TH2F **hESDTruePi0PtAlpha;
156    TH2F **hESDTrueEtaPtAlpha;
157    TH2F **hESDTruePi0PtOpenAngle;
158    TH2F **hESDTrueEtaPtOpenAngle;
159    TH2F **hESDTrueMotherDalitzInvMassPt;
160    TH1F **hESDTrueConvGammaPt;
161    TH2F **hESDCombinatorialPt;
162    TH1F **hESDTruePrimaryConvGammaPt;
163    TH2F **hESDTruePrimaryConvGammaESDPtMCPt;
164    TH1F **hESDTrueSecondaryConvGammaPt;
165    TH1F **hESDTrueSecondaryConvGammaFromXFromK0sPt;
166    TH1F **hESDTrueSecondaryConvGammaFromXFromLambdaPt;
167    TH2F **hESDTrueDalitzPsiPairDeltaPhi;
168    TH2F **hESDTrueGammaPsiPairDeltaPhi;
169    TH1I **hNEvents;
170    TH1I **hNGoodESDTracks;
171    TH1I **hNGammaCandidates;
172    TH1I **hNV0Tracks;
173    TProfile **hEtaShift;
174    TTree **tESDMesonsInvMassPtDcazMinDcazMaxFlag;
175    Float_t fInvMass;
176    Float_t fPt;
177    Float_t fDCAzGammaMin;
178    Float_t fDCAzGammaMax;
179    UChar_t iFlag;
180    UChar_t iMesonMCInfo; // 0: garbage,
181                          // 1: background
182                          // 2: secondary meson not from eta or k0s,
183                          // 3: secondary meson from eta, 
184                          // 4: secondary meson from k0s, 
185                          // 5: dalitz
186                          // 6: primary meson gamma-gamma-channel
187    Double_t fEventPlaneAngle; // EventPlaneAngle
188    TRandom3 fRandom;
189    Int_t fnGammaCandidates;
190    Double_t *fUnsmearedPx; //[fnGammaCandidates]
191    Double_t *fUnsmearedPy; //[fnGammaCandidates]
192    Double_t *fUnsmearedPz; //[fnGammaCandidates]
193    Double_t *fUnsmearedE;  //[fnGammaCandidates]
194    Int_t *fMCStackPos;     //[fnGammaCandidates]
195    Int_t *fMCStackNeg;     //[fnGammaCandidates]
196    Int_t *fESDArrayPos;    //[fnGammaCandidates]
197    Int_t *fESDArrayNeg;    //[fnGammaCandidates]
198    Int_t fnCuts;
199    Int_t fiCut;
200    Bool_t fMoveParticleAccordingToVertex;
201    Int_t fIsHeavyIon;
202    Bool_t fDoMesonAnalysis;
203    Int_t fDoMesonQA;
204    Int_t fDoPhotonQA;
205    Bool_t fIsFromMBHeader;
206    Bool_t fIsMC;
207
208 private:
209
210    AliAnalysisTaskGammaConvV1(const AliAnalysisTaskGammaConvV1&); // Prevent copy-construction
211    AliAnalysisTaskGammaConvV1 &operator=(const AliAnalysisTaskGammaConvV1&); // Prevent assignment
212
213
214    ClassDef(AliAnalysisTaskGammaConvV1, 10);
215 };
216
217 #endif