// ClusterFilterTest.h #ifndef ClusterFilterTest_H #define ClusterFilterTest_H #include "ClusterFilter.h" #include "objstream/ObjData.hpp" #include "objstream/ObjTable.hpp" #include "trfutil/trfstream.h" // dummy concrete class ObjPtr create(const ObjData& data); class ClusterFilterTest : public trf::ClusterFilter { public: // static methods // Return the type name. static TypeName get_type_name() { return "ClusterFilterTest"; } // Return the creator. static ObjCreator get_creator() { return create; } // Return the type. static Type get_static_type() { return get_creator(); } private: // Output stream. void ostr(ostream& stream) const { stream << begin_object << "Test cluster filter" << end_object; } public: // Return the type. Type get_type() const { return get_static_type(); } // Write the object data. ObjData write_data() const { ObjData data("ClusterFilterTest"); return data; } // Process tracks. // We drop the first cluster if more than one cluster // is present. void filter(const trf::MTrack& trm, trf::ClusterList& clus) const { if ( clus.size() > 1 ) { clus.erase(clus.begin()); } } }; // Creator. ObjPtr create(const ObjData& data) { assert( data.get_object_type() == "ClusterFilterTest" ); return ObjPtr( new ClusterFilterTest ); } #endif