Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:17:54

0001 /**
0002  * @file mvtx/MvtxClusterizer.h
0003  * @author D. McGlinchey
0004  * @date June 2018
0005  * @brief Clusterizer for the MVTX
0006  */
0007 #ifndef MVTX_MVTXCLUSTERIZER_H
0008 #define MVTX_MVTXCLUSTERIZER_H
0009 
0010 #include <fun4all/SubsysReco.h>
0011 #include <trackbase/TrkrCluster.h>
0012 #include <trackbase/TrkrDefs.h>
0013 
0014 #include <string>  // for string
0015 #include <utility>
0016 
0017 class ClusHitsVerbose;
0018 class PHCompositeNode;
0019 class TrkrHit;
0020 class TrkrHitSetContainer;
0021 class TrkrClusterContainer;
0022 class TrkrClusterHitAssoc;
0023 class RawHit;
0024 class RawHitSet;
0025 class RawHitSetContainer;
0026 
0027 /**
0028  * @brief Clusterizer for the MVTX
0029  */
0030 class MvtxClusterizer : public SubsysReco
0031 {
0032  public:
0033   typedef std::pair<unsigned int, unsigned int> pixel;
0034 
0035   MvtxClusterizer(const std::string &name = "MvtxClusterizer");
0036   ~MvtxClusterizer() override {}
0037 
0038   //! module initialization
0039   int Init(PHCompositeNode * /*topNode*/) override { return 0; }
0040 
0041   //! run initialization
0042   int InitRun(PHCompositeNode *topNode) override;
0043 
0044   //! event processing
0045   int process_event(PHCompositeNode *topNode) override;
0046 
0047   //! end of process
0048   int End(PHCompositeNode * /*topNode*/) override { return 0; }
0049 
0050   //! option to turn off z-dimension clustering
0051   void SetZClustering(const bool make_z_clustering)
0052   {
0053     m_makeZClustering = make_z_clustering;
0054   }
0055   bool GetZClustering() const
0056   {
0057     return m_makeZClustering;
0058   }
0059 
0060   void set_do_hit_association(bool do_assoc) { do_hit_assoc = do_assoc; }
0061   void set_read_raw(bool read_raw) { do_read_raw = read_raw; }
0062   void set_ClusHitsVerbose(bool set = true) { record_ClusHitsVerbose = set; };
0063   ClusHitsVerbose *mClusHitsVerbose{nullptr};
0064 
0065  private:
0066   // bool are_adjacent(const pixel lhs, const pixel rhs);
0067   bool record_ClusHitsVerbose{false};
0068   bool are_adjacent(const std::pair<TrkrDefs::hitkey, TrkrHit *> &lhs, const std::pair<TrkrDefs::hitkey, TrkrHit *> &rhs);
0069   bool are_adjacent(RawHit *lhs, RawHit *rhs);
0070 
0071   void ClusterMvtx(PHCompositeNode *topNode);
0072   void ClusterMvtxRaw(PHCompositeNode *topNode);
0073   void PrintClusters(PHCompositeNode *topNode);
0074 
0075   // node tree storage pointers
0076   TrkrHitSetContainer *m_hits {nullptr};
0077   RawHitSetContainer *m_rawhits {nullptr};
0078   TrkrClusterContainer *m_clusterlist {nullptr};
0079 
0080   TrkrClusterHitAssoc *m_clusterhitassoc {nullptr};
0081 
0082   // settings
0083   bool m_makeZClustering {true};  // z_clustering_option
0084   bool do_hit_assoc {true};
0085   bool do_read_raw {false};
0086 };
0087 
0088 #endif  // MVTX_MVTXCLUSTERIZER_H