CGEM BOSS 6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
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"
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
45 DstMdcKalTrack(const DstMdcKalTrack& track);
48
50 {
51 null = -1,
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 const int nCgemXCluster() const {return m_nCgemXCluster[0][m_pidType];}
91 const int nCgemVCluster() const {return m_nCgemVCluster[0][m_pidType];}
92
93 const double dr( void ) const { return m_zhelixs[m_pidType][0]; }
94 const double fi0( void ) const { return m_zhelixs[m_pidType][1]; }
95 const double kappa( void ) const { return m_zhelixs[m_pidType][2]; }
96 const double dz( void ) const { return m_zhelixs[m_pidType][3]; }
97 const double tanl( void ) const { return m_zhelixs[m_pidType][4]; }
98
99 const HepVector& helix() const { return m_zhelixs[m_pidType]; }
100 const HepSymMatrix& err() const { return m_zerrors[m_pidType]; }
101 const HepVector& fhelix() const { return m_fhelixs[m_pidType]; }
102 const HepSymMatrix& ferr() const { return m_ferrors[m_pidType]; }
103 const HepPoint3D poca() const { return m_pocas[m_pidType]; }
104 const Hep3Vector p3() const;
105 const HepPoint3D x3() const;
106 const HepLorentzVector p4() const;
107 const HepLorentzVector p4(double mass) const;
108
109//modifiers
111 void setMass(double mass, int pid) { m_mass[pid] = mass; }
112 void setCharge(const int charge, const int pid) { m_charge[pid] = charge;}
113 void setPxy(const double pxy, const int pid) { m_pxy[pid] = pxy; }
114 void setPx(const double px, const int pid) { m_px[pid] = px; }
115 void setPy(const double py, const int pid) { m_py[pid] = py; }
116 void setPz(const double pz, const int pid) { m_pz[pid] = pz; }
117 void setP(const double p, const int pid) { m_p[pid] = p; }
118 void setTheta(const double theta,const int pid) { m_theta[pid] = theta; }
119 void setPhi(const double phi, const int pid) { m_phi[pid] = phi; }
120 void setX(const double x, const int pid) { m_x[pid] = x; }
121 void setY(const double y,const int pid) { m_y[pid] = y; }
122 void setZ(const double z, const int pid) { m_z[pid] = z; }
123 void setR(const double r, const int pid) { m_r[pid] = r; }
124 void setNlayer(int nlayer, int pid) { m_nlayer[pid] = nlayer; }
125 void setNster(int ns, int i, int pid) { m_nster[i][pid] = ns; }
126 void setStat(int stat, int i, int pid) { m_stat[i][pid] = stat; }
127 void setChisq(double chisq, int i, int pid) { m_chisq[i][pid] = chisq; }
128 void setFirstLayer(int fL, int i, int pid) { m_firstLayer[i][pid] = fL; }
129 void setLastLayer(int lL, int i, int pid) { m_lastLayer[i][pid] = lL; }
130 void setNhits(int nhits, int pid) { m_nhits[pid] = nhits; }
131 void setNdf(int ndf, int i, int pid) { m_ndf[i][pid] = ndf; }
132 void setNCgemXCluster(int n, int i, int pid) {m_nCgemXCluster[i][pid]=n;}
133 void setNCgemVCluster(int n, int i, int pid) {m_nCgemVCluster[i][pid]=n;}
134
135 void setPoca(const HepPoint3D& poca, const int pid){
136 m_pocas[pid] = poca;
137 }
138
139 void setPoca(double* poca, const int pid){
140 for(int i=0; i<3; i++){
141 m_pocas[pid][i] = poca[i];
142 }
143 }
144
145 void setZHelix(const HepVector& helix, const int pid) {
146 m_zhelixs[pid] = helix;
147 }
148
149 void setZError(const HepSymMatrix& error, const int pid) {
150 m_zerrors[pid] = error;
151 }
152 void setZHelix(double* helix, const int pid) {
153 for(int i=0; i<5; i++) {
154 m_zhelixs[pid][i] = helix[i];
155 }
156 }
157
158 void setZError(double* error, const int pid) {
159 int k=0;
160 HepSymMatrix mat(5);
161 for(int i=0; i<5 ; i++) {
162 for(int j=0; j<=i; j++,k++) {
163 mat[i][j] = error[k];
164 mat[j][i] = error[k];
165 }
166 }
167 m_zerrors[pid] = mat;
168 }
169
170 void setFHelix(const HepVector& fhelix, const int pid) {
171 m_fhelixs[pid] = fhelix;
172 }
173
174 void setFError(const HepSymMatrix& ferror, const int pid) {
175 m_ferrors[pid] = ferror;
176 }
177 void setFHelix(double* fhelix, const int pid) {
178 for(int i=0; i<5; i++) {
179 m_fhelixs[pid][i] = fhelix[i];
180 }
181 }
182
183 void setFError(double* ferror, const int pid) {
184 int k=0;
185 HepSymMatrix mat(5);
186 for(int i=0; i<5 ; i++) {
187 for(int j=0; j<=i; j++,k++) {
188 mat[i][j] = ferror[k];
189 mat[j][i] = ferror[k];
190 }
191 }
192 m_ferrors[pid] = mat;
193 }
194 const int getTrackId() const { return m_trackId; }
195 const int getCharge(const int pid) const { return m_charge[pid]; }
196 const int getStat( const int pid) const { return m_stat[0][pid]; }
197 const int getNster(const int pid) const { return m_nster[0][pid]; }
198 const double getChisq(const int pid) const { return m_chisq[0][pid]; }
199 const int getNdf(const int pid) const { return m_ndf[0][pid]; }
200 const int getFirstLayer(const int pid) const { return m_firstLayer[0][pid];}
201 const int getLastLayer(const int pid) const { return m_lastLayer[0][pid]; }
202 const int getNlayer(const int pid) const { return m_nlayer[pid]; }
203
204
205 const HepPoint3D& getPoca(const int pid) const{
206 return m_pocas[pid];
207 }
208 const HepVector& getZHelix(const int pid) const{
209 return m_zhelixs[pid];
210 }
211 const HepSymMatrix& getZError(const int pid) const{
212 return m_zerrors[pid];
213 }
214 const HepVector& getFHelix(const int pid) const{
215 return m_fhelixs[pid];
216 }
217 const HepSymMatrix& getFError(const int pid) const{
218 return m_ferrors[pid];
219 }
220
221
222 protected:
224 int m_trackId; // Track ID wensp add 2005-10-18
225 int m_charge[5];
226 int m_stat[2][5];
227 int m_nster[2][5];
228 int m_firstLayer[2][5];
229 int m_lastLayer[2][5];
230 double m_mass[5];
231 double m_chisq[2][5];
232 double m_pxy[5];
233 double m_px[5];
234 double m_py[5];
235 double m_pz[5];
236 double m_p[5];
237 double m_theta[5];
238 double m_phi[5];
239 double m_x[5];
240 double m_y[5];
241 double m_z[5];
242 double m_r[5];
243 //double m_chi2[2][5]; // chi square of forward filter
244 int m_ndf[2][5]; // degree of freedom of forward filter
245 int m_nhits[5];
246 int m_nlayer[5];
247 int m_nCgemXCluster[2][5]; // number of Cgem X-clusters
248 int m_nCgemVCluster[2][5]; // number of Cgem V-clusters
249
250 std::vector<HepPoint3D> m_pocas; //
251 std::vector<HepVector> m_zhelixs; //
252 std::vector<HepSymMatrix> m_zerrors; //
253 std::vector<HepVector> m_fhelixs; //
254 std::vector<HepSymMatrix> m_ferrors; //
255};
256
257typedef ObjectVector<DstMdcKalTrack> DstMdcKalTrackCol;
258
259#endif
260
const Int_t n
HepGeom::Point3D< double > HepPoint3D
ObjectVector< DstMdcKalTrack > DstMdcKalTrackCol
const CLID & CLID_DstMdcKalTrack
void setLastLayer(int lL, int i, int pid)
const int nCgemVCluster() const
std::vector< HepSymMatrix > m_ferrors
void setFHelix(const HepVector &fhelix, const int pid)
const int nlayer() const
static const CLID & classID()
const double y() const
const int getFirstLayer(const int pid) const
const int lastLayer() const
void setMass(double mass, int pid)
const int getNster(const int pid) const
const double z(const int i) const
void setPhi(const double phi, const int pid)
void setStat(int stat, int i, int pid)
const int getStat(const int pid) const
void setY(const double y, const int pid)
const HepSymMatrix & ferr() const
void setPz(const double pz, const int pid)
const int getLastLayer(const int pid) const
const HepVector & fhelix() const
const int trackId() const
void setNster(int ns, int i, int pid)
const HepVector & helix() 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)
const int getNdf(const int pid) const
void setPoca(const HepPoint3D &poca, const int pid)
const HepVector & getZHelix(const int pid) const
const double theta() const
const int getTrackId() const
const double phi() const
const HepSymMatrix & getFError(const int pid) const
void setPx(const double px, const int pid)
void setZ(const double z, const int pid)
const double dz(void) const
void setTheta(const double theta, const int pid)
void setR(const double r, const int pid)
int m_lastLayer[2][5]
const double px() const
void setNhits(int nhits, int pid)
void setZHelix(double *helix, const int pid)
int m_firstLayer[2][5]
const HepVector & getFHelix(const int pid) const
const int nCgemXCluster() const
const int stat() const
double m_chisq[2][5]
const double z() 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)
const double x(const int i) const
const double dr(void) const
const double tanl(void) const
static void setPidType(PidType pidType)
void setTrackId(int trackId)
const double pz() const
const int firstLayer() const
DstMdcKalTrack & operator=(const DstMdcKalTrack &)
std::vector< HepSymMatrix > m_zerrors
virtual const CLID & clID() const
const HepPoint3D poca() const
int m_nCgemXCluster[2][5]
const int nster() const
const int ndof() const
const double r() const
static PidType getPidType()
const int getCharge(const int pid) const
const double chi2() const
void setFHelix(double *fhelix, const int pid)
const HepPoint3D x3() const
const double y(const int i) const
const Hep3Vector p3() const
void setPoca(double *poca, const int pid)
void setZHelix(const HepVector &helix, const int pid)
std::vector< HepPoint3D > m_pocas
const double py() const
const double p() const
const HepSymMatrix & err() const
void setCharge(const int charge, const int pid)
void setNCgemXCluster(int n, int i, int pid)
void setFirstLayer(int fL, int i, int pid)
std::vector< HepVector > m_fhelixs
const double kappa(void) const
void setNdf(int ndf, int i, int pid)
static PidType m_pidType
void setNlayer(int nlayer, int pid)
const HepLorentzVector p4() const
void setZError(double *error, const int pid)
const int charge() const
const double fi0(void) const
int m_nCgemVCluster[2][5]
const double mass() const
const double getChisq(const int pid) const
void setNCgemVCluster(int n, int i, int pid)
const double x() const
const int getNlayer(const int pid) const
std::vector< HepVector > m_zhelixs
void setFError(double *ferror, const int pid)
const double pxy() const
#define ns(x)
Definition xmltok.c:1504