1 #ifndef ALIFLATESDEVENT_H
2 #define ALIFLATESDEVENT_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice *
6 * Primary Authors : Sergey Gorbunov, Jochen Thaeder, Chiara Zampolli */
9 * See implementation file for documentation
13 #include "AliFlatESDTrack.h"
14 #include "AliFlatESDV0.h"
15 #include "AliVVevent.h"
16 #include "AliFlatESDVertex.h"
24 class AliFlatESDEvent: public AliVVevent {
25 //class AliFlatESDEvent {
27 // --------------------------------------------------------------------------------
28 // -- Constructor / Destructors
31 // empty constructor, to be called by placement new,
32 // when accessing information after reinterpret_cast
33 // so that vtable is generated, but values are not overwritten
34 AliFlatESDEvent(Bool_t){}
36 AliFlatESDEvent(AliESDEvent *esd);
37 AliFlatESDEvent(AliESDEvent *esd, Bool_t useESDFriends);
40 // --------------------------------------------------------------------------------
41 // -- Fill / Set methods
44 Int_t Fill( const AliESDEvent *esd, const Bool_t useESDFriends = kTRUE, const Bool_t fillV0s=kTRUE );
46 void FillPrimaryVertices( const AliESDVertex *vertexSPD,
47 const AliESDVertex *vertexTracks );
50 AliFlatESDTrack *GetNextTrackPointer(){
51 return reinterpret_cast<AliFlatESDTrack*> (fContent + fSize);
54 void StoreLastTrack(){
56 fSize+= GetNextTrackPointer()->GetSize();
60 AliFlatESDV0 *GetNextV0Pointer(){
61 return reinterpret_cast<AliFlatESDV0*> (fContent + fSize);
66 fSize+= sizeof(AliFlatESDV0);
69 // --------------------------------------------------------------------------------
72 const AliFlatESDVertex* GetPrimaryVertexSPD() const {
73 if (fPrimaryVertexMask & 0x1){
74 return reinterpret_cast< AliFlatESDVertex*> (const_cast<Byte_t*>(fContent));
79 const AliFlatESDVertex* GetPrimaryVertexTracks() const {
80 if (fPrimaryVertexMask & 0x2){
81 return reinterpret_cast< AliFlatESDVertex*> (const_cast<Byte_t*>(fContent)) + CountBits(fPrimaryVertexMask, 0x1);
86 Int_t GetNumberOfV0s() const {return fNV0s;}
88 Int_t GetNumberOfTracks() const {return fNTracks;}
90 AliFlatESDTrack *GetTracks() {
91 return reinterpret_cast<AliFlatESDTrack*> (fContent + fTracksPointer);
94 const AliVVvertex* GetPrimaryVertex() const {return NULL;}
95 const AliVVvertex* GetPrimaryVertexTPC() const {return NULL;}
96 AliFlatESDTrack* GetTrack(Int_t /*i*/) const {return NULL;}
97 AliVVkink* GetKink(Int_t /*i*/) const {return NULL;}
98 AliFlatESDV0* GetV0(Int_t /*i*/) const {return NULL;}
99 Int_t GetNumberOfKinks() const {return 0;}
100 Int_t GetEventNumberInFile() const {return -1;}
101 const AliMultiplicity* GetMultiplicity() const {return NULL;} //by default SPDmult
102 Int_t GetRunNumber() const {return -1;}
103 TString GetFiredTriggerClasses() const {TString string; return string;}
104 TObject* FindListObject(const char* /*name*/) const {return NULL;}
105 ULong64_t GetTriggerMask() const {return 0;}
106 Double_t GetMagneticField() const {return 0;}
107 UInt_t GetTimeStamp() const { return 0;}
108 UInt_t GetEventSpecie() const { return 0;}
111 // --------------------------------------------------------------------------------
113 static ULong64_t EstimateSize(AliESDEvent*esd, Bool_t useESDFriends = kTRUE, Bool_t fillV0s=kTRUE);
114 ULong64_t GetSize() {return fContent - reinterpret_cast<Byte_t*>(this) + fSize;}
120 AliFlatESDEvent(const AliFlatESDEvent&);
121 AliFlatESDEvent& operator=(const AliFlatESDEvent&);
123 void FillPrimaryVertex(const AliESDVertex *v, Byte_t flag);
124 Int_t FillNextTrack( const AliESDtrack* esdTrack, AliESDfriendTrack* friendTrack);
125 Int_t FillNextV0( const AliESDV0 *v0);
126 UInt_t CountBits(Byte_t field, UInt_t mask) const;
128 // --------------------------------------------------------------------------------
129 // -- Fixed size member objects
130 // -> Try to align in memory
132 Byte_t fPrimaryVertexMask; // Bit mask specfifying which primary vertices are present
133 Int_t fNTracks; // Number of tracks in vector
134 ULong64_t fTracksPointer; // position of the first track in fContent
135 Int_t fNV0s; // Number of v0's
136 ULong64_t fV0Pointer; // position of the first V0 in fContent
139 ULong64_t fSize; // Size of this object
141 // --------------------------------------------------------------------------------
142 // -- Variable Size Object
143 Byte_t fContent[1]; // Variale size object, which contains all data