// SurfZPlane.h #ifndef SurfZPlane_H #define SurfZPlane_H // Defines the pure suface correponding to a plane perpendicular to // the z-axis. // // The corresponding track parameters are: // z (cm) is fixed // 0 - x (cm) // 1 - y (cm) // 2 - dx/dz // 3 - dy/dz // 4 - q/p p is momentum of a track, q is its charge // // This class serves as a base class for bounded cylinders. // // The forward direction for the surface is +z. #include "trfbase/Surface.h" namespace trf { class VTrack; class CrossStat; class SurfZPlane : public Surface { public: // enums identifying surface parameters enum {ZPOS = 0}; // track parameter indices enum { IX=0, IY=1, IDXDZ=2, IDYDZ=3, IQP=4 }; public: // Return the type name. static TypeName get_type_name() { return "SurfZPlane"; } // Return the creator. static ObjCreator get_creator(); // Return the type. static Type get_static_type() { return get_creator(); } protected: // attributes double _z; protected: // Output stream operator. // used by operator<<. virtual void ostr(std::ostream& stream) const; 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 this surface and the argument are in order. // See Surface::pure_less_than() for more information. // Argument may be safely downcast. bool safe_pure_less_than(const Surface& srf) const ; public: // constructor SurfZPlane(double z); // destructor virtual ~SurfZPlane(); // pure type Type get_pure_type() const { return get_static_type(); }; // Write the object data. ObjData write_data() const; // Virtual constructor. SurfZPlane* new_pure_surface() const; // 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 z position. double get_z() const { return _z; }; // 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; }; } // end namespace trf #endif