Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MvtxEventInfo.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file MvtxEventInfo.cc
1 #include "MvtxEventInfo.h"
2 
3 #include <cmath> // for NAN
4 #include <utility> // for pair
5 #include <phool/phool.h>
6 
8 {
9  std::cout << PHWHERE << "::" << __func__ << " is not implemented in base class" << std::endl;
10  return nullptr;
11 }
12 
14 {
15  std::cout << PHWHERE << "::" << __func__ << " is not implemented in base class" << std::endl;
16  return;
17 }
18 
19 
20 void MvtxEventInfo::identify(std::ostream &out) const
21 {
22  out << "MvtxEventInfo information" << std::endl;
23 
24  auto iters = m_StringEventProperties.begin();
25  while (iters != m_StringEventProperties.end())
26  {
27  out << iters->first << ": " << iters->second << std::endl;
28  ++iters;
29  }
30 
31  auto iteri = m_IntEventProperties.begin();
32  while (iteri != m_IntEventProperties.end())
33  {
34  out << iteri->first << ": " << iteri->second << std::endl;
35  ++iteri;
36  }
37 
38  auto iteri64 = m_Int64EventProperties.begin();
39  while (iteri64 != m_Int64EventProperties.end())
40  {
41  out << iteri64->first << ": " << iteri64->second << std::endl;
42  ++iteri64;
43  }
44 
45  auto iteru = m_UintEventProperties.begin();
46  while (iteru != m_UintEventProperties.end())
47  {
48  out << iteru->first << ": " << iteru->second << std::endl;
49  ++iteru;
50  }
51 
52  auto iteru64 = m_Uint64EventProperties.begin();
53  while (iteru64 != m_Uint64EventProperties.end())
54  {
55  out << iteru64->first << ": " << iteru64->second << std::endl;
56  ++iteru64;
57  }
58 
59  auto iterf = m_FloatEventProperties.begin();
60  while (iterf != m_FloatEventProperties.end())
61  {
62  out << iterf->first << ": " << iterf->second << std::endl;
63  ++iterf;
64  }
65  return;
66 }
67 
69 {
70  std::cout << PHWHERE << " isValid not implemented by base class" << std::endl;
71  return 0;
72 }
73 
74 void MvtxEventInfo::set_floatval(const std::string &name, const float fval)
75 {
77 }
78 
80 {
81  std::map<std::string, float>::const_iterator iter = m_FloatEventProperties.find(name);
82  if (iter != m_FloatEventProperties.end())
83  {
84  return iter->second;
85  }
86  return NAN;
87 }
88 
89 void MvtxEventInfo::set_intval(const std::string &name, const int32_t ival)
90 {
91  m_IntEventProperties[name] = ival;
92 }
93 
95 {
96  std::map<std::string, int32_t>::const_iterator iter = m_IntEventProperties.find(name);
97  if (iter != m_IntEventProperties.end())
98  {
99  return iter->second;
100  }
101  return -999999;
102 }
103 
104 void MvtxEventInfo::set_int64val(const std::string &name, const int64_t ival)
105 {
107 }
108 
110 {
111  std::map<std::string, int64_t>::const_iterator iter = m_Int64EventProperties.find(name);
112  if (iter != m_Int64EventProperties.end())
113  {
114  return iter->second;
115  }
116  return -999999;
117 }
118 
119 void MvtxEventInfo::set_uintval(const std::string &name, const uint32_t ival)
120 {
121  m_UintEventProperties[name] = ival;
122 }
123 
125 {
126  std::map<std::string, uint32_t>::const_iterator iter = m_UintEventProperties.find(name);
127  if (iter != m_UintEventProperties.end())
128  {
129  return iter->second;
130  }
131  return 999999;
132 }
133 
134 void MvtxEventInfo::set_uint64val(const std::string &name, const uint64_t ival)
135 {
137 }
138 
140 {
141  std::map<std::string, uint64_t>::const_iterator iter = m_Uint64EventProperties.find(name);
142  if (iter != m_Uint64EventProperties.end())
143  {
144  return iter->second;
145  }
146  return 999999;
147 }
148 
150 {
152 }
153 
155 {
156  std::map<std::string, std::string>::const_iterator iter = m_StringEventProperties.find(name);
157  if (iter != m_StringEventProperties.end())
158  {
159  return iter->second;
160  }
161  return "Empty";
162 }