Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EventplaneinfoMapv1.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file EventplaneinfoMapv1.cc
1 #include "EventplaneinfoMapv1.h"
2 
3 #include "Eventplaneinfo.h"
4 #include "EventplaneinfoMap.h"
5 
6 #include <iterator> // for reverse_iterator
7 #include <utility> // for pair, make_pair
8 
10 {
11  clear();
12 }
13 
14 void EventplaneinfoMapv1::identify(std::ostream& os) const
15 {
16  os << "EventplaneinfoMapv1: size = " << _map.size() << std::endl;
17  for (auto& m : _map)
18  {
19  m.second->identify(os);
20  }
21  return;
22 }
23 
25 {
26  for (const auto& iter : _map)
27  {
28  delete iter.second;
29  }
30  _map.clear();
31  return;
32 }
33 
34 const Eventplaneinfo* EventplaneinfoMapv1::get(unsigned int id) const
35 {
36  ConstIter iter = _map.find(id);
37  if (iter == _map.end())
38  {
39  return nullptr;
40  }
41  return iter->second;
42 }
43 
45 {
46  Iter iter = _map.find(id);
47  if (iter == _map.end())
48  {
49  return nullptr;
50  }
51  return iter->second;
52 }
53 
55 {
56  auto ret = _map.insert(std::make_pair(id, clus));
57  return ret.first->second;
58 }