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