00001 #ifndef WTrack_Parameter_H
00002 #define WTrack_Parameter_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include <cmath>
00015 #include "CLHEP/Matrix/Vector.h"
00016 #include "CLHEP/Vector/LorentzVector.h"
00017 #include "CLHEP/Vector/ThreeVector.h"
00018 #include "CLHEP/Matrix/SymMatrix.h"
00019 #include "CLHEP/Matrix/Matrix.h"
00020 using CLHEP::HepVector;
00021 using CLHEP::HepLorentzVector;
00022 using CLHEP::Hep3Vector;
00023 using CLHEP::HepMatrix;
00024 using CLHEP::HepSymMatrix;
00025 #include "CLHEP/Geometry/Point3D.h"
00026
00027 #ifndef ENABLE_BACKWARDS_COMPATIBILITY
00028 typedef HepGeom::Point3D<double> HepPoint3D;
00029 #endif
00030
00031 class WTrackParameter
00032 {
00033 public:
00034
00035 WTrackParameter();
00036 ~WTrackParameter(){;}
00037 WTrackParameter(const WTrackParameter &wtrk);
00038 WTrackParameter& operator =(const WTrackParameter &wtrk);
00039
00040
00041 WTrackParameter(const int charge, const HepLorentzVector &p, const HepPoint3D &x, const double err[]);
00042 WTrackParameter(const int charge, const HepLorentzVector &p, const HepPoint3D &x, const HepSymMatrix &err);
00043 WTrackParameter(const double mass, const HepVector &helix, const double err[]);
00044 WTrackParameter(const double mass, const HepVector &helix, const HepSymMatrix &err);
00045
00046
00047 WTrackParameter(const HepPoint3D &x, const HepLorentzVector &p, const double dphi, const double dtheta, const double dE);
00048 WTrackParameter(const HepLorentzVector &p, const double dphi, const double dtheta, const double dE);
00049
00050
00051 void setW(const HepVector &w) {m_w = w; m_mass = sqrt(w[3]*w[3] - w[2]*w[2] - w[1]*w[1] - w[0]*w[0]);}
00052 void setW(const int n, const double w) {m_w[n] = w;}
00053 void setEw(const HepSymMatrix &Ew) {m_Ew = Ew;}
00054 void setCharge(const int charge) {m_charge = charge;}
00055 void setMass(const double mass) {m_mass = mass;}
00056 void setType(const int type) {m_type = type;}
00057 void setVplm(const HepSymMatrix &Vplm) {m_Vplm = Vplm;}
00058 void setPlmp(const HepVector &plmp) {m_plmp = plmp;}
00059
00060
00061 int type() const {return m_type;}
00062 int charge() const {return m_charge;}
00063 double mass() const {return m_mass;}
00064 bool IsInvariableMass() const {return m_massInvariable;}
00065 double phi() const {return atan(w()[1]/(w()[0]));}
00066 double Lambda() const {return w()[2]/sqrt(w()[0]*w()[0] + w()[1]*w()[1]);}
00067 HepVector w() const {return m_w;}
00068 HepSymMatrix Ew() const {return m_Ew;}
00069 HepLorentzVector p() const {return HepLorentzVector(m_w[0], m_w[1], m_w[2], m_w[3]);}
00070 HepSymMatrix Ep() const {return m_Ew.sub(1, 4); }
00071 HepPoint3D x() const {return HepPoint3D(m_w[4], m_w[5], m_w[6]);}
00072 HepVector X() const {return m_w.sub(5, 7); }
00073 HepSymMatrix Ex() const {return m_Ew.sub(5, 7); }
00074 HepVector philambdamass();
00075 HepSymMatrix Vplm() const {return m_Vplm;}
00076 HepVector plmp() const {return m_plmp;}
00077
00078 private:
00079
00080 int m_charge;
00081 HepVector m_w;
00082 HepSymMatrix m_Ew;
00083 int m_type;
00084 HepSymMatrix m_Vplm;
00085 HepVector m_plmp;
00086 double m_mass;
00087 bool m_massInvariable;
00088
00089 HepMatrix GetCvtMatrix(const double mass, const HepVector &helix);
00090 HepVector CvtH2W(const double mass, const HepVector &helix);
00091 };
00092
00093 #endif // WTrack_Parameter_H
00094