CbmRoot
CbmKFTrackInterface.h
Go to the documentation of this file.
1 
18 #ifndef CBMKFTRACKINTERFACE_H
19 #define CBMKFTRACKINTERFACE_H
20 
21 #include "TObject.h"
22 
23 class CbmKFHit;
25 
27 
28 public:
30  virtual ~CbmKFTrackInterface() {}
31 
35  virtual Double_t GetMass() { return 0.1396; }
36  virtual Bool_t IsElectron() { return 0; }
37 
41  virtual Double_t*
42  GetTrack();
43  virtual Double_t* GetCovMatrix();
44 
48  virtual Double_t& GetRefChi2();
49  virtual Int_t& GetRefNDF();
50 
54  virtual Int_t GetNOfHits() { return 0; }
55  virtual CbmKFHit* GetHit(Int_t) { return 0; }
56 
59  Int_t Extrapolate(Double_t z, Double_t* QP0 = 0);
60  Int_t Fit(Bool_t downstream = 1);
61  void Smooth(Double_t Z);
63 
64  Int_t Propagate(Double_t z_out, Double_t QP0);
65  Int_t Propagate(Double_t z_out);
66 
67  int Id() const { return fId; };
68  void SetId(int id) { fId = id; };
69 
70 protected:
71  int fId;
72 
73  ClassDef(CbmKFTrackInterface, 1)
74 };
75 
76 
77 /******************************************************************
78  *
79  * There are few ways to let the Kalman Filter treat your track.
80  *
81  ******************************************************************
82  *
83  * // The first way: inherit the CbmKFTrackInterface, like :
84  *
85  * class CbmMyTrack :public CbmKFTrackInterface{
86  * public:
87  * // here overwrite CbmKF virtual methods
88  * Double_t *GetTrack(){ return fT; }
89  * ...
90  * // Here is my methods
91  * ...
92  * private:
93  * Double_t fT[6];
94  * Double_t fVariablesForMyNeeds;
95  * };
96  *
97  * // Then use your track directly:
98  *
99  * CbmMyTrack my_track;
100  * ...
101  * CbmKF::Instance()->FitTrack( my_track );
102  *
103  *
104  ******************************************************************
105  *
106  *
107  * // The second way: make interface class to your track, like:
108  *
109  * class CbmMyTrack{
110  * public:
111  * Double_t *GetFittedTrackParametersAtThePrimaryVertex();
112  * ...
113  * };
114  *
115  * class CbmMyTrackInterface : public CbmKFTrackInterface{
116  * public:
117  * CbmMyTrackInterface( CbmMyTrack *track ):fTrack(track){}
118  * Double_t *GetTrack(){
119  * return ((CbmMyTrack*)fTrack)->GetFittedTrackParametersAtThePrimaryVertex();
120  * }
121  * ...
122  * private:
123  * CbmMyTrackTrack *fTrack;
124  * };
125  *
126  * // Then call the KF routines through the interface, like:
127  *
128  * CbmMyTrack my_track;
129  * ...
130  * CbmMyTrackInterface I(my_track);
131  * CbmKF::Instance()->FitTrack( I );
132  *
133  ******************************************************************
134  *
135  *
136  * // Other ways...
137  *
138  *
139  */
140 
141 #endif /* !CBMKFTRACKINTERFACE_H */
CbmKFTrackInterface::GetHit
virtual CbmKFHit * GetHit(Int_t)
Number of hits.
Definition: CbmKFTrackInterface.h:55
CbmKFTrackInterface::IsElectron
virtual Bool_t IsElectron()
Mass hypothesis.
Definition: CbmKFTrackInterface.h:36
CbmKFTrackInterface::GetTrack
virtual Double_t * GetTrack()
Is it electron.
Definition: CbmKFTrackInterface.cxx:33
CbmKFHit
Definition: CbmKFHit.h:16
CbmKFTrackInterface::Fit2Vertex
void Fit2Vertex(CbmKFVertexInterface &vtx)
Definition: CbmKFTrackInterface.cxx:350
CbmKFTrackInterface::CbmKFTrackInterface
CbmKFTrackInterface()
Definition: CbmKFTrackInterface.h:29
CbmKFTrackInterface::GetMass
virtual Double_t GetMass()
Definition: CbmKFTrackInterface.h:35
CbmKFTrackInterface::fId
int fId
Definition: CbmKFTrackInterface.h:68
CbmKFTrackInterface::~CbmKFTrackInterface
virtual ~CbmKFTrackInterface()
Definition: CbmKFTrackInterface.h:30
CbmKFTrackInterface::Id
int Id() const
Definition: CbmKFTrackInterface.h:67
CbmKFTrackInterface::GetNOfHits
virtual Int_t GetNOfHits()
Number of Degrees of Freedom after fit.
Definition: CbmKFTrackInterface.h:54
CbmKFVertexInterface
Definition: CbmKFVertexInterface.h:24
CbmKFTrackInterface::GetRefNDF
virtual Int_t & GetRefNDF()
Chi^2 after fit.
Definition: CbmKFTrackInterface.cxx:36
CbmKFTrackInterface
Definition: CbmKFTrackInterface.h:26
CbmKFTrackInterface::Smooth
void Smooth(Double_t Z)
Definition: CbmKFTrackInterface.cxx:214
CbmKFTrackInterface::GetCovMatrix
virtual Double_t * GetCovMatrix()
array[6] of track parameters(x,y,tx,ty,qp,z)
Definition: CbmKFTrackInterface.cxx:34
CbmKFTrackInterface::SetId
void SetId(int id)
Definition: CbmKFTrackInterface.h:68
CbmKFTrackInterface::Propagate
Int_t Propagate(Double_t z_out, Double_t QP0)
Definition: CbmKFTrackInterface.cxx:449
CbmKFTrackInterface::Fit
Int_t Fit(Bool_t downstream=1)
Definition: CbmKFTrackInterface.cxx:101
CbmKFTrackInterface::GetRefChi2
virtual Double_t & GetRefChi2()
array[15] of covariance matrix
Definition: CbmKFTrackInterface.cxx:35
CbmKFTrackInterface::Extrapolate
Int_t Extrapolate(Double_t z, Double_t *QP0=0)
Access to i-th hit.
Definition: CbmKFTrackInterface.cxx:39