ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ParticleFlowElementContainer.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ParticleFlowElementContainer.cc
2 
3 #include "ParticleFlowElement.h"
4 
5 #include <cstdlib>
6 #include <iostream>
7 #include <utility>
8 
9 
12 {
13  return make_pair( _pflowElementMap.begin(), _pflowElementMap.end() );
14 }
15 
18 {
19  return make_pair( _pflowElementMap.begin(), _pflowElementMap.end() );
20 }
21 
22 void
24 {
25 
26  _pflowElementMap[index] = pflowElement;
27 
28 }
29 
32 {
33  ConstIterator it = _pflowElementMap.find( index );
34  if (it != _pflowElementMap.end())
35  {
36  return it->second;
37  }
38  return NULL;
39 }
40 
41 const ParticleFlowElement *
43 {
44  ConstIterator it = _pflowElementMap.find( index );
45  if (it != _pflowElementMap.end())
46  {
47  return it->second;
48  }
49  return NULL;
50 }
51 
53 {
54  return (!_pflowElementMap.empty());
55 }
56 
58 {
59  while (_pflowElementMap.begin() != _pflowElementMap.end())
60  {
61  delete _pflowElementMap.begin()->second;
62  _pflowElementMap.erase(_pflowElementMap.begin());
63  }
64 }
65 
66 void ParticleFlowElementContainer::identify(std::ostream &os) const
67 {
68  os << "ParticleFlowElementContainer, number of elements: " << size() << std::endl;
69 }
70