Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 /**
0002  * @file trackbase/TrkrClusterCrossingAssoc.h
0003  * @author Tony Frawley
0004  * @date March 2022
0005  * @brief Base class for associating clusters to the bunch crossing they originated from
0006  */
0007 #ifndef TRACKBASE_TRKRCLUSTERCROSSINGASSOC_H
0008 #define TRACKBASE_TRKRCLUSTERCROSSINGASSOC_H
0009 
0010 #include "TrkrDefs.h"
0011 
0012 #include <phool/PHObject.h>
0013 
0014 #include <climits>
0015 #include <iostream>  // for cout, ostream
0016 #include <map>
0017 #include <utility>  // for pair
0018 
0019 /**
0020  * @brief Base 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 TrkrClusterCrossingAssoc : public PHObject
0025 {
0026  public:
0027   using Map = std::multimap<TrkrDefs::cluskey, short int>;
0028   using ConstIterator = Map::const_iterator;
0029   using ConstRange = std::pair<Map::const_iterator, Map::const_iterator>;
0030 
0031   void Reset() override;
0032 
0033   /**
0034    * @brief Add association between cluster and hit
0035    * @param[in] ckey Cluster key
0036    * @param[in] bunch crossing number
0037    */
0038   virtual void addAssoc(TrkrDefs::cluskey ckey, short int hidx) = 0;
0039 
0040   virtual ConstRange getCrossings(TrkrDefs::cluskey) const = 0;
0041 
0042   virtual ConstRange getAll() const = 0;
0043 
0044   virtual unsigned int size() const { return 0; }
0045 
0046  protected:
0047   TrkrClusterCrossingAssoc() = default;
0048 
0049  private:
0050   ClassDefOverride(TrkrClusterCrossingAssoc, 1);
0051 };
0052 
0053 #endif  // TRACKBASE_TRKRCLUSTERCROSSINGASSOC_H