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