BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Event/DstEvent/include/DstEvent/DstMdcKalTrack.h
Go to the documentation of this file.
1/*
2 * @class : DstMdcKalTrack
3 *
4 * this class models "Kalman Track" from Mdc
5 *
6 * ********************************************************/
7
8#ifndef DSTMDCKALTRACK_H
9#define DSTMDCKALTRACK_H
10#include "CLHEP/Geometry/Point3D.h"
11#include "CLHEP/Matrix/SymMatrix.h"
12#include "CLHEP/Matrix/Vector.h"
13#include "CLHEP/Vector/LorentzVector.h"
14#include "CLHEP/Vector/ThreeVector.h"
15#include "EventModel/EventModel.h"
16#include "GaudiKernel/ContainedObject.h"
17#include "GaudiKernel/ObjectVector.h"
18#include "GaudiKernel/SmartRef.h"
19#include <vector>
20
21#ifndef ENABLE_BACKWARDS_COMPATIBILITY
22// backwards compatibility will be enabled ONLY in CLHEP 1.9
23typedef HepGeom::Point3D<double> HepPoint3D;
24#endif
25using namespace CLHEP;
26
27using namespace EventModel;
28using CLHEP::HepSymMatrix;
29using CLHEP::HepVector;
30extern const CLID& CLID_DstMdcKalTrack;
31
32class DstMdcKalTrack : virtual public ContainedObject {
33
34public:
35 virtual const CLID& clID() const { return DstMdcKalTrack::classID(); }
36
37 static const CLID& classID() { return CLID_DstMdcKalTrack; }
38 // cconstructor and destructor
40 DstMdcKalTrack( const DstMdcKalTrack& track );
43
44 enum PidType { null = -1, electron = 0, muon = 1, pion = 2, kaon = 3, proton = 4 };
45
46 static void setPidType( PidType pidType ) { m_pidType = pidType; }
47 static PidType getPidType() { return m_pidType; }
48
49 // extractors
50 const int trackId() const { return m_trackId; }
51 const double mass() const { return m_mass[m_pidType]; }
52 const int charge() const { return m_charge[m_pidType]; }
53 const double pxy() const { return m_pxy[m_pidType]; }
54 const double px() const { return m_px[m_pidType]; }
55 const double py() const { return m_py[m_pidType]; }
56 const double pz() const { return m_pz[m_pidType]; }
57 const double theta() const { return m_theta[m_pidType]; }
58 const double phi() const { return m_phi[m_pidType]; }
59
60 const double x() const { return m_x[m_pidType]; }
61 const double y() const { return m_y[m_pidType]; }
62 const double z() const { return m_z[m_pidType]; }
63
64 const double x( const int i ) const { return m_x[i]; }
65 const double y( const int i ) const { return m_y[i]; }
66 const double z( const int i ) const { return m_z[i]; }
67
68 const double r() const { return m_r[m_pidType]; }
69 const double p() const { return m_p[m_pidType]; }
70 const int stat() const { return m_stat[0][m_pidType]; }
71 const double chi2() const { return m_chisq[0][m_pidType]; }
72 const int ndof() const { return m_ndf[0][m_pidType]; }
73 const int nster() const { return m_nster[0][m_pidType]; }
74 const int firstLayer() const { return m_firstLayer[0][m_pidType]; }
75 const int lastLayer() const { return m_lastLayer[0][m_pidType]; }
76 const int nlayer() const { return m_nlayer[m_pidType]; }
77
78 const double dr( void ) const { return m_zhelixs[m_pidType][0]; }
79 const double fi0( void ) const { return m_zhelixs[m_pidType][1]; }
80 const double kappa( void ) const { return m_zhelixs[m_pidType][2]; }
81 const double dz( void ) const { return m_zhelixs[m_pidType][3]; }
82 const double tanl( void ) const { return m_zhelixs[m_pidType][4]; }
83
84 const HepVector& helix() const { return m_zhelixs[m_pidType]; }
85 const HepSymMatrix& err() const { return m_zerrors[m_pidType]; }
86 const HepVector& fhelix() const { return m_fhelixs[m_pidType]; }
87 const HepSymMatrix& ferr() const { return m_ferrors[m_pidType]; }
88 const HepPoint3D poca() const { return m_pocas[m_pidType]; }
89 const Hep3Vector p3() const;
90 const HepPoint3D x3() const;
91 const HepLorentzVector p4() const;
92 const HepLorentzVector p4( double mass ) const;
93
94 // modifiers
96 void setMass( double mass, int pid ) { m_mass[pid] = mass; }
97 void setCharge( const int charge, const int pid ) { m_charge[pid] = charge; }
98 void setPxy( const double pxy, const int pid ) { m_pxy[pid] = pxy; }
99 void setPx( const double px, const int pid ) { m_px[pid] = px; }
100 void setPy( const double py, const int pid ) { m_py[pid] = py; }
101 void setPz( const double pz, const int pid ) { m_pz[pid] = pz; }
102 void setP( const double p, const int pid ) { m_p[pid] = p; }
103 void setTheta( const double theta, const int pid ) { m_theta[pid] = theta; }
104 void setPhi( const double phi, const int pid ) { m_phi[pid] = phi; }
105 void setX( const double x, const int pid ) { m_x[pid] = x; }
106 void setY( const double y, const int pid ) { m_y[pid] = y; }
107 void setZ( const double z, const int pid ) { m_z[pid] = z; }
108 void setR( const double r, const int pid ) { m_r[pid] = r; }
109 void setNlayer( int nlayer, int pid ) { m_nlayer[pid] = nlayer; }
110 void setNster( int ns, int i, int pid ) { m_nster[i][pid] = ns; }
111 void setStat( int stat, int i, int pid ) { m_stat[i][pid] = stat; }
112 void setChisq( double chisq, int i, int pid ) { m_chisq[i][pid] = chisq; }
113 void setFirstLayer( int fL, int i, int pid ) { m_firstLayer[i][pid] = fL; }
114 void setLastLayer( int lL, int i, int pid ) { m_lastLayer[i][pid] = lL; }
115 void setNhits( int nhits, int pid ) { m_nhits[pid] = nhits; }
116 void setNdf( int ndf, int i, int pid ) { m_ndf[i][pid] = ndf; }
117
118 void setPoca( const HepPoint3D& poca, const int pid ) { m_pocas[pid] = poca; }
119
120 void setPoca( double* poca, const int pid ) {
121 for ( int i = 0; i < 3; i++ ) { m_pocas[pid][i] = poca[i]; }
122 }
123
124 void setZHelix( const HepVector& helix, const int pid ) { m_zhelixs[pid] = helix; }
125
126 void setZError( const HepSymMatrix& error, const int pid ) { m_zerrors[pid] = error; }
127 void setZHelix( double* helix, const int pid ) {
128 for ( int i = 0; i < 5; i++ ) { m_zhelixs[pid][i] = helix[i]; }
129 }
130
131 void setZError( double* error, const int pid ) {
132 int k = 0;
133 HepSymMatrix mat( 5 );
134 for ( int i = 0; i < 5; i++ )
135 {
136 for ( int j = 0; j <= i; j++, k++ )
137 {
138 mat[i][j] = error[k];
139 mat[j][i] = error[k];
140 }
141 }
142 m_zerrors[pid] = mat;
143 }
144
145 void setFHelix( const HepVector& fhelix, const int pid ) { m_fhelixs[pid] = fhelix; }
146
147 void setFError( const HepSymMatrix& ferror, const int pid ) { m_ferrors[pid] = ferror; }
148 void setFHelix( double* fhelix, const int pid ) {
149 for ( int i = 0; i < 5; i++ ) { m_fhelixs[pid][i] = fhelix[i]; }
150 }
151
152 void setFError( double* ferror, const int pid ) {
153 int k = 0;
154 HepSymMatrix mat( 5 );
155 for ( int i = 0; i < 5; i++ )
156 {
157 for ( int j = 0; j <= i; j++, k++ )
158 {
159 mat[i][j] = ferror[k];
160 mat[j][i] = ferror[k];
161 }
162 }
163 m_ferrors[pid] = mat;
164 }
165 const int getTrackId() const { return m_trackId; }
166 const int getCharge( const int pid ) const { return m_charge[pid]; }
167 const int getStat( const int pid ) const { return m_stat[0][pid]; }
168 const int getNster( const int pid ) const { return m_nster[0][pid]; }
169 const double getChisq( const int pid ) const { return m_chisq[0][pid]; }
170 const int getNdf( const int pid ) const { return m_ndf[0][pid]; }
171 const int getFirstLayer( const int pid ) const { return m_firstLayer[0][pid]; }
172 const int getLastLayer( const int pid ) const { return m_lastLayer[0][pid]; }
173 const int getNlayer( const int pid ) const { return m_nlayer[pid]; }
174
175 const HepPoint3D& getPoca( const int pid ) const { return m_pocas[pid]; }
176 const HepVector& getZHelix( const int pid ) const { return m_zhelixs[pid]; }
177 const HepSymMatrix& getZError( const int pid ) const { return m_zerrors[pid]; }
178 const HepVector& getFHelix( const int pid ) const { return m_fhelixs[pid]; }
179 const HepSymMatrix& getFError( const int pid ) const { return m_ferrors[pid]; }
180
181protected:
183 int m_trackId{ 0 }; // Track ID wensp add 2005-10-18
184 int m_charge[5]{};
185 int m_stat[2][5]{};
186 int m_nster[2][5]{};
187 int m_firstLayer[2][5]{};
188 int m_lastLayer[2][5]{};
189 double m_mass[5]{};
190 double m_chisq[2][5]{};
191 double m_pxy[5]{};
192 double m_px[5]{};
193 double m_py[5]{};
194 double m_pz[5]{};
195 double m_p[5]{};
196 double m_theta[5]{};
197 double m_phi[5]{};
198 double m_x[5]{};
199 double m_y[5]{};
200 double m_z[5]{};
201 double m_r[5]{};
202 // double m_chi2[2][5]; // chi square of forward filter
203 int m_ndf[2][5]{}; // degree of freedom of forward filter
204 int m_nhits[5]{};
205 int m_nlayer[5]{};
206
207 std::vector<HepPoint3D> m_pocas; //
208 std::vector<HepVector> m_zhelixs; //
209 std::vector<HepSymMatrix> m_zerrors; //
210 std::vector<HepVector> m_fhelixs; //
211 std::vector<HepSymMatrix> m_ferrors; //
212};
213
214typedef ObjectVector<DstMdcKalTrack> DstMdcKalTrackCol;
215
216#endif
double mass
HepGeom::Point3D< double > HepPoint3D
ObjectVector< DstMdcKalTrack > DstMdcKalTrackCol
const CLID & CLID_DstMdcKalTrack
const CLID & CLID_DstMdcKalTrack
void setFHelix(const HepVector &fhelix, const int pid)
const int getFirstLayer(const int pid) const
void setPhi(const double phi, const int pid)
void setY(const double y, const int pid)
void setPz(const double pz, const int pid)
const int getLastLayer(const int pid) const
void setChisq(double chisq, int i, int pid)
void setZError(const HepSymMatrix &error, const int pid)
void setX(const double x, const int pid)
void setP(const double p, const int pid)
void setPoca(const HepPoint3D &poca, const int pid)
const HepVector & getZHelix(const int pid) const
const HepSymMatrix & getFError(const int pid) const
void setPx(const double px, const int pid)
void setZ(const double z, const int pid)
void setTheta(const double theta, const int pid)
void setR(const double r, const int pid)
void setZHelix(double *helix, const int pid)
const HepVector & getFHelix(const int pid) const
void setPxy(const double pxy, const int pid)
void setPy(const double py, const int pid)
const HepSymMatrix & getZError(const int pid) const
const HepPoint3D & getPoca(const int pid) const
void setFError(const HepSymMatrix &ferror, const int pid)
DstMdcKalTrack & operator=(const DstMdcKalTrack &)
void setFHelix(double *fhelix, const int pid)
const HepPoint3D x3() const
const Hep3Vector p3() const
void setPoca(double *poca, const int pid)
void setZHelix(const HepVector &helix, const int pid)
void setCharge(const int charge, const int pid)
const HepLorentzVector p4() const
void setZError(double *error, const int pid)
const double getChisq(const int pid) const
void setFError(double *ferror, const int pid)
#define ns(x)
Definition xmltok.c:1355