]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/CaloCalib/AliAnalysisTaskEMCALPi0PbPb.h
Renamed some vars plus print task settings in usercreateobjects
[u/mrichter/AliRoot.git] / PWG4 / CaloCalib / AliAnalysisTaskEMCALPi0PbPb.h
1 #ifndef AliAnalysisTaskEMCALPi0PbPb_h
2 #define AliAnalysisTaskEMCALPi0PbPb_h
3
4 // $Id$
5
6 class TAxis;
7 class TClonesArray;
8 class TH1;
9 class TH2;
10 class TNtuple;
11 class TObjArray;
12 class AliAODCaloCells;
13 class AliAODCaloCluster;
14 class AliAODEvent;
15 class AliAODTrack;
16 class AliAODVertex;
17 class AliEMCALGeoUtils;
18 class AliEMCALRecoUtils;
19 class AliESDCaloCells;
20 class AliESDCaloCluster;
21 class AliESDEvent;
22 class AliESDTrack;
23 class AliESDVertex;
24 class AliESDtrackCuts;
25 class AliStaHeader;
26 class AliStaVertex;
27
28 #include "AliAnalysisTaskSE.h"
29
30 class AliAnalysisTaskEMCALPi0PbPb : public AliAnalysisTaskSE {
31  public:
32   AliAnalysisTaskEMCALPi0PbPb(const char *name=0);
33   virtual ~AliAnalysisTaskEMCALPi0PbPb(); 
34   
35   void         UserCreateOutputObjects();
36   void         UserExec(Option_t *option);
37   void         Terminate(Option_t *);
38
39   void         SetAsymMax(Double_t asymMax)                   { fAsymMax       = asymMax;   }
40   void         SetCentrality(const char *n)                   { fCentVar       = n;         }
41   void         SetCentralityRange(Double_t from, Double_t to) { fCentFrom=from; fCentTo=to; }
42   void         SetClusName(const char *n)                     { fClusName      = n;         }
43   void         SetDoAfterburner(Bool_t b)                     { fDoAfterburner = b;         }
44   void         SetDoTrackMatWithGeom(Bool_t b)                { fDoTrMatGeom   = b;         }
45   void         SetFillNtuple(Bool_t b)                        { fDoNtuple      = b;         }
46   void         SetGeoName(const char *n)                      { fGeoName       = n;         }
47   void         SetIsoDist(Double_t d)                         { fIsoDist       = d;         }
48   void         SetMarkCells(const char *n)                    { fMarkCells     = n;         }
49   void         SetMinClusEnergy(Double_t e)                   { fMinE          = e;         }
50   void         SetMinEcc(Double_t ecc)                        { fMinEcc        = ecc;       }
51   void         SetMinErat(Double_t erat)                      { fMinErat       = erat;      }
52   void         SetMinNClustersPerTrack(Double_t m)            { fMinNClusPerTr = m;         }
53   void         SetNminCells(Int_t n)                          { fNminCells     = n;         }
54   void         SetPrimTrackCuts(AliESDtrackCuts *c)           { fPrimTrCuts    = c;         }
55   void         SetTrClassNames(const char *n)                 { fTrClassNames  = n;         }
56   void         SetTrackCuts(AliESDtrackCuts *c)               { fTrCuts        = c;         }
57   void         SetTrainMode(Bool_t b)                         { fTrainMode     = b;         }
58   void         SetUseQualFlag(Bool_t b)                       { fUseQualFlag   = b;         }
59   void         SetVertexRange(Double_t z1, Double_t z2)       { fVtxZMin=z1; fVtxZMax=z2;   }
60
61  protected:
62   void         CalcCaloTriggers();
63   virtual void CalcClusterProps();
64   virtual void CalcPrimTracks();
65   virtual void CalcTracks();
66   virtual void ClusterAfterburner();
67   virtual void FillCellHists();
68   virtual void FillClusHists();
69   virtual void FillNtuple();
70   virtual void FillOtherHists();
71   virtual void FillPionHists();
72   void         FillVertex(AliStaVertex *v, const AliESDVertex *esdv);
73   void         FillVertex(AliStaVertex *v, const AliAODVertex *aodv);
74   Double_t     GetCellIsolation(Double_t cEta, Double_t cPhi, Double_t radius=0.2)                  const;
75   Double_t     GetMaxCellEnergy(AliVCluster *c) const { Short_t id=-1; return GetMaxCellEnergy(c,id); }
76   Double_t     GetMaxCellEnergy(AliVCluster *c, Short_t &id)                                        const;
77   Int_t        GetNCells(AliVCluster *c, Double_t emin=0.)                                          const;
78   void         GetSigma(AliVCluster *c, Double_t &sigmaMax, Double_t &sigmaMin)                     const;
79   Double_t     GetTrackIsolation(Double_t cEta, Double_t cPhi, Double_t radius=0.2, Double_t pt=0.) const;
80   Double_t     GetTrigEnergy(AliVCluster *c)                                                        const;
81
82     // input members
83   TString                fCentVar;                // variable for centrality determination
84   Double_t               fCentFrom;               // min centrality (def=0)
85   Double_t               fCentTo;                 // max centrality (def=100)
86   Double_t               fVtxZMin;                // min primary vertex z (def=-10cm)
87   Double_t               fVtxZMax;                // max primary vertex z (def=+10cm)
88   Bool_t                 fUseQualFlag;            // if true use quality flag for centrality
89   TString                fClusName;               // cluster branch name (def="")
90   Bool_t                 fDoNtuple;               // if true write out ntuple
91   Bool_t                 fDoAfterburner;          // if true run after burner
92   Double_t               fAsymMax;                // maximum energy asymmetry (def=1)
93   Int_t                  fNminCells;              // minimum number of cells attached to cluster (def=1)
94   Double_t               fMinE;                   // minimum cluster energy (def=0.1 GeV/c)
95   Double_t               fMinErat;                // minimum emax/ec ratio (def=0)
96   Double_t               fMinEcc;                 // minimum eccentricity (def=0)
97   TString                fGeoName;                // geometry name (def = EMCAL_FIRSTYEARV1)
98   Double_t               fMinNClusPerTr;          // minimum number of cluster per track (def=50)
99   Double_t               fIsoDist;                // isolation distance (def=0.2)
100   TString                fTrClassNames;           // trigger class names
101   AliESDtrackCuts       *fTrCuts;                 // track cuts
102   AliESDtrackCuts       *fPrimTrCuts;             // track cuts
103   Bool_t                 fDoTrMatGeom;            // track matching including geometry
104   Bool_t                 fTrainMode;              // train mode with minimal number of resources
105   TString                fMarkCells;              // list of mark cells to monitor
106   Int_t                  fMinL0Time;              // minimum accepted time for trigger
107   Int_t                  fMaxL0Time;              // maximum accepted time for trigger
108     // derived members (ie with ! after //)
109   Bool_t                 fIsGeoMatsSet;           //!indicate that geo matrices are set 
110   ULong64_t              fNEvs;                   //!accepted events 
111   AliEMCALGeoUtils      *fGeom;                   //!geometry utils
112   AliEMCALRecoUtils     *fReco;                   //!geometry utils
113   TList                 *fOutput;                 //!container of output histograms
114   TObjArray             *fTrClassNamesArr;        //!array of trig class names  
115   AliESDEvent           *fEsdEv;                  //!pointer to input esd event
116   AliAODEvent           *fAodEv;                  //!pointer to input aod event
117   TObjArray             *fRecPoints;              //!pointer to rec points (AliAnalysisTaskEMCALClusterizeFast)
118   TObjArray             *fEsdClusters;            //!pointer to esd clusters
119   AliESDCaloCells       *fEsdCells;               //!pointer to esd cells
120   TObjArray             *fAodClusters;            //!pointer to aod clusters
121   AliAODCaloCells       *fAodCells;               //!pointer to aod cells
122   TAxis                 *fPtRanges;               //!pointer to pt ranges
123   TObjArray             *fSelTracks;              //!pointer to selected tracks
124   TObjArray             *fSelPrimTracks;          //!pointer to selected primary tracks
125   Int_t                  fNAmpInTrigger;          //!number of cells to keep trigger statistic
126   Float_t               *fAmpInTrigger;           //!amplitude for calo cells which are part of trigger
127     // ntuple
128   TTree                 *fNtuple;                 //!pointer to ntuple
129   AliStaHeader          *fHeader;                 //!pointer to header
130   AliStaVertex          *fPrimVert;               //!pointer to primary vertex
131   AliStaVertex          *fSpdVert;                //!pointer to SPD vertex
132   AliStaVertex          *fTpcVert;                //!pointer to TPC vertex
133   TClonesArray          *fClusters;               //!pointer to clusters
134   TClonesArray          *fTriggers;               //!pointer to triggers
135     // histograms
136   TH1                   *fHCuts;                  //!histo for cuts
137   TH1                   *fHVertexZ;               //!histo for vtxz
138   TH1                   *fHVertexZ2;              //!histo for vtxz after vtx cuts
139   TH1                   *fHCent;                  //!histo for cent
140   TH1                   *fHCentQual;              //!histo for cent after quality flag cut
141   TH1                   *fHTclsBeforeCuts;        //!histo for trigger classes before cuts
142   TH1                   *fHTclsAfterCuts;         //!histo for trigger classes after cuts
143
144     // histograms for cells
145   TH2                  **fHColuRow;               //!histo for cell column and row
146   TH2                  **fHColuRowE;              //!histo for cell column and row weight energy
147   TH1                  **fHCellMult;              //!histo for cell multiplicity in module
148   TH1                   *fHCellE;                 //!histo for cell energy
149   TH1                   *fHCellH;                 //!histo for highest cell energy
150   TH1                   *fHCellM;                 //!histo for mean cell energy (normalized to hit cells)
151   TH1                   *fHCellM2;                //!histo for mean cell energy (normalized to all cells)
152   TH1                  **fHCellFreqNoCut;         //!histo for cell frequency without cut
153   TH1                  **fHCellFreqCut100M;       //!histo for cell frequency with cut 100MeV
154   TH1                  **fHCellFreqCut300M;       //!histo for cell frequency with cut 300MeV
155   TH1                  **fHCellFreqE;             //!histo for cell frequency weighted with energy
156   TH1                  **fHCellCheckE;            //!histo for cell E distribution for given channels
157     // histograms for clusters
158   TH1                   *fHClustEccentricity;     //!histo for cluster eccentricity
159   TH2                   *fHClustEtaPhi;           //!histo for cluster eta vs. phi
160   TH2                   *fHClustEnergyPt;         //!histo for cluster energy vs. pT
161   TH2                   *fHClustEnergySigma;      //!histo for cluster energy vs. variance over long axis 
162   TH2                   *fHClustSigmaSigma;       //!histo for sigma vs. lambda_0 comparison
163   TH2                   *fHClustNCellEnergyRatio; //!histo for cluster n tow vs. energy ratio
164     // histograms for track matching
165   TH1                   *fHMatchDr;               //!histo for dR track cluster matching
166   TH1                   *fHMatchDz;               //!histo for dZ track cluster matching
167   TH1                   *fHMatchEp;               //!histo for E/p track cluster matching
168     // histograms for pion candidates
169   TH2                   *fHPionEtaPhi;            //!histo for pion eta vs. phi
170   TH2                   *fHPionMggPt;             //!histo for pion mass vs. pT
171   TH2                   *fHPionMggAsym;           //!histo for pion mass vs. asym
172   TH2                   *fHPionMggDgg;            //!histo for pion mass vs. opening angle
173   TH1                   *fHPionInvMasses[21];     //!histos for invariant mass plots 
174
175  private:
176   AliAnalysisTaskEMCALPi0PbPb(const AliAnalysisTaskEMCALPi0PbPb&);            // not implemented
177   AliAnalysisTaskEMCALPi0PbPb &operator=(const AliAnalysisTaskEMCALPi0PbPb&); // not implemented
178
179   ClassDef(AliAnalysisTaskEMCALPi0PbPb, 7) // Analysis task for neutral pions in Pb+Pb
180 };
181 #endif
182
183 #ifndef AliStaObjs_h
184 #define AliStaObjs_h
185 class AliStaHeader
186 {
187  public:
188   AliStaHeader() : fRun(0), fOrbit(0), fPeriod(0), fBx(0), fL0(0), fL1(0), fL2(0),
189                    fTrClassMask(0), fTrCluster(0), fOffTriggers(0), fFiredTriggers(),
190                    fTcls(0), fV0Cent(0), fCl1Cent(0), fTrCent(0), fCqual(-1),
191                    fPsi(0), fPsiRes(0) {;}
192   virtual ~AliStaHeader() {;}
193
194  public:
195   Int_t         fRun;            //         run number
196   UInt_t        fOrbit;          //         orbit number
197   UInt_t        fPeriod;         //         period number
198   UShort_t      fBx;             //         bunch crossing id
199   UInt_t        fL0;             //         l0 trigger bits
200   UInt_t        fL1;             //         l1 trigger bits
201   UShort_t      fL2;             //         l2 trigger bits
202   ULong64_t     fTrClassMask;    //         trigger class mask
203   UChar_t       fTrCluster;      //         trigger cluster mask
204   UInt_t        fOffTriggers;    //         fired offline triggers for this event
205   TString       fFiredTriggers;  //         string with fired triggers
206   UInt_t        fTcls;           //         custom trigger definition
207   Double32_t    fV0Cent;         //[0,0,16] v0 cent
208   Double32_t    fCl1Cent;        //[0,0,16] cl1 cent
209   Double32_t    fTrCent;         //[0,0,16] tr cent
210   Int_t         fCqual;          //         centrality quality
211   Double32_t    fPsi;            //[0,0,16] event-plane angle
212   Double32_t    fPsiRes;         //[0,0,16] event-plane ange resolution
213
214   ClassDef(AliStaHeader,2) // Header class
215 };
216
217 class AliStaVertex
218 {
219  public:
220   AliStaVertex(Double_t x=0, Double_t y=0, Double_t z=0) : fVx(x), fVy(y), fVz(z), fVc(-1), fDisp(0), fZres(0),
221                                                            fChi2(0), fSt(0), fIs3D(0), fIsZ(0) {;}
222   virtual ~AliStaVertex() {;}
223
224  public:
225   Double_t      fVx;          //[0,0,16] vertex x
226   Double_t      fVy;          //[0,0,16] vertex y
227   Double_t      fVz;          //[0,0,16] vertex z
228   Double_t      fVc;          //[0,0,16] number of contributors to vertex
229   Double_t      fDisp;        //[0,0,16] dispersion
230   Double_t      fZres;        //[0,0,16] z-resolution
231   Double_t      fChi2;        //[0,0,16] chi2 of fit
232   Bool_t        fSt;          //         status bit
233   Bool_t        fIs3D;        //         is vertex from 3D
234   Bool_t        fIsZ;         //         is vertex from Z only
235
236   ClassDef(AliStaVertex,1) // Vertex class
237 };
238
239 class AliStaCluster : public TObject
240 {
241  public:
242   AliStaCluster() : TObject(), fE(0), fR(0), fEta(0), fPhi(0), fN(0), fN1(0), fN3(0), fIdMax(0), fEmax(0),  
243                     fDbc(-1), fDisp(-1), fM20(0), fM02(0), fEcc(0), fSig(0), fIsTrackM(0), fTrDz(0), fTrDr(-1), 
244                     fTrEp(0), fTrIso(0), fTrIso1(0), fTrIso2(0), fCeIso(0), fCeCore(0), fIsTrigM(0), fTrigE(-1), 
245                     fTrigMaskE(-1) {;}
246
247  public:
248   Double32_t    fE;                //[0,0,16] energy
249   Double32_t    fR;                //[0,0,16] radius
250   Double32_t    fEta;              //[0,0,16] eta
251   Double32_t    fPhi;              //[0,0,16] phi
252   UChar_t       fN;                //         number of cells
253   UChar_t       fN1;               //         number of cells > 100 MeV
254   UChar_t       fN3;               //         number of cells > 300 MeV
255   UShort_t      fIdMax;            //         id maximum cell
256   Double32_t    fEmax;             //[0,0,16] energy of maximum cell
257   Double32_t    fDbc;              //[0,0,16] distance to nearest bad channel
258   Double32_t    fDisp;             //[0,0,16] cluster dispersion, for shape analysis
259   Double32_t    fM20;              //[0,0,16] 2-nd moment along the main eigen axis
260   Double32_t    fM02;              //[0,0,16] 2-nd moment along the second eigen axis
261   Double32_t    fEcc;              //[0,0,16] eccentricity
262   Double32_t    fSig;              //[0,0,16] sigma
263   Bool_t        fIsTrackM;         //         if true then track values are set
264   Double32_t    fTrDz;             //[0,0,16] dZ to nearest track
265   Double32_t    fTrDr;             //[0,0,16] dR to nearest track (in x,y)
266   Double32_t    fTrEp;             //[0,0,16] E/P to nearest track 
267   Double32_t    fTrIso;            //[0,0,16] track isolation
268   Double32_t    fTrIso1;           //[0,0,16] track isolation (pt>1GeV/c)
269   Double32_t    fTrIso2;           //[0,0,16] track isolation (pt>2GeV/c)
270   Double32_t    fCeIso;            //[0,0,16] cell isolation
271   Double32_t    fCeCore;           //[0,0,16] cell content in R=0.025
272   Bool_t        fIsTrigM;          //         if true then trigger values are set
273   Double32_t    fTrigE;            //[0,0,16] trigger tower energy
274   Double32_t    fTrigMaskE;        //[0,0,16] masked trigger tower energy
275
276   ClassDef(AliStaCluster,3) // Cluster class
277 };
278
279 class AliStaTrigger : public TObject
280 {
281  public:
282   AliStaTrigger() : TObject(), fE(0), fEta(0), fPhi(0), fAmp(0), fMinTime(0), fMaxTime(0) {}
283
284  public:
285   Double32_t    fE;                //[0,0,16] energy
286   Double32_t    fEta;              //[0,0,16] eta
287   Double32_t    fPhi;              //[0,0,16] phi
288   Double32_t    fAmp;              //[0,0,16] amplitude
289   Short_t       fMinTime;           //        minimum L0 "time"
290   Short_t       fMaxTime;           //        maximum L0 "time"
291
292   ClassDef(AliStaTrigger,1) // Trigger class
293 };
294 #endif