GCC Code Coverage Report


Directory: ./
File: src/event/data/event.cc
Date: 2025-09-01 06:19:01
Exec Total Coverage
Lines: 28 84 33.3%
Functions: 2 19 10.5%
Branches: 19 22 86.4%

Line Branch Exec Source
1 /**\file
2 * \brief Main event structure declaration
3 *
4 * The event structure is the principal declaration affecting every handler
5 * within the pipeline. Handlers take and modify the data from/within an event
6 * instance, by accessing its members.
7 *
8 * Refer to :ref:`event structure` for insights of
9 * how to modify the events composition.
10 *
11 * \warning This is a file generated for event's data structure.
12 * \note Generated at 14/08/2025 23:52:56 with template utils/evstruct/templates/cpp/impl.cc
13 * \version 0.1
14 */
15
16
17 #include "na64event/data/event.hh"
18
19 #include "na64event/data/event.hh"
20
21 #include "na64event/data/event.hh"
22
23 #include <cmath>
24 #include "na64event/reset-values.hh"
25
26 namespace na64dp {
27
28
29
30
31
32
33
34 namespace event {
35 35 Event::Event( LocalMemory & lmem )
36
2/2
✓ Branch 1 taken 35 times.
✓ Branch 4 taken 35 times.
35 : sadcHits(lmem)
37
2/2
✓ Branch 1 taken 35 times.
✓ Branch 4 taken 35 times.
35 , apvHits(lmem)
38
2/2
✓ Branch 1 taken 35 times.
✓ Branch 4 taken 35 times.
35 , stwtdcHits(lmem)
39
2/2
✓ Branch 1 taken 35 times.
✓ Branch 4 taken 35 times.
35 , f1Hits(lmem)
40
2/2
✓ Branch 1 taken 35 times.
✓ Branch 4 taken 35 times.
35 , caloHits(lmem)
41
2/2
✓ Branch 1 taken 35 times.
✓ Branch 4 taken 35 times.
35 , apvClusters(lmem)
42
2/2
✓ Branch 1 taken 35 times.
✓ Branch 4 taken 35 times.
35 , trackScores(lmem)
43
2/2
✓ Branch 1 taken 35 times.
✓ Branch 4 taken 35 times.
35 , tracks(lmem)
44
2/2
✓ Branch 4 taken 35 times.
✓ Branch 7 taken 35 times.
70 , vertices(lmem)
45
46 35 {}
47 } // namespace ::event::na64dp
48
49
50
51
52 namespace util {
53 void reset( event::MCTruthInfo & obj ) {
54 using namespace event;
55
56 ::na64dp::util::reset(obj.weight);
57
58 ::na64dp::util::reset(obj.beamPosition);
59
60 ::na64dp::util::reset(obj.beamMomentum);
61
62 ::na64dp::util::reset(obj.beamE0);
63
64 ::na64dp::util::reset(obj.ecalEntryPoisition);
65
66 ::na64dp::util::reset(obj.beamPDG);
67
68 }
69 } // namespace ::na64dp::util
70
71 namespace util {
72 void reset( event::Vertex & obj ) {
73 using namespace event;
74
75 ::na64dp::util::reset(obj.E0);
76
77 ::na64dp::util::reset(obj.E);
78
79 ::na64dp::util::reset(obj.position);
80
81 ::na64dp::util::reset(obj.decayPosition);
82
83 ::na64dp::util::reset(obj.lvEm);
84
85 ::na64dp::util::reset(obj.lvEp);
86
87 ::na64dp::util::reset(obj.initPDG);
88
89 ::na64dp::util::reset(obj.DMTRID1);
90
91 ::na64dp::util::reset(obj.DMTRID2);
92
93 }
94 } // namespace ::na64dp::util
95
96 namespace util {
97 35 void reset( event::Event & obj ) {
98 using namespace event;
99
100 35 ::na64dp::util::reset(obj.id);
101
102 35 ::na64dp::util::reset(obj.trigger);
103
104 35 ::na64dp::util::reset(obj.evType);
105
1/1
✓ Branch 1 taken 35 times.
35 obj.time = std::make_pair<time_t, uint32_t>(0, 0);
106 35 ::na64dp::util::reset(obj.masterTime);
107
108 35 ::na64dp::util::reset(obj.mcTruth);
109
110 35 obj.sadcHits.clear();
111 35 obj.apvHits.clear();
112 35 obj.stwtdcHits.clear();
113 35 obj.f1Hits.clear();
114 35 obj.caloHits.clear();
115 35 obj.apvClusters.clear();
116 35 obj.trackScores.clear();
117 35 obj.tracks.clear();
118 35 obj.vertices.clear();
119 35 }
120 } // namespace ::na64dp::util
121
122
123 namespace event {
124
125
126
127
128 static StdFloat_t _MCTruthInfo_get_weight( const MCTruthInfo & obj ) {
129 return static_cast<StdFloat_t>(obj.weight); // simple value
130 }
131 // getter for MCTruthInfo::beamPosition disabled
132 // getter for MCTruthInfo::beamMomentum disabled
133 static StdFloat_t _MCTruthInfo_get_beamE0( const MCTruthInfo & obj ) {
134 return static_cast<StdFloat_t>(obj.beamE0); // simple value
135 }
136 // getter for MCTruthInfo::ecalEntryPoisition disabled
137 static StdFloat_t _MCTruthInfo_get_beamPDG( const MCTruthInfo & obj ) {
138 return static_cast<StdFloat_t>(obj.beamPDG); // simple value
139 }
140
141
142
143 const Traits<MCTruthInfo>::Getters
144 Traits<MCTruthInfo>::getters = {
145
146 { "weight", { "A \"statistical weight\" of the event", _MCTruthInfo_get_weight } },
147
148 // getter for MCTruthInfo::beamPosition disabled
149
150 // getter for MCTruthInfo::beamMomentum disabled
151 { "beamE0", { "initializing particle initial full E (TODO: redundant?)", _MCTruthInfo_get_beamE0 } },
152
153 // getter for MCTruthInfo::ecalEntryPoisition disabled
154 { "beamPDG", { "PDG code of initializing particle", _MCTruthInfo_get_beamPDG } },
155
156
157 };
158
159
160
161
162 static StdFloat_t _Vertex_get_E0( const Vertex & obj ) {
163 return static_cast<StdFloat_t>(obj.E0); // simple value
164 }
165 static StdFloat_t _Vertex_get_E( const Vertex & obj ) {
166 return static_cast<StdFloat_t>(obj.E); // simple value
167 }
168 // getter for Vertex::position disabled
169 // getter for Vertex::decayPosition disabled
170 // getter for Vertex::lvEm disabled
171 // getter for Vertex::lvEp disabled
172 static StdFloat_t _Vertex_get_initPDG( const Vertex & obj ) {
173 return static_cast<StdFloat_t>(obj.initPDG); // simple value
174 }
175 static StdFloat_t _Vertex_get_DMTRID1( const Vertex & obj ) {
176 return static_cast<StdFloat_t>(obj.DMTRID1); // simple value
177 }
178 static StdFloat_t _Vertex_get_DMTRID2( const Vertex & obj ) {
179 return static_cast<StdFloat_t>(obj.DMTRID2); // simple value
180 }
181
182
183
184 const Traits<Vertex>::Getters
185 Traits<Vertex>::getters = {
186
187 { "E0", { "Initializing particle energy before DM producton [GeV]", _Vertex_get_E0 } },
188 { "E", { "Initializing paritcle energy after DM production [GeV]", _Vertex_get_E } },
189
190 // getter for Vertex::position disabled
191
192 // getter for Vertex::decayPosition disabled
193
194 // getter for Vertex::lvEm disabled
195
196 // getter for Vertex::lvEp disabled
197 { "initPDG", { "PDG code of the initializing particle (MC typically)", _Vertex_get_initPDG } },
198 { "DMTRID1", { "(unknown MK\u0027s MC datum) \\todo", _Vertex_get_DMTRID1 } },
199 { "DMTRID2", { "(unknown MK\u0027s MC datum) \\todo", _Vertex_get_DMTRID2 } },
200
201
202 };
203
204
205
206
207 static StdFloat_t _Event_get_id( const Event & obj ) {
208 return static_cast<StdFloat_t>(obj.id); // simple value
209 }
210 static StdFloat_t _Event_get_trigger( const Event & obj ) {
211 return static_cast<StdFloat_t>(obj.trigger); // simple value
212 }
213 static StdFloat_t _Event_get_evType( const Event & obj ) {
214 return static_cast<StdFloat_t>(obj.evType); // simple value
215 }
216 // getter for Event::time disabled
217 static StdFloat_t _Event_get_masterTime( const Event & obj ) {
218 return static_cast<StdFloat_t>(obj.masterTime); // simple value
219 }
220
221
222 // propagated from / mcTruth:mem::Ref<MCTruthInfo> / weight:double
223 static StdFloat_t _Event_get_mcTruth_weight( const Event & obj_ ) {
224 if(!obj_.mcTruth) return std::nan("0");
225 const auto & mcTruth = *obj_.mcTruth;
226 const auto & obj = mcTruth;
227
228 return static_cast<StdFloat_t>(obj.weight); // simple value
229
230 }
231
232 // no std getter for Event/mcTruth/beamPosition
233 // no std getter for Event/mcTruth/beamMomentum
234 // propagated from / mcTruth:mem::Ref<MCTruthInfo> / beamE0:double
235 static StdFloat_t _Event_get_mcTruth_beamE0( const Event & obj_ ) {
236 if(!obj_.mcTruth) return std::nan("0");
237 const auto & mcTruth = *obj_.mcTruth;
238 const auto & obj = mcTruth;
239
240 return static_cast<StdFloat_t>(obj.beamE0); // simple value
241
242 }
243
244 // no std getter for Event/mcTruth/ecalEntryPoisition
245 // propagated from / mcTruth:mem::Ref<MCTruthInfo> / beamPDG:int
246 static StdFloat_t _Event_get_mcTruth_beamPDG( const Event & obj_ ) {
247 if(!obj_.mcTruth) return std::nan("0");
248 const auto & mcTruth = *obj_.mcTruth;
249 const auto & obj = mcTruth;
250
251 return static_cast<StdFloat_t>(obj.beamPDG); // simple value
252
253 }
254
255
256
257 // getter for Event::sadcHits disabled
258 // getter for Event::apvHits disabled
259 // getter for Event::stwtdcHits disabled
260 // getter for Event::f1Hits disabled
261 // getter for Event::caloHits disabled
262 // getter for Event::apvClusters disabled
263 // getter for Event::trackScores disabled
264 // getter for Event::tracks disabled
265 // getter for Event::vertices disabled
266
267
268
269 const Traits<Event>::Getters
270 Traits<Event>::getters = {
271
272 { "id", { "Event\u0027s unique identifier.", _Event_get_id } },
273 { "trigger", { "Trigger code of this event", _Event_get_trigger } },
274 { "evType", { "Event type code", _Event_get_evType } },
275
276 // getter for Event::time disabled
277 { "masterTime", { "Relative event master time, [ns]", _Event_get_masterTime } },
278
279
280 // propagated from / mcTruth:mem::Ref<MCTruthInfo> / weight:double
281 { "mcTruth.weight", { "A \"statistical weight\" of the event", _Event_get_mcTruth_weight } },
282 // no std getter for Event/mcTruth/beamPosition
283 // no std getter for Event/mcTruth/beamMomentum
284 // propagated from / mcTruth:mem::Ref<MCTruthInfo> / beamE0:double
285 { "mcTruth.beamE0", { "initializing particle initial full E (TODO: redundant?)", _Event_get_mcTruth_beamE0 } },
286 // no std getter for Event/mcTruth/ecalEntryPoisition
287 // propagated from / mcTruth:mem::Ref<MCTruthInfo> / beamPDG:int
288 { "mcTruth.beamPDG", { "PDG code of initializing particle", _Event_get_mcTruth_beamPDG } },
289
290
291
292 // getter for Event::sadcHits disabled
293
294 // getter for Event::apvHits disabled
295
296 // getter for Event::stwtdcHits disabled
297
298 // getter for Event::f1Hits disabled
299
300 // getter for Event::caloHits disabled
301
302 // getter for Event::apvClusters disabled
303
304 // getter for Event::trackScores disabled
305
306 // getter for Event::tracks disabled
307
308 // getter for Event::vertices disabled
309
310
311 };
312
313
314
315 } // namespace ::na64dp::event
316 } // namespace na64dp
317