@@ -59,12 +59,15 @@ namespace tdis::io {
59
59
60
60
/* * POD structure for readout hits **/
61
61
struct DigitizedReadoutHit {
62
- double time; // - Time of arrival at Pad (ns)
63
- double adc; // - Amplitude (ADC bin of sample)
64
- int ring; // - Ring (id of rin, 0 is innermost).
65
- int pad; // - Pad (id of pad, 0 is at or closest to phi=0 and numbering is clockwise).
66
- int plane; // - Plane(id of z plane from 0 upstream to 9 downstream)
67
- double zToGem; // - ZtoGEM (m)
62
+ double time; // - Time of arrival at Pad (ns)
63
+ double adc; // - Amplitude (ADC bin of sample)
64
+ int ring; // - Ring (id of rin, 0 is innermost).
65
+ int pad; // - Pad (id of pad, 0 is at or closest to phi=0 and numbering is clockwise).
66
+ int plane; // - Plane(id of z plane from 0 upstream to 9 downstream)
67
+ double zToGem; // - ZtoGEM (m)
68
+ double true_x; // - True hit x info (quiet_NaN() if not provided)
69
+ double true_y; // - True hit y info (quiet_NaN() if not provided)
70
+ double true_z; // - True hit z info (quiet_NaN() if not provided)
68
71
};
69
72
70
73
/* * POD structure for readout track **/
@@ -240,12 +243,31 @@ namespace tdis::io {
240
243
return false ;
241
244
}
242
245
243
- result.time = std::stod (tokens[0 ]); // - Time of arrival at Pad (ns)
244
- result.adc = std::stod (tokens[1 ]); // - Amplitude (ADC bin of sample)
245
- result.ring = std::stoi (tokens[2 ]); // - Ring (id of rin, 0 is innermost).
246
- result.pad = std::stoi (tokens[3 ]); // - Pad (id of pad, 0 is at or closest to phi=0 and numbering is clockwise).
247
- result.plane = std::stoi (tokens[4 ]); // - Plane(id of z plane from 0 upstream to 9 downstream)
248
- result.zToGem = std::stod (tokens[5 ]); // - ZtoGEM (m)
246
+ if (tokens.size () == 6 ) {
247
+ // Files with no true X Y Z hit info
248
+ result.time = std::stod (tokens[0 ]); // - Time of arrival at Pad (ns)
249
+ result.adc = std::stod (tokens[1 ]); // - Amplitude (ADC bin of sample)
250
+ result.ring = std::stoi (tokens[2 ]); // - Ring (id of rin, 0 is innermost).
251
+ result.pad = std::stoi (tokens[3 ]); // - Pad (id of pad, 0 is at or closest to phi=0 and numbering is clockwise).
252
+ result.plane = std::stoi (tokens[4 ]); // - Plane(id of z plane from 0 upstream to 9 downstream)
253
+ result.zToGem = std::stod (tokens[5 ]); // - ZtoGEM (m)
254
+
255
+ // True hit information is not set
256
+ result.true_x = std::numeric_limits<double >::quiet_NaN ();
257
+ result.true_y = std::numeric_limits<double >::quiet_NaN ();
258
+ result.true_z = std::numeric_limits<double >::quiet_NaN ();
259
+ } else {
260
+ result.time = std::stod (tokens[0 ]); // - Time of arrival at Pad (ns)
261
+ result.adc = std::stod (tokens[1 ]); // - Amplitude (ADC bin of sample)
262
+ result.true_x = std::stod (tokens[2 ]); // True X Y Z of hit
263
+ result.true_y = std::stod (tokens[3 ]);
264
+ result.true_z = std::stod (tokens[4 ]);
265
+ result.ring = std::stoi (tokens[5 ]); // - Ring (id of rin, 0 is innermost).
266
+ result.pad = std::stoi (tokens[6 ]); // - Pad (id of pad, 0 is at or closest to phi=0 and numbering is clockwise).
267
+ result.plane = std::stoi (tokens[7 ]); // - Plane(id of z plane from 0 upstream to 9 downstream)
268
+ result.zToGem = std::stod (tokens[8 ]); // - ZtoGEM (m)
269
+ }
270
+
249
271
return true ;
250
272
}
251
273
0 commit comments