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"
24 #include "AliFlatESDMisc.h"
27 class AliESDfriendTrack;
28 class AliExternalTrackParam;
30 class AliFlatESDTrack: public AliVVtrack {
31 friend class AliFlatESDEvent;
33 // --------------------------------------------------------------------------------
34 // -- Constructor / Destructors
36 AliFlatESDTrack(const AliESDtrack* track, AliESDfriendTrack* friendTrack);
37 virtual ~AliFlatESDTrack();
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;
107 AliFlatTPCCluster *GetITSClusters() {
108 return reinterpret_cast< AliFlatTPCCluster*>(fContent + sizeof(AliFlatExternalTrackParam)*CountBits(fTrackParamMask));
112 // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
114 AliFlatESDTrack *GetNextTrack()
117 return reinterpret_cast<AliFlatESDTrack*> (fContent + fSize);
120 // --------------------------------------------------------------------------------
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;}
127 AliFlatESDTrack(const AliFlatESDTrack&);
128 AliFlatESDTrack& operator=(const AliFlatESDTrack&);
129 AliFlatESDTrack(AliFlatESDSpecialConstructorFlag);
131 Int_t FillExternalTrackParam(const AliExternalTrackParam* param, UShort_t flag);
133 UInt_t CountBits(Byte_t field, UInt_t mask = 0xFFFFFFFF);
135 // --------------------------------------------------------------------------------
136 // -- Fixed size member objects
137 // -> Try to align in memory
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
144 ULong64_t fSize; // Size of this object
146 // --------------------------------------------------------------------------------
147 // -- Variable Size Object
148 Byte_t fContent[1]; // Variale size object, which contains all data