CbmRoot
Loading...
Searching...
No Matches
CbmKFTrackInterface.h
Go to the documentation of this file.
1/* Copyright (C) 2006-2015 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergey Gorbunov, Denis Bertini [committer] */
4
21#ifndef CBMKFTRACKINTERFACE_H
22#define CBMKFTRACKINTERFACE_H
23
24#include "TObject.h"
25
26class CbmKFHit;
28
30
31 public:
34
38 virtual Double_t GetMass() const { return 0.1396; }
39 virtual Bool_t IsElectron() const { return 0; }
40
44 virtual Double_t* GetTrack();
45 virtual Double_t* GetCovMatrix();
46
50 virtual Double_t& GetRefChi2();
51 virtual Int_t& GetRefNDF();
52
56 virtual Int_t GetNOfHits() { return 0; }
57 virtual CbmKFHit* GetHit(Int_t) { return nullptr; }
58
61 Int_t Extrapolate(Double_t z, Double_t* QP0 = nullptr);
62 Int_t Fit(Bool_t downstream = 1);
63 void Smooth(Double_t Z);
65
66 Int_t Propagate(Double_t z_out, Double_t QP0);
67 Int_t Propagate(Double_t z_out);
68
69 int Id() const { return fId; };
70 void SetId(int id) { fId = id; };
71
72 protected:
73 int fId;
74
75 ClassDef(CbmKFTrackInterface, 1)
76};
77
78
79/******************************************************************
80 *
81 * There are few ways to let the Kalman Filter treat your track.
82 *
83 ******************************************************************
84 *
85 * // The first way: inherit the CbmKFTrackInterface, like :
86 *
87 * class CbmMyTrack :public CbmKFTrackInterface{
88 * public:
89 * // here overwrite CbmKF virtual methods
90 * Double_t *GetTrack(){ return fT; }
91 * ...
92 * // Here is my methods
93 * ...
94 * private:
95 * Double_t fT[6];
96 * Double_t fVariablesForMyNeeds;
97 * };
98 *
99 * // Then use your track directly:
100 *
101 * CbmMyTrack my_track;
102 * ...
103 * CbmKF::Instance()->FitTrack( my_track );
104 *
105 *
106 ******************************************************************
107 *
108 *
109 * // The second way: make interface class to your track, like:
110 *
111 * class CbmMyTrack{
112 * public:
113 * Double_t *GetFittedTrackParametersAtThePrimaryVertex();
114 * ...
115 * };
116 *
117 * class CbmMyTrackInterface : public CbmKFTrackInterface{
118 * public:
119 * CbmMyTrackInterface( CbmMyTrack *track ):fTrack(track){}
120 * Double_t *GetTrack(){
121 * return ((CbmMyTrack*)fTrack)->GetFittedTrackParametersAtThePrimaryVertex();
122 * }
123 * ...
124 * private:
125 * CbmMyTrackTrack *fTrack;
126 * };
127 *
128 * // Then call the KF routines through the interface, like:
129 *
130 * CbmMyTrack my_track;
131 * ...
132 * CbmMyTrackInterface I(my_track);
133 * CbmKF::Instance()->FitTrack( I );
134 *
135 ******************************************************************
136 *
137 *
138 * // Other ways...
139 *
140 *
141 */
142
143#endif /* !CBMKFTRACKINTERFACE_H */
virtual Bool_t IsElectron() const
Mass hypothesis.
Int_t Propagate(Double_t z_out, Double_t QP0)
virtual Double_t * GetTrack()
Is it electron.
virtual Double_t GetMass() const
Int_t Fit(Bool_t downstream=1)
virtual Int_t & GetRefNDF()
Chi^2 after fit.
virtual Double_t * GetCovMatrix()
array[6] of track parameters(x,y,tx,ty,qp,z)
virtual Int_t GetNOfHits()
Number of Degrees of Freedom after fit.
void Fit2Vertex(CbmKFVertexInterface &vtx)
virtual Double_t & GetRefChi2()
array[15] of covariance matrix
virtual CbmKFHit * GetHit(Int_t)
Number of hits.
Int_t Extrapolate(Double_t z, Double_t *QP0=nullptr)
Access to i-th hit.