Make SetChi2 method public
[u/mrichter/AliRoot.git] / HLT / global / AliFlatESDFriendTrack.h
CommitLineData
ce392def 1#ifndef ALIFLATESDFRIENDTRACK_H
2#define ALIFLATESDFRIENDTRACK_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
ce392def 12
13#include "Rtypes.h"
14
1f516476 15#include "AliVfriendTrack.h"
16#include "AliVMisc.h"
48ec9ee6 17#include "AliFlatTPCseed.h"
ce392def 18
19class AliESDtrack;
20class AliESDfriendTrack;
21class AliExternalTrackParam;
08f45a9c 22class AliTrackPointArray;
aa883ad7 23class AliTPCseed;
ce392def 24
1f516476 25class AliFlatESDFriendTrack :public AliVfriendTrack
ce392def 26{
27 public:
48ec9ee6 28
29 // --------------------------------------------------------------------------------
30 // -- Constructor / Destructors
ce392def 31 AliFlatESDFriendTrack();
32 ~AliFlatESDFriendTrack() {}
48ec9ee6 33
34 // constructor and method for reinitialisation of virtual table
1f516476 35 AliFlatESDFriendTrack( AliVConstructorReinitialisationFlag );
48ec9ee6 36 void Reinitialize() { new (this) AliFlatESDFriendTrack( AliVReinitialize ); }
37
38 // -------------------- AliVfriendTrack interface ---------------------------------
ce392def 39
86b90cc6 40 Int_t GetTPCseed( AliTPCseed &) const;
48ec9ee6 41
42 Int_t GetTrackParamTPCOut( AliExternalTrackParam &p ) const { return GetTrackParam( fTPCOutPointer, p ); }
43 Int_t GetTrackParamITSOut( AliExternalTrackParam &p ) const { return GetTrackParam( fITSOutPointer, p ); }
44 Int_t GetTrackParamTRDIn( AliExternalTrackParam &p ) const { return GetTrackParam( fTRDInPointer, p ); }
ce392def 45
48ec9ee6 46 //virtual const AliVtrackPointArray *GetTrackPointArray() const {return NULL;}
ce392def 47
e3d1b1e2 48 TObject* GetCalibObject(Int_t) const {return NULL;}
49 const AliExternalTrackParam* GetTPCOut() const {return NULL;}
50 const AliExternalTrackParam* GetITSOut() const {return NULL;}
51
48ec9ee6 52
53 // bit manipulation for filtering
ce392def 54
48ec9ee6 55 void SetSkipBit(Bool_t skip){ fBitFlags = skip; }
56 Bool_t TestSkipBit() const { return (fBitFlags!=0); }
a4b2769d 57
48ec9ee6 58 // ------------------- Own methods ---------------------------------------------------------
59
60 // -- Set methods
61
62 void Reset();
63
64 Int_t SetFromESDfriendTrack( const AliESDfriendTrack* track, size_t allocatedMemory );
65
66 void SetTrackParamTPCOut( const AliExternalTrackParam *p ){ SetTrackParam( fTPCOutPointer, p ); }
67 void SetTrackParamITSOut( const AliExternalTrackParam *p ){ SetTrackParam( fITSOutPointer, p ); }
68 void SetTrackParamTRDIn ( const AliExternalTrackParam *p ){ SetTrackParam( fTRDInPointer, p ); }
69 void SetTPCseed ( const AliTPCseed *p );
70
71 // --
72
73 const AliFlatESDFriendTrack *GetNextTrack() const { return reinterpret_cast<const AliFlatESDFriendTrack*>(fContent+fContentSize); }
74 AliFlatESDFriendTrack *GetNextTrackNonConst() { return reinterpret_cast<AliFlatESDFriendTrack*>(fContent+fContentSize); }
75
76 // --------------------------------------------------------------------------------
77 // -- Size methods
78
79 static size_t EstimateSize(){
80 return sizeof(AliFlatESDFriendTrack) + 3*sizeof(AliFlatExternalTrackParam) + AliFlatTPCseed::EstimateSize();
81 }
82
83 size_t GetSize() const { return fContent - reinterpret_cast<const Byte_t*>(this) + fContentSize; }
84
a4b2769d 85 private:
ce392def 86
ce392def 87 AliFlatESDFriendTrack(const AliFlatESDFriendTrack &);
a4b2769d 88 AliFlatESDFriendTrack& operator=(const AliFlatESDFriendTrack& );
ce392def 89
48ec9ee6 90 Int_t GetTrackParam( Long64_t ptr, AliExternalTrackParam &param ) const;
91 void SetTrackParam( Long64_t &ptr, const AliExternalTrackParam *p );
92
93 // --------------------------------------------------------------------------------
94
95 ULong64_t fContentSize; // Size of this object
96 Long64_t fTPCOutPointer; // pointer to TPCOut track param in fContent
97 Long64_t fITSOutPointer; // pointer to ITSOut track param in fContent
98 Long64_t fTRDInPointer; // pointer to TRDIn track param in fContent
99 Long64_t fTPCseedPointer; // pointer to TPCseed in fContent
100 Bool_t fBitFlags; // bit flags
101
102 // --------------------------------------------------------------------------------
103
104 Byte_t fContent[1]; // Variale size object, which contains all data
105
bbddf50f 106 //ClassDef(AliFlatESDFriendTrack, 0)
e3d1b1e2 107
ce392def 108};
109
48ec9ee6 110inline Int_t AliFlatESDFriendTrack::GetTrackParam( Long64_t ptr, AliExternalTrackParam &param ) const
111{
112 if( ptr<0 ) return -1;
113 const AliFlatExternalTrackParam *fp = reinterpret_cast< const AliFlatExternalTrackParam* >( fContent + ptr );
114 fp->GetExternalTrackParam( param );
115}
116
117inline void AliFlatESDFriendTrack::SetTrackParam( Long64_t &ptr, const AliExternalTrackParam *p )
118{
119 if(!p ) return;
120 if( ptr<0 ){
121 ptr = fContentSize;
122 fContentSize += sizeof(AliFlatExternalTrackParam);
123 }
124 AliFlatExternalTrackParam *fp = reinterpret_cast< AliFlatExternalTrackParam* >( fContent + ptr );
125 fp->SetExternalTrackParam( p );
126}
127
128inline void AliFlatESDFriendTrack::SetTPCseed( const AliTPCseed *p )
129{
130 fTPCseedPointer = -1;
131 if(!p ) return;
132 fTPCseedPointer = fContentSize;
133 AliFlatTPCseed *fp = reinterpret_cast< AliFlatTPCseed* >( fContent + fTPCseedPointer );
134 fp->SetFromTPCseed( p );
135 fContentSize += fp->GetSize();
136}
ce392def 137
86b90cc6 138inline Int_t AliFlatESDFriendTrack::GetTPCseed( AliTPCseed &s ) const
139{
140 if( fTPCseedPointer<0 ) return -1;
141 const AliFlatTPCseed *fp = reinterpret_cast< const AliFlatTPCseed* >( fContent + fTPCseedPointer );
142 fp->GetTPCseed( &s );
143 return 0;
144}
07fe4f0e 145
ce392def 146#endif