// ClusterFilter.h #ifndef ClusterFilter_H #define ClusterFilter_H // Abstract interface for a class that filters a container of clusters // based on the information contained in an MTrack. It returns a // container holding the acceptable clusters. #include #include "trfbase/Algorithm.h" #include "trfbase/Hit.h" namespace trf { class MTrack; class CutRecord; class ClusterContainer; class ClusterFilter : public Algorithm { public: // typedefs // Map of CutRecord pointers indexed by cluster pointer. typedef std::map< ClusterPtr, CutRecord*, std::less > CutRecordMap; private: // data // Flag to protect agains infinite loop. mutable bool _loop; public: // static methods // Return the type name. static TypeName get_type_name() { return "ClusterFilter"; } // Return the creator. static ObjCreator get_creator(); // Return the type. static Type get_static_type() { return get_creator(); } public: // methods // constructor ClusterFilter(); // destructor virtual ~ClusterFilter(); // Return the generic type. // This is only needed at this level. Type get_generic_type() const { return get_static_type(); } // Filter a list of clusters. // Default implementation calls filter_with_record(trm,clus,0). // This method is deprecated and is maintained only for backward // compatibility. virtual void filter(const MTrack& trm, ClusterList& clus) const; // Filter a list of clusters and pass a cut record map. // The caller is responsible for filling map with a pointer to a // cut record for each cluster. // Default implementation calls filter(trm,clus); // This method is deprecated and is maintained only for backward // compatibility. virtual void filter_with_record(const MTrack& trm, ClusterList& clus, CutRecordMap* precs) const; // Filter the clusters in a cluster container. // This class manages the returned container and will likely modify // it the next time filter_container is called. // Default implementation returns a SimpleClusterContainer holding the // result from filter_with_record. This is for backward compatibility. // Future implementations of ClusterFilter should implement this method // rather than filter of filter_with_record. virtual const ClusterContainer& filter_container(const MTrack& trm, const ClusterContainer& box, CutRecordMap* precs) const; }; } // end namespace trf #endif