Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SvtxPHG4ParticleMap_v1.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SvtxPHG4ParticleMap_v1.cc
2 
4  : m_map()
5 {}
6 
8  : m_map()
9 {
10  for (ConstIter iter = map.begin(); iter != map.end(); ++iter)
11  {
12  WeightedTruthTrackMap trackmap = iter->second;
13  m_map.insert(std::make_pair(iter->first, trackmap));
14  }
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 SvtxPHG4ParticleMap_v1::identify(std::ostream& os) const
36 {
37  os << "SvtxPHG4ParticleMap_v1 size = " << m_map.size() << std::endl;
38 
39  for(const auto& [trackID, matchedTruthTracks] : m_map)
40  {
41  os << "Reco track " << trackID << " has matched truth tracks " << std::endl;
42  for(const auto& [weight, partset] : matchedTruthTracks)
43  {
44  os << " weight " << weight << " has truth tracks " << std::endl;
45  for(const auto& g4part : partset)
46  { os << " g4id : " << g4part << std::endl; }
47  }
48  }
49 
50 }
51 
53 {
54  m_map.insert(std::make_pair(key, map));
55  return map;
56 }
57 
59 {
60  const auto iter = m_map.find(key);
61  if (iter == m_map.end())
62  {
63  return SvtxPHG4ParticleMap::get(key);
64  }
65  else
66  {
67  return iter->second;
68  }
69 }