]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGGA/EMCALTasks/AliAnalysisTaskEMCALPhoton.h
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGGA / EMCALTasks / AliAnalysisTaskEMCALPhoton.h
1 #ifndef AliAnalysisTaskEMCALPhoton_h
2 #define AliAnalysisTaskEMCALPhoton_h
3
4 // $Id$
5
6 class TH1;
7 class TH2;
8 class TObjArray;
9 class AliESDEvent;
10 class AliMCEvent;
11 class AliStack;
12 class AliESDtrack;
13 class AliESDtrackCuts;
14 class AliESDCaloCells;
15 class AliAODEvent;
16 class AliAODCaloCells;
17 class AliEMCALGeometry;
18 class AliOADBContainer;
19 class AliVCluster;
20 class AliVCaloCells;
21 class AliAnalysisTaskEMCALClusterizeFast;
22 class TParticle;
23 class TGeoHMatrix;
24 class AliPhotonHeaderObj;
25 class AliPhotonConvObj;
26 class AliPhotonClusterObj;
27 class AliPhotonCellObj;
28
29 #include "AliAnalysisTaskSE.h"
30
31 class AliAnalysisTaskEMCALPhoton : public AliAnalysisTaskSE {
32  public:
33   AliAnalysisTaskEMCALPhoton();
34   AliAnalysisTaskEMCALPhoton(const char *name);
35   virtual ~AliAnalysisTaskEMCALPhoton() {}
36
37   void         UserCreateOutputObjects();
38   void         UserExec(Option_t *option);
39   void         Terminate(Option_t *);
40
41   void         SetTrackCuts(AliESDtrackCuts *c)                                  { fTrCuts             =    c;    }
42   void         SetPrimTrackCuts(AliESDtrackCuts *c)                              { fPrTrCuts           =    c;    }
43   void         SetTimeResTOF(Float_t tr = 130.)                                  { fTimeResTOF         =    tr;   }
44   void         SetMipResponseTPC(Float_t mr = 47.9)                              { fMipResponseTPC     =    mr;   }
45   void         SetGeoName(const char *n)                                         { fGeoName            =    n;    }
46   void         SetPeriod(const char *n)                                          { fPeriod             =    n;    }
47   void         SetTrainMode(Bool_t t)                                            { fIsTrain            =    t;    }
48   void         SetGridMode(Bool_t g)                                             { fIsGrid             =    g;    }
49   void         SetClusThreshold(Double_t et)                                     { fClusThresh         =    et;   }
50   void         SetClusterizer(AliAnalysisTaskEMCALClusterizeFast *c)             { fClusterizer        =    c;    }
51   void         SetMcMode(Bool_t mc)                                              { fIsMC               =    mc;   }
52   void         SetDebugMode(Bool_t d)                                            { fDebug              =    d;    }
53   void         SetRedoV0(Bool_t v)                                               { fRedoV0             =    v;    }
54   void         FindConversions();
55   void         FillMyCells();
56   void         FillMyClusters();
57   void         FillMyAltClusters();
58   void         FillIsoTracks();
59   void         FillMcPart(  Int_t itrack, Int_t label);
60   void         GetMcParts();
61   Double_t     GetMcIsolation( Int_t itrack, Double_t radius, Double_t pt)                 const;
62   Double_t     GetTrackIsolation(Double_t cEta, Double_t cPhi, Double_t radius=0.2, Double_t pt=0.)       const;
63   Double_t     GetPhiBandEt(Double_t cEta, Double_t cPhi, Double_t radius=0.2, Double_t pt=0.)            const;
64  // Double_t     GetPhiBandEt(Double_t cEta, Double_t cPhi, Double_t radius=0.2, Double_t pt=0.)            const;
65   Double_t     GetCrossEnergy(const AliVCluster *cluster, Short_t &idmax);
66   Double_t     GetMaxCellEnergy(const AliVCluster *cluster, Short_t &id) const; 
67   
68  protected:
69   AliESDtrackCuts                       *fTrCuts;                 // track cuts
70   AliESDtrackCuts                       *fPrTrCuts;               // primary track cuts
71   TObjArray                             *fSelTracks;             //!pointer to selected inclusive tracks
72   TObjArray                             *fSelPrimTracks;         //!pointer to selected primary tracks
73   TClonesArray                          *fTracks;                //!track input array
74   TClonesArray                          *fPhotConvArray;         //!array of AliPhotonConvObj
75   TClonesArray                          *fMyClusts;              //!array of AliPhotonClusterObj
76   TClonesArray                          *fMyAltClusts;           //!array of AliPhotonClusterObj from the alternative clusterizer
77   TClonesArray                          *fMyCells;               //!array of AliPhotonCellObj
78   TClonesArray                          *fMyTracks;              //!array of AliPhotonTrackObj
79   TClonesArray                          *fMyMcParts;             //!array of AliPhotonMcPartObj
80   AliPhotonHeaderObj                    *fHeader;                //!
81   AliOADBContainer                      *fOADBContainer;         //!OADB container used to load misalignment matrices
82   TClonesArray                          *fCaloClusters;          //!pointer to EMCal clusters
83   TClonesArray                          *fCaloClustersNew;       //!pointer to EMCal clusters v2
84   TClonesArray                          *fAODMCParticles;        //!MC particles array for AOD analysis
85   AliVCaloCells                         *fVCells;                //!pointer to EMCal cells      
86   AliEMCALGeometry                      *fGeom;                   // geometry utils
87   Float_t                                fTimeResTOF;            //TOF time resolution for track PID
88   Float_t                                fMipResponseTPC;        //TPC mip response for track pid
89   TString                                fGeoName;                // geometry name (def = EMCAL_FIRSTYEARV1)
90   TString                                fPeriod;                 // string to the LHC period
91   Bool_t                                 fIsTrain;                //variable to set train mode
92   Bool_t                                 fIsMC;                   //variable to switch mcparts branch on/off
93   Bool_t                                 fDebug;                 //variable to switch debug on/off
94   Bool_t                                 fRedoV0;                 //variable to recalculate V0s - must be off for A-A collisions
95   Bool_t                                 fIsGrid;                //variable to set grid mode
96   Double_t                               fClusThresh;            //!energy threshold for cluster be saved
97   AliAnalysisTaskEMCALClusterizeFast    *fClusterizer;           //!pointer for alternative clusterizer
98   TString                                fCaloClustersName;      //alternative clusterizer name
99
100   
101   
102  private:
103   AliESDEvent                           *fESD;      //! ESD object
104   AliAODEvent                           *fAOD;      //! AOD object
105   AliVEvent                             *fVev;      //!virtual event obj 
106   AliMCEvent                            *fMCEvent;    //! MC event object
107   AliStack                              *fStack;     //!MC particles stack object
108   TGeoHMatrix                           *fGeomMatrix[12];//! Geometry misalignment matrices for EMCal
109   
110   TList                                 *fOutputList;            //! Output list
111   TTree                                 *fTree;                  //!output tree
112   Int_t                                  fMyMcIndex; //!counter of the saved mc particlesx
113   
114   //conversion histograms
115   TH2F                                  *fNV0sBefAndAftRerun;      //!check the number of V0s before and after rerun
116   TH2F                                  *fConversionVtxXY;         //! X x Y of found conversion vertices
117   TH1F                                  *fInvMassV0;               //!invariant mass from v0->GetEffMass()
118   TH1F                                  *fInvMassV0KF;             //!invariant mass from the v0 tracks
119   TH1F                                  *fInvMassV0SS;             //!invariant mass from the tracks in the "dirty" finder
120   TH2F                                  *fDedxPAll;               //!dE/dx vs p of all selected tracks
121   
122
123    
124   AliAnalysisTaskEMCALPhoton(const AliAnalysisTaskEMCALPhoton&); // not implemented
125   AliAnalysisTaskEMCALPhoton& operator=(const AliAnalysisTaskEMCALPhoton&); // not implemented
126   
127   ClassDef(AliAnalysisTaskEMCALPhoton, 1); // example of analysis
128 };
129
130 #endif
131
132 #ifndef AliPhotonObjs_h
133 #define AliPhotonObjs_h
134
135 class AliPhotonHeaderObj : public TObject
136 {
137   public: AliPhotonHeaderObj() :
138   TObject(), fInputFileName(""),fRunNumber(0), fTrClassMask(0), fTrCluster(0), fV0Cent(0), fV0(0), fCl1Cent(0), 
139     fCl1(0), fTrCent(0), fTr(0), fNClus(0), fNCells(0), fTrackMult(0), fNMcParts(0)  {;}
140   public:
141   TString       fInputFileName;  // used for normalization purposes in MC productions
142   Int_t         fRunNumber;      // event run number
143   ULong64_t     fTrClassMask;    //         trigger class mask
144   UChar_t       fTrCluster;      //         trigger cluster mask
145   Double32_t    fV0Cent;         //[0,0,16] v0 cent
146   Double32_t    fV0;             //[0,0,16] v0 result used for cent 
147   Double32_t    fCl1Cent;        //[0,0,16] cl1 cent
148   Double32_t    fCl1;            //[0,0,16] cl1 result used for cent 
149   Double32_t    fTrCent;         //[0,0,16] tr cent
150   Double32_t    fTr;             //[0,0,16] tr result used for cent 
151   Int_t         fNClus;
152   Int_t         fNCells;
153   Int_t         fTrackMult;
154   Int_t         fNMcParts;
155
156   ClassDef(AliPhotonHeaderObj,6)
157 };
158
159 class AliPhotonConvObj : public TObject
160 {
161   public: AliPhotonConvObj() : 
162         TObject(), fPt(0), fEta(0), fPhi(0), fVR(0), fVEta(0), fVPhi(0), fMass(0), fMcLabel(-1),
163                fNegPt(0), fNegEta(0), fNegPhi(0), fNegDedx(0), fNegMcLabel(-1),
164                fPosPt(0), fPosEta(0), fPosPhi(0), fPosDedx(0), fPosMcLabel(-1) {;}
165  public:
166   Double32_t    fPt;               //[0,0,16] pt
167   Double32_t    fEta;              //[0,0,16] eta
168   Double32_t    fPhi;              //[0,0,16] phi
169   Double32_t    fVR;               //[0,0,16] prod r (cylinder)
170   Double32_t    fVEta;             //[0,0,16] prod eta
171   Double32_t    fVPhi;             //[0,0,16] prod phi
172   Double32_t    fMass;             //[0,0,16] if correctly filled, should be <50 MeV
173   Short_t       fMcLabel;          //corresponding MC label
174
175   //negative daughter
176   Double32_t    fNegPt;               //[0,0,16] pt
177   Double32_t    fNegEta;              //[0,0,16] eta
178   Double32_t    fNegPhi;              //[0,0,16] phi
179   Double32_t    fNegDedx;             //[0,0,16] if correctly filled, should be <50 MeV
180   Short_t       fNegMcLabel;          //corresponding MC label
181
182   //positive daughter
183   Double32_t    fPosPt;               //[0,0,16] pt
184   Double32_t    fPosEta;              //[0,0,16] eta
185   Double32_t    fPosPhi;              //[0,0,16] phi
186   Double32_t    fPosDedx;             //[0,0,16] if correctly filled, should be <50 MeV
187   Short_t       fPosMcLabel;          //corresponding MC label
188
189   ClassDef(AliPhotonConvObj,1) // conversion class
190
191 };
192 class AliPhotonClusterObj : public TObject
193 {
194   public: AliPhotonClusterObj() : 
195   TObject(), fE(0), fEt(0), fR(0), fEta(0), fPhi(0), fN(0),fEmax(0),fTmax(0), fIdmax(0), fEcross(0),fDisp(-1), 
196         fM20(-1), fM02(-1),fTrDEta(0), fTrDPhi(0), fTrEp(-1), fTrDedx(-1), fTrIso01(0), fTrIso02(0), fTrIso03(0), fTrIso04(0), 
197         fTrPhiBand01(0), fTrPhiBand02(0), fTrPhiBand03(0), fTrPhiBand04(0), fCellsAbsId(""),fMcLabel(-1)
198         {;}
199  public:
200   Double32_t   fE;
201   Double32_t   fEt;
202   Double32_t   fR;
203   Double32_t   fEta;
204   Double32_t   fPhi;
205   UShort_t     fN;
206   Double_t     fEmax;
207   Double_t     fTmax;
208   Short_t      fIdmax;
209   Double_t     fEcross;
210   Double32_t   fDisp;
211   Double32_t   fM20;
212   Double32_t   fM02;
213   Double32_t   fTrDEta;
214   Double32_t   fTrDPhi;
215   Double32_t   fTrEp;
216   Double32_t   fTrDedx;
217   Double32_t   fTrIso01;
218   Double32_t   fTrIso02;
219   Double32_t   fTrIso03;
220   Double32_t   fTrIso04;
221   Double32_t   fTrPhiBand01;
222   Double32_t   fTrPhiBand02;
223   Double32_t   fTrPhiBand03;
224   Double32_t   fTrPhiBand04;
225   TString      fCellsAbsId;           //cluster cells absid
226   Short_t      fMcLabel;
227   
228   
229   
230   ClassDef(AliPhotonClusterObj,6) // cluster class
231
232 };
233
234 class AliPhotonCellObj : public TObject
235 {
236   public: AliPhotonCellObj() : 
237         TObject(), fAbsID(-1), fE(0), fEt(0), fEta(0), fPhi(0), fTime(0)
238         {;}
239  public:
240   Short_t      fAbsID;
241   Double32_t   fE;
242   Double32_t   fEt;
243   Double32_t   fEta;
244   Double32_t   fPhi;
245   Double32_t   fTime;
246   
247   
248   
249   ClassDef(AliPhotonCellObj,1) // cell class
250
251 };
252
253 class AliPhotonTrackObj : public TObject
254 {
255   public: AliPhotonTrackObj() :
256         TObject(), fPt(0), fEta(0), fPhi(0), fDedx(0), fCharge(0), fMcLabel(-1) {;}
257   public:
258   Double32_t fPt;
259   Double32_t fEta;
260   Double32_t fPhi;
261   Double32_t fDedx;
262   Short_t    fCharge;
263   Short_t    fMcLabel;
264
265   ClassDef(AliPhotonTrackObj,3)
266 };
267
268 class AliPhotonMcPartObj : public TObject
269 {
270   public: AliPhotonMcPartObj() :
271   TObject(), fLabel(-1), fPdg(0), fPt(0), fEta(0), fPhi(0), 
272     fVR(0), fVEta(0), fVPhi(0), fMother(-1), fFirstD(-1),
273     fLastD(-1), fStatus(-1), fIso(-1), fIso3(-1) {;}
274   public:
275   Short_t    fLabel;
276   Short_t    fPdg;
277   Double32_t fPt;
278   Double32_t fEta;
279   Double32_t fPhi;
280   Double32_t fVR;
281   Double32_t fVEta;
282   Double32_t fVPhi;
283   Short_t    fMother;
284   Short_t    fFirstD;
285   Short_t    fLastD;
286   Short_t    fStatus;
287   Double32_t fIso;
288   Double32_t fIso3; //in cone of radius 0.3
289
290   ClassDef(AliPhotonMcPartObj,3)
291 };
292
293 #endif