From 792d1c5545051ffc6f7da1bf58acfbcae822ee27 Mon Sep 17 00:00:00 2001 From: splitPoleDAQ Date: Fri, 19 Jan 2024 03:07:16 -0500 Subject: [PATCH] Added traceLength in Hit Class --- Hit.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Hit.h b/Hit.h index cd5acd9..7472035 100644 --- a/Hit.h +++ b/Hit.h @@ -3,14 +3,15 @@ class Hit{ public: - int sn; - unsigned short bd; - unsigned short ch; + unsigned short sn; + uint8_t bd; + uint8_t ch; unsigned short energy; unsigned short energy2; unsigned long long timestamp; unsigned short fineTime; + unsigned short traceLength; std::vector trace; Hit(){ @@ -25,6 +26,7 @@ public: energy2 = 0; timestamp = 0; fineTime = 0; + traceLength = 0; trace.clear(); } @@ -32,6 +34,12 @@ public: printf("(%5d, %2d) %6d %16llu, %6d, %5ld\n", sn, ch, energy, timestamp, fineTime, trace.size()); } + void PrintTrace(){ + for( unsigned short i = 0; i < traceLength; i++){ + printf("%3u | %6d \n", i, trace[i]); + } + } + // Define operator< for sorting bool operator<(const Hit& other) const { return timestamp < other.timestamp;