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