Moving AliESDCosmicTrack from TPC to STEER/ESD (Marian)
[u/mrichter/AliRoot.git] / STEER / ESD / AliESDEvent.h
CommitLineData
af885e0f 1// -*- mode: C++ -*-
2#ifndef ALIESDEVENT_H
3#define ALIESDEVENT_H
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7
8/* $Id$ */
9
10//-------------------------------------------------------------------------
f56a9fa7 11// Class AliESDEvent
6989bff3 12// This is the class to deal with during the physics analysis of data.
f56a9fa7 13// It also ensures the backward compatibility with the old ESD format.
af885e0f 14//
f56a9fa7 15// Origin: Christian Klein-Boesing, CERN, Christian.Klein-Boesing@cern.ch
af885e0f 16//-------------------------------------------------------------------------
17
18#include <TClonesArray.h>
19#include <TObject.h>
20#include <TTree.h>
21#include <TArrayF.h>
22
af885e0f 23
024c7734 24#include "AliVEvent.h"
694aad0c 25// some includes for delegated methods
f0106218 26#include "AliESDCaloTrigger.h"
af885e0f 27#include "AliESDRun.h"
28#include "AliESDHeader.h"
3f47e572 29#include "AliESDTZERO.h"
f0106218 30#include "AliESDZDC.h"
bd95bae7 31#include "AliESDACORDE.h"
af885e0f 32
024c7734 33// AliESDtrack has to be included so that the compiler
34// knows its inheritance tree (= that it is a AliVParticle).
35#include "AliESDtrack.h"
5303c167 36// same for AliESDVertex (which is a AliVVertex)
37#include "AliESDVertex.h"
c8fe2783 38// same for CaloCells and CaloClusters (which is a AliVCaloCells, AliVCluster)
39#include "AliESDCaloCluster.h"
40#include "AliESDCaloCells.h"
41
f858b00e 42#include "AliTOFHeader.h"
024c7734 43
ae2bccf1 44#include "AliESDVZERO.h"
820b4d9e 45#ifdef MFT_UPGRADE
46//#include "AliESDMFT.h"
47#endif
ae2bccf1 48
af885e0f 49class AliESDfriend;
af885e0f 50class AliESDHLTtrack;
f0106218 51class AliESDVertex;
52class AliESDPmdTrack;
53class AliESDFMD;
54class AliESDkink;
f0106218 55class AliESDv0;
f0106218 56class AliMultiplicity;
57class AliRawDataErrorLog;
58class AliESDRun;
6c8e0967 59class AliESDTrdTrigger;
f0106218 60class AliESDTrdTrack;
52cd0cc0 61class AliESDTrdTracklet;
f0106218 62class AliESDMuonTrack;
af885e0f 63class AliESD;
f0106218 64class AliESDcascade;
fba4b2e2 65class AliCentrality;
ce7adfe9 66class AliEventplane;
cd1d4ee0 67class TRefArray;
bd95bae7 68class AliESDACORDE;
8b12d288 69class AliESDHLTDecision;
8e1324ab 70class AliESDCosmicTrack;
af885e0f 71
80791508 72class TList;
73class TString;
74
75
024c7734 76class AliESDEvent : public AliVEvent {
af885e0f 77public:
78
79
6989bff3 80 enum ESDListIndex {kESDRun,
af885e0f 81 kHeader,
82 kESDZDC,
83 kESDFMD,
84 kESDVZERO,
85 kESDTZERO,
06cc9d95 86 kTPCVertex,
af885e0f 87 kSPDVertex,
88 kPrimaryVertex,
89 kSPDMult,
90 kPHOSTrigger,
91 kEMCALTrigger,
04d01397 92 kSPDPileupVertices,
93 kTrkPileupVertices,
af885e0f 94 kTracks,
95 kMuonTracks,
96 kPmdTracks,
6c8e0967 97 kTrdTrigger,
af885e0f 98 kTrdTracks,
52cd0cc0 99 kTrdTracklets,
af885e0f 100 kV0s,
101 kCascades,
102 kKinks,
103 kCaloClusters,
e649177a 104 kEMCALCells,
105 kPHOSCells,
af885e0f 106 kErrorLogs,
bd95bae7 107 kESDACORDE,
f858b00e 108 kTOFHeader,
8e1324ab 109 kCosmicTracks,
af885e0f 110 kESDListN
820b4d9e 111 #ifdef MFT_UPGRADE
112 // , kESDMFT
113 #endif
af885e0f 114 };
115
116 AliESDEvent();
732a24fe 117 virtual ~AliESDEvent();
118 AliESDEvent &operator=(const AliESDEvent& source); // or make private and use only copy?
119 virtual void Copy(TObject& obj) const;
af885e0f 120
121 // RUN
122 // move this to the UserData!!!
123 const AliESDRun* GetESDRun() const {return fESDRun;}
124
125 // Delegated methods for fESDRun
c017f53f 126 void SetRunNumber(Int_t n) {if(fESDRun) fESDRun->SetRunNumber(n);}
127 Int_t GetRunNumber() const {return fESDRun?fESDRun->GetRunNumber():-1;}
00d00f58 128 void SetPeriodNumber(UInt_t n){
129 if(fESDRun) fESDRun->SetPeriodNumber(n);
130 if(fHeader) fHeader->SetPeriodNumber(n);
131 }
c017f53f 132 UInt_t GetPeriodNumber() const {return fESDRun?fESDRun->GetPeriodNumber():0;}
133 void SetMagneticField(Double_t mf){if(fESDRun) fESDRun->SetMagneticField(mf);}
134 Double_t GetMagneticField() const {return fESDRun?fESDRun->GetMagneticField():0;}
135 void SetDiamond(const AliESDVertex *vertex) { if(fESDRun) fESDRun->SetDiamond(vertex);}
136 Double_t GetDiamondX() const {return fESDRun?fESDRun->GetDiamondX():0;}
137 Double_t GetDiamondY() const {return fESDRun?fESDRun->GetDiamondY():0;}
1c7554f9 138 Double_t GetDiamondZ() const {return fESDRun?fESDRun->GetDiamondZ():0;}
c017f53f 139 Double_t GetSigma2DiamondX() const {return fESDRun?fESDRun->GetSigma2DiamondX():0;}
140 Double_t GetSigma2DiamondY() const {return fESDRun?fESDRun->GetSigma2DiamondY():0;}
1c7554f9 141 Double_t GetSigma2DiamondZ() const {return fESDRun?fESDRun->GetSigma2DiamondZ():0;}
c017f53f 142 void GetDiamondCovXY(Float_t cov[3]) const {if(fESDRun) fESDRun->GetDiamondCovXY(cov);}
143 void SetTriggerClass(const char*name, Int_t index) {if(fESDRun) fESDRun->SetTriggerClass(name,index);}
144 void SetPHOSMatrix(TGeoHMatrix*matrix, Int_t i) {if(fESDRun) fESDRun->SetPHOSMatrix(matrix,i);}
145 const TGeoHMatrix* GetPHOSMatrix(Int_t i) const {return fESDRun?fESDRun->GetPHOSMatrix(i):0x0;}
146 void SetEMCALMatrix(TGeoHMatrix*matrix, Int_t i) {if(fESDRun) fESDRun->SetEMCALMatrix(matrix,i);}
147 const TGeoHMatrix* GetEMCALMatrix(Int_t i) const {return fESDRun?fESDRun->GetEMCALMatrix(i):0x0;}
da6062af 148 void SetCaloTriggerType(const Int_t* type) {if (fESDRun) fESDRun->SetCaloTriggerType(type);}
1dc767cf 149 Int_t* GetCaloTriggerType() const {return fESDRun?fESDRun->GetCaloTriggerType():0x0;}
5e14e698 150 virtual const Float_t* GetVZEROEqFactors() const {return fESDRun?fESDRun->GetVZEROEqFactors():0x0;}
151 virtual Float_t GetVZEROEqMultiplicity(Int_t i) const;
da6062af 152
33fe5eb1 153 //
c017f53f 154 void SetCurrentL3(Float_t cur) const {if(fESDRun) fESDRun->SetCurrentL3(cur);}
155 void SetCurrentDip(Float_t cur) const {if(fESDRun) fESDRun->SetCurrentDip(cur);}
156 void SetBeamEnergy(Float_t be) const {if(fESDRun) fESDRun->SetBeamEnergy(be);}
157 void SetBeamType(const char* bt) const {if(fESDRun) fESDRun->SetBeamType(bt);}
91460b26 158 void SetBeamParticle(Int_t az, Int_t ibeam) {if(fESDRun) fESDRun->SetBeamParticle(az,ibeam);}
c017f53f 159 void SetUniformBMap(Bool_t val=kTRUE) const {if(fESDRun) fESDRun->SetBit(AliESDRun::kUniformBMap,val);}
160 void SetBInfoStored(Bool_t val=kTRUE) const {if(fESDRun) fESDRun->SetBit(AliESDRun::kBInfoStored,val);}
33fe5eb1 161 //
c017f53f 162 Float_t GetCurrentL3() const {return fESDRun?fESDRun->GetCurrentL3():0;}
163 Float_t GetCurrentDip() const {return fESDRun?fESDRun->GetCurrentDip():0;}
164 Float_t GetBeamEnergy() const {return fESDRun?fESDRun->GetBeamEnergy():0;}
165 const char* GetBeamType() const {return fESDRun?fESDRun->GetBeamType():0;}
91460b26 166 Int_t GetBeamParticle(Int_t ibeam) const {return fESDRun?fESDRun->GetBeamParticle(ibeam):0;}
167 Int_t GetBeamParticleA(Int_t ibeam) const {return fESDRun?fESDRun->GetBeamParticleA(ibeam):0;}
168 Int_t GetBeamParticleZ(Int_t ibeam) const {return fESDRun?fESDRun->GetBeamParticleZ(ibeam):0;}
c017f53f 169 Bool_t IsUniformBMap() const {return fESDRun?fESDRun->TestBit(AliESDRun::kUniformBMap):kFALSE;}
33fe5eb1 170 //
c017f53f 171 Bool_t InitMagneticField() const {return fESDRun?fESDRun->InitMagneticField():kFALSE;}
8938f4e0 172 void SetT0spread(Float_t *t) const {if(fESDRun) fESDRun->SetT0spread(t);}
1dc767cf 173 void SetVZEROEqFactors(Float_t factors[64]) const {if(fESDRun) fESDRun->SetVZEROEqFactors(factors);}
af885e0f 174 // HEADER
024c7734 175 AliESDHeader* GetHeader() const {return fHeader;}
af885e0f 176
177 // Delegated methods for fHeader
c017f53f 178 void SetTriggerMask(ULong64_t n) {if(fHeader) fHeader->SetTriggerMask(n);}
179 void SetOrbitNumber(UInt_t n) {if(fHeader) fHeader->SetOrbitNumber(n);}
180 void SetTimeStamp(UInt_t timeStamp){if(fHeader) fHeader->SetTimeStamp(timeStamp);}
181 void SetEventType(UInt_t eventType){if(fHeader) fHeader->SetEventType(eventType);}
182 void SetEventSpecie(UInt_t eventSpecie){if(fHeader) fHeader->SetEventSpecie(eventSpecie);}
183 void SetEventNumberInFile(Int_t n) {if(fHeader) fHeader->SetEventNumberInFile(n);}
184 // void SetRunNumber(Int_t n) {if(fHeader) fHeader->SetRunNumber(n);}
185 void SetBunchCrossNumber(UShort_t n) {if(fHeader) fHeader->SetBunchCrossNumber(n);}
186 void SetTriggerCluster(UChar_t n) {if(fHeader) fHeader->SetTriggerCluster(n);}
694aad0c 187
c017f53f 188 ULong64_t GetTriggerMask() const {return fHeader?fHeader->GetTriggerMask():0;}
189 TString GetFiredTriggerClasses() const {return (fESDRun&&fHeader)?fESDRun->GetFiredTriggerClasses(fHeader->GetTriggerMask()):"";}
190 Bool_t IsTriggerClassFired(const char *name) const {return (fESDRun&&fHeader)?fESDRun->IsTriggerClassFired(fHeader->GetTriggerMask(),name):kFALSE;}
2a3dfb14 191 Bool_t IsEventSelected(const char *trigExpr) const;
3b286f80 192 TObject* GetHLTTriggerDecision() const;
193 TString GetHLTTriggerDescription() const;
194 Bool_t IsHLTTriggerFired(const char* name=NULL) const;
158a76dd 195 UInt_t GetOrbitNumber() const {return fHeader?fHeader->GetOrbitNumber():0;}
c017f53f 196 UInt_t GetTimeStamp() const { return fHeader?fHeader->GetTimeStamp():0;}
197 UInt_t GetEventType() const { return fHeader?fHeader->GetEventType():0;}
198 UInt_t GetEventSpecie() const { return fHeader?fHeader->GetEventSpecie():0;}
199 Int_t GetEventNumberInFile() const {return fHeader?fHeader->GetEventNumberInFile():-1;}
200 UShort_t GetBunchCrossNumber() const {return fHeader?fHeader->GetBunchCrossNumber():0;}
201 UChar_t GetTriggerCluster() const {return fHeader?fHeader->GetTriggerCluster():0;}
af885e0f 202
203 // ZDC CKB: put this in the header?
16d867eb 204 AliESDZDC* GetESDZDC() const {return fESDZDC;}
205 AliESDZDC* GetZDCData() const {return fESDZDC;}
206
af6f24c9 207 void SetZDCData(AliESDZDC * obj);
af885e0f 208
209 // Delegated methods for fESDZDC
c017f53f 210 Double_t GetZDCN1Energy() const {return fESDZDC?fESDZDC->GetZDCN1Energy():0;}
211 Double_t GetZDCP1Energy() const {return fESDZDC?fESDZDC->GetZDCP1Energy():0;}
212 Double_t GetZDCN2Energy() const {return fESDZDC?fESDZDC->GetZDCN2Energy():0;}
213 Double_t GetZDCP2Energy() const {return fESDZDC?fESDZDC->GetZDCP2Energy():0;}
214 Double_t GetZDCEMEnergy(Int_t i=0) const {return fESDZDC?fESDZDC->GetZDCEMEnergy(i):0;}
215 Int_t GetZDCParticipants() const {return fESDZDC?fESDZDC->GetZDCParticipants():0;}
fba4b2e2 216 AliCentrality* GetCentrality();
ce7adfe9 217 AliEventplane* GetEventplane();
cb62947d 218
2eec2a33 219
b19cc8d0 220 void SetZDC(Float_t n1Energy, Float_t p1Energy, Float_t em1Energy, Float_t em2Energy,
221 Float_t n2Energy, Float_t p2Energy, Int_t participants, Int_t nPartA,
222 Int_t nPartC, Double_t b, Double_t bA, Double_t bC, UInt_t recoflag)
c017f53f 223 {if(fESDZDC) fESDZDC->SetZDC(n1Energy, p1Energy, em1Energy, em2Energy, n2Energy, p2Energy,
b19cc8d0 224 participants, nPartA, nPartC, b, bA, bC, recoflag);}
cb62947d 225 // FMD
af885e0f 226 void SetFMDData(AliESDFMD * obj);
5b96d6f1 227 AliESDFMD *GetFMDData() const { return fESDFMD; }
af885e0f 228
229
230 // TZERO CKB: put this in the header?
231 const AliESDTZERO* GetESDTZERO() const {return fESDTZERO;}
b0e13b29 232 void SetTZEROData(AliESDTZERO * obj);
233 // delegetated methods for fESDTZERO
af885e0f 234
adf36b9d 235 Double32_t GetT0zVertex() const {return fESDTZERO?fESDTZERO->GetT0zVertex():0;}
236 void SetT0zVertex(Double32_t z) {if(fESDTZERO) fESDTZERO->SetT0zVertex(z);}
237 Double32_t GetT0() const {return fESDTZERO?fESDTZERO->GetT0():0;}
238 void SetT0(Double32_t timeStart) {if(fESDTZERO) fESDTZERO->SetT0(timeStart);}
239 Double32_t GetT0clock() const {return fESDTZERO?fESDTZERO->GetT0clock():0;}
240 void SetT0clock(Double32_t timeStart) {if(fESDTZERO) fESDTZERO->SetT0clock(timeStart);}
241 Double32_t GetT0TOF(Int_t icase) const {return fESDTZERO?fESDTZERO->GetT0TOF(icase):0;}
242 const Double32_t * GetT0TOF() const {return fESDTZERO?fESDTZERO->GetT0TOF():0x0;}
243 void SetT0TOF(Int_t icase,Double32_t timeStart) {if(fESDTZERO) fESDTZERO->SetT0TOF(icase,timeStart);}
244 const Double32_t * GetT0time() const {return fESDTZERO?fESDTZERO->GetT0time():0x0;}
245 void SetT0time(Double32_t time[24]) {if(fESDTZERO) fESDTZERO->SetT0time(time);}
246 const Double32_t * GetT0amplitude() const {return fESDTZERO?fESDTZERO->GetT0amplitude():0x0;}
247 void SetT0amplitude(Double32_t amp[24]){if(fESDTZERO) fESDTZERO->SetT0amplitude(amp);}
248 Int_t GetT0Trig() const { return fESDTZERO?fESDTZERO->GetT0Trig():0;}
249 void SetT0Trig(Int_t tvdc) {if(fESDTZERO) fESDTZERO->SetT0Trig(tvdc);}
af885e0f 250
251 // VZERO
252 AliESDVZERO *GetVZEROData() const { return fESDVZERO; }
253 void SetVZEROData(AliESDVZERO * obj);
820b4d9e 254
255 #ifdef MFT_UPGRADE
256 // MFT
257// AliESDMFT *GetMFTData() const { return fESDMFT; }
258// void SetMFTData(AliESDMFT * obj);
259 #endif
260
bd95bae7 261 // ACORDE
262 AliESDACORDE *GetACORDEData() const { return fESDACORDE;}
263 void SetACORDEData(AliESDACORDE * obj);
af885e0f 264
7d44c466 265 void SetESDfriend(const AliESDfriend *f) const;
af885e0f 266 void GetESDfriend(AliESDfriend *f) const;
ddfbc51a 267
af885e0f 268
269
06cc9d95 270 void SetPrimaryVertexTPC(const AliESDVertex *vertex);
271 const AliESDVertex *GetPrimaryVertexTPC() const {return fTPCVertex;}
272
273 void SetPrimaryVertexSPD(const AliESDVertex *vertex);
274 const AliESDVertex *GetPrimaryVertexSPD() const {return fSPDVertex;}
275 const AliESDVertex *GetVertex() const {
276 //For the backward compatibily only
277 return GetPrimaryVertexSPD();
278 }
af885e0f 279
c264b61b 280 void SetPrimaryVertexTracks(const AliESDVertex *vertex);
281 const AliESDVertex *GetPrimaryVertexTracks() const {return fPrimaryVertex;}
518573d7 282 AliESDVertex *PrimaryVertexTracksUnconstrained() const;
c264b61b 283
284 const AliESDVertex *GetPrimaryVertex() const;
af885e0f 285
f858b00e 286
287
288 void SetTOFHeader(const AliTOFHeader * tofEventTime);
289 const AliTOFHeader *GetTOFHeader() const {return fTOFHeader;}
d9fc7e74 290 Float_t GetEventTimeSpread() const {if (fTOFHeader) return fTOFHeader->GetT0spread(); else return 0.;}
291 Float_t GetTOFTimeResolution() const {if (fTOFHeader) return fTOFHeader->GetTOFResolution(); else return 0.;}
f858b00e 292
293
f0106218 294 void SetMultiplicity(const AliMultiplicity *mul);
295
af885e0f 296 const AliMultiplicity *GetMultiplicity() const {return fSPDMult;}
4ace6760 297 void EstimateMultiplicity(Int_t &tracklets,Int_t &trITSTPC,Int_t &trITSSApure,
298 Double_t eta=1.,Bool_t useDCAFlag=kTRUE,Bool_t useV0Flag=kTRUE) const;
f0106218 299
7f68891d 300 Bool_t Clean(Float_t *cleanPars);
7d44c466 301 Bool_t RemoveKink(Int_t i) const;
302 Bool_t RemoveV0(Int_t i) const;
303 Bool_t RemoveTrack(Int_t i) const;
d64bd07d 304
04d01397 305 const AliESDVertex *GetPileupVertexSPD(Int_t i) const {
c017f53f 306 return (const AliESDVertex *)(fSPDPileupVertices?fSPDPileupVertices->UncheckedAt(i):0x0);
04d01397 307 }
6dc21f57 308 Char_t AddPileupVertexSPD(const AliESDVertex *vtx);
04d01397 309 const AliESDVertex *GetPileupVertexTracks(Int_t i) const {
c017f53f 310 return (const AliESDVertex *)(fTrkPileupVertices?fTrkPileupVertices->UncheckedAt(i):0x0);
04d01397 311 }
6dc21f57 312 Char_t AddPileupVertexTracks(const AliESDVertex *vtx);
3f2db92f 313 TClonesArray* GetPileupVerticesTracks() const {return (TClonesArray*)fTrkPileupVertices;}
314 TClonesArray* GetPileupVerticesSPD() const {return (TClonesArray*)fSPDPileupVertices;}
04d01397 315
a98c78e5 316 virtual Bool_t IsPileupFromSPD(Int_t minContributors=3,
317 Double_t minZdist=0.8,
318 Double_t nSigmaZdist=3.,
319 Double_t nSigmaDiamXY=2.,
320 Double_t nSigmaDiamZ=5.) const;
321
b46ff4b0 322 virtual Bool_t IsPileupFromSPDInMultBins() const;
323
af885e0f 324 AliESDtrack *GetTrack(Int_t i) const {
0ecbfc1b 325 if (!fTracks) return 0;
326 AliESDtrack* track = (AliESDtrack*) fTracks->UncheckedAt(i);
327 track->SetESDEvent(this);
328 return track;
af885e0f 329 }
330 Int_t AddTrack(const AliESDtrack *t);
331
65a0cf79 332 /// add new track at the end of tracks array and return instance
333 AliESDtrack* NewTrack();
af885e0f 334
335 AliESDHLTtrack *GetHLTConfMapTrack(Int_t /*i*/) const {
336 // return (AliESDHLTtrack *)fHLTConfMapTracks->UncheckedAt(i);
337 return 0;
338 }
339 void AddHLTConfMapTrack(const AliESDHLTtrack */*t*/) {
340 printf("ESD:: AddHLTConfMapTrack do nothing \n");
341 // TClonesArray &fhlt = *fHLTConfMapTracks;
342 // new(fhlt[fHLTConfMapTracks->GetEntriesFast()]) AliESDHLTtrack(*t);
343 }
344
345
346 AliESDHLTtrack *GetHLTHoughTrack(Int_t /*i*/) const {
347 // return (AliESDHLTtrack *)fHLTHoughTracks->UncheckedAt(i);
348 return 0;
349 }
350 void AddHLTHoughTrack(const AliESDHLTtrack */*t*/) {
351 printf("ESD:: AddHLTHoughTrack do nothing \n");
352 // TClonesArray &fhlt = *fHLTHoughTracks;
353 // new(fhlt[fHLTHoughTracks->GetEntriesFast()]) AliESDHLTtrack(*t);
354 }
355
356 AliESDMuonTrack *GetMuonTrack(Int_t i) const {
c017f53f 357 return (AliESDMuonTrack *)(fMuonTracks?fMuonTracks->UncheckedAt(i):0x0);
af885e0f 358 }
f0106218 359
360 void AddMuonTrack(const AliESDMuonTrack *t);
af885e0f 361
362 AliESDPmdTrack *GetPmdTrack(Int_t i) const {
c017f53f 363 return (AliESDPmdTrack *)(fPmdTracks?fPmdTracks->UncheckedAt(i):0x0);
af885e0f 364 }
f0106218 365
366 void AddPmdTrack(const AliESDPmdTrack *t);
367
af885e0f 368
369 AliESDTrdTrack *GetTrdTrack(Int_t i) const {
c017f53f 370 return (AliESDTrdTrack *)(fTrdTracks?fTrdTracks->UncheckedAt(i):0x0);
af885e0f 371 }
f0106218 372
373
6c8e0967 374 void SetTrdTrigger(const AliESDTrdTrigger *t);
375
376 AliESDTrdTrigger* GetTrdTrigger() const {
377 return (AliESDTrdTrigger*)(fTrdTrigger);
378 }
379
f0106218 380 void AddTrdTrack(const AliESDTrdTrack *t);
af885e0f 381
52cd0cc0 382 AliESDTrdTracklet* GetTrdTracklet(Int_t idx) const {
383 return (AliESDTrdTracklet*)(fTrdTracklets?fTrdTracklets->UncheckedAt(idx):0x0);
384 }
385
386 void AddTrdTracklet(const AliESDTrdTracklet *trkl);
387
af885e0f 388 AliESDv0 *GetV0(Int_t i) const {
c017f53f 389 return (AliESDv0*)(fV0s?fV0s->UncheckedAt(i):0x0);
af885e0f 390 }
391 Int_t AddV0(const AliESDv0 *v);
392
393 AliESDcascade *GetCascade(Int_t i) const {
c017f53f 394 return (AliESDcascade *)(fCascades?fCascades->UncheckedAt(i):0x0);
af885e0f 395 }
f0106218 396
397 void AddCascade(const AliESDcascade *c);
af885e0f 398
399 AliESDkink *GetKink(Int_t i) const {
c017f53f 400 return (AliESDkink *)(fKinks?fKinks->UncheckedAt(i):0x0);
af885e0f 401 }
402 Int_t AddKink(const AliESDkink *c);
403
404 AliESDCaloCluster *GetCaloCluster(Int_t i) const {
c017f53f 405 return (AliESDCaloCluster *)(fCaloClusters?fCaloClusters->UncheckedAt(i):0x0);
af885e0f 406 }
e649177a 407
af885e0f 408 Int_t AddCaloCluster(const AliESDCaloCluster *c);
409
e649177a 410 AliESDCaloCells *GetEMCALCells() const {return fEMCALCells; }
411 AliESDCaloCells *GetPHOSCells() const {return fPHOSCells; }
412
042d5330 413 AliESDCaloTrigger* GetCaloTrigger(TString calo) const
414 {
415 if (calo.Contains("EMCAL")) return fEMCALTrigger;
416 else
417 return fPHOSTrigger;
418 }
8e1324ab 419
420 AliESDCosmicTrack *GetCosmicTrack(Int_t i) const {
421 return fCosmicTracks ? (AliESDCosmicTrack*) fCosmicTracks->UncheckedAt(i) : 0;
422 }
423 const TClonesArray * GetCosmicTracks() const{ return fCosmicTracks;}
424
425 void AddCosmicTrack(const AliESDCosmicTrack *t);
042d5330 426
af885e0f 427 AliRawDataErrorLog *GetErrorLog(Int_t i) const {
c017f53f 428 return (AliRawDataErrorLog *)(fErrorLogs?fErrorLogs->UncheckedAt(i):0x0);
af885e0f 429 }
7d44c466 430 void AddRawDataErrorLog(const AliRawDataErrorLog *log) const;
f0106218 431
c017f53f 432 Int_t GetNumberOfErrorLogs() const {return fErrorLogs?fErrorLogs->GetEntriesFast():0;}
af885e0f 433
04d01397 434 Int_t GetNumberOfPileupVerticesSPD() const {
642f673b 435 return (fSPDPileupVertices?fSPDPileupVertices->GetEntriesFast():0);
04d01397 436 }
437 Int_t GetNumberOfPileupVerticesTracks() const {
642f673b 438 return (fTrkPileupVertices?fTrkPileupVertices->GetEntriesFast():0);
04d01397 439 }
c017f53f 440 Int_t GetNumberOfTracks() const {return fTracks?fTracks->GetEntriesFast():0;}
af885e0f 441 Int_t GetNumberOfHLTConfMapTracks() const {return 0;}
442 // fHLTConfMapTracks->GetEntriesFast();}
443 Int_t GetNumberOfHLTHoughTracks() const {return 0; }
444 // fHLTHoughTracks->GetEntriesFast(); }
445
c017f53f 446 Int_t GetNumberOfMuonTracks() const {return fMuonTracks?fMuonTracks->GetEntriesFast():0;}
447 Int_t GetNumberOfPmdTracks() const {return fPmdTracks?fPmdTracks->GetEntriesFast():0;}
448 Int_t GetNumberOfTrdTracks() const {return fTrdTracks?fTrdTracks->GetEntriesFast():0;}
52cd0cc0 449 Int_t GetNumberOfTrdTracklets() const {return fTrdTracklets?fTrdTracklets->GetEntriesFast():0;}
c017f53f 450 Int_t GetNumberOfV0s() const {return fV0s?fV0s->GetEntriesFast():0;}
451 Int_t GetNumberOfCascades() const {return fCascades?fCascades->GetEntriesFast():0;}
452 Int_t GetNumberOfKinks() const {return fKinks?fKinks->GetEntriesFast():0;}
8e1324ab 453
454 Int_t GetNumberOfCosmicTracks() const {return fCosmicTracks ? fCosmicTracks->GetEntriesFast():0;}
cd1d4ee0 455 Int_t GetEMCALClusters(TRefArray *clusters) const;
456 Int_t GetPHOSClusters(TRefArray *clusters) const;
c017f53f 457 Int_t GetNumberOfCaloClusters() const {return fCaloClusters?fCaloClusters->GetEntriesFast():0;}
af885e0f 458
a2fbb067 459 void SetUseOwnList(Bool_t b){fUseOwnList = b;}
b19cc8d0 460 Bool_t GetUseOwnList() const {return fUseOwnList;}
e649177a 461
c017f53f 462 void ResetV0s() { if(fV0s) fV0s->Clear(); }
463 void ResetCascades() { if(fCascades) fCascades->Clear(); }
af885e0f 464 void Reset();
465
466 void Print(Option_t *option="") const;
467
468 void AddObject(TObject* obj);
1d0dd492 469 void ReadFromTree(TTree *tree, Option_t* opt = "");
2811495d 470 TObject* FindListObject(const char *name) const;
af885e0f 471 AliESD *GetAliESDOld(){return fESDOld;}
f12d42ce 472 void WriteToTree(TTree* tree) const;
af885e0f 473 void GetStdContent();
474 void ResetStdContent();
475 void CreateStdContent();
a2fbb067 476 void CreateStdContent(Bool_t bUseThisList);
af885e0f 477 void SetStdNames();
478 void CopyFromOldESD();
024c7734 479 TList* GetList() const {return fESDObjects;}
c8fe2783 480
481 //Following needed only for mixed event
482 virtual Int_t EventIndex(Int_t) const {return 0;}
483 virtual Int_t EventIndexForCaloCluster(Int_t) const {return 0;}
484 virtual Int_t EventIndexForPHOSCell(Int_t) const {return 0;}
485 virtual Int_t EventIndexForEMCALCell(Int_t) const {return 0;}
486
a8f382ab 487 void SetDetectorStatus(ULong_t detMask) {fDetectorStatus|=detMask;}
488 void ResetDetectorStatus(ULong_t detMask) {fDetectorStatus&=~detMask;}
489 ULong_t GetDetectorStatus() const {return fDetectorStatus;}
490 Bool_t IsDetectorOn(ULong_t detMask) const {return (fDetectorStatus&detMask)>0;}
af885e0f 491
492protected:
493 AliESDEvent(const AliESDEvent&);
102c56c8 494 static Bool_t ResetWithPlacementNew(TObject *pObject);
af885e0f 495
496 TList *fESDObjects; // List of esd Objects
497
498 AliESDRun *fESDRun; //! Run information tmp put in the Userdata
499 AliESDHeader *fHeader; //! ESD Event Header
500 AliESDZDC *fESDZDC; //! ZDC information
501 AliESDFMD *fESDFMD; //! FMD object containing rough multiplicity
502 AliESDVZERO *fESDVZERO; //! VZERO object containing rough multiplicity
503 AliESDTZERO *fESDTZERO; //! TZEROObject
06cc9d95 504 AliESDVertex *fTPCVertex; //! Primary vertex estimated by the TPC
af885e0f 505 AliESDVertex *fSPDVertex; //! Primary vertex estimated by the SPD
506 AliESDVertex *fPrimaryVertex; //! Primary vertex estimated using ESD tracks
507 AliMultiplicity *fSPDMult; //! SPD tracklet multiplicity
508 AliESDCaloTrigger* fPHOSTrigger; //! PHOS Trigger information
509 AliESDCaloTrigger* fEMCALTrigger; //! PHOS Trigger information
bd95bae7 510 AliESDACORDE *fESDACORDE; //! ACORDE ESD object caontaining bit pattern
6c8e0967 511 AliESDTrdTrigger *fTrdTrigger; //! TRD trigger information
af885e0f 512
04d01397 513 TClonesArray *fSPDPileupVertices;//! Pileup primary vertices reconstructed by SPD
514 TClonesArray *fTrkPileupVertices;//! Pileup primary vertices reconstructed using the tracks
af885e0f 515 TClonesArray *fTracks; //! ESD tracks
516 TClonesArray *fMuonTracks; //! MUON ESD tracks
517 TClonesArray *fPmdTracks; //! PMD ESD tracks
518 TClonesArray *fTrdTracks; //! TRD ESD tracks (triggered)
52cd0cc0 519 TClonesArray *fTrdTracklets; //! TRD tracklets (for trigger)
af885e0f 520 TClonesArray *fV0s; //! V0 vertices
521 TClonesArray *fCascades; //! Cascade vertices
522 TClonesArray *fKinks; //! Kinks
523 TClonesArray *fCaloClusters; //! Calorimeter clusters for PHOS/EMCAL
e649177a 524 AliESDCaloCells *fEMCALCells; //! EMCAL cell info
525 AliESDCaloCells *fPHOSCells; //! PHOS cell info
8e1324ab 526 TClonesArray *fCosmicTracks; //! Tracks created by cosmics finder
af885e0f 527 TClonesArray *fErrorLogs; //! Raw-data reading error messages
528
529
530
1bd10080 531 AliESD *fESDOld; //! Old esd Structure
532 AliESDfriend *fESDFriendOld; //! Old friend esd Structure
60e8f114 533 Bool_t fConnected; //! flag if leaves are alreday connected
a2fbb067 534 Bool_t fUseOwnList; //! Do not use the list from the esdTree but use the one created by this class
60e8f114 535
6989bff3 536 static const char* fgkESDListName[kESDListN]; //!
af885e0f 537
f858b00e 538 AliTOFHeader *fTOFHeader; //! event times (and sigmas) as estimated by TOF
539 // combinatorial algorithm.
540 // It contains also TOF time resolution
541 // and T0spread as written in OCDB
fba4b2e2 542 AliCentrality *fCentrality; //! Centrality for AA collision
ce7adfe9 543 AliEventplane *fEventplane; //! Event plane for AA collision
a8f382ab 544
545 ULong_t fDetectorStatus; // set detector event status bit for good event selection
546
547 ClassDef(AliESDEvent,17) //ESDEvent class
af885e0f 548};
549#endif
550