// SurfCylinder.h #ifndef SurfCylinder_H #define SurfCylinder_H // Defines the pure suface correponding to a cylinder with axis // along the z-axis. // // The corresponding track parameters are: // r (cm) is fixed // 0 - phi // 1 - z (cm) // 2 - alpha = phi_dir - phi; tan(alpha) = r*dphi/dr // 3 - sin(lambda) = dz/ds; tan(lambda) = dz/dsT // 4 - q/pT (1/GeV/c) (pT is component of p parallel to cylinder) // // The curvature is signed pointing along +z (i.e. phi_dir // is increasing if curvature is positive). // // This class serves as a base class for bounded cylinders. // // ObjStream example: // // [ mycyl SurfCylinder radius=30.0 ] // #include "trfbase/Surface.h" namespace trf { class VTrack; class CrossStat; class SurfCylinder : public Surface { public: // static methods // Return the type name. static TypeName get_type_name() { return "SurfCylinder"; } // Return the creator. static ObjCreator get_creator(); // Return the type. static Type get_static_type() { return get_creator(); } public: // enums // Surface parameters. enum { RADIUS=0 }; // Track parameters. enum { IPHI=0, IZ=1, IALF=2, ITLM=3, IQPT=4 }; protected: // attributes double _radius; protected: // Output stream operator. // used by operator<<. virtual void ostr(std::ostream& stream) const; // Raw output stream operator. // No begin or end object markers. void raw_ostr(std::ostream& stream) const; // Return true if two surfaces have the same pure surface. // Argument may be safely downcast. bool safe_pure_equal(const Surface& srf) const; // Return true if two pure surfaces are ordered. // We order in r. // Argument may be safely downcast. bool safe_pure_less_than(const Surface& srf) const; public: // constructor SurfCylinder(double radius); // destructor virtual ~SurfCylinder(); // Return the type. Type get_pure_type() const { return get_static_type(); } // Write the object data. ObjData write_data() const; // Virtual constructor. #ifdef DEFECT_NO_VIRTUAL_COVARIANCE Surface* new_pure_surface() const; #else SurfCylinder* new_pure_surface() const; #endif // Find crossing status for a track. CrossStat pure_status(const VTrack& trv) const; // Return the surface parameter. double get_parameter(int i) const; // Return the radius. double get_radius() const { return _radius; }; // Return the difference between two track vectors. TrackVector vec_diff(const TrackVector& vec1, const TrackVector& vec2) const; // Return the space point for a track vector. SpacePoint space_point(const TrackVector& vec) const; // Return the space vector for a track vector. SpacePath space_vector(const TrackVector& vec, TrackSurfaceDirection dir) const; // Return q/p. double qoverp(const TrackVector& vec) const; // Return the direction. // Forward is radially outward. TrackSurfaceDirection get_direction(const TrackVector& vec) const; }; } // end namespace trf #endif