// McTrackState.hpp #ifndef McTrackState_H #define McTrackState_H // This class represents the state of a Monte Carlo track at one // point along its trajectory. It consists of the path distance and // a VTrack. #include #include "trfbase/VTrack.h" #include "gtrbase/DetectorID.hpp" class McTrackState { private: // The path distance. double _s; // The track. trf::VTrack _trv; // The detector element id unsigned int _id; public: // Default constructor. McTrackState(); // Constructor from s and track. McTrackState(double s, const trf::VTrack& trv); McTrackState(const McTrackState&); // Constructor from s, surface and track vector. McTrackState(double s, const trf::SurfacePtr& psrf, const trf::TrackVector& vec); // Destructor. ~McTrackState(); public: // Return if this state is valid. // This is true if the track is valid. bool is_valid() const { return _trv.is_valid(); } // Return the path distance. double s() const { return _s; } // Return the track. const trf::VTrack& track() const { return _trv; } // Return the id DetectorID get_detid() const {return DetectorID(_id);} // set id void set_detid(const DetectorID& id) {_id=id.get_detector_id();} }; // Ordering operator. // Order by s. bool operator<(const McTrackState& lhs, const McTrackState& rhs); // Equality operator. // Require s and track bool operator==(const McTrackState& lhs, const McTrackState& rhs); // Output stream. std::ostream& operator<<(std::ostream& stream, const McTrackState& rhs); #endif