/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Reconstruction/MdcPatRec/MdcGeom/MdcGeom-00-01-17/MdcGeom/Trajectory.h

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information:
00003 //      $Id: Trajectory.h,v 1.3 2010/03/25 09:54:17 zhangy Exp $
00004 // 
00005 // Description:
00006 //  Abstract base class to describe 3-dimensional trajectories in space. 
00007 //  Defines an interface, and provides one data member -- the pathlength 
00008 //  range for which a trejectory object is valid (infinite by default).  
00009 //  In all cases, "flightlength" = 3-d pathlength along traj.
00010 //
00011 //      Software developed for the BaBar Detector at the SLAC B-Factory.
00012 //
00013 // Author(s): Dave Brown, Steve Schaffner
00014 //
00015 //------------------------------------------------------------------------
00016 #ifndef TRAJECTORY_H
00017 #define TRAJECTORY_H
00018 
00019 //----------------
00020 //-- header --
00021 //----------------
00022 #include <iosfwd>
00023 #include "CLHEP/Matrix/Vector.h"
00024 #include "CLHEP/Vector/ThreeVector.h"
00025 
00026 #include "CLHEP/Geometry/Point3D.h"
00027 #ifndef ENABLE_BACKWARDS_COMPATIBILITY
00028 typedef HepGeom::Point3D<double> HepPoint3D;
00029 #endif
00030 
00031 
00032 using namespace CLHEP;
00033 
00034 
00035 class Trajectory{
00036 
00037   public:
00038     //*******************
00039     // Constructors, etc.
00040     //*******************
00041     //       By default, the valid flight distance range is really big
00042     Trajectory(double lowlim, double hilim);
00043     virtual ~Trajectory();
00044 
00045     //**********
00046     //  Access 
00047     //**********
00048     // As a function of the flight distance
00049     virtual HepPoint3D   position( double )  const = 0;
00050     virtual Hep3Vector direction( double ) const = 0;
00051     virtual Hep3Vector delDirect( double ) const = 0; // 2nd deriv. WRT pathlen
00052     virtual double     curvature( double ) const = 0; // = |delDirect|
00053     // For more efficient calling:
00054     virtual void  getInfo(double fltLen, HepPoint3D& pos, Hep3Vector& direction) const = 0;
00055     virtual void  getInfo(double fltLen, HepPoint3D& pos, Hep3Vector& direction,
00056         Hep3Vector& delDirect) const = 0;
00057 
00058     // How far can you go using given approximation in direction (+/- 1) pathDir 
00059     //      before error > tolerance?  Only the sign of pathDir matters; magnitude
00060     //      must be 1.  Returned distance is >= 0.
00061     double distTo0thError(double s, double tol, int pathDir) const;
00062     virtual double distTo1stError(double s, double tol, int pathDir) const = 0;
00063     virtual double distTo2ndError(double s, double tol, int pathDir) const = 0;
00064 
00065     //  CopyOf function 
00066     virtual Trajectory* clone() const = 0;
00067 
00068     // Range of valid flight distances:
00069     bool validFlightDistance(double f,double tolerance=0.0) const;
00070     virtual void setFlightRange(double newrange[2]);
00071     double lowRange() const;
00072     double hiRange() const;
00073     double range() const;
00074     //  Print functions
00075 
00076     virtual void print(std::ostream& os) const;
00077     virtual void printAll(std::ostream& os) const;
00078     //**************
00079     // End interface
00080     //**************
00081   protected:
00082     Trajectory& operator=(const Trajectory&);
00083     double flightrange[2]; // validity range for the flight distance parameter
00084 };
00085 
00086 // inline functions
00087 
00088 inline bool Trajectory::validFlightDistance(double f,double tol) const {
00089   return f >= flightrange[0]-tol && f <= flightrange[1]+tol; 
00090 }
00091 inline double Trajectory::lowRange() const {return flightrange[0];}
00092 inline double Trajectory::hiRange() const {return flightrange[1];}
00093 inline double Trajectory::range() const  { return hiRange()-lowRange(); }
00094 #endif

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