Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TrkrClusterCrossingAssocv1.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TrkrClusterCrossingAssocv1.cc
1 
9 #include "TrkrDefs.h"
10 
11 #include <ostream> // for operator<<, endl, basic_ostream, ostream, basic_o...
12 
13 namespace
14 {
16 }
17 
18 //_________________________________________________________________________
20 {
21 
22 
23  // delete all entries
24  Map empty_map;
25  empty_map.swap(m_map);
26  empty_map.clear();
27 
28  m_map.clear();
29 }
30 
31 //_________________________________________________________________________
32 void TrkrClusterCrossingAssocv1::identify(std::ostream &os) const
33 {
34  std::multimap<TrkrDefs::cluskey, TrkrDefs::hitkey>::const_iterator iter;
35  os << "-----TrkrClusterCrossingAssocv1-----" << std::endl;
36  os << "Number of associations: " << size() << std::endl;
37  for( const auto& map_pair:m_map )
38  {
39  os << "clus key " << map_pair.first << std::dec
40  << " layer " << (unsigned int) TrkrDefs::getLayer(map_pair.first)
41  << " crossing number: " << map_pair.second << std::endl;
42  }
43  os << "------------------------------" << std::endl;
44 
45  return;
46 
47 }
48 
49 //_________________________________________________________________________
51 {
52  // insert association
53  m_map.insert(std::make_pair(ckey, hidx));
54 }
55 
56 //_________________________________________________________________________
58 {
59  const auto range = m_map.equal_range(ckey);
60  return range;
61 }
62 
63 //_________________________________________________________________________
64 unsigned int TrkrClusterCrossingAssocv1::size(void) const
65 {
66  unsigned int size = 0;
67  size = m_map.size();
68 
69  return size;
70 }
71 
73 {
74  return std::make_pair(m_map.begin(), m_map.end());
75 }