Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 /**
0002  * @file trackbase/TrkrClusterIterationMap.h
0003  * @author D. McGlinchey
0004  * @date June 2018
0005  * @brief Base class for associating clusters to the hits that went into them
0006  */
0007 #ifndef TRACKBASE_TRKRCLUSTERITERATIONMAP_H
0008 #define TRACKBASE_TRKRCLUSTERITERATIONMAP_H
0009 
0010 #include "TrkrDefs.h"
0011 
0012 #include <phool/PHObject.h>
0013 
0014 #include <climits>
0015 #include <iostream>  // for cout, ostream
0016 #include <limits>
0017 #include <map>
0018 #include <utility>  // for pair
0019 
0020 /**
0021  * @brief Base class for associating clusters to iterations they were used in
0022  *
0023  * Store the associations between clusters and trackign iterations.
0024  */
0025 class TrkrClusterIterationMap : public PHObject
0026 {
0027  public:
0028   using Map = std::map<TrkrDefs::cluskey, short int>;
0029   using ConstIter = Map::const_iterator;
0030 
0031   void Reset() override;
0032 
0033   /**
0034    * @brief Add association between cluster andthe tracking iteration it was used in
0035    * @param[in] ckey Cluster key
0036    * @param[in] tracking iteration
0037    */
0038   virtual void addIteration(TrkrDefs::cluskey, short int) {}
0039 
0040   virtual short int getIteration(TrkrDefs::cluskey) { return std::numeric_limits<short int>::max(); }
0041 
0042   virtual unsigned int size() const { return 0; }
0043 
0044   virtual ConstIter begin() const;
0045   virtual ConstIter end() const;
0046 
0047  protected:
0048   TrkrClusterIterationMap() = default;
0049 
0050  private:
0051   ClassDefOverride(TrkrClusterIterationMap, 1);
0052 };
0053 
0054 #endif  // TRACKBASE_TRKRCLUSTERITERATIONMAP_H