Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PidInfoContainer.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PidInfoContainer.cc
1 #include "PidInfoContainer.h"
2 #include "PidInfo.h"
3 
4 #include <cstdlib>
5 #include <iostream>
6 
7 using namespace std;
8 
11 {
12  return make_pair(_pidinfos.begin(), _pidinfos.end());
13 }
14 
17 {
18  return make_pair(_pidinfos.begin(), _pidinfos.end());
19 }
20 
23 {
24  unsigned int key = pidinfo->get_track_id();
25  _pidinfos[key] = pidinfo;
26  return _pidinfos.find(key);
27 }
28 
29 PidInfo *
31 {
32  Iterator it = _pidinfos.find(key);
33  if (it != _pidinfos.end())
34  {
35  return it->second;
36  }
37  return NULL;
38 }
39 
40 int
42 {
43  return (!_pidinfos.empty());
44 }
45 
46 void
48 {
49  while (_pidinfos.begin() != _pidinfos.end())
50  {
51  delete _pidinfos.begin()->second;
52  _pidinfos.erase(_pidinfos.begin());
53  }
54 }
55 
56 void
57 PidInfoContainer::identify(std::ostream& os) const
58 {
59  os << "PidInfoContainer, number of pid infos: " << size() << std::endl;
60 }