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