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