@@ -243,10 +243,16 @@ struct sbn::ExtraTriggerInfo {
243243 // / Returns whether there is some recorded LVDS activity.
244244 constexpr bool hasLVDS () const ;
245245
246+ // / Returns whether there is some recorded sector activity.
247+ constexpr bool hasSectors () const ;
248+
249+ // / Returns whether there is some recorded activity (LVDS or sector).
250+ constexpr bool hasAnyActivity () const ;
251+
246252 }; // CryostatInfo
247253
248254
249- // / Bits for the trigger location (@ see `triggerLocation()`).
255+ // / Bits for the trigger location (see `triggerLocation()`).
250256 unsigned int triggerLocationBits { 0U };
251257 // sbn::triggerLocation triggerLocationBits { sbn::triggerSource::NBits }
252258 // / Status of each LVDS channel in each PMT wall at trigger time.
@@ -321,16 +327,34 @@ namespace sbn {
321327 std::ostream& operator << (std::ostream& out, ExtraTriggerInfo const & info);
322328}
323329
324- // -----------------------------------------------------------------------------
325330
326- constexpr bool sbn::ExtraTriggerInfo::CryostatInfo::hasLVDS () const {
331+ // -----------------------------------------------------------------------------
332+ inline constexpr bool sbn::ExtraTriggerInfo::CryostatInfo::hasLVDS () const {
327333 // C++20:
328- // return std::ranges::any_of(LVDSstatus, std::identity{});
334+ // return std::ranges::any_of(LVDSstatus, std::identity{});
329335 for (std::uint64_t bits: LVDSstatus) if (bits) return true ;
330336 return false ;
331- } // sbn::ExtraTriggerInfo::CryostatInfo::empty ()
337+ } // sbn::ExtraTriggerInfo::CryostatInfo::hasLVDS ()
332338
333339
340+ // -----------------------------------------------------------------------------
341+ inline constexpr bool sbn::ExtraTriggerInfo::CryostatInfo::hasSectors () const {
342+ // C++20:
343+ // return std::ranges::any_of(SectorStatus, std::identity{});
344+ for (std::uint64_t bits: SectorStatus) if (bits) return true ;
345+ return false ;
346+ } // sbn::ExtraTriggerInfo::CryostatInfo::hasSectors()
347+
348+
349+ // -----------------------------------------------------------------------------
350+ inline constexpr bool sbn::ExtraTriggerInfo::CryostatInfo::hasAnyActivity ()
351+ const
352+ {
353+ return hasLVDS () || hasSectors ();
354+ } // sbn::ExtraTriggerInfo::CryostatInfo::hasAnyActivity()
355+
356+
357+ // -----------------------------------------------------------------------------
334358
335359
336360#endif // SBNOBJ_COMMON_TRIGGER_EXTRATRIGGERINFO_H
0 commit comments