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