// ETrack.h #ifndef ETrack_H #define ETrack_H // TRF track vector with error. // // Data includes a surface pointer _psrf, 5-vector _vec and 5 x 5 // symmetric error matrix _err. All are managed internally. #include "VTrack.h" namespace trf { class ETrack : public VTrack { private: // attributes TrackError _err; public: // methods // default constructor ETrack(); // construct a track vector from a surface #ifndef DEFECT_NO_EXPLICIT explicit #endif ETrack(const SurfacePtr& psrf); // constructor from a surface, track and error matrix ETrack(const SurfacePtr& psrf, const TrackVector& vec, const TrackError& err); // constructor from a surface, track, error matrix and direction ETrack(const SurfacePtr& psrf, const TrackVector& vec, const TrackError& err, TrackSurfaceDirection dir); // Constructor from a VTrack and an error matrix. ETrack(const VTrack& trv, const TrackError& err); // copy constructor ETrack(const ETrack& tre); // destructor virtual ~ETrack(); // assignment operator ETrack& operator=(const ETrack& tre); // output stream void ostr(std::ostream& stream) const; // set error matrix void set_error(const TrackError& newerr) { _err = newerr; } // get error matrix const TrackError& get_error() const { return _err; } // get a component of the error matrix double get_error(int i, int j) const { assert( i>=0 && i<5 ); assert( j>=0 && j<5 ); return _err(i,j); } }; } // end namespace trf // External functions. // output stream std::ostream& operator<<(std::ostream& stream, const trf::ETrack& rhs ); // equality bool operator==(const trf::ETrack& trv1, const trf::ETrack& trv2); // inequality bool operator!=(const trf::ETrack& trv1, const trf::ETrack& trv2); // Get the difference between two track vectors with errors // weighted by their combined error matrix. double chisq_diff(const trf::ETrack& trv1, const trf::ETrack& trv2 ); // Get the difference between two track vectors with and // without errors weighted by the error matrix. double chisq_diff(const trf::ETrack& trv1, const trf::VTrack& trv2 ); // Get the difference between two track vectors without and // with errors weighted by the error matrix. double chisq_diff(const trf::VTrack& trv1, const trf::ETrack& trv2 ); #endif