00001 #ifndef HTrack_Parameter_H
00002 #define HTrack_Parameter_H
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include "CLHEP/Matrix/Vector.h"
00012 #include "CLHEP/Vector/LorentzVector.h"
00013 #include "CLHEP/Vector/ThreeVector.h"
00014 #include "CLHEP/Matrix/SymMatrix.h"
00015 #include "CLHEP/Matrix/Matrix.h"
00016 using CLHEP::HepVector;
00017 using CLHEP::HepLorentzVector;
00018 using CLHEP::Hep3Vector;
00019 using CLHEP::HepMatrix;
00020 using CLHEP::HepSymMatrix;
00021 #include "CLHEP/Geometry/Point3D.h"
00022 #ifndef ENABLE_BACKWARDS_COMPATIBILITY
00023 typedef HepGeom::Point3D<double> HepPoint3D;
00024 #endif
00025
00026 class WTrackParameter;
00027
00028 class HTrackParameter {
00029
00030 public:
00031 HTrackParameter();
00032 ~HTrackParameter() {;}
00033 HTrackParameter(const HTrackParameter &htrk);
00034 HTrackParameter & operator = (const HTrackParameter &htrk);
00035 HTrackParameter(const HepVector helix, const HepSymMatrix eMatrix, const int trackid, const int partid);
00036 HTrackParameter(const HepVector helix, const double error[], const int trackid, const int partid);
00037
00038
00039
00040
00041 HTrackParameter(const WTrackParameter wtrk);
00042
00043
00044
00045 HTrackParameter(const int charge, const HepVector p, const HepVector x);
00046 HepMatrix dHdx(const HepVector p, const HepVector x);
00047 HepMatrix dHdp(const HepVector p, const HepVector x);
00048
00049 HepVector hel() const {return m_hel;}
00050 HepVector helix() const {return m_hel;}
00051 HepSymMatrix eHel() const {return m_eHel;}
00052 int trackID() const {return m_trackID;}
00053 int partID() const {return m_partID;}
00054
00055
00056 inline int charge() const;
00057
00058 inline double pxy() const;
00059 inline HepVector p() const;
00060 inline HepVector x() const;
00061 inline Hep3Vector p3() const;
00062 inline HepPoint3D x3() const;
00063 inline HepLorentzVector p(const double mass) const;
00064 HepPoint3D center() const;
00065 double radius() const;
00066
00067 double drho() const {return m_hel[0];}
00068 double phi0() const {return m_hel[1];}
00069 double kappa() const {return m_hel[2];}
00070 double dz() const {return m_hel[3];}
00071 double lambda() const {return m_hel[4];}
00072
00073
00074
00075 WTrackParameter wTrack() const;
00076 WTrackParameter wTrack(const double mass) const;
00077
00078
00079 void setTrackID(const int trackID) {m_trackID = trackID;}
00080 void setPartID(const int partID) { m_partID = partID;}
00081
00082 void setHel(const HepVector he) {m_hel = he;}
00083 void setEHel(const HepSymMatrix eH) {m_eHel = eH;}
00084
00085
00086
00087
00088 double xmass(const int i) const;
00089
00090
00091
00092 HepPoint3D positionTwoHelix(const HTrackParameter) const;
00093 HepPoint3D positionPlane(const double) const;
00094 HepPoint3D positionCylinder(const double) const;
00095 HepPoint3D positionCone() const;
00096
00097
00098
00099 double minDistanceTwoHelix(const HTrackParameter G, HepPoint3D &pos);
00100 private:
00101 int m_trackID;
00102 int m_partID;
00103 HepVector m_hel;
00104 HepSymMatrix m_eHel;
00105 };
00106
00107 inline int HTrackParameter::charge() const {
00108 return (m_hel[2]>0 ? +1 :-1);
00109 }
00110
00111 inline double HTrackParameter::pxy() const {
00112 return fabs(1/m_hel[2]);
00113 }
00114
00115 inline HepVector HTrackParameter::p() const {
00116 HepVector p0(3, 0);
00117 double pxy = 1./fabs(m_hel[2]);
00118 p0[0] = 0 - pxy*sin(m_hel[1]);
00119 p0[1] = pxy*cos(m_hel[1]);
00120 p0[2] = pxy * m_hel[4];
00121 return p0;
00122 }
00123
00124
00125 inline HepVector HTrackParameter::x() const {
00126 HepVector v0(3, 0);
00127 v0[0] = m_hel[0]*cos(m_hel[1]);
00128 v0[1] = m_hel[0]*sin(m_hel[1]);
00129 v0[2] = m_hel[3];
00130 return v0;
00131 }
00132
00133 inline HepPoint3D HTrackParameter::x3() const {
00134 return HepPoint3D(m_hel[0]*cos(m_hel[1]), m_hel[0]*sin(m_hel[1]), m_hel[3]);
00135 }
00136
00137 inline Hep3Vector HTrackParameter::p3() const {
00138 double pxy = 1./fabs(m_hel[2]);
00139 return Hep3Vector(0-pxy*sin(m_hel[1]), pxy*cos(m_hel[1]), pxy*m_hel[4]);
00140 }
00141
00142 inline HepLorentzVector HTrackParameter::p(const double mass) const{
00143
00144
00145
00146
00147
00148
00149
00150 Hep3Vector p3tmp = p3();
00151 double ptrk = p3tmp.r();
00152 double e = sqrt(ptrk*ptrk+mass*mass);
00153 return HepLorentzVector(p3tmp, e);
00154 }
00155
00156 #endif