00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef TRAJECTORY_H
00017 #define TRAJECTORY_H
00018
00019
00020
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
00040
00041
00042 Trajectory(double lowlim, double hilim);
00043 virtual ~Trajectory();
00044
00045
00046
00047
00048
00049 virtual HepPoint3D position( double ) const = 0;
00050 virtual Hep3Vector direction( double ) const = 0;
00051 virtual Hep3Vector delDirect( double ) const = 0;
00052 virtual double curvature( double ) const = 0;
00053
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
00059
00060
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
00066 virtual Trajectory* clone() const = 0;
00067
00068
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
00075
00076 virtual void print(std::ostream& os) const;
00077 virtual void printAll(std::ostream& os) const;
00078
00079
00080
00081 protected:
00082 Trajectory& operator=(const Trajectory&);
00083 double flightrange[2];
00084 };
00085
00086
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