diff --git a/sbnobj/Common/CRT/CRTHit.hh b/sbnobj/Common/CRT/CRTHit.hh index 21499ab1..bb606e59 100644 --- a/sbnobj/Common/CRT/CRTHit.hh +++ b/sbnobj/Common/CRT/CRTHit.hh @@ -22,30 +22,31 @@ namespace sbn::crt { struct CRTHit{ + static constexpr float kInvalidF = std::numeric_limits::lowest(); + static constexpr double kInvalidD = std::numeric_limits::lowest(); + std::vector feb_id; ///< FEB address std::map< uint8_t, std::vector > > pesmap; ///< Saves signal hit information (FEB, local-channel and PE) . - float peshit; ///< Total photo-electron (PE) in a crt hit. + float peshit{kInvalidF}; ///< Total photo-electron (PE) in a crt hit. - uint64_t ts0_s; ///< Second-only part of timestamp T0. - double ts0_s_corr; ///< [Honestly, not sure at this point, it was there since long time (BB)] - double ts0_ns; ///< Timestamp T0 (from White Rabbit), in UTC absolute time scale in nanoseconds from the Epoch. - double ts0_ns_corr; ///< [Honestly, not sure at this point, it was there since long time (BB)] + uint64_t ts0_s{-1}; ///< Second-only part of timestamp T0. + double ts0_s_corr{kInvalidD}; ///< [Honestly, not sure at this point, it was there since long time (BB)] + double ts0_ns{kInvalidD}; ///< Timestamp T0 (from White Rabbit), in UTC absolute time scale in nanoseconds from the Epoch. + double ts0_ns_corr{kInvalidD}; ///< [Honestly, not sure at this point, it was there since long time (BB)] - double ts1_ns; ///< Timestamp T1 ([signal time w.r.t. Trigger time]), + double ts1_ns{kInvalidD}; ///< Timestamp T1 ([signal time w.r.t. Trigger time]), - int plane; ///< Name of the CRT wall (in the form of numbers). + int plane{-1}; ///< Name of the CRT wall (in the form of numbers). - float x_pos; ///< position in x-direction (cm). - float x_err; ///< position uncertainty in x-direction (cm). - float y_pos; ///< position in y-direction (cm). - float y_err; ///< position uncertainty in y-direction (cm). - float z_pos; ///< position in z-direction (cm). - float z_err; ///< position uncertainty in z-direction (cm). + float x_pos{kInvalidF}; ///< position in x-direction (cm). + float x_err{kInvalidF}; ///< position uncertainty in x-direction (cm). + float y_pos{kInvalidF}; ///< position in y-direction (cm). + float y_err{kInvalidF}; ///< position uncertainty in y-direction (cm). + float z_pos{kInvalidF}; ///< position in z-direction (cm). + float z_err{kInvalidF}; ///< position uncertainty in z-direction (cm). std::string tagger; ///< Name of the CRT wall (in the form of strings). - CRTHit() {} - int64_t ts0() const { return static_cast(ts0_s) * 1'000'000'000LL + static_cast(ts0_ns); } // T1 is a relative time not a timestamp, so we don't need second-part. // nano-second part is enough and we saved entire time there.