BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Mdc/MdcRecEvent/include/MdcRecEvent/RecMdcKalTrack.h
Go to the documentation of this file.
1/*
2 * @class : RecMdcKalTrack
3 *
4 * this class models "Kalman Track" used in Mdc Reconstruction
5 *
6 * by wangjk 2006.9
7 *
8 * ********************************************************/
9
10#ifndef RECMDCKALTRACK_H
11#define RECMDCKALTRACK_H
12#include "CLHEP/Geometry/Point3D.h"
13#include "CLHEP/Matrix/SymMatrix.h"
14#include "CLHEP/Matrix/Vector.h"
15#include "CLHEP/Vector/ThreeVector.h"
16#include "DstEvent/DstMdcKalTrack.h"
17#include "EventModel/EventModel.h"
18#include "GaudiKernel/ContainedObject.h"
19#include "GaudiKernel/ObjectVector.h"
20#include "GaudiKernel/SmartRef.h"
21#include "GaudiKernel/SmartRefVector.h"
22#include "RecMdcKalHelixSeg.h"
23
24extern const CLID& CLID_RecMdcKalTrack;
25
26typedef SmartRefVector<RecMdcKalHelixSeg> HelixSegRefVec;
27
28class RecMdcKalTrack : public DstMdcKalTrack {
29
30public:
31 virtual const CLID& clID() const { return RecMdcKalTrack::classID(); }
32
33 static const CLID& classID() { return CLID_RecMdcKalTrack; }
34 // constructor and destructor
41
42 // extractors
43 HelixSegRefVec getVecHelixSegs( int pid = -1 ) const; // 2011-05-06
44
45 int getTrackId( void ) const { return m_trackId; }
46 double getMass( int pid ) const { return m_mass[pid]; }
47 double getLength( int pid ) const { return m_length[pid]; }
48 double getTof( int pid ) const { return m_tof[pid]; }
49 int getNhits( int pid ) const { return m_nhits[pid]; }
50 int getStat( int i, int pid ) const { return m_stat[i][pid]; }
51 int getNster( const int i, const int pid ) const { return m_nster[i][pid]; }
52 int getFirstLayer( const int i, const int pid ) const { return m_firstLayer[i][pid]; }
53 int getLastLayer( const int i, const int pid ) const { return m_lastLayer[i][pid]; }
54 double getChisq( int i, int pid ) const { return m_chisq[i][pid]; }
55 int getNdf( int i, int pid ) const { return m_ndf[i][pid]; }
56 double getPathl( int i ) const { return m_pathl[i]; }
57 double getPathSM( int pid ) const { return m_pathSM[pid]; }
58
59 const HepVector& getZHelix() const { return m_zhelixs[2]; }
60 const HepSymMatrix& getZError() const { return m_zerrors[2]; }
61 const HepVector& getFHelix() const { return m_fhelixs[2]; }
62 const HepSymMatrix& getFError() const { return m_ferrors[2]; }
63 const HepVector& getLHelix() const { return m_lhelixs[2]; }
64 const HepSymMatrix& getLError() const { return m_lerrors[2]; }
65 const double getTHelix( const int i ) const { return m_thelix[i]; }
66 const double getTError( const int i ) const { return m_terror[i]; }
67 const HepVector getTHelix() const { return m_ta; }
68 const HepSymMatrix getTError() const { return m_tEa; }
69
70 HepVector& getZHelixE() { return m_zhelixs[0]; }
71 HepSymMatrix& getZErrorE() { return m_zerrors[0]; }
72 HepVector& getFHelixE() { return m_fhelixs[0]; }
73 HepSymMatrix& getFErrorE() { return m_ferrors[0]; }
74 HepVector& getLHelixE() { return m_lhelixs[0]; }
75 HepSymMatrix& getLErrorE() { return m_lerrors[0]; }
76
77 HepVector& getZHelixMu() { return m_zhelixs[1]; }
78 HepSymMatrix& getZErrorMu() { return m_zerrors[1]; }
79 HepVector& getFHelixMu() { return m_fhelixs[1]; }
80 HepSymMatrix& getFErrorMu() { return m_ferrors[1]; }
81 HepVector& getLHelixMu() { return m_lhelixs[1]; }
82 HepSymMatrix& getLErrorMu() { return m_lerrors[1]; }
83
84 HepVector& getZHelixK() { return m_zhelixs[3]; }
85 HepSymMatrix& getZErrorK() { return m_zerrors[3]; }
86 HepVector& getFHelixK() { return m_fhelixs[3]; }
87 HepSymMatrix& getFErrorK() { return m_ferrors[3]; }
88 HepVector& getLHelixK() { return m_lhelixs[3]; }
89 HepSymMatrix& getLErrorK() { return m_lerrors[3]; }
90
91 HepVector& getZHelixP() { return m_zhelixs[4]; }
92 HepSymMatrix& getZErrorP() { return m_zerrors[4]; }
93 HepVector& getFHelixP() { return m_fhelixs[4]; }
94 HepSymMatrix& getFErrorP() { return m_ferrors[4]; }
95 HepVector& getLHelixP() { return m_lhelixs[4]; }
96 HepSymMatrix& getLErrorP() { return m_lerrors[4]; }
97
98 const HepPoint3D getPocaE() const { return m_pocas[0]; }
99 const HepPoint3D getPocaMu() const { return m_pocas[1]; }
100 const HepPoint3D getPoca() const { return m_pocas[2]; }
101 const HepPoint3D getPocaK() const { return m_pocas[3]; }
102 const HepPoint3D getPocaP() const { return m_pocas[4]; }
103
104 const HepPoint3D& getLPointE() const { return m_lpoints[0]; }
105 const HepPoint3D& getLPointMu() const { return m_lpoints[1]; }
106 const HepPoint3D& getLPoint() const { return m_lpoints[2]; }
107 const HepPoint3D& getLPointK() const { return m_lpoints[3]; }
108 const HepPoint3D& getLPointP() const { return m_lpoints[4]; }
109
110 const HepPoint3D& getLPivotE() const { return m_lpivots[0]; }
111 const HepPoint3D& getLPivotMu() const { return m_lpivots[1]; }
112 const HepPoint3D& getLPivot() const { return m_lpivots[2]; }
113 const HepPoint3D& getLPivotK() const { return m_lpivots[3]; }
114 const HepPoint3D& getLPivotP() const { return m_lpivots[4]; }
115
116 // const HepVector& getZHelix(const int pid) const { return m_zhelixs[pid];}
117 // const HepSymMatrix& getZError(const int pid) const { return m_zerrors[pid];}
118 const HepVector& getLHelix( const int pid ) const { return m_lhelixs[pid]; }
119 const HepSymMatrix& getLError( const int pid ) const { return m_lerrors[pid]; }
120 // const HepVector& getFHelix(const int pid) const { return m_fhelixs[pid];}
121 // const HepSymMatrix& getFError(const int pid) const { return m_ferrors[pid];}
122 const HepPoint3D& getPoca( const int pid ) const { return m_pocas[pid]; }
123 const HepPoint3D& getLPoint( const int pid ) const { return m_lpoints[pid]; }
124 const double getFiTerm( const int pid ) const { return m_fiTerm[pid]; }
125 const HepPoint3D& getLPivot( const int pid ) const { return m_lpivots[pid]; }
126
127 const double getZDr( void ) const { return m_zhelixs[2][0]; }
128 const double getZFi0( void ) const { return m_zhelixs[2][1]; }
129 const double getZCpa( void ) const { return m_zhelixs[2][2]; }
130 const double getZDz( void ) const { return m_zhelixs[2][3]; }
131 const double getZTanl( void ) const { return m_zhelixs[2][4]; }
132
133 const double getLDr( void ) const { return m_lhelixs[2][0]; }
134 const double getLFi0( void ) const { return m_lhelixs[2][1]; }
135 const double getLCpa( void ) const { return m_lhelixs[2][2]; }
136 const double getLDz( void ) const { return m_lhelixs[2][3]; }
137 const double getLTanl( void ) const { return m_lhelixs[2][4]; }
138
139 const double getFDr( void ) const { return m_fhelixs[2][0]; }
140 const double getFFi0( void ) const { return m_fhelixs[2][1]; }
141 const double getFCpa( void ) const { return m_fhelixs[2][2]; }
142 const double getFDz( void ) const { return m_fhelixs[2][3]; }
143 const double getFTanl( void ) const { return m_fhelixs[2][4]; }
144
145 // modifiers
146 void setVecHelixSegs( const HelixSegRefVec& vechelixsegs, int pid = -1 ); // 2011-05-06
147
148 // void setTrackId(int id) { m_trackId = id; }
149 void setMass( double mass, int pid ) { m_mass[pid] = mass; }
150 void setLength( double length, int pid ) { m_length[pid] = length; }
151 void setTof( double tof, int pid ) { m_tof[pid] = tof; }
152 void setNhits( int nhits, int pid ) { m_nhits[pid] = nhits; }
153 // void setStat(int stat, int i, int pid) { m_stat[i][pid] = stat; }
154 // void setChisq(double chisq, int i, int pid) { m_chisq[i][pid] = chisq; }
155 // void setNdf(int ndf, int i, int pid) { m_ndf[i][pid] = ndf; }
156 // void setNster(int nster, int i, int pid) { m_nster[i][pid] = nster; }
157 // void setFirstLayer(int fL, int i, int pid) { m_firstLayer[i][pid] = fL;}
158 // void setLastLayer(int lL, int i, int pid) { m_lastLayer[i][pid] = lL; }
159 void setPathl( double pathl, int i ) { m_pathl[i] = pathl; }
160 void setPathSM( double length, int pid ) { m_pathSM[pid] = length; }
161
162 /*
163 void setZHelix(const HepVector& helix, const int pid) {
164 m_zhelixs[pid] = helix;
165 }
166 void setZError(const HepSymMatrix& error, const int pid) {
167 m_zerrors[pid] = error;
168 }
169 void setZHelix(float* helix, const int pid) {
170 for(int i=0; i<3; i++) {
171 m_zhelixs[pid][i] = helix[i];
172 }
173 }
174 void setZError(float* error, const int pid) {
175 int k=0;
176 HepSymMatrix mat(5);
177 for(int i=0; i<5 ; i++) {
178 for(int j=0; j<=i; j++,k++) {
179 mat[i][j] = error[k];
180 mat[j][i] = error[k];
181 }
182 }
183 m_zerrors[pid] = mat;
184 }
185 */
186
187 // void setFHelix(const HepVector& helix, const int pid) {
188 // m_fhelixs[pid] = helix;
189 // }
190 // void setFError(const HepSymMatrix& error, const int pid) {
191 // m_ferrors[pid] = error;
192 // }
193 // void setFHelix(double* helix, const int pid) {
194 // for(int i=0; i<5; i++) {
195 // m_fhelixs[pid][i] = helix[i];
196 // }
197 // }
198 // void setFError(double* error, const int pid) {
199 // int k=0;
200 // HepSymMatrix mat(5);
201 // for(int i=0; i<5 ; i++) {
202 // for(int j=0; j<=i; j++,k++) {
203 // mat[i][j] = error[k];
204 // mat[j][i] = error[k];
205 // }
206 // }
207 // m_ferrors[pid] = mat;
208 // }
209
210 void setLHelix( const HepVector& helix, const int pid ) { m_lhelixs[pid] = helix; }
211 void setLError( const HepSymMatrix& error, const int pid ) { m_lerrors[pid] = error; }
212 void setLHelix( double* helix, const int pid ) {
213 for ( int i = 0; i < 5; i++ ) { m_lhelixs[pid][i] = helix[i]; }
214 }
215 void setLError( double* error, const int pid ) {
216 int k = 0;
217 HepSymMatrix mat( 5 );
218 for ( int i = 0; i < 5; i++ )
219 {
220 for ( int j = 0; j <= i; j++, k++ )
221 {
222 mat[i][j] = error[k];
223 mat[j][i] = error[k];
224 }
225 }
226 m_lerrors[pid] = mat;
227 }
228
229 void setTHelix( const HepVector& helix ) {
230 for ( int i = 0; i < 5; i++ ) { m_thelix[i] = helix[i]; }
231 m_ta = helix;
232 }
233 void setTError( const HepSymMatrix& error ) {
234 int k = 0;
235 for ( int i = 0; i < 5; i++ )
236 {
237 for ( int j = i; j < 5; j++ )
238 {
239 m_terror[k] = error[i][j];
240 k++;
241 }
242 }
243 m_tEa = error;
244 }
245 void setTHelix( double helix[5] ) {
246 HepVector atemp( 5 );
247 for ( int i = 0; i < 5; i++ )
248 {
249 m_thelix[i] = helix[i];
250 atemp[i] = helix[i];
251 }
252 m_ta = atemp;
253 }
254 void setTError( double error[15] ) {
255 int k = 0;
256 HepSymMatrix mat( 5 );
257 for ( int i = 0; i < 5; i++ )
258 {
259 for ( int j = 0; j <= i; j++, k++ )
260 {
261 mat[i][j] = error[k];
262 mat[j][i] = mat[i][j];
263 }
264 }
265 m_tEa = mat;
266
267 for ( int i = 0; i < 15; i++ ) { m_terror[i] = error[i]; }
268 }
269
270 void setLPoint( const HepPoint3D& point, const int pid ) { m_lpoints[pid] = point; }
271
272 void setFiTerm( double fi, const int pid ) { m_fiTerm[pid] = fi; }
273
274 void setLPivot( const HepPoint3D& pivot, const int pid ) { m_lpivots[pid] = pivot; }
275
276 /*
277 void setPoca(const HepPoint3D& poca, const int pid) {
278 m_pocas[pid] = poca;
279 }
280 void setPoca(float* poca, const int pid) {
281 for(int i=0; i<3; i++) {
282 m_pocas[pid][i] = poca[i];
283 }
284 }
285 */
286
287private:
288 HelixSegRefVec m_vechelixsegs[5]{}; // add 5 hypotheses by wangll 2011-05-06
289 int pidSeg{ 0 }; // added by wangll 2011-05-06
290 // int m_trackId;
291 double m_mass[5]{}; // mass assumption during the fit
292 // track path length from closest point to coord. origin to the last hit
293 double m_length[5]{};
294 double m_tof[5]{}; // time of flight correspond to length;
295 int m_nhits[5]{}; // number of total hits contained
296 // status flag 0:filter 1: smoother, convention: -1:as default; 0:kalfit OK; 1: kalfit
297 // abandoned int m_stat[2][5]; int m_nster[2][5]; int m_firstLayer[2][5]; int
298 // m_lastLayer[2][5]; double m_chisq[2][5]; // chi square of fit 0:filter 1:smoother int
299 // m_ndf[2][5]; // degree of freedom for the fit 0:filter 1:smoother
300 double m_pathl[43]{}; // path length in each layer
301 double m_pathSM[5]{};
302 double m_fiTerm[5]{};
303
304 // std::vector<HepPoint3D> m_pocas;
305 // std::vector<HepVector> m_zhelixs;
306 // std::vector<HepSymMatrix> m_zerrors;
307
308 std::vector<HepPoint3D> m_lpivots;
309 std::vector<HepPoint3D> m_lpoints;
310
311 // std::vector<HepVector> m_fhelixs;
312 // std::vector<HepSymMatrix> m_ferrors;
313 std::vector<HepVector> m_lhelixs;
314 std::vector<HepSymMatrix> m_lerrors;
315 double m_thelix[5]{};
316 double m_terror[15]{};
317 HepVector m_ta;
318 HepSymMatrix m_tEa;
319};
320
321typedef ObjectVector<RecMdcKalTrack> RecMdcKalTrackCol;
322
323#endif
const CLID & CLID_RecMdcKalTrack
SmartRefVector< RecMdcKalHelixSeg > HelixSegRefVec
SmartRefVector< RecMdcKalHelixSeg > HelixSegRefVec
const CLID & CLID_RecMdcKalTrack
void setLHelix(const HepVector &helix, const int pid)
RecMdcKalTrack(const RecMdcKalTrack &track)
const HepVector & getLHelix(const int pid) const
void setLError(double *error, const int pid)
int getLastLayer(const int i, const int pid) const
int getFirstLayer(const int i, const int pid) const
RecMdcKalTrack & operator=(const RecMdcKalTrack &)
const double getFiTerm(const int pid) const
const HepPoint3D & getLPoint(const int pid) const
HelixSegRefVec getVecHelixSegs(int pid=-1) const
const HepPoint3D & getLPivot(const int pid) const
RecMdcKalTrack & operator=(const DstMdcKalTrack &)
void setVecHelixSegs(const HelixSegRefVec &vechelixsegs, int pid=-1)
void setLError(const HepSymMatrix &error, const int pid)
void setLPoint(const HepPoint3D &point, const int pid)
int getNster(const int i, const int pid) const
void setLPivot(const HepPoint3D &pivot, const int pid)
const HepSymMatrix & getLError(const int pid) const
const HepPoint3D & getPoca(const int pid) const
void setLHelix(double *helix, const int pid)
RecMdcKalTrack(const DstMdcKalTrack &track)