- Three classes by MinJung Kweon AliHFEpriVtx, AliHFEsecVtx and AliHFEmcQA for primar...
[u/mrichter/AliRoot.git] / STEER / 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
23class TList;
24
024c7734 25#include "AliVEvent.h"
694aad0c 26// some includes for delegated methods
f0106218 27#include "AliESDCaloTrigger.h"
af885e0f 28#include "AliESDRun.h"
29#include "AliESDHeader.h"
3f47e572 30#include "AliESDTZERO.h"
f0106218 31#include "AliESDZDC.h"
bd95bae7 32#include "AliESDACORDE.h"
af885e0f 33
024c7734 34// AliESDtrack has to be included so that the compiler
35// knows its inheritance tree (= that it is a AliVParticle).
36#include "AliESDtrack.h"
5303c167 37// same for AliESDVertex (which is a AliVVertex)
38#include "AliESDVertex.h"
024c7734 39
af885e0f 40class AliESDfriend;
41class AliESDVZERO;
42class AliESDHLTtrack;
f0106218 43class AliESDVertex;
44class AliESDPmdTrack;
45class AliESDFMD;
46class AliESDkink;
f0106218 47class AliESDCaloCluster;
e649177a 48class AliESDCaloCells;
f0106218 49class AliESDv0;
f0106218 50class AliMultiplicity;
51class AliRawDataErrorLog;
52class AliESDRun;
53class AliESDTrdTrack;
54class AliESDMuonTrack;
af885e0f 55class AliESD;
f0106218 56class AliESDcascade;
cd1d4ee0 57class TRefArray;
bd95bae7 58class AliESDACORDE;
af885e0f 59
024c7734 60class AliESDEvent : public AliVEvent {
af885e0f 61public:
62
63
6989bff3 64 enum ESDListIndex {kESDRun,
af885e0f 65 kHeader,
66 kESDZDC,
67 kESDFMD,
68 kESDVZERO,
69 kESDTZERO,
06cc9d95 70 kTPCVertex,
af885e0f 71 kSPDVertex,
72 kPrimaryVertex,
73 kSPDMult,
74 kPHOSTrigger,
75 kEMCALTrigger,
04d01397 76 kSPDPileupVertices,
77 kTrkPileupVertices,
af885e0f 78 kTracks,
79 kMuonTracks,
80 kPmdTracks,
81 kTrdTracks,
82 kV0s,
83 kCascades,
84 kKinks,
85 kCaloClusters,
e649177a 86 kEMCALCells,
87 kPHOSCells,
af885e0f 88 kErrorLogs,
bd95bae7 89 kESDACORDE,
af885e0f 90 kESDListN
91 };
92
93 AliESDEvent();
732a24fe 94 virtual ~AliESDEvent();
95 AliESDEvent &operator=(const AliESDEvent& source); // or make private and use only copy?
96 virtual void Copy(TObject& obj) const;
af885e0f 97
98 // RUN
99 // move this to the UserData!!!
100 const AliESDRun* GetESDRun() const {return fESDRun;}
101
102 // Delegated methods for fESDRun
024c7734 103 void SetRunNumber(Int_t n) {fESDRun->SetRunNumber(n);}
104 Int_t GetRunNumber() const {return fESDRun->GetRunNumber();}
105 void SetPeriodNumber(UInt_t n){fESDRun->SetPeriodNumber(n);}
106 UInt_t GetPeriodNumber() const {return fESDRun->GetPeriodNumber();}
107 void SetMagneticField(Double_t mf){fESDRun->SetMagneticField(mf);}
108 Double_t GetMagneticField() const {return fESDRun->GetMagneticField();}
109 void SetDiamond(const AliESDVertex *vertex) { fESDRun->SetDiamond(vertex);}
694aad0c 110 Double_t GetDiamondX() const {return fESDRun->GetDiamondX();}
111 Double_t GetDiamondY() const {return fESDRun->GetDiamondY();}
112 Double_t GetSigma2DiamondX() const {return fESDRun->GetSigma2DiamondX();}
113 Double_t GetSigma2DiamondY() const {return fESDRun->GetSigma2DiamondY();}
114 void GetDiamondCovXY(Float_t cov[3]) const {fESDRun->GetDiamondCovXY(cov);}
b024fd7f 115 void SetTriggerClass(const char*name, Int_t index) {fESDRun->SetTriggerClass(name,index);}
af885e0f 116
117
118 // HEADER
024c7734 119 AliESDHeader* GetHeader() const {return fHeader;}
af885e0f 120
121 // Delegated methods for fHeader
122 void SetTriggerMask(ULong64_t n) {fHeader->SetTriggerMask(n);}
123 void SetOrbitNumber(UInt_t n) {fHeader->SetOrbitNumber(n);}
124 void SetTimeStamp(UInt_t timeStamp){fHeader->SetTimeStamp(timeStamp);}
125 void SetEventType(UInt_t eventType){fHeader->SetEventType(eventType);}
126 void SetEventNumberInFile(Int_t n) {fHeader->SetEventNumberInFile(n);}
732a24fe 127 // void SetRunNumber(Int_t n) {fHeader->SetRunNumber(n);}
af885e0f 128 void SetBunchCrossNumber(UShort_t n) {fHeader->SetBunchCrossNumber(n);}
129 void SetTriggerCluster(UChar_t n) {fHeader->SetTriggerCluster(n);}
694aad0c 130
af885e0f 131 ULong64_t GetTriggerMask() const {return fHeader->GetTriggerMask();}
ed4e8b82 132 TString GetFiredTriggerClasses() const {return fESDRun->GetFiredTriggerClasses(fHeader->GetTriggerMask());}
133 Bool_t IsTriggerClassFired(const char *name) const {return fESDRun->IsTriggerClassFired(fHeader->GetTriggerMask(),name);}
af885e0f 134 UInt_t GetOrbitNumber() const {return fHeader->GetOrbitNumber();}
135 UInt_t GetTimeStamp() const { return fHeader->GetTimeStamp();}
136 UInt_t GetEventType() const { return fHeader->GetEventType();}
137 Int_t GetEventNumberInFile() const {return fHeader->GetEventNumberInFile();}
138 UShort_t GetBunchCrossNumber() const {return fHeader->GetBunchCrossNumber();}
139 UChar_t GetTriggerCluster() const {return fHeader->GetTriggerCluster();}
140
141 // ZDC CKB: put this in the header?
a85132e7 142 AliESDZDC* GetESDZDC() const {return fESDZDC;}
af885e0f 143
144 // Delegated methods for fESDZDC
024c7734 145 Double_t GetZDCN1Energy() const {return fESDZDC->GetZDCN1Energy();}
146 Double_t GetZDCP1Energy() const {return fESDZDC->GetZDCP1Energy();}
147 Double_t GetZDCN2Energy() const {return fESDZDC->GetZDCN2Energy();}
148 Double_t GetZDCP2Energy() const {return fESDZDC->GetZDCP2Energy();}
a85132e7 149 Double_t GetZDCEMEnergy(Int_t i=0) const {return fESDZDC->GetZDCEMEnergy(i);}
af885e0f 150 Int_t GetZDCParticipants() const {return fESDZDC->GetZDCParticipants();}
2b6cdc43 151 Int_t GetZDCParticipants2() const {return fESDZDC->GetZDCParticipants2();}
a85132e7 152 void SetZDC(Float_t n1Energy, Float_t p1Energy, Float_t em1Energy, Float_t em2Energy,
2b6cdc43 153 Float_t n2Energy, Float_t p2Energy,
154 Int_t participants, Int_t participants2)
155 {fESDZDC->SetZDC(n1Energy, p1Energy, em1Energy, em2Energy, n2Energy, p2Energy,
156 participants, participants2);}
af885e0f 157
158
159 // FMD
160 void SetFMDData(AliESDFMD * obj);
161 AliESDFMD *GetFMDData(){ return fESDFMD; }
162
163
164 // TZERO CKB: put this in the header?
165 const AliESDTZERO* GetESDTZERO() const {return fESDTZERO;}
166 // delegetated methods for fESDTZERO
167
694aad0c 168 Double_t GetT0zVertex() const {return fESDTZERO->GetT0zVertex();}
af885e0f 169 void SetT0zVertex(Float_t z) {fESDTZERO->SetT0zVertex(z);}
694aad0c 170 Double_t GetT0() const {return fESDTZERO->GetT0();}
af885e0f 171 void SetT0(Float_t timeStart) {fESDTZERO->SetT0(timeStart);}
694aad0c 172 const Double_t * GetT0time() const {return fESDTZERO->GetT0time();}
af885e0f 173 void SetT0time(Float_t time[24]) {fESDTZERO->SetT0time(time);}
694aad0c 174 const Double_t * GetT0amplitude() const {return fESDTZERO->GetT0amplitude();}
af885e0f 175 void SetT0amplitude(Float_t amp[24]){fESDTZERO->SetT0amplitude(amp);}
176
177 // VZERO
178 AliESDVZERO *GetVZEROData() const { return fESDVZERO; }
179 void SetVZEROData(AliESDVZERO * obj);
180
bd95bae7 181 // ACORDE
182 AliESDACORDE *GetACORDEData() const { return fESDACORDE;}
183 void SetACORDEData(AliESDACORDE * obj);
af885e0f 184
7d44c466 185 void SetESDfriend(const AliESDfriend *f) const;
af885e0f 186 void GetESDfriend(AliESDfriend *f) const;
187
188
189
06cc9d95 190 void SetPrimaryVertexTPC(const AliESDVertex *vertex);
191 const AliESDVertex *GetPrimaryVertexTPC() const {return fTPCVertex;}
192
193 void SetPrimaryVertexSPD(const AliESDVertex *vertex);
194 const AliESDVertex *GetPrimaryVertexSPD() const {return fSPDVertex;}
195 const AliESDVertex *GetVertex() const {
196 //For the backward compatibily only
197 return GetPrimaryVertexSPD();
198 }
af885e0f 199
c264b61b 200 void SetPrimaryVertexTracks(const AliESDVertex *vertex);
201 const AliESDVertex *GetPrimaryVertexTracks() const {return fPrimaryVertex;}
202
203 const AliESDVertex *GetPrimaryVertex() const;
af885e0f 204
f0106218 205 void SetMultiplicity(const AliMultiplicity *mul);
206
af885e0f 207 const AliMultiplicity *GetMultiplicity() const {return fSPDMult;}
f0106218 208
209
7f68891d 210 Bool_t Clean(Float_t *cleanPars);
7d44c466 211 Bool_t RemoveKink(Int_t i) const;
212 Bool_t RemoveV0(Int_t i) const;
213 Bool_t RemoveTrack(Int_t i) const;
d64bd07d 214
04d01397 215 const AliESDVertex *GetPileupVertexSPD(Int_t i) const {
216 return (const AliESDVertex *)fSPDPileupVertices->UncheckedAt(i);
217 }
6dc21f57 218 Char_t AddPileupVertexSPD(const AliESDVertex *vtx);
04d01397 219
220 const AliESDVertex *GetPileupVertexTracks(Int_t i) const {
221 return (const AliESDVertex *)fTrkPileupVertices->UncheckedAt(i);
222 }
6dc21f57 223 Char_t AddPileupVertexTracks(const AliESDVertex *vtx);
04d01397 224
af885e0f 225 AliESDtrack *GetTrack(Int_t i) const {
226 return (AliESDtrack *)fTracks->UncheckedAt(i);
227 }
228 Int_t AddTrack(const AliESDtrack *t);
229
230
231 AliESDHLTtrack *GetHLTConfMapTrack(Int_t /*i*/) const {
232 // return (AliESDHLTtrack *)fHLTConfMapTracks->UncheckedAt(i);
233 return 0;
234 }
235 void AddHLTConfMapTrack(const AliESDHLTtrack */*t*/) {
236 printf("ESD:: AddHLTConfMapTrack do nothing \n");
237 // TClonesArray &fhlt = *fHLTConfMapTracks;
238 // new(fhlt[fHLTConfMapTracks->GetEntriesFast()]) AliESDHLTtrack(*t);
239 }
240
241
242 AliESDHLTtrack *GetHLTHoughTrack(Int_t /*i*/) const {
243 // return (AliESDHLTtrack *)fHLTHoughTracks->UncheckedAt(i);
244 return 0;
245 }
246 void AddHLTHoughTrack(const AliESDHLTtrack */*t*/) {
247 printf("ESD:: AddHLTHoughTrack do nothing \n");
248 // TClonesArray &fhlt = *fHLTHoughTracks;
249 // new(fhlt[fHLTHoughTracks->GetEntriesFast()]) AliESDHLTtrack(*t);
250 }
251
252 AliESDMuonTrack *GetMuonTrack(Int_t i) const {
253 return (AliESDMuonTrack *)fMuonTracks->UncheckedAt(i);
254 }
f0106218 255
256 void AddMuonTrack(const AliESDMuonTrack *t);
af885e0f 257
258 AliESDPmdTrack *GetPmdTrack(Int_t i) const {
259 return (AliESDPmdTrack *)fPmdTracks->UncheckedAt(i);
260 }
f0106218 261
262 void AddPmdTrack(const AliESDPmdTrack *t);
263
af885e0f 264
265 AliESDTrdTrack *GetTrdTrack(Int_t i) const {
266 return (AliESDTrdTrack *)fTrdTracks->UncheckedAt(i);
267 }
f0106218 268
269
270 void AddTrdTrack(const AliESDTrdTrack *t);
af885e0f 271
272 AliESDv0 *GetV0(Int_t i) const {
273 return (AliESDv0*)fV0s->UncheckedAt(i);
274 }
275 Int_t AddV0(const AliESDv0 *v);
276
277 AliESDcascade *GetCascade(Int_t i) const {
278 return (AliESDcascade *)fCascades->UncheckedAt(i);
279 }
f0106218 280
281 void AddCascade(const AliESDcascade *c);
af885e0f 282
283 AliESDkink *GetKink(Int_t i) const {
284 return (AliESDkink *)fKinks->UncheckedAt(i);
285 }
286 Int_t AddKink(const AliESDkink *c);
287
288 AliESDCaloCluster *GetCaloCluster(Int_t i) const {
289 return (AliESDCaloCluster *)fCaloClusters->UncheckedAt(i);
290 }
e649177a 291
af885e0f 292 Int_t AddCaloCluster(const AliESDCaloCluster *c);
293
e649177a 294 AliESDCaloCells *GetEMCALCells() const {return fEMCALCells; }
295 AliESDCaloCells *GetPHOSCells() const {return fPHOSCells; }
296
af885e0f 297 AliRawDataErrorLog *GetErrorLog(Int_t i) const {
298 return (AliRawDataErrorLog *)fErrorLogs->UncheckedAt(i);
299 }
7d44c466 300 void AddRawDataErrorLog(const AliRawDataErrorLog *log) const;
f0106218 301
af885e0f 302 Int_t GetNumberOfErrorLogs() const {return fErrorLogs->GetEntriesFast();}
303
304
305 void AddPHOSTriggerPosition(TArrayF array) { fPHOSTrigger->AddTriggerPosition(array); }
306 void AddPHOSTriggerAmplitudes(TArrayF array) { fPHOSTrigger->AddTriggerAmplitudes(array);}
307 void AddEMCALTriggerPosition(TArrayF array) { fEMCALTrigger->AddTriggerPosition(array); }
308 void AddEMCALTriggerAmplitudes(TArrayF array){ fEMCALTrigger->AddTriggerAmplitudes(array); }
309
04d01397 310 Int_t GetNumberOfPileupVerticesSPD() const {
311 return fSPDPileupVertices->GetEntriesFast();
312 }
313 Int_t GetNumberOfPileupVerticesTracks() const {
314 return fTrkPileupVertices->GetEntriesFast();
315 }
af885e0f 316 Int_t GetNumberOfTracks() const {return fTracks->GetEntriesFast();}
317 Int_t GetNumberOfHLTConfMapTracks() const {return 0;}
318 // fHLTConfMapTracks->GetEntriesFast();}
319 Int_t GetNumberOfHLTHoughTracks() const {return 0; }
320 // fHLTHoughTracks->GetEntriesFast(); }
321
322 Int_t GetNumberOfMuonTracks() const {return fMuonTracks->GetEntriesFast();}
323 Int_t GetNumberOfPmdTracks() const {return fPmdTracks->GetEntriesFast();}
324 Int_t GetNumberOfTrdTracks() const {return fTrdTracks->GetEntriesFast();}
325 Int_t GetNumberOfV0s() const {return fV0s->GetEntriesFast();}
326 Int_t GetNumberOfCascades() const {return fCascades->GetEntriesFast();}
327 Int_t GetNumberOfKinks() const {return fKinks->GetEntriesFast();}
e649177a 328
cd1d4ee0 329 Int_t GetEMCALClusters(TRefArray *clusters) const;
330 Int_t GetPHOSClusters(TRefArray *clusters) const;
af885e0f 331 Int_t GetNumberOfCaloClusters() const {return fCaloClusters->GetEntriesFast();}
332
a2fbb067 333 void SetUseOwnList(Bool_t b){fUseOwnList = b;}
334 Bool_t GetUseOwnList(){return fUseOwnList;}
e649177a 335
336 // Remove this stuff CKB?
337 //---------------------------------------------------
af885e0f 338 Int_t GetNumberOfEMCALClusters() const {return fEMCALClusters;}
339 void SetNumberOfEMCALClusters(Int_t clus) {fEMCALClusters = clus;}
340 Int_t GetFirstEMCALCluster() const {return fFirstEMCALCluster;}
341 void SetFirstEMCALCluster(Int_t index) {fFirstEMCALCluster = index;}
e649177a 342
af885e0f 343 Int_t GetNumberOfPHOSClusters() const {return fPHOSClusters;}
344 void SetNumberOfPHOSClusters(Int_t part) { fPHOSClusters = part ; }
345 void SetFirstPHOSCluster(Int_t index) { fFirstPHOSCluster = index ; }
346 Int_t GetFirstPHOSCluster() const { return fFirstPHOSCluster ; }
e649177a 347 //-------------------------------------------------------
348
349 TArrayF *GetEMCALTriggerPosition() const {return fEMCALTrigger->GetTriggerPosition();}
350 TArrayF *GetEMCALTriggerAmplitudes() const {return fEMCALTrigger->GetTriggerAmplitudes();}
af885e0f 351 TArrayF *GetPHOSTriggerPosition() const {return fPHOSTrigger->GetTriggerPosition();}
352 TArrayF *GetPHOSTriggerAmplitudes() const {return fPHOSTrigger->GetTriggerAmplitudes();}
353
354 void ResetV0s() { fV0s->Clear(); }
355 void ResetCascades() { fCascades->Clear(); }
356 void Reset();
357
358 void Print(Option_t *option="") const;
359
360 void AddObject(TObject* obj);
1d0dd492 361 void ReadFromTree(TTree *tree, Option_t* opt = "");
001b9beb 362 TObject* FindListObject(const char *name);
af885e0f 363 AliESD *GetAliESDOld(){return fESDOld;}
f12d42ce 364 void WriteToTree(TTree* tree) const;
af885e0f 365 void GetStdContent();
366 void ResetStdContent();
367 void CreateStdContent();
a2fbb067 368 void CreateStdContent(Bool_t bUseThisList);
af885e0f 369 void SetStdNames();
370 void CopyFromOldESD();
024c7734 371 TList* GetList() const {return fESDObjects;}
af885e0f 372
373protected:
374 AliESDEvent(const AliESDEvent&);
102c56c8 375 static Bool_t ResetWithPlacementNew(TObject *pObject);
af885e0f 376
377 TList *fESDObjects; // List of esd Objects
378
379 AliESDRun *fESDRun; //! Run information tmp put in the Userdata
380 AliESDHeader *fHeader; //! ESD Event Header
381 AliESDZDC *fESDZDC; //! ZDC information
382 AliESDFMD *fESDFMD; //! FMD object containing rough multiplicity
383 AliESDVZERO *fESDVZERO; //! VZERO object containing rough multiplicity
384 AliESDTZERO *fESDTZERO; //! TZEROObject
06cc9d95 385 AliESDVertex *fTPCVertex; //! Primary vertex estimated by the TPC
af885e0f 386 AliESDVertex *fSPDVertex; //! Primary vertex estimated by the SPD
387 AliESDVertex *fPrimaryVertex; //! Primary vertex estimated using ESD tracks
388 AliMultiplicity *fSPDMult; //! SPD tracklet multiplicity
389 AliESDCaloTrigger* fPHOSTrigger; //! PHOS Trigger information
390 AliESDCaloTrigger* fEMCALTrigger; //! PHOS Trigger information
bd95bae7 391 AliESDACORDE *fESDACORDE; //! ACORDE ESD object caontaining bit pattern
af885e0f 392
04d01397 393 TClonesArray *fSPDPileupVertices;//! Pileup primary vertices reconstructed by SPD
394 TClonesArray *fTrkPileupVertices;//! Pileup primary vertices reconstructed using the tracks
af885e0f 395 TClonesArray *fTracks; //! ESD tracks
396 TClonesArray *fMuonTracks; //! MUON ESD tracks
397 TClonesArray *fPmdTracks; //! PMD ESD tracks
398 TClonesArray *fTrdTracks; //! TRD ESD tracks (triggered)
399 TClonesArray *fV0s; //! V0 vertices
400 TClonesArray *fCascades; //! Cascade vertices
401 TClonesArray *fKinks; //! Kinks
402 TClonesArray *fCaloClusters; //! Calorimeter clusters for PHOS/EMCAL
e649177a 403 AliESDCaloCells *fEMCALCells; //! EMCAL cell info
404 AliESDCaloCells *fPHOSCells; //! PHOS cell info
af885e0f 405 TClonesArray *fErrorLogs; //! Raw-data reading error messages
406
407
408
1bd10080 409 AliESD *fESDOld; //! Old esd Structure
410 AliESDfriend *fESDFriendOld; //! Old friend esd Structure
60e8f114 411 Bool_t fConnected; //! flag if leaves are alreday connected
a2fbb067 412 Bool_t fUseOwnList; //! Do not use the list from the esdTree but use the one created by this class
60e8f114 413
6989bff3 414 static const char* fgkESDListName[kESDListN]; //!
af885e0f 415
af885e0f 416 // Remove this stuff CKB
417 Int_t fEMCALClusters; // Number of EMCAL clusters (subset of caloclusters)
418 Int_t fFirstEMCALCluster; // First EMCAL cluster in the fCaloClusters list
419
420 Int_t fPHOSClusters; // Number of PHOS clusters (subset of caloclusters)
421 Int_t fFirstPHOSCluster; // First PHOS cluster in the fCaloClusters list
422
04d01397 423 ClassDef(AliESDEvent,10) //ESDEvent class
af885e0f 424};
425#endif
426