1 #ifndef ALIFLATESDTRACK_H
2 #define ALIFLATESDTRACK_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 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
21 #include "AliFlatTPCCluster.h"
22 #include "AliFlatExternalTrackParam.h"
23 #include "AliVVtrack.h"
26 class AliESDfriendTrack;
27 class AliExternalTrackParam;
29 class AliFlatESDTrack: public AliVVtrack {
30 //class AliFlatESDTrack {
32 // --------------------------------------------------------------------------------
33 // -- Constructor / Destructors
35 AliFlatESDTrack(Bool_t){}
36 AliFlatESDTrack(const AliESDtrack* track, AliESDfriendTrack* friendTrack);
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
50 AliFlatTPCCluster *GetNextTPCClusterPointer(){ return GetTPCCluster(fNTPCClusters); }
52 void StoreLastTPCCluster(){
54 fSize += sizeof(AliFlatTPCCluster);
57 void SetNumberOfITSClusters( Int_t nCl ) { fNITSClusters = nCl; }
59 Int_t Fill( const AliESDtrack* track, AliESDfriendTrack* friendTrack);
61 // --------------------------------------------------------------------------------
63 AliFlatExternalTrackParam* GetTrackParamRefitted(){
64 return (fTrackParamMask & 0x1) ? reinterpret_cast<AliFlatExternalTrackParam*>(fContent) : NULL;
67 AliFlatExternalTrackParam* GetTrackParamIp() {
68 return (fTrackParamMask & 0x2) ? reinterpret_cast<AliFlatExternalTrackParam*>(fContent) + CountBits(fTrackParamMask, 0x1) : NULL;
71 AliFlatExternalTrackParam* GetTrackParamTPCInner() {
72 return (fTrackParamMask & 0x4) ? reinterpret_cast<AliFlatExternalTrackParam*>(fContent) + CountBits(fTrackParamMask, 0x3) : NULL;
75 AliFlatExternalTrackParam* GetTrackParamOp() {
76 return (fTrackParamMask & 0x8) ? reinterpret_cast<AliFlatExternalTrackParam*>(fContent) + CountBits(fTrackParamMask, 0x7) : NULL;
79 AliFlatExternalTrackParam* GetTrackParamCp() {
80 return (fTrackParamMask & 0x10) ? reinterpret_cast<AliFlatExternalTrackParam*>(fContent) + CountBits(fTrackParamMask, 0xF) : NULL;
83 AliFlatExternalTrackParam* GetTrackParamITSOut() {
84 return (fTrackParamMask & 0x20) ? reinterpret_cast<AliFlatExternalTrackParam*>(fContent) + CountBits(fTrackParamMask, 0x1F) : NULL;
87 // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
89 Int_t GetNumberOfTPCClusters() {
93 AliFlatTPCCluster *GetTPCClusters() {
94 return reinterpret_cast< AliFlatTPCCluster*>(fContent + sizeof(AliFlatExternalTrackParam)*CountBits(fTrackParamMask));
99 AliFlatTPCCluster *GetTPCCluster(Int_t ind) {
100 return reinterpret_cast< AliFlatTPCCluster*>( GetTPCClusters() ) + ind ;
103 Int_t GetNumberOfITSClusters() {
104 return fNITSClusters;
108 // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
110 AliFlatESDTrack *GetNextTrack()
113 AliFlatESDTrack * t = reinterpret_cast<AliFlatESDTrack*> (fContent + fSize);
114 new(t) AliFlatESDTrack(kTRUE);
118 // --------------------------------------------------------------------------------
120 static ULong64_t EstimateSize(Bool_t useESDFriends = kTRUE, Int_t nTPCClusters = 160 );
121 ULong64_t GetSize() {return fContent - reinterpret_cast<Byte_t*>(this) + fSize;}
125 AliFlatESDTrack(const AliFlatESDTrack&);
126 AliFlatESDTrack& operator=(const AliFlatESDTrack&);
128 Int_t FillExternalTrackParam(const AliExternalTrackParam* param, UShort_t flag);
130 UInt_t CountBits(Byte_t field, UInt_t mask = 0xFFFFFFFF);
132 // --------------------------------------------------------------------------------
133 // -- Fixed size member objects
134 // -> Try to align in memory
136 Byte_t fTrackParamMask; // Bit mask specfifying which ExternalTrackParam are present
137 Int_t fNTPCClusters; // Number of TPC clusters in track
138 Int_t fNITSClusters; // Number of ITS clusters in track
141 ULong64_t fSize; // Size of this object
143 // --------------------------------------------------------------------------------
144 // -- Variable Size Object
145 Byte_t fContent[1]; // Variale size object, which contains all data