Analysis Software
Documentation for sPHENIX simulation 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  // cppcheck-suppress virtualCallInConstructor
22  void Reset() override;
23  void identify(std::ostream& os = std::cout) const override;
24 
25  void SetClusterTrackAssoc(const TrkrDefs::cluskey& cluster_id, const unsigned int& track_id) override
26  {
27  _map_cluster_id_track_id.insert(ClusterTrackMap::value_type(cluster_id, track_id));
28  }
29 
30  std::vector<unsigned int> GetTracksFromCluster(const TrkrDefs::cluskey& cluster_id) const override
31  {
32  std::vector<unsigned int> ret;
33  for (auto iter = _map_cluster_id_track_id.lower_bound(cluster_id);
34  iter != _map_cluster_id_track_id.upper_bound(cluster_id); ++iter)
35  {
36  ret.push_back(iter->second);
37  }
38  return ret;
39  }
40 
41  private:
43 
44  ClassDefOverride(AssocInfoContainerv1, 1)
45 };
46 
47 #endif