Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHG4ParticleSvtxMap_v1.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHG4ParticleSvtxMap_v1.cc
2 
4  : m_map()
5 {
6 }
7 
9  : m_map()
10 {
11  for (ConstIter iter = map.begin(); iter != map.end(); ++iter)
12  {
13  WeightedRecoTrackMap trackmap = iter->second;
14  m_map.insert(std::make_pair(iter->first, trackmap));
15  }
16 }
17 
19 {
20  Reset();
21 
22  for (ConstIter iter = map.begin(); iter != map.end(); ++iter)
23  {
24  m_map.insert(std::make_pair(iter->first, iter->second));
25  }
26 
27  return *this;
28 }
29 
31 {
32  Reset();
33 }
34 
35 void PHG4ParticleSvtxMap_v1::identify(std::ostream& os) const
36 {
37  os << "PHG4ParticleSvtxMap_v1 size = " << m_map.size() << std::endl;
38 
39  for (const auto& [g4id, matchedRecoTracks] : m_map)
40  {
41  os << "G4Particle " << g4id << " has matched reco tracks " << std::endl;
42  for (const auto& [weight, trackset] : matchedRecoTracks)
43  {
44  os << " weight " << weight << " has reco tracks " << std::endl;
45  for (const auto& track : trackset)
46  {
47  os << " trackid : " << track << std::endl;
48  }
49  }
50  }
51 }
52 
54 {
55  m_map.insert(std::make_pair(key, map));
56  return map;
57 }
58 
60 {
61  const auto iter = m_map.find(key);
62  if (iter == m_map.end())
63  {
64  return PHG4ParticleSvtxMap::get(key);
65  }
66  else
67  {
68  return iter->second;
69  }
70 }