00001
00002
00003
00004
00005
00006 #ifndef HELIXTRAJ_HH
00007 #define HELIXTRAJ_HH
00008 #include "TrkBase/TrkSimpTraj.h"
00009 #include "CLHEP/Matrix/Vector.h"
00010 #include "CLHEP/Matrix/Matrix.h"
00011 #include "CLHEP/Matrix/SymMatrix.h"
00012 #include "CLHEP/Geometry/Point3D.h"
00013 #ifndef ENABLE_BACKWARDS_COMPATIBILITY
00014 typedef HepGeom::Point3D<double> HepPoint3D;
00015 #endif
00016
00017
00018 #include <iosfwd>
00019
00020 using CLHEP::Hep3Vector;
00021 using CLHEP::HepMatrix;
00022 using CLHEP::HepSymMatrix;
00023
00024 class TrkVisitor;
00025 class TrkExchangePar;
00026
00027 class HelixTraj : public TrkSimpTraj {
00028 public:
00029
00030 enum ParIndex {d0Index=0, phi0Index, omegaIndex, z0Index, tanDipIndex};
00031 enum {NHLXPRM = 5};
00032 HelixTraj(const HepVector&,const HepSymMatrix&, double lowlim=-99999.,
00033 double hilim=99999., const HepPoint3D& refpoint = _theOrigin);
00034 HelixTraj(const TrkExchangePar&, double lowlim=-99999.,
00035 double hilim=99999., const HepPoint3D& refpoint = _theOrigin);
00036 HelixTraj(const TrkParams&, double lowlim=-99999.,
00037 double hilim=99999., const HepPoint3D& refpoint = _theOrigin);
00038 HelixTraj( const HelixTraj& );
00039 HelixTraj* clone() const;
00040
00041 virtual ~HelixTraj();
00042
00043
00044 HelixTraj& operator=(const HelixTraj&);
00045 virtual HepPoint3D position(double fltLen) const;
00046 virtual Hep3Vector direction(double fltLen) const;
00047 virtual Hep3Vector delDirect(double) const;
00048 virtual void getInfo(double fltLen, HepPoint3D& pos,
00049 Hep3Vector& dir) const;
00050 virtual void getInfo(double fltLen, HepPoint3D& , Hep3Vector& dir,
00051 Hep3Vector& delDir) const;
00052 virtual void getDFInfo(double fltLen, DifPoint& , DifVector& dir,
00053 DifVector& delDir) const;
00054 virtual void getDFInfo2(double fltLen, DifPoint& pos, DifVector&
00055 dir) const;
00056
00057
00058
00059 virtual double distTo1stError(double s, double tol, int pathDir) const;
00060 virtual double distTo2ndError(double s, double tol, int pathDir) const;
00061
00062
00063
00064 double curvature( double fltLen) const;
00065 HepMatrix derivDeflect(double fltlen,deflectDirection) const;
00066 HepMatrix derivDisplace(double fltlen,deflectDirection idir) const;
00067 HepMatrix derivPFract(double fltlen) const;
00068
00069 TranslateParams paramFunction() const { return HelixTraj::paramFunc; }
00070
00071
00072 void invertParams(TrkParams* params, std::vector<bool>& flags) const;
00073
00074
00075 int nPar() const { return NHLXPRM;}
00076
00077
00078
00079 double d0() const {return parameters()->parameter()[d0Index];}
00080 double phi0() const;
00081 double omega() const {return parameters()->parameter()[omegaIndex]; }
00082 double z0() const {return parameters()->parameter()[z0Index]; }
00083 double tanDip() const { return parameters()->parameter()[tanDipIndex]; }
00084
00085
00086
00087
00088
00089 virtual void visitAccept(TrkVisitor* vis) const;
00090
00091 virtual void print(std::ostream& os) const;
00092 virtual void printAll(std::ostream& os) const;
00093
00094
00095 private:
00096
00097
00098
00099
00100
00101
00102 double z( const double& ) const;
00103 double dip() const {return atan(tanDip());}
00104
00105 double cosDip() const {return 1./sqrt(1.+tanDip()*tanDip()); }
00106 double sinDip() const {return tanDip()*cosDip(); }
00107 double translen(const double& f) const {return cosDip()*f;}
00108 double arc( const double& f) const {return translen(f)*omega();}
00109 double angle(const double& f) const;
00110
00111 static void paramFunc(const HepPoint3D& oldpoint,const HepPoint3D& newpoint,
00112 const HepVector& oldpar,const HepSymMatrix& oldcov,
00113 HepVector& newpar,HepSymMatrix& newcov,
00114 double fltlen);
00115 };
00116 #endif
00117