// SpacePath.cpp #include "SpacePath.h" #ifndef DEFECT_NO_STDLIB_NAMESPACES using std::ostream; using std::endl; #endif //********************************************************************** // Default constructor. SpacePath::SpacePath( ) : SpacePointVector() { } //********************************************************************** // Constructor from a space point. SpacePath::SpacePath( const SpacePoint& spt ) : SpacePointVector(spt) { } //********************************************************************** // Constructor from a space vector. SpacePath::SpacePath( const SpacePointVector& svec ) : SpacePointVector(svec) { } //********************************************************************** // Destructor. SpacePath::~SpacePath( ) { } //********************************************************************** // CartesianPath //********************************************************************** // Construct a Cartesian path from coordinates and path components. CartesianPath::CartesianPath(double x, double y, double z, double dx, double dy, double dz) : SpacePath( CartesianPointVector(x,y,z,dx,dy,dz) ) { } //********************************************************************** // Construct a Cartesian path from a space point and path components. CartesianPath::CartesianPath(const SpacePoint& spt, double dx, double dy, double dz) : SpacePath( CartesianPointVector(spt,dx,dy,dz) ) { } //********************************************************************** // CylindricalPath //********************************************************************** // Construct a cylindrical path from coordinates and path components. CylindricalPath::CylindricalPath(double x, double y, double z, double dr, double r_dphi, double dz) : SpacePath( CylindricalPointVector(x,y,z,dr,r_dphi,dz) ) { } //********************************************************************** // Construct a cylindrical path from a space point and path components. CylindricalPath::CylindricalPath(const SpacePoint& spt, double dr, double r_dphi, double dz) : SpacePath( CylindricalPointVector(spt,dr,r_dphi,dz) ) { } //********************************************************************** // SphericalPath //********************************************************************** // Construct a spherical path from coordinates and path components. SphericalPath::SphericalPath(double x, double y, double z, double dr, double r_dtheta, double rt_dphi) : SpacePath( SphericalPointVector(x,y,z,dr,r_dtheta,rt_dphi) ) { } //********************************************************************** // Construct a spherical path from a space point and path components. SphericalPath::SphericalPath(const SpacePoint& spt, double dr, double r_dtheta, double rt_dphi) : SpacePath( SphericalPointVector(spt,dr,r_dtheta,rt_dphi) ) { } //********************************************************************** // Output stream operator. ostream& operator<<(ostream & stream, const SpacePath& ds) { stream << (SpacePoint&) ds << endl; stream << " dx: " << ds.dx() << endl; stream << " dy: " << ds.dy() << endl; stream << " dz: " << ds.dz() << endl; stream << " drxy: " << ds.drxy() << endl; stream << " drxyz: " << ds.drxyz() << endl; stream << " rt*dphi: " << ds.rxy_dphi() << endl; stream << "r*dtheta: " << ds.rxyz_dtheta() << endl; stream << " Magnitude: " << ds.magnitude(); return stream; } //**********************************************************************