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"
25 class AliESDfriendTrack;
26 class AliExternalTrackParam;
28 class AliFlatESDTrack {
30 // --------------------------------------------------------------------------------
31 // -- Constructor / Destructors
33 AliFlatESDTrack(const AliESDtrack* track, AliESDfriendTrack* friendTrack);
36 // --------------------------------------------------------------------------------
37 // -- Fill / Set methods
38 Int_t FillExternalTrackParam(
39 const AliExternalTrackParam* refittedParam,
40 const AliExternalTrackParam* innerParam,
41 const AliExternalTrackParam* innerTPC,
42 const AliExternalTrackParam* outerParam,
43 const AliExternalTrackParam* constrainedParam,
44 const AliExternalTrackParam* outerITSParam
47 AliFlatTPCCluster *GetNextTPCClusterPointer(){ return &GetTPCCluster(fNTPCClusters); }
49 void StoreLastTPCCluster(){
51 fSize += sizeof(AliFlatTPCCluster);
54 void SetNumberOfITSClusters( Int_t nCl ) { fNITSClusters = nCl; }
56 Int_t Fill( const AliESDtrack* track, AliESDfriendTrack* friendTrack);
58 // --------------------------------------------------------------------------------
60 AliFlatExternalTrackParam* GetTrackParamRefitted(){
61 return (fTrackParamMask & 0x1) ? reinterpret_cast<AliFlatExternalTrackParam*>(fContent) : NULL;
64 AliFlatExternalTrackParam* GetTrackParamIp() {
65 return (fTrackParamMask & 0x2) ? reinterpret_cast<AliFlatExternalTrackParam*>(fContent) + CountBits(fTrackParamMask, 0x1) : NULL;
68 AliFlatExternalTrackParam* GetTrackParamTPCInner() {
69 return (fTrackParamMask & 0x4) ? reinterpret_cast<AliFlatExternalTrackParam*>(fContent) + CountBits(fTrackParamMask, 0x3) : NULL;
72 AliFlatExternalTrackParam* GetTrackParamOp() {
73 return (fTrackParamMask & 0x8) ? reinterpret_cast<AliFlatExternalTrackParam*>(fContent) + CountBits(fTrackParamMask, 0x7) : NULL;
76 AliFlatExternalTrackParam* GetTrackParamCp() {
77 return (fTrackParamMask & 0x10) ? reinterpret_cast<AliFlatExternalTrackParam*>(fContent) + CountBits(fTrackParamMask, 0xF) : NULL;
80 AliFlatExternalTrackParam* GetTrackParamITSOut() {
81 return (fTrackParamMask & 0x20) ? reinterpret_cast<AliFlatExternalTrackParam*>(fContent) + CountBits(fTrackParamMask, 0x1F) : NULL;
84 // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
86 Int_t GetNumberOfTPCClusters() {
90 AliFlatTPCCluster *GetTPCClusters() {
91 return reinterpret_cast< AliFlatTPCCluster*>(fContent + sizeof(AliFlatExternalTrackParam)*CountBits(fTrackParamMask));
94 AliFlatTPCCluster &GetTPCCluster(Int_t ind) {
95 return GetTPCClusters()[ind];
98 Int_t GetNumberOfITSClusters() {
103 // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
105 AliFlatESDTrack *GetNextTrack() {return reinterpret_cast<AliFlatESDTrack*>(fContent+fSize);}
107 // --------------------------------------------------------------------------------
109 static ULong64_t EstimateSize(Bool_t useESDFriends = kTRUE, Int_t nTPCClusters = 160 );
110 ULong64_t GetSize() {return fContent - reinterpret_cast<Byte_t*>(this) + fSize;}
113 AliFlatESDTrack(const AliFlatESDTrack&);
114 AliFlatESDTrack& operator=(const AliFlatESDTrack&);
116 Int_t FillExternalTrackParam(const AliExternalTrackParam* param, UShort_t flag);
118 UInt_t CountBits(Byte_t field, UInt_t mask = 0xFFFFFFFF);
120 // --------------------------------------------------------------------------------
121 // -- Fixed size member objects
122 // -> Try to align in memory
124 Byte_t fTrackParamMask; // Bit mask specfifying which ExternalTrackParam are present
125 Int_t fNTPCClusters; // Number of TPC clusters in track
126 Int_t fNITSClusters; // Number of ITS clusters in track
129 ULong64_t fSize; // Size of this object
131 // --------------------------------------------------------------------------------
132 // -- Variable Size Object
133 Byte_t fContent[1]; // Variale size object, which contains all data