Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 /**
0002  * @file trackbase/TrackVertexCrossingAssoc.h
0003  * @author Tony Frawley
0004  * @date April 2024
0005  * @brief Base class for associating tracks and vertices to the bunch crossing they originated from
0006  */
0007 #ifndef TRACKBASE_TRACKVERTEXCROSSINGASSOC_H
0008 #define TRACKBASE_TRACKVERTEXCROSSINGASSOC_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 <set>
0018 #include <utility>  // for pair
0019 
0020 /**
0021  * @brief Base class for associating clusters to the hits that went into them
0022  *
0023  * Store the associations between clusters and the hits that went into them.
0024  */
0025 class TrackVertexCrossingAssoc : public PHObject
0026 {
0027  public:
0028   using Map = std::multimap<short int, unsigned int>;
0029   using ConstIterator = Map::const_iterator;
0030   using ConstRange = std::pair<Map::const_iterator, Map::const_iterator>;
0031 
0032   void Reset() override;
0033 
0034   /**
0035    * @brief Add association between tracks, vertices and crossings
0036    * @param[in] ckey track ID, vertex ID
0037    * @param[in] bunch crossing number
0038    */
0039   virtual std::set<short int> getCrossings() const = 0;
0040   virtual void addTrackAssoc(short int crossing, unsigned int trackid) = 0;
0041   virtual void addVertexAssoc(short int crossing, unsigned int vertexid) = 0;
0042 
0043   virtual ConstRange getTracks(short int crossing) const = 0;
0044   virtual ConstRange getVertices(short int crossing) const = 0;
0045 
0046   virtual unsigned int sizeTracks() const { return 0; }
0047   virtual unsigned int sizeVertices() const { return 0; }
0048 
0049  protected:
0050   TrackVertexCrossingAssoc() = default;
0051 
0052  private:
0053   ClassDefOverride(TrackVertexCrossingAssoc, 1);
0054 };
0055 
0056 #endif  // TRACKBASE_TRACKVERTREXCROSSINGASSOC_H