]>
Commit | Line | Data |
---|---|---|
251a2c81 | 1 | #ifndef ALIFLATESDTRACK_H |
2 | #define ALIFLATESDTRACK_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 | /* | |
13 | Cp - Track parameters constrained to the primary vertex | |
14 | Ip - Track parameters estimated at the inner wall of TPC | |
15 | TPCInner - Track parameters estimated at the inner wall of TPC using the TPC stand-alone | |
16 | Op - Track parameters estimated at the point of maximal radial coordinate reached during the tracking | |
17 | */ | |
18 | ||
19 | #include "Rtypes.h" | |
20 | ||
21 | #include "AliFlatTPCCluster.h" | |
22 | #include "AliFlatExternalTrackParam.h" | |
50ff8c36 | 23 | #include "AliVVtrack.h" |
f009a562 | 24 | #include "AliFlatESDMisc.h" |
251a2c81 | 25 | |
26 | class AliESDtrack; | |
27 | class AliESDfriendTrack; | |
28 | class AliExternalTrackParam; | |
29 | ||
8dbbdcd3 | 30 | class AliFlatESDTrack: public AliVVtrack { |
f009a562 | 31 | friend class AliFlatESDEvent; |
251a2c81 | 32 | public: |
33 | // -------------------------------------------------------------------------------- | |
34 | // -- Constructor / Destructors | |
8fcd8556 | 35 | AliFlatESDTrack(); |
251a2c81 | 36 | AliFlatESDTrack(const AliESDtrack* track, AliESDfriendTrack* friendTrack); |
8fcd8556 | 37 | virtual ~AliFlatESDTrack(); |
251a2c81 | 38 | |
39 | // -------------------------------------------------------------------------------- | |
40 | // -- Fill / Set methods | |
41 | Int_t FillExternalTrackParam( | |
42 | const AliExternalTrackParam* refittedParam, | |
43 | const AliExternalTrackParam* innerParam, | |
44 | const AliExternalTrackParam* innerTPC, | |
45 | const AliExternalTrackParam* outerParam, | |
46 | const AliExternalTrackParam* constrainedParam, | |
47 | const AliExternalTrackParam* outerITSParam | |
48 | ); | |
49 | ||
50ff8c36 | 50 | AliFlatTPCCluster *GetNextTPCClusterPointer(){ return GetTPCCluster(fNTPCClusters); } |
251a2c81 | 51 | |
52 | void StoreLastTPCCluster(){ | |
53 | ++fNTPCClusters; | |
54 | fSize += sizeof(AliFlatTPCCluster); | |
55 | } | |
56 | ||
57 | void SetNumberOfITSClusters( Int_t nCl ) { fNITSClusters = nCl; } | |
58 | ||
59 | Int_t Fill( const AliESDtrack* track, AliESDfriendTrack* friendTrack); | |
60 | ||
61 | // -------------------------------------------------------------------------------- | |
62 | // -- Getter methods | |
63 | AliFlatExternalTrackParam* GetTrackParamRefitted(){ | |
64 | return (fTrackParamMask & 0x1) ? reinterpret_cast<AliFlatExternalTrackParam*>(fContent) : NULL; | |
65 | } | |
66 | ||
67 | AliFlatExternalTrackParam* GetTrackParamIp() { | |
68 | return (fTrackParamMask & 0x2) ? reinterpret_cast<AliFlatExternalTrackParam*>(fContent) + CountBits(fTrackParamMask, 0x1) : NULL; | |
69 | } | |
70 | ||
71 | AliFlatExternalTrackParam* GetTrackParamTPCInner() { | |
72 | return (fTrackParamMask & 0x4) ? reinterpret_cast<AliFlatExternalTrackParam*>(fContent) + CountBits(fTrackParamMask, 0x3) : NULL; | |
73 | } | |
74 | ||
75 | AliFlatExternalTrackParam* GetTrackParamOp() { | |
76 | return (fTrackParamMask & 0x8) ? reinterpret_cast<AliFlatExternalTrackParam*>(fContent) + CountBits(fTrackParamMask, 0x7) : NULL; | |
77 | } | |
78 | ||
79 | AliFlatExternalTrackParam* GetTrackParamCp() { | |
80 | return (fTrackParamMask & 0x10) ? reinterpret_cast<AliFlatExternalTrackParam*>(fContent) + CountBits(fTrackParamMask, 0xF) : NULL; | |
81 | } | |
82 | ||
83 | AliFlatExternalTrackParam* GetTrackParamITSOut() { | |
84 | return (fTrackParamMask & 0x20) ? reinterpret_cast<AliFlatExternalTrackParam*>(fContent) + CountBits(fTrackParamMask, 0x1F) : NULL; | |
85 | } | |
86 | ||
87 | // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | |
88 | ||
89 | Int_t GetNumberOfTPCClusters() { | |
90 | return fNTPCClusters; | |
91 | } | |
92 | ||
93 | AliFlatTPCCluster *GetTPCClusters() { | |
94 | return reinterpret_cast< AliFlatTPCCluster*>(fContent + sizeof(AliFlatExternalTrackParam)*CountBits(fTrackParamMask)); | |
95 | } | |
488e1434 | 96 | |
97 | ||
251a2c81 | 98 | |
50ff8c36 | 99 | AliFlatTPCCluster *GetTPCCluster(Int_t ind) { |
488e1434 | 100 | return reinterpret_cast< AliFlatTPCCluster*>( GetTPCClusters() ) + ind ; |
f4e66baf | 101 | } |
251a2c81 | 102 | |
103 | Int_t GetNumberOfITSClusters() { | |
104 | return fNITSClusters; | |
105 | } | |
106 | ||
8fcd8556 | 107 | AliFlatTPCCluster *GetITSClusters() { |
108 | return reinterpret_cast< AliFlatTPCCluster*>(fContent + sizeof(AliFlatExternalTrackParam)*CountBits(fTrackParamMask)); | |
109 | } | |
110 | ||
251a2c81 | 111 | |
112 | // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | |
113 | ||
488e1434 | 114 | AliFlatESDTrack *GetNextTrack() |
115 | { | |
116 | ||
6eb01754 | 117 | return reinterpret_cast<AliFlatESDTrack*> (fContent + fSize); |
488e1434 | 118 | } |
251a2c81 | 119 | |
120 | // -------------------------------------------------------------------------------- | |
121 | // -- Size methods | |
122 | static ULong64_t EstimateSize(Bool_t useESDFriends = kTRUE, Int_t nTPCClusters = 160 ); | |
123 | ULong64_t GetSize() {return fContent - reinterpret_cast<Byte_t*>(this) + fSize;} | |
124 | ||
488e1434 | 125 | |
251a2c81 | 126 | private: |
127 | AliFlatESDTrack(const AliFlatESDTrack&); | |
128 | AliFlatESDTrack& operator=(const AliFlatESDTrack&); | |
f009a562 | 129 | AliFlatESDTrack(AliFlatESDSpecialConstructorFlag); |
251a2c81 | 130 | |
131 | Int_t FillExternalTrackParam(const AliExternalTrackParam* param, UShort_t flag); | |
132 | ||
133 | UInt_t CountBits(Byte_t field, UInt_t mask = 0xFFFFFFFF); | |
134 | ||
135 | // -------------------------------------------------------------------------------- | |
136 | // -- Fixed size member objects | |
137 | // -> Try to align in memory | |
138 | ||
139 | Byte_t fTrackParamMask; // Bit mask specfifying which ExternalTrackParam are present | |
140 | Int_t fNTPCClusters; // Number of TPC clusters in track | |
141 | Int_t fNITSClusters; // Number of ITS clusters in track | |
142 | // Bool_t fMCLabels; | |
143 | ||
144 | ULong64_t fSize; // Size of this object | |
145 | ||
146 | // -------------------------------------------------------------------------------- | |
147 | // -- Variable Size Object | |
148 | Byte_t fContent[1]; // Variale size object, which contains all data | |
149 | ||
150 | }; | |
8fcd8556 | 151 | |
251a2c81 | 152 | #endif |