Skip to content

Commit ce704f5

Browse files
authored
Merge pull request #72 from SBNSoftware/feature/jskim_CRTT1_SBN2022B
Fix sbn::crt::ts1()
2 parents 34b8ac7 + 0bf8a3f commit ce704f5

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

sbnobj/Common/CRT/CRTHit.hh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ namespace sbn::crt {
2828

2929
uint64_t ts0_s; ///< Second-only part of timestamp T0.
3030
double ts0_s_corr; ///< [Honestly, not sure at this point, it was there since long time (BB)]
31-
3231
double ts0_ns; ///< Timestamp T0 (from White Rabbit), in UTC absolute time scale in nanoseconds from the Epoch.
3332
double ts0_ns_corr; ///< [Honestly, not sure at this point, it was there since long time (BB)]
34-
double ts1_ns; ///< Timestamp T1 ([signal time w.r.t. Trigger time]), in UTC absolute time scale in nanoseconds from the Epoch.
33+
34+
double ts1_ns; ///< Timestamp T1 ([signal time w.r.t. Trigger time]),
3535

3636
int plane; ///< Name of the CRT wall (in the form of numbers).
3737

@@ -47,7 +47,9 @@ namespace sbn::crt {
4747
CRTHit() {}
4848

4949
int64_t ts0() const { return static_cast<int64_t>(ts0_s) * 1'000'000'000LL + static_cast<int64_t>(ts0_ns); }
50-
int64_t ts1() const { return static_cast<int64_t>(ts0_s) * 1'000'000'000LL + static_cast<int64_t>(ts1_ns); }
50+
// T1 is a relative time not a timestamp, so we don't need second-part.
51+
// nano-second part is enough and we saved entire time there.
52+
int64_t ts1() const { return static_cast<int64_t>(ts1_ns); }
5153

5254
};
5355

0 commit comments

Comments
 (0)