// PathStop.h #ifndef PathStop_H #define PathStop_H // A path stop indicates a path where track-finding should cease // until a list of filters is executed. The path stop maintains // a list of filter references. // // ObjStream example: // // [ mystop PathStop filters=*( filt1 filt2 ) ] // #include "ptr/Ptr.h" #include "ptr/NullPolicy.h" #include #include #include #include "trfobj/TrfReportingObject.h" #include "FilterPtr.h" #include "CheckerPtr.h" #include "trffit/FullFitterPtr.h" namespace trf { class Filter; class PathStop; // output stream std::ostream& operator<<(std::ostream& stream, const PathStop& stop); class PathStop : public TrfReportingObject { public: // typedefs // list of filters typedef std::list FilterList; // list of checkers typedef std::vector CheckerList; public: // static methods // Return the type name. static TypeName get_type_name() { return "PathStop"; } // Return the creator. static ObjCreator get_creator(); // Return the type. static Type get_static_type() { return get_creator(); } private: // attributes // filters FilterList _filters; // Optional fitter applied after the filters. FullFitterPtr _pfit; // Post checkers (applied after the fit). CheckerList _checkers; private: // methods // output stream void ostr(std::ostream& stream) const; public: // methods // constructor PathStop(); // constructor with fitter. PathStop(const FullFitterPtr& pfit); // destructor ~PathStop(); // Return the type. Type get_generic_type() const { return get_static_type(); } // Return the type. Type get_type() const { return get_static_type(); } // Write the object data. ObjData write_data() const; // Add a filter. void add_filter(const FilterPtr& pfilt); // Add a post checker. void add_checker(const CheckerPtr& pfilt); // Return the fitter. const FullFitterPtr& get_fitter() const { return _pfit; } // Return the list of filters. const FilterList& get_filters() const { return _filters; }; // Return the list of post checkers. const CheckerList& get_checkers() const { return _checkers; }; // Apply the fitter and list of post checkers to the track. // Return 0 if fit succeeds and all checkers pass. // Track may no longer be valid if nonzero is returned. int fitcheck(MTrack& trm) const; public: // friends // output stream friend std::ostream& operator<<(std::ostream& stream, const PathStop& stop); }; } // end namespace trf #endif