/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Reconstruction/MdcPatRec/TrkBase/TrkBase-00-01-12/TrkBase/HelixTraj.h

Go to the documentation of this file.
00001 // $Id: HelixTraj.h,v 1.3 2010/03/25 09:56:26 zhangy Exp $
00002 //
00003 // Trajectory subclass that implements a helix simple along the z axis
00004 // Author : Gautier Hamel de Monchenault, from TrkParms and other similar classes
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 //  Define the parameters 
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 // operators
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   // How far can you go using given approximation before error > tolerance, 
00058   //   in direction pathDir?
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 //  Real versions of the base class derrivative functions
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 //  PointTraj functions
00069   TranslateParams paramFunction() const { return HelixTraj::paramFunc; }
00070   // Invert the parameters.  Returns true in flags if the inversion
00071   // requires a change of sign in the covariance matrix.
00072   void invertParams(TrkParams* params, std::vector<bool>& flags) const;
00073   
00074   //yzhang
00075   int nPar() const { return NHLXPRM;}
00076   //zhangy
00077   
00078   // Helix-specific accessors
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   // Visitor access
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 //  Private functions (data members are part of the base class)
00099 
00100   //  double x( const double& ) const;
00101   //  double y( const double& ) const;
00102   double z( const double& ) const;
00103   double dip() const {return atan(tanDip());}
00104 //  double cosDip() const {return 1./sqrt(1.+sqr(tanDip())); }
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 // the real point translation function
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 

Generated on Tue Nov 29 23:13:41 2016 for BOSS_7.0.2 by  doxygen 1.4.7