Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:18:11

0001 /**
0002  * @file trackbase/TrkrClusterHitAssocv1.h
0003  * @author D. McGlinchey
0004  * @date June 2018
0005  * @brief Class for associating clusters to the hits that went into them
0006  */
0007 #ifndef TRACKBASE_TRKRCLUSTERHITASSOCV1_H
0008 #define TRACKBASE_TRKRCLUSTERHITASSOCV1_H
0009 
0010 #include "TrkrClusterHitAssoc.h"
0011 #include "TrkrDefs.h"
0012 
0013 #include <phool/PHObject.h>
0014 
0015 #include <iostream>  // for cout, ostream
0016 #include <map>
0017 #include <utility>  // for pair
0018 
0019 /**
0020  * @brief Class for associating clusters to the hits that went into them
0021  *
0022  * Store the associations between clusters and the hits that went into them.
0023  */
0024 class TrkrClusterHitAssocv1 : public TrkrClusterHitAssoc
0025 {
0026  public:
0027   //! ctor
0028   TrkrClusterHitAssocv1() = default;
0029 
0030   void Reset() override;
0031 
0032   void identify(std::ostream &os = std::cout) const override;
0033 
0034   /**
0035    * @brief Add association between cluster and hit
0036    * @param[in] ckey Cluster key
0037    * @param[in] hidx Index of the hit in TrkrHitSet
0038    */
0039   void addAssoc(TrkrDefs::cluskey ckey, unsigned int hidx) override;
0040 
0041   /**
0042    * @brief Get all the hits associated with a cluster by key
0043    * @param[in] ckey Cluster key
0044    * @param[out] Range over hits associated with @c ckey
0045    */
0046   ConstRange getHits(TrkrDefs::cluskey) override;
0047 
0048  private:
0049   Map m_map;
0050 
0051   ClassDefOverride(TrkrClusterHitAssocv1, 1);
0052 };
0053 
0054 #endif  // TRACKBASE_TRKRCLUSTERHITASSOCV1_H