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