// TrackFinder.h #ifndef TrackFinder_H #define TrackFinder_H // This class does the global track finding. It is constructed from // a starting path and kinematic track and has a method find() which // returns the list of found tracks. It contains a single TrackExtender // which is used to carry out the track finding. // Tracks are propagated until they reach stops and the next stop // is processed. This process is repeated until the list of stops is // exhausted. // // The path and list of stops are not managed here. // // ObjStream example: // // [ finder TrackFinder // path=*head_path // surface=&cyl1 // vector=double( 0.1 0.2 0.3 0.4 0.5 ) // error_matrix=double( // 0.001 // 0.000 0.002 // 0.000 0.000 0.003 // 0.000 0.000 0.000 0.004 // 0.000 0.000 0.000 0.000 0.005 // ) // stops=*( stop1 stop2 ) // tuple_name="" // debug=0 // ] // #include #include "ptr/Ptr.h" #include "ptr/LocalSharedDeletePolicy.h" #include "trfbase/Algorithm.h" #include "trfbase/ETrack.h" #include "TrackExtender.h" class CpuTimerTuple; namespace trf { class Path; class PathStop; class TrackFinder : public Algorithm { public: // static methods // Return the type name. static TypeName get_type_name() { return "TrackFinder"; } // Return the creator. static ObjCreator get_creator(); // Return the type. static Type get_static_type() { return get_creator(); } public: // typedefs // list of path stops typedef TrackExtender::PathStopList PathStopList; // list iterator typedef TrackExtender::PathStopConstIterator PathStopConstIterator; // Managing pointer for extender. typedef Ptr ExtenderPtr; private: // attributes // starting path const Path& _path; // starting track ETrack _tre; // extender ExtenderPtr _pextend; private: // methods // output stream void ostr(std::ostream& stream) const; public: // methods // constructor TrackFinder(const Path& path, const ETrack& tre, CpuTimerTuple* ptimer=0); // destructor ~TrackFinder(); // 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; // Return the path. const Path& get_path() const { return _path; } // Return the starting track. const ETrack& get_track() const { return _tre; } // Return the extender. ExtenderPtr get_extender() const { return _pextend; } // add stop to end of list void add_stop(const PathStop& stop); // fetch the list of stops const PathStopList& get_stops() const { return _pextend->get_stops(); } // Define ntuple. If this is called with a nonzero length argument // then a PTrack ntuple with the given name will be filled. void set_tuple(std::string name); // Fetch the tuple name. std::string get_tuple_name() const { return _pextend->get_tuple_name(); } // find the tracks PTrack::PTrackList find() const; // Override set debug to set extender debug. void set_debug(int debug); }; } // end namespace trf #endif