// ClusterFindCyl.h #ifndef ClusterFindCyl_H #define ClusterFindCyl_H // Cluster finder for a cylindrical layer. It maintains a map of // clusters of type HitCylPhi or HitCylPhiZ indexed by position // the clusters near a track can be retrieved quickly. // // There is an ntuple associated with this class. If it is active, // it is filled each time get_clusters(const ETrack&) is called. // In order to be active, // it must meet tthe following wo conditions // 1. enabled - this is a global state for the class // 2. defined - the ntuple is defined if it is enabled at time of // construction // // The data in the ntuple: // z0 - initial calculated z-position // z - calculated z-position making z > _zmin // return - return status (0 for no error) // // ObjStream example: // // [ myfind ClusterFindCyl // radius=30. // stereo=false // tuple_id=0 // ] // #include "trflayer/ClusterFindManager.h" #include "SurfCylinder.h" #include "ptr/Ptr.h" #include "trfutil/Tuple_fwd.h" namespace trf { class CutRecord; class ClusterContainer; class ClusterContainerCyl; class ClusterContainerCylZ; class ClusterFindCyl : public ClusterFindManager { public: // static data // Flag indicating whether tuple is active. static bool _ltuple; // Name for the tuple. static char* _tuple_name; public: // static methods // Return the type name. static TypeName get_type_name() { return "ClusterFindCyl"; } // Return the creator. static ObjCreator get_creator(); // Return the type. static Type get_static_type() { return get_creator(); } // global enable of ntuple for this class static void enable_tuple() { _ltuple = true; }; // global disable of ntuple for this class static void disable_tuple() { _ltuple = false; }; // return global enable status static bool tuple_is_enabled() { return _ltuple; }; private: // attributes // surface SurfCylinder _scy; // stereo layer? bool _stereo; // Clusters. Only one of _pclusters_ax and _pclusters_st should be // non-zero, and the other should be the same as _pclusters. ClusterContainer* _pclusters; // All clusters in doublet. ClusterContainerCyl* _pclusters_ax; // All axial clusteers. ClusterContainerCylZ* _pclusters_st; // All stereo clusters. // tuple // Using Ptr instead of a bare pointer makes the tuple mutable. Ptr _ptup; // ID for tuple int _id; private: // methods // output stream void ostr(std::ostream& stream) const; // define ntuple void define_tuple(); // fill the tuple void fill_tuple(int status) const; public: // methods // constructor ClusterFindCyl(double radius, bool stereo, int id=0); // destructor ~ClusterFindCyl(); // Return the type. Type get_type() const { return get_static_type(); } // Write the object data. ObjData write_data() const; // Return the radius. double get_radius() const { return _scy.get_radius(); } // Stereo layer?. bool get_stereo() const { return _stereo; } // Return the tuple ID. int get_tuple_id() const { return _id; } // add a cluster int add_cluster(const ClusterPtr& pclu); // drop all clusters void drop_clusters(); // Return the surface. const Surface& get_surface() const { return _scy; }; // Return all the clusters. ClusterList get_clusters() const; // Return all the clusters near a track at the surface. ClusterList get_clusters(const ETrack& tre) const; // Return all the clusters near a track at the surface and generate // CutRecords.. const ClusterContainer& get_cluster_container(const ETrack& tre, const CutRecord* pcut_record, std::map< ClusterPtr, CutRecord*>* precs) const; }; } // end namespace trf #endif