]>
Commit | Line | Data |
---|---|---|
251a2c81 | 1 | #ifndef ALIFLATESDEVENT_H |
2 | #define ALIFLATESDEVENT_H | |
3 | ||
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 */ | |
7 | ||
8 | /* | |
9 | * See implementation file for documentation | |
10 | */ | |
11 | ||
12 | #include "Rtypes.h" | |
13 | #include "AliFlatESDTrack.h" | |
14 | #include "AliFlatESDV0.h" | |
50ff8c36 | 15 | #include "AliVVevent.h" |
16 | #include "AliFlatESDVertex.h" | |
251a2c81 | 17 | |
18 | class AliESDEvent; | |
251a2c81 | 19 | class AliESDVertex; |
20 | class AliESDV0; | |
50ff8c36 | 21 | class TString; |
22 | class AliVVv0; | |
251a2c81 | 23 | |
50ff8c36 | 24 | class AliFlatESDEvent: public AliVVevent { |
251a2c81 | 25 | public: |
26 | // -------------------------------------------------------------------------------- | |
27 | // -- Constructor / Destructors | |
28 | AliFlatESDEvent(); | |
29 | AliFlatESDEvent(AliESDEvent *esd); | |
30 | AliFlatESDEvent(AliESDEvent *esd, Bool_t useESDFriends); | |
31 | ~AliFlatESDEvent(); | |
32 | ||
33 | // -------------------------------------------------------------------------------- | |
34 | // -- Fill / Set methods | |
35 | void Reset(); | |
36 | ||
37 | Int_t Fill( const AliESDEvent *esd, const Bool_t useESDFriends = kTRUE, const Bool_t fillV0s=kTRUE ); | |
38 | ||
39 | void FillPrimaryVertices( const AliESDVertex *vertexSPD, | |
40 | const AliESDVertex *vertexTracks ); | |
41 | ||
42 | ||
43 | AliFlatESDTrack *GetNextTrackPointer(){ return reinterpret_cast<AliFlatESDTrack*>(fContent + fSize); } | |
44 | ||
45 | void StoreLastTrack(){ | |
46 | fNTracks++; | |
47 | fSize+= GetNextTrackPointer()->GetSize(); | |
48 | fV0Pointer = fSize; | |
49 | } | |
50 | ||
51 | AliFlatESDV0 *GetNextV0Pointer(){ return reinterpret_cast<AliFlatESDV0*>(fContent + fSize); } | |
52 | ||
53 | void StoreLastV0(){ | |
54 | fNV0s++; | |
55 | fSize+= sizeof(AliFlatESDV0); | |
56 | } | |
57 | ||
58 | // -------------------------------------------------------------------------------- | |
59 | // -- Getter methods | |
60 | ||
50ff8c36 | 61 | const AliFlatESDVertex* GetPrimaryVertexSPD() const { |
62 | return (fPrimaryVertexMask & 0x1) ? reinterpret_cast<const AliFlatESDVertex*>(fContent) : NULL; | |
251a2c81 | 63 | } |
64 | ||
50ff8c36 | 65 | const AliFlatESDVertex* GetPrimaryVertexTracks() const { |
66 | return (fPrimaryVertexMask & 0x2) ? reinterpret_cast<const AliFlatESDVertex*>(fContent + CountBits(fPrimaryVertexMask, 0x1)) : NULL; | |
251a2c81 | 67 | } |
68 | ||
6a15ab77 | 69 | Int_t GetNumberOfV0s() const {return fNV0s;} |
251a2c81 | 70 | |
50ff8c36 | 71 | Int_t GetNumberOfTracks() const {return fNTracks;} |
251a2c81 | 72 | |
73 | AliFlatESDTrack *GetTracks() {return reinterpret_cast<AliFlatESDTrack*>(fContent + fTracksPointer);} | |
50ff8c36 | 74 | |
75 | const AliVVvertex* GetPrimaryVertex() const {return NULL;} | |
76 | const AliVVvertex* GetPrimaryVertexTPC() const {return NULL;} | |
6a15ab77 | 77 | AliFlatESDTrack* GetTrack(Int_t /*i*/) const {return NULL;} |
50ff8c36 | 78 | AliVVkink* GetKink(Int_t /*i*/) const {return NULL;} |
79 | AliFlatESDV0* GetV0(Int_t /*i*/) const {return NULL;} | |
80 | Int_t GetNumberOfKinks() const {return 0;} | |
81 | Int_t GetEventNumberInFile() const {return -1;} | |
82 | const AliMultiplicity* GetMultiplicity() const {return NULL;} //by default SPDmult | |
83 | Int_t GetRunNumber() const {return -1;} | |
84 | TString GetFiredTriggerClasses() const {TString string; return string;} | |
85 | TObject* FindListObject(const char* /*name*/) const {return NULL;} | |
86 | ULong64_t GetTriggerMask() const {return 0;} | |
87 | Double_t GetMagneticField() const {return 0;} | |
88 | UInt_t GetTimeStamp() const { return 0;} | |
89 | UInt_t GetEventSpecie() const { return 0;} | |
90 | ||
251a2c81 | 91 | |
92 | // -------------------------------------------------------------------------------- | |
93 | // -- Size methods | |
94 | static ULong64_t EstimateSize(AliESDEvent*esd, Bool_t useESDFriends = kTRUE, Bool_t fillV0s=kTRUE); | |
95 | ULong64_t GetSize() {return fContent - reinterpret_cast<Byte_t*>(this) + fSize;} | |
96 | ||
97 | private: | |
98 | AliFlatESDEvent(const AliFlatESDEvent&); | |
99 | AliFlatESDEvent& operator=(const AliFlatESDEvent&); | |
100 | ||
101 | void FillPrimaryVertex(const AliESDVertex *v, Byte_t flag); | |
102 | Int_t FillNextTrack( const AliESDtrack* esdTrack, AliESDfriendTrack* friendTrack); | |
103 | Int_t FillNextV0( const AliESDV0 *v0); | |
50ff8c36 | 104 | UInt_t CountBits(Byte_t field, UInt_t mask) const; |
251a2c81 | 105 | |
106 | // -------------------------------------------------------------------------------- | |
107 | // -- Fixed size member objects | |
108 | // -> Try to align in memory | |
109 | ||
110 | Byte_t fPrimaryVertexMask; // Bit mask specfifying which primary vertices are present | |
111 | Int_t fNTracks; // Number of tracks in vector | |
112 | ULong64_t fTracksPointer; // position of the first track in fContent | |
113 | Int_t fNV0s; // Number of v0's | |
114 | ULong64_t fV0Pointer; // position of the first V0 in fContent | |
115 | ||
116 | ||
117 | ULong64_t fSize; // Size of this object | |
118 | ||
119 | // -------------------------------------------------------------------------------- | |
120 | // -- Variable Size Object | |
121 | Byte_t fContent[1]; // Variale size object, which contains all data | |
122 | ||
123 | }; | |
124 | #endif |