]>
Commit | Line | Data |
---|---|---|
ce392def | 1 | #ifndef ALIFLATESDFRIEND_H |
2 | #define ALIFLATESDFRIEND_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 "AliFlatESDMisc.h" | |
08f45a9c | 14 | #include "AliVVfriendEvent.h" |
ce392def | 15 | #include "AliFlatESDFriendTrack.h" |
16 | ||
17 | class AliVVVZEROfriend; | |
18 | class AliVVTZEROfriend; | |
19 | ||
20 | //_____________________________________________________________________________ | |
08f45a9c | 21 | class AliFlatESDFriend : public AliVVfriendEvent { |
ce392def | 22 | public: |
23 | AliFlatESDFriend(); | |
24 | ~AliFlatESDFriend() {} | |
25 | ||
26 | // Implementation of virtual methods of AliVVfriend | |
27 | ||
28 | Int_t GetNumberOfTracks() const { return fNTracks; } | |
29 | Int_t GetEntriesInTracks() const { return fNTrackEntries; } | |
30 | const AliVVfriendTrack* GetTrack(Int_t i) const {return GetFlatTrack(i); } | |
31 | ||
32 | AliVVVZEROfriend *GetVZEROfriend(){ return NULL; } | |
33 | AliVVTZEROfriend *GetTZEROfriend(){ return NULL; } | |
34 | ||
35 | void Ls() const; | |
36 | ||
37 | void Reset(); | |
38 | ||
39 | Bool_t TestSkipBit() const { return (fBitFlags!=0); } | |
40 | ||
41 | Int_t GetNclustersTPC(UInt_t sector) const { return (sector<72)?fNclustersTPC[sector]:0; } | |
42 | Int_t GetNclustersTPCused(UInt_t sector) const { return (sector<72)?fNclustersTPCused[sector]:0; } | |
43 | ||
44 | //virtual void AddTrack(const AliVVfriendTrack *t) {} | |
45 | //virtual void AddTrackAt(const AliVVfriendTrack* /*t*/, Int_t /*i*/) {} | |
46 | //virtual void SetVZEROfriend(AliESDVZEROfriend* /*obj*/) {} | |
47 | //virtual void SetTZEROfriend(AliESDTZEROfriend * obj) {} | |
48 | //void SetSkipBit(Bool_t skip){} | |
49 | ||
50 | // Own methods | |
51 | ||
52 | void SetSkipBit(Bool_t skip){ fBitFlags = skip; } | |
53 | void SetNclustersTPC(UInt_t sector, Int_t occupancy ) { if (sector<72) fNclustersTPC[sector]=occupancy; } | |
54 | void SetNclustersTPCused(UInt_t sector, Int_t occupancy ) {if (sector<72) fNclustersTPCused[sector]=occupancy; } | |
55 | ||
56 | const AliFlatESDFriendTrack *GetFlatTrack( Int_t i ) const { | |
57 | const Long64_t *table = reinterpret_cast<const Long64_t*> (fContent + fTrackTablePointer); | |
58 | if( i<0 || i>fNTracks || table[i]<0 ) return NULL; | |
59 | return reinterpret_cast<const AliFlatESDFriendTrack*>( fContent + table[i] ); | |
60 | } | |
61 | ||
62 | // -- Size methods | |
63 | ||
64 | ULong64_t GetSize() const { return fContent - reinterpret_cast<const Byte_t*>(this) + fContentSize; } | |
65 | ||
66 | void Reinitialize() | |
67 | { | |
68 | new (this) AliFlatESDFriend(AliFlatESDReinitialize); | |
69 | } | |
70 | ||
71 | private: | |
72 | ||
73 | AliFlatESDFriend(const AliFlatESDFriend&); | |
74 | AliFlatESDFriend& operator=(const AliFlatESDFriend& ); | |
75 | ||
76 | // special constructor, to be called by placement new, | |
77 | // when accessing information after reinterpret_cast | |
78 | // so that vtable is generated, but values are not overwritten | |
79 | AliFlatESDFriend(AliFlatESDSpecialConstructorFlag); | |
80 | ||
81 | AliFlatESDFriendTrack *GetFlatTrackNonConst( Int_t i ){ | |
82 | const Long64_t *table = reinterpret_cast<const Long64_t*> (fContent + fTrackTablePointer); | |
83 | if( i<0 || i>fNTracks || table[i]<0 ) return NULL; | |
84 | return reinterpret_cast<AliFlatESDFriendTrack*>( fContent + table[i] ); | |
85 | } | |
86 | ||
87 | size_t fContentSize; // Size of fContent | |
88 | UInt_t fBitFlags; // bit flags | |
89 | Int_t fNTracks; // Number of tracks in vector | |
90 | Int_t fNTrackEntries; // Number of non-empty track friends in vector | |
91 | Int_t fNclustersTPC[72]; //cluster occupancy per sector per sector | |
92 | Int_t fNclustersTPCused[72]; //number of clusters used in tracking per sector | |
93 | ||
94 | // Pointers to specific data in fContent | |
95 | ||
96 | size_t fTrackTablePointer; // position of the first track in fContent | |
97 | size_t fTracksPointer; // position of the first track in fContent | |
98 | ||
99 | // -- Variable Size Object | |
100 | ||
101 | Byte_t fContent[1]; // Variale size object, which contains all data | |
102 | }; | |
103 | ||
104 | #endif |