Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MvtxEventInfov1.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file MvtxEventInfov1.cc
1 #include "MvtxEventInfov1.h"
2 
3 #include <phool/phool.h>
4 
6 {
7  std::cout << PHWHERE << "::" << __func__ << " is not implemented in daughter class" << std::endl;
8  return nullptr;
9 }
10 
12 {
13  m_strobe_BCO_L1_BCO.clear();
15  m_IntEventProperties.clear();
16  m_Int64EventProperties.clear();
17  m_UintEventProperties.clear();
19  m_FloatEventProperties.clear();
20 
21  return;
22 }
23 
24 
25 void MvtxEventInfov1::identify(std::ostream &out) const
26 {
27  out << "MvtxEventInfov1 information" << std::endl;
28 
29  for (auto iters = m_StringEventProperties.begin(); iters != m_StringEventProperties.end(); ++iters)
30  {
31  out << iters->first << ": " << iters->second << std::endl;
32  }
33 
34  out << "Number of L1 triggers in this event" << std::endl;
35  out << m_number_L1_name << ": " << get_number_L1s() << std::endl;
36 
37  out << "Number of heart beats in this event" << std::endl;
38  out << m_number_HB_name << ": " << get_number_HB() << std::endl;
39 
40  if (get_number_L1s() > 0)
41  {
42  out << "List of strobe BCOs and L1 BCOs in this event" << std::endl;
43 
44  std::set<uint64_t> strobeList = get_strobe_BCOs();
45  for (auto iterStrobe = strobeList.begin(); iterStrobe != strobeList.end(); ++iterStrobe)
46  {
47  std::set<uint64_t> l1List = get_L1_BCO_from_strobe_BCO(*iterStrobe);
48  out << "Strobe BCO: " << *iterStrobe << std::endl;
49  for (auto iterL1 = l1List.begin(); iterL1 != l1List.end(); ++iterL1)
50  {
51  out << "L1 BCO: " << *iterL1 << std::endl;
52  }
53  out << std::endl;
54  }
55  }
56 
57  for (auto iteri = m_IntEventProperties.begin(); iteri != m_IntEventProperties.end(); ++iteri)
58  {
59  out << iteri->first << ": " << iteri->second << std::endl;
60  }
61 
62  for (auto iteri64 = m_Int64EventProperties.begin(); iteri64 != m_Int64EventProperties.end(); ++iteri64)
63  {
64  out << iteri64->first << ": " << iteri64->second << std::endl;
65  }
66 
67  for (auto iteru = m_UintEventProperties.begin(); iteru != m_UintEventProperties.end(); ++iteru)
68  {
69  out << iteru->first << ": " << iteru->second << std::endl;
70  }
71 
72  for (auto iteru64 = m_Uint64EventProperties.begin(); iteru64 != m_Uint64EventProperties.end(); ++iteru64)
73  {
74  out << iteru64->first << ": " << iteru64->second << std::endl;
75  }
76 
77  for (auto iterf = m_FloatEventProperties.begin(); iterf != m_FloatEventProperties.end(); ++iterf)
78  {
79  out << iterf->first << ": " << iterf->second << std::endl;
80  }
81  return;
82 }
83 
85 {
86  std::cout << PHWHERE << " isValid not implemented by daughter class" << std::endl;
87  return 0;
88 }
89 
90 void MvtxEventInfov1::set_number_HB(const int ival)
91 {
92  m_number_HB = ival;
93 }
94 
96 {
97  return m_number_HB;
98 }
99 
100 void MvtxEventInfov1::set_strobe_BCO_L1_BCO(const uint64_t strobe_BCO, const uint64_t L1_BCO)
101 {
102  strobe_L1_pair strobe_L1_BCO_pair(strobe_BCO, L1_BCO);
103  m_strobe_BCO_L1_BCO.insert(strobe_L1_BCO_pair);
104 }
105 
107 {
108  std::set<uint64_t> mySet;
109  std::set<strobe_L1_pair>::const_iterator iter;
110  for (iter = m_strobe_BCO_L1_BCO.begin(); iter != m_strobe_BCO_L1_BCO.end(); ++iter)
111  {
112  strobe_L1_pair myPair = *iter;
113  mySet.insert(myPair.first);
114  }
115 
116  return mySet.size();
117 }
118 
120 {
121  std::set<uint64_t> mySet;
122  std::set<strobe_L1_pair>::const_iterator iter;
123  for (iter = m_strobe_BCO_L1_BCO.begin(); iter != m_strobe_BCO_L1_BCO.end(); ++iter)
124  {
125  strobe_L1_pair myPair = *iter;
126  mySet.insert(myPair.second);
127  }
128 
129  return mySet.size();
130 }
131 
132 std::set<uint64_t> MvtxEventInfov1::get_strobe_BCOs() const
133 {
134  std::set<uint64_t> mySet;
135  std::set<strobe_L1_pair>::const_iterator iter;
136  for (iter = m_strobe_BCO_L1_BCO.begin(); iter != m_strobe_BCO_L1_BCO.end(); ++iter)
137  {
138  strobe_L1_pair myPair = *iter;
139  mySet.insert(myPair.first);
140  }
141 
142  return mySet;
143 }
144 
145 std::set<uint64_t> MvtxEventInfov1::get_L1_BCOs() const
146 {
147  std::set<uint64_t> mySet;
148  std::set<strobe_L1_pair>::const_iterator iter;
149  for (iter = m_strobe_BCO_L1_BCO.begin(); iter != m_strobe_BCO_L1_BCO.end(); ++iter)
150  {
151  strobe_L1_pair myPair = *iter;
152  mySet.insert(myPair.second);
153  }
154 
155  return mySet;
156 }
157 
158 std::set<uint64_t> MvtxEventInfov1::get_strobe_BCO_from_L1_BCO(const uint64_t ival) const
159 {
160  std::set<uint64_t> mySet;
161  std::set<strobe_L1_pair>::const_iterator iter;
162  for (iter = m_strobe_BCO_L1_BCO.begin(); iter != m_strobe_BCO_L1_BCO.end(); ++iter)
163  {
164  strobe_L1_pair myPair = *iter;
165  if (ival == myPair.second)
166  {
167  mySet.insert(myPair.first);
168  }
169  }
170 
171  return mySet;
172 }
173 
174 std::set<uint64_t> MvtxEventInfov1::get_L1_BCO_from_strobe_BCO(const uint64_t ival) const
175 {
176  std::set<uint64_t> mySet;
177  std::set<strobe_L1_pair>::const_iterator iter;
178  for (iter = m_strobe_BCO_L1_BCO.begin(); iter != m_strobe_BCO_L1_BCO.end(); ++iter)
179  {
180  strobe_L1_pair myPair = *iter;
181  if (ival == myPair.first)
182  {
183  mySet.insert(myPair.second);
184  }
185  }
186 
187  return mySet;
188 }