00001
00002
00003
00004
00005
00006
00007
00008 #ifndef DSTMDCKALTRACK_H
00009 #define DSTMDCKALTRACK_H
00010 #include "GaudiKernel/ContainedObject.h"
00011 #include "GaudiKernel/SmartRef.h"
00012 #include "GaudiKernel/ObjectVector.h"
00013 #include "EventModel/EventModel.h"
00014 #include "CLHEP/Matrix/Vector.h"
00015 #include "CLHEP/Matrix/SymMatrix.h"
00016 #include "CLHEP/Vector/ThreeVector.h"
00017 #include "CLHEP/Geometry/Point3D.h"
00018 #include "CLHEP/Vector/LorentzVector.h"
00019 #include <vector>
00020
00021 #ifndef ENABLE_BACKWARDS_COMPATIBILITY
00022
00023 typedef HepGeom::Point3D<double> HepPoint3D;
00024 #endif
00025 using namespace CLHEP;
00026
00027 using namespace EventModel;
00028 using CLHEP::HepVector;
00029 using CLHEP::HepSymMatrix;
00030 extern const CLID& CLID_DstMdcKalTrack;
00031
00032
00033 class DstMdcKalTrack : virtual public ContainedObject {
00034
00035 public:
00036 virtual const CLID& clID() const {
00037 return DstMdcKalTrack::classID();
00038 }
00039
00040 static const CLID& classID() {
00041 return CLID_DstMdcKalTrack;
00042 }
00043
00044 DstMdcKalTrack();
00045 DstMdcKalTrack(const DstMdcKalTrack& track);
00046 DstMdcKalTrack& operator=(const DstMdcKalTrack&);
00047 ~DstMdcKalTrack();
00048
00049 enum PidType
00050 {
00051 null = -1,
00052 electron = 0,
00053 muon = 1,
00054 pion = 2,
00055 kaon = 3,
00056 proton = 4
00057 };
00058
00059 static void setPidType(PidType pidType) {m_pidType = pidType; }
00060 static PidType getPidType() {return m_pidType; }
00061
00062
00063 const int trackId() const { return m_trackId; }
00064 const double mass() const { return m_mass[m_pidType]; }
00065 const int charge() const { return m_charge[m_pidType];}
00066 const double pxy() const { return m_pxy[m_pidType]; }
00067 const double px() const { return m_px[m_pidType]; }
00068 const double py() const { return m_py[m_pidType]; }
00069 const double pz() const { return m_pz[m_pidType]; }
00070 const double theta() const { return m_theta[m_pidType]; }
00071 const double phi() const { return m_phi[m_pidType]; }
00072
00073 const double x() const { return m_x[m_pidType]; }
00074 const double y() const { return m_y[m_pidType]; }
00075 const double z() const { return m_z[m_pidType]; }
00076
00077 const double x(const int i) const {return m_x[i];}
00078 const double y(const int i) const {return m_y[i];}
00079 const double z(const int i) const {return m_z[i];}
00080
00081 const double r() const {return m_r[m_pidType];}
00082 const double p() const {return m_p[m_pidType];}
00083 const int stat() const {return m_stat[0][m_pidType];}
00084 const double chi2() const {return m_chisq[0][m_pidType];}
00085 const int ndof() const {return m_ndf[0][m_pidType];}
00086 const int nster() const {return m_nster[0][m_pidType];}
00087 const int firstLayer() const {return m_firstLayer[0][m_pidType];}
00088 const int lastLayer() const {return m_lastLayer[0][m_pidType];}
00089
00090 const double dr( void ) const { return m_zhelixs[m_pidType][0]; }
00091 const double fi0( void ) const { return m_zhelixs[m_pidType][1]; }
00092 const double kappa( void ) const { return m_zhelixs[m_pidType][2]; }
00093 const double dz( void ) const { return m_zhelixs[m_pidType][3]; }
00094 const double tanl( void ) const { return m_zhelixs[m_pidType][4]; }
00095
00096 const HepVector& helix() const { return m_zhelixs[m_pidType]; }
00097 const HepSymMatrix& err() const { return m_zerrors[m_pidType]; }
00098 const HepVector& fhelix() const { return m_fhelixs[m_pidType]; }
00099 const HepSymMatrix& ferr() const { return m_ferrors[m_pidType]; }
00100 const HepPoint3D poca() const { return m_pocas[m_pidType]; }
00101 const Hep3Vector p3() const;
00102 const HepPoint3D x3() const;
00103 const HepLorentzVector p4() const;
00104 const HepLorentzVector p4(double mass) const;
00105
00106
00107 void setTrackId(int trackId) { m_trackId = trackId; }
00108 void setMass(double mass, int pid) { m_mass[pid] = mass; }
00109 void setCharge(const int charge, const int pid) { m_charge[pid] = charge;}
00110 void setPxy(const double pxy, const int pid) { m_pxy[pid] = pxy; }
00111 void setPx(const double px, const int pid) { m_px[pid] = px; }
00112 void setPy(const double py, const int pid) { m_py[pid] = py; }
00113 void setPz(const double pz, const int pid) { m_pz[pid] = pz; }
00114 void setP(const double p, const int pid) { m_p[pid] = p; }
00115 void setTheta(const double theta,const int pid) { m_theta[pid] = theta; }
00116 void setPhi(const double phi, const int pid) { m_phi[pid] = phi; }
00117 void setX(const double x, const int pid) { m_x[pid] = x; }
00118 void setY(const double y,const int pid) { m_y[pid] = y; }
00119 void setZ(const double z, const int pid) { m_z[pid] = z; }
00120 void setR(const double r, const int pid) { m_r[pid] = r; }
00121 void setNster(int ns, int i, int pid) { m_nster[i][pid] = ns; }
00122 void setStat(int stat, int i, int pid) { m_stat[i][pid] = stat; }
00123 void setChisq(double chisq, int i, int pid) { m_chisq[i][pid] = chisq; }
00124 void setFirstLayer(int fL, int i, int pid) { m_firstLayer[i][pid] = fL; }
00125 void setLastLayer(int lL, int i, int pid) { m_lastLayer[i][pid] = lL; }
00126 void setNhits(int nhits, int pid) { m_nhits[pid] = nhits; }
00127 void setNdf(int ndf, int i, int pid) { m_ndf[i][pid] = ndf; }
00128
00129 void setPoca(const HepPoint3D& poca, const int pid){
00130 m_pocas[pid] = poca;
00131 }
00132
00133 void setPoca(double* poca, const int pid){
00134 for(int i=0; i<3; i++){
00135 m_pocas[pid][i] = poca[i];
00136 }
00137 }
00138
00139 void setZHelix(const HepVector& helix, const int pid) {
00140 m_zhelixs[pid] = helix;
00141 }
00142
00143 void setZError(const HepSymMatrix& error, const int pid) {
00144 m_zerrors[pid] = error;
00145 }
00146 void setZHelix(double* helix, const int pid) {
00147 for(int i=0; i<5; i++) {
00148 m_zhelixs[pid][i] = helix[i];
00149 }
00150 }
00151
00152 void setZError(double* error, const int pid) {
00153 int k=0;
00154 HepSymMatrix mat(5);
00155 for(int i=0; i<5 ; i++) {
00156 for(int j=0; j<=i; j++,k++) {
00157 mat[i][j] = error[k];
00158 mat[j][i] = error[k];
00159 }
00160 }
00161 m_zerrors[pid] = mat;
00162 }
00163
00164 void setFHelix(const HepVector& fhelix, const int pid) {
00165 m_fhelixs[pid] = fhelix;
00166 }
00167
00168 void setFError(const HepSymMatrix& ferror, const int pid) {
00169 m_ferrors[pid] = ferror;
00170 }
00171 void setFHelix(double* fhelix, const int pid) {
00172 for(int i=0; i<5; i++) {
00173 m_fhelixs[pid][i] = fhelix[i];
00174 }
00175 }
00176
00177 void setFError(double* ferror, const int pid) {
00178 int k=0;
00179 HepSymMatrix mat(5);
00180 for(int i=0; i<5 ; i++) {
00181 for(int j=0; j<=i; j++,k++) {
00182 mat[i][j] = ferror[k];
00183 mat[j][i] = ferror[k];
00184 }
00185 }
00186 m_ferrors[pid] = mat;
00187 }
00188 const int getTrackId() const { return m_trackId; }
00189 const int getCharge(const int pid) const { return m_charge[pid]; }
00190 const int getStat( const int pid) const { return m_stat[0][pid]; }
00191 const int getNster(const int pid) const { return m_nster[0][pid]; }
00192 const double getChisq(const int pid) const { return m_chisq[0][pid]; }
00193 const int getNdf(const int pid) const { return m_ndf[0][pid]; }
00194 const int getFirstLayer(const int pid) const { return m_firstLayer[0][pid];}
00195 const int getLastLayer(const int pid) const { return m_lastLayer[0][pid]; }
00196
00197
00198 const HepPoint3D& getPoca(const int pid) const{
00199 return m_pocas[pid];
00200 }
00201 const HepVector& getZHelix(const int pid) const{
00202 return m_zhelixs[pid];
00203 }
00204 const HepSymMatrix& getZError(const int pid) const{
00205 return m_zerrors[pid];
00206 }
00207 const HepVector& getFHelix(const int pid) const{
00208 return m_fhelixs[pid];
00209 }
00210 const HepSymMatrix& getFError(const int pid) const{
00211 return m_ferrors[pid];
00212 }
00213
00214
00215 protected:
00216 static PidType m_pidType;
00217 int m_trackId;
00218 int m_charge[5];
00219 int m_stat[2][5];
00220 int m_nster[2][5];
00221 int m_firstLayer[2][5];
00222 int m_lastLayer[2][5];
00223 double m_mass[5];
00224 double m_chisq[2][5];
00225 double m_pxy[5];
00226 double m_px[5];
00227 double m_py[5];
00228 double m_pz[5];
00229 double m_p[5];
00230 double m_theta[5];
00231 double m_phi[5];
00232 double m_x[5];
00233 double m_y[5];
00234 double m_z[5];
00235 double m_r[5];
00236
00237 int m_ndf[2][5];
00238 int m_nhits[5];
00239
00240 std::vector<HepPoint3D> m_pocas;
00241 std::vector<HepVector> m_zhelixs;
00242 std::vector<HepSymMatrix> m_zerrors;
00243 std::vector<HepVector> m_fhelixs;
00244 std::vector<HepSymMatrix> m_ferrors;
00245 };
00246
00247 typedef ObjectVector<DstMdcKalTrack> DstMdcKalTrackCol;
00248
00249 #endif
00250