Skip to content

Commit edc2f2c

Browse files
committed
Check trigger time decoding in dldprint of tdc5
1 parent 638c396 commit edc2f2c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

plugins/dogma/dldprint.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ void print_tu(dogma::DogmaTu *tu, const char *prefix = "")
137137
double last_rising_tm = 0.;
138138
int last_rising_ch = -1;
139139
printf("%s Trigger time: %12.9fs\n", prefix, h.trig_time * coarse_tmlen5 * 1e-9); // time in seconds
140+
141+
// keep for debug purposes
142+
if (h.trig_time != tu->GetTdc5TrigTime())
143+
printf("%s DECODING TRIGGER TIME FAILURE 0x%016lx 0x%016lx\n", prefix, (long unsigned) h.trig_time, (long unsigned) tu->GetTdc5TrigTime());
140144
while (tdc5_parse_next(&tm, &it, buf, pktlen) == 1) {
141145
int fine = tm.fine;
142146
if (fine < fine_min5)

plugins/dogma/dogma/defines.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ namespace dogma {
6565

6666
inline uint32_t GetLocalTrigTime() const { return SWAP_VALUE(tuLocalTrigTime); }
6767

68+
inline uint64_t GetTdc5TrigTime() const { return (((uint64_t) GetTrigTime()) << 32) | GetLocalTrigTime(); }
69+
6870
inline uint32_t GetPayloadLen() const { return SWAP_VALUE(tuLenPayload) & 0xffff; }
6971

7072
inline uint32_t GetErrorBits() const { return SWAP_VALUE(tuLenPayload) >> 24; }

0 commit comments

Comments
 (0)