//----------------------------------------------------------------------------- // Jan 13 2001 P.Murat: stolen from Joe in exchange for trybos bank //----------------------------------------------------------------------------- #ifndef TLine3D_hh #define TLine3D_hh #include "TVector3.h" #include "TTrajectory3D.hh" class TTrajectoryPoint; class TLine3D : public TTrajectory3D { public: // ****** constructors and destructor TLine3D(); TLine3D(const TLine3D &right); TLine3D(const TVector3 &point, const TVector3 &direction); ~TLine3D(); void Init(const TVector3 &point, const TVector3 &direction); // point is x,y,z,nx,ny,nz,ptot void Init(TTrajectoryPoint* point); const TLine3D & operator=(const TLine3D &right); // Position virtual void GetPosition(TVector3& pos, double s = 0.0) const; // Direction virtual void GetDirection(TVector3& dir, double s = 0.0) const; // Parameters. double getD0 () const { return _d0; } double getZ0 () const { return _z0; } double getPhi0 () const { return _phi0; } double getCotTheta() const { return _sinTheta==0 ? 0:_cosTheta/_sinTheta; } // Position and direction together virtual void GetLocation(TTrajectory3D::Location & loc, double s = 0.0) const; void GetPoint (TTrajectoryPoint* point, double s = 0.0) const; // pathlength at specifed distance // from z-axis virtual double GetPathLengthAtRho(double rho) const; virtual double GetPathLengthAtZ (double Z ) const; // Second deiviative virtual TVector3 getSecondDerivative(double s = 0.0) const; // This is to keep the base class // methods from being hidden virtual double getPathLengthTo(const TTrajectory3D &t) const { return TTrajectory3D::getPathLengthTo(t); } virtual double getDzeroTo(const TTrajectory3D &t) const { return TTrajectory3D::getDzeroTo(t); } // Pathlength to point virtual double getPathLengthTo(const TVector3 &point) const; // DZero to point virtual double getDzeroTo(const TVector3 &point) const; // Pathlength to line virtual double getPathLengthTo(const TLine3D & line); // DZero to line virtual double getDzeroTo(const TLine3D &line); // Intersection with a plane // temporarily disabled // virtual TTrajectory3D::Location * newIntersectionWith(const HepPlane3D &plane) const; private: double _sinTheta; double _cosTheta; double _z0; double _d0; double _phi0; double _sinPhi0; double _cosPhi0; ClassDef(TLine3D,1) }; #endif