Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TrackPidAssoc.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TrackPidAssoc.cc
1 
8 #include "TrackPidAssoc.h"
9 
10 #include <ostream> // for operator<<, endl, basic_ostream, ostream, basic_o...
11 
13  : m_map()
14 {
15 }
16 
17 
19 {
20 }
21 
22 void
24 {
25  m_map.clear();
26 }
27 
28 void
29 TrackPidAssoc::identify(std::ostream &os) const
30 {
31  os << "-----TrackPidAssoc-----" << std::endl;
32  os << "Number of associations: " << m_map.size() << std::endl;
33 
34  for ( auto& entry : m_map )
35  {
36  // os << " cluster key: 0x" << std::hex << entry.first << std::dec
37  os << " particle ID: " << entry.first << std::dec
38  << " track key: " << entry.second << std::endl;
39  }
40 
41  os << "------------------------------" << std::endl;
42 
43  return;
44 
45 }
46 
47 void
48 TrackPidAssoc::addAssoc(unsigned int pid, unsigned int trid)
49 {
50  m_map.insert(std::make_pair(pid, trid));
51 }
52 
55 {
56  ConstRange retpair;
57  retpair.first = m_map.lower_bound(pid);
58  retpair.second = m_map.upper_bound(pid);
59  return retpair;
60 }