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