ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AssocInfoContainerv1.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file AssocInfoContainerv1.h
1 #ifndef TRACKRECO_ASSOCINFOCONTAINERV1_H
2 #define TRACKRECO_ASSOCINFOCONTAINERV1_H
3 
4 #include "AssocInfoContainer.h"
5 
6 #include <trackbase/TrkrDefs.h>
7 
8 #include <iostream> // for cout, ostream
9 #include <map>
10 #include <utility> // for pair
11 #include <vector> // for vector
12 
14 {
15  public:
16  typedef std::multimap<TrkrDefs::cluskey, unsigned int> ClusterTrackMap;
17 
19  ~AssocInfoContainerv1() override;
20 
21  void Reset() override;
22  void identify(std::ostream& os = std::cout) const override;
23 
24  void SetClusterTrackAssoc(const TrkrDefs::cluskey& cluster_id, const unsigned int& track_id) override
25  {
26  _map_cluster_id_track_id.insert(ClusterTrackMap::value_type(cluster_id, track_id));
27  }
28 
29  std::vector<unsigned int> GetTracksFromCluster(const TrkrDefs::cluskey& cluster_id) const override
30  {
31  std::vector<unsigned int> ret;
32  for (auto iter = _map_cluster_id_track_id.lower_bound(cluster_id);
33  iter != _map_cluster_id_track_id.upper_bound(cluster_id); ++iter)
34  {
35  ret.push_back(iter->second);
36  }
37  return ret;
38  }
39 
40  private:
42 
43  ClassDefOverride(AssocInfoContainerv1, 1)
44 };
45 
46 #endif