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