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