GCC Code Coverage Report


Directory: ./
File: src/event/data/stwTDC.cc
Date: 2025-09-01 06:19:01
Exec Total Coverage
Lines: 0 90 0.0%
Functions: 0 25 0.0%
Branches: 0 9 0.0%

Line Branch Exec Source
1 /**\file
2 * STRAW detectors are used for tracking in NA64. They are listened by a
3 * dedicated NA64-specific DAQ entity (called "NA64TDC").
4 *
5 * \warning This is a file generated for event's data structure.
6 * \note Generated at 14/08/2025 23:52:56 with template utils/evstruct/templates/cpp/impl.cc
7 * \version 0.1.dev
8 */
9
10
11 #include "na64event/data/stwTDC.hh"
12
13 #include "na64event/data/stwTDC.hh"
14
15 #include "na64event/data/stwTDC.hh"
16
17 #include <cmath>
18 #include "na64event/reset-values.hh"
19
20 namespace na64dp {
21
22
23
24
25
26
27
28 namespace event {
29 StwTDCHit::StwTDCHit( LocalMemory & lmem )
30
31 {}
32 } // namespace ::event::na64dp
33
34
35
36
37 namespace util {
38 void reset( event::StwTDCRawData & obj ) {
39 using namespace event;
40
41 ::na64dp::util::reset(obj.wireNo);
42
43 ::na64dp::util::reset(obj.time);
44
45 ::na64dp::util::reset(obj.timeDecoded);
46
47 }
48 } // namespace ::na64dp::util
49
50 namespace util {
51 void reset( event::StwMCInfo & obj ) {
52 using namespace event;
53
54 ::na64dp::util::reset(obj.entryPoint);
55
56 ::na64dp::util::reset(obj.exitPoint);
57
58 ::na64dp::util::reset(obj.eDep);
59
60 ::na64dp::util::reset(obj.trackE);
61
62 ::na64dp::util::reset(obj.particlePDG);
63
64 ::na64dp::util::reset(obj.geant4TrackID);
65
66 ::na64dp::util::reset(obj.r);
67
68 ::na64dp::util::reset(obj.u);
69
70 }
71 } // namespace ::na64dp::util
72
73 namespace util {
74 void reset( event::StwTDCHit & obj ) {
75 using namespace event;
76
77 ::na64dp::util::reset(obj.rawData);
78
79 ::na64dp::util::reset(obj.distance);
80
81 ::na64dp::util::reset(obj.distanceError);
82
83 ::na64dp::util::reset(obj.mcInfo);
84
85 ::na64dp::util::reset(obj.correctedTime);
86
87 }
88 } // namespace ::na64dp::util
89
90
91 namespace event {
92
93
94
95
96 static StdFloat_t _StwTDCRawData_get_wireNo( const StwTDCRawData & obj ) {
97 return static_cast<StdFloat_t>(obj.wireNo); // simple value
98 }
99 static StdFloat_t _StwTDCRawData_get_time( const StwTDCRawData & obj ) {
100 return static_cast<StdFloat_t>(obj.time); // simple value
101 }
102 static StdFloat_t _StwTDCRawData_get_timeDecoded( const StwTDCRawData & obj ) {
103 return static_cast<StdFloat_t>(obj.timeDecoded); // simple value
104 }
105
106
107
108 const Traits<StwTDCRawData>::Getters
109 Traits<StwTDCRawData>::getters = {
110
111 { "wireNo", { "Triggered wire number (physical, decoded)", _StwTDCRawData_get_wireNo } },
112 { "time", { "Time on a wire (internal units)", _StwTDCRawData_get_time } },
113 { "timeDecoded", { "Time in ns with the respect to trigger time", _StwTDCRawData_get_timeDecoded } },
114
115
116 };
117
118
119
120
121 // getter for StwMCInfo::entryPoint disabled
122 // getter for StwMCInfo::exitPoint disabled
123 static StdFloat_t _StwMCInfo_get_eDep( const StwMCInfo & obj ) {
124 return static_cast<StdFloat_t>(obj.eDep); // simple value
125 }
126 static StdFloat_t _StwMCInfo_get_trackE( const StwMCInfo & obj ) {
127 return static_cast<StdFloat_t>(obj.trackE); // simple value
128 }
129 static StdFloat_t _StwMCInfo_get_particlePDG( const StwMCInfo & obj ) {
130 return static_cast<StdFloat_t>(obj.particlePDG); // simple value
131 }
132 static StdFloat_t _StwMCInfo_get_geant4TrackID( const StwMCInfo & obj ) {
133 return static_cast<StdFloat_t>(obj.geant4TrackID); // simple value
134 }
135 static StdFloat_t _StwMCInfo_get_r( const StwMCInfo & obj ) {
136 return static_cast<StdFloat_t>(obj.r); // simple value
137 }
138 static StdFloat_t _StwMCInfo_get_u( const StwMCInfo & obj ) {
139 return static_cast<StdFloat_t>(obj.u); // simple value
140 }
141
142
143
144 const Traits<StwMCInfo>::Getters
145 Traits<StwMCInfo>::getters = {
146
147
148 // getter for StwMCInfo::entryPoint disabled
149
150 // getter for StwMCInfo::exitPoint disabled
151 { "eDep", { "energy deposition of incident particle", _StwMCInfo_get_eDep } },
152 { "trackE", { "energy of initiating track", _StwMCInfo_get_trackE } },
153 { "particlePDG", { "PDG code of initiating particle", _StwMCInfo_get_particlePDG } },
154 { "geant4TrackID", { "Geant4 track ID", _StwMCInfo_get_geant4TrackID } },
155 { "r", { "distance according to MC geometry", _StwMCInfo_get_r } },
156 { "u", { "measured (local) coordinate according to MC geometry", _StwMCInfo_get_u } },
157
158
159 };
160
161
162
163
164
165
166 // propagated from / rawData:mem::Ref<StwTDCRawData> / wireNo:uint16_t
167 static StdFloat_t _StwTDCHit_get_rawData_wireNo( const StwTDCHit & obj_ ) {
168 if(!obj_.rawData) return std::nan("0");
169 const auto & rawData = *obj_.rawData;
170 const auto & obj = rawData;
171
172 return static_cast<StdFloat_t>(obj.wireNo); // simple value
173
174 }
175
176 // propagated from / rawData:mem::Ref<StwTDCRawData> / time:int16_t
177 static StdFloat_t _StwTDCHit_get_rawData_time( const StwTDCHit & obj_ ) {
178 if(!obj_.rawData) return std::nan("0");
179 const auto & rawData = *obj_.rawData;
180 const auto & obj = rawData;
181
182 return static_cast<StdFloat_t>(obj.time); // simple value
183
184 }
185
186 // propagated from / rawData:mem::Ref<StwTDCRawData> / timeDecoded:double
187 static StdFloat_t _StwTDCHit_get_rawData_timeDecoded( const StwTDCHit & obj_ ) {
188 if(!obj_.rawData) return std::nan("0");
189 const auto & rawData = *obj_.rawData;
190 const auto & obj = rawData;
191
192 return static_cast<StdFloat_t>(obj.timeDecoded); // simple value
193
194 }
195
196
197
198 static StdFloat_t _StwTDCHit_get_distance( const StwTDCHit & obj ) {
199 return static_cast<StdFloat_t>(obj.distance); // simple value
200 }
201 static StdFloat_t _StwTDCHit_get_distanceError( const StwTDCHit & obj ) {
202 return static_cast<StdFloat_t>(obj.distanceError); // simple value
203 }
204
205
206 // no std getter for StwTDCHit/mcInfo/entryPoint
207 // no std getter for StwTDCHit/mcInfo/exitPoint
208 // propagated from / mcInfo:mem::Ref<StwMCInfo> / eDep:double
209 static StdFloat_t _StwTDCHit_get_mcInfo_eDep( const StwTDCHit & obj_ ) {
210 if(!obj_.mcInfo) return std::nan("0");
211 const auto & mcInfo = *obj_.mcInfo;
212 const auto & obj = mcInfo;
213
214 return static_cast<StdFloat_t>(obj.eDep); // simple value
215
216 }
217
218 // propagated from / mcInfo:mem::Ref<StwMCInfo> / trackE:float
219 static StdFloat_t _StwTDCHit_get_mcInfo_trackE( const StwTDCHit & obj_ ) {
220 if(!obj_.mcInfo) return std::nan("0");
221 const auto & mcInfo = *obj_.mcInfo;
222 const auto & obj = mcInfo;
223
224 return static_cast<StdFloat_t>(obj.trackE); // simple value
225
226 }
227
228 // propagated from / mcInfo:mem::Ref<StwMCInfo> / particlePDG:int
229 static StdFloat_t _StwTDCHit_get_mcInfo_particlePDG( const StwTDCHit & obj_ ) {
230 if(!obj_.mcInfo) return std::nan("0");
231 const auto & mcInfo = *obj_.mcInfo;
232 const auto & obj = mcInfo;
233
234 return static_cast<StdFloat_t>(obj.particlePDG); // simple value
235
236 }
237
238 // propagated from / mcInfo:mem::Ref<StwMCInfo> / geant4TrackID:int
239 static StdFloat_t _StwTDCHit_get_mcInfo_geant4TrackID( const StwTDCHit & obj_ ) {
240 if(!obj_.mcInfo) return std::nan("0");
241 const auto & mcInfo = *obj_.mcInfo;
242 const auto & obj = mcInfo;
243
244 return static_cast<StdFloat_t>(obj.geant4TrackID); // simple value
245
246 }
247
248 // propagated from / mcInfo:mem::Ref<StwMCInfo> / r:float
249 static StdFloat_t _StwTDCHit_get_mcInfo_r( const StwTDCHit & obj_ ) {
250 if(!obj_.mcInfo) return std::nan("0");
251 const auto & mcInfo = *obj_.mcInfo;
252 const auto & obj = mcInfo;
253
254 return static_cast<StdFloat_t>(obj.r); // simple value
255
256 }
257
258 // propagated from / mcInfo:mem::Ref<StwMCInfo> / u:float
259 static StdFloat_t _StwTDCHit_get_mcInfo_u( const StwTDCHit & obj_ ) {
260 if(!obj_.mcInfo) return std::nan("0");
261 const auto & mcInfo = *obj_.mcInfo;
262 const auto & obj = mcInfo;
263
264 return static_cast<StdFloat_t>(obj.u); // simple value
265
266 }
267
268
269
270 static StdFloat_t _StwTDCHit_get_correctedTime( const StwTDCHit & obj ) {
271 return static_cast<StdFloat_t>(obj.correctedTime); // simple value
272 }
273
274
275
276 const Traits<StwTDCHit>::Getters
277 Traits<StwTDCHit>::getters = {
278
279
280
281 // propagated from / rawData:mem::Ref<StwTDCRawData> / wireNo:uint16_t
282 { "rawData.wireNo", { "Triggered wire number (physical, decoded)", _StwTDCHit_get_rawData_wireNo } },
283 // propagated from / rawData:mem::Ref<StwTDCRawData> / time:int16_t
284 { "rawData.time", { "Time on a wire (internal units)", _StwTDCHit_get_rawData_time } },
285 // propagated from / rawData:mem::Ref<StwTDCRawData> / timeDecoded:double
286 { "rawData.timeDecoded", { "Time in ns with the respect to trigger time", _StwTDCHit_get_rawData_timeDecoded } },
287
288
289 { "distance", { "estimated by time (ambiguous) distance from the wire (isochrone surface radius)", _StwTDCHit_get_distance } },
290 { "distanceError", { "error of distance estimation", _StwTDCHit_get_distanceError } },
291
292
293 // no std getter for StwTDCHit/mcInfo/entryPoint
294 // no std getter for StwTDCHit/mcInfo/exitPoint
295 // propagated from / mcInfo:mem::Ref<StwMCInfo> / eDep:double
296 { "mcInfo.eDep", { "energy deposition of incident particle", _StwTDCHit_get_mcInfo_eDep } },
297 // propagated from / mcInfo:mem::Ref<StwMCInfo> / trackE:float
298 { "mcInfo.trackE", { "energy of initiating track", _StwTDCHit_get_mcInfo_trackE } },
299 // propagated from / mcInfo:mem::Ref<StwMCInfo> / particlePDG:int
300 { "mcInfo.particlePDG", { "PDG code of initiating particle", _StwTDCHit_get_mcInfo_particlePDG } },
301 // propagated from / mcInfo:mem::Ref<StwMCInfo> / geant4TrackID:int
302 { "mcInfo.geant4TrackID", { "Geant4 track ID", _StwTDCHit_get_mcInfo_geant4TrackID } },
303 // propagated from / mcInfo:mem::Ref<StwMCInfo> / r:float
304 { "mcInfo.r", { "distance according to MC geometry", _StwTDCHit_get_mcInfo_r } },
305 // propagated from / mcInfo:mem::Ref<StwMCInfo> / u:float
306 { "mcInfo.u", { "measured (local) coordinate according to MC geometry", _StwTDCHit_get_mcInfo_u } },
307
308
309 { "correctedTime", { "Time corrected for T0", _StwTDCHit_get_correctedTime } },
310
311
312 };
313
314
315
316 } // namespace ::na64dp::event
317 } // namespace na64dp
318