21 #define BOOST_TEST_MODULE ( TrackedTriggerGate_test )
22 #include <boost/test/unit_test.hpp>
26 #include <type_traits>
44 static_assert(std::is_same_v<
45 decltype(
gateIn(trackedGate)),
48 static_assert(std::is_same_v<
49 decltype(
gateIn(std::as_const(trackedGate))),
52 static_assert(std::is_same_v<
53 decltype(
gateIn(std::move(trackedGate))),
57 static_assert(std::is_same_v<
61 static_assert(std::is_same_v<
62 decltype(
gateIn(std::as_const(gate))),
65 static_assert(std::is_same_v<
66 decltype(
gateIn(std::move(gate))),
73 static_assert(std::is_same_v<
77 static_assert(std::is_same_v<
78 decltype(
gateDataIn(std::as_const(trackedGate))),
81 static_assert(std::is_same_v<
85 static_assert(std::is_same_v<
89 static_assert(std::is_same_v<
93 static_assert(std::is_same_v<
98 static_assert(std::is_same_v<
102 static_assert(std::is_same_v<
103 decltype(
gateDataIn(std::as_const(gateData))),
106 static_assert(std::is_same_v<
114 BOOST_TEST(
gateIn(trackedGate) == trackedGate.
gate());
115 BOOST_TEST(
gateIn(gate) == gate);
116 BOOST_TEST(
gateDataIn(trackedGate) == trackedGate.
gate().gateLevels());
233 auto [ lower2031, upper2031 ] = gate.
openingRange(20, 30);
234 BOOST_TEST((lower2031 == 1));
235 BOOST_TEST((upper2031 == 4));
Base_t GateData_t
Type for gate data access.
void TrackedTriggerGate_test()
A wrapper to trigger gate objects tracking the input of operations.
GateData_t const & gateLevels() const
Access to the underlying gate level data.
void closeAt(ClockTick_t tick, OpeningDiff_t count)
Close this gate at the specified time (decrease the opening by count).
void openBetween(ClockTick_t start, ClockTick_t end, OpeningDiff_t count=1)
Open this gate at specified start tick, and close it at end tick.
Logical multi-level gate associated to one or more readout channels.
OpeningCount_t openingCount(ClockTick_t tick) const
Returns the opening count of the gate at the specified tick.
Functions to help debugging by instrumenting code.
void openAt(ClockTick_t tick, OpeningDiff_t count)
Open this gate at the specified time (increase the opening by count).
TriggerGate_t const & gate() const &
Returns the enclosed gate.
Data types for detinfo::DetectorTimings.
ClockTick_t findMaxOpen(ClockTick_t start=MinTick, ClockTick_t end=MaxTick) const
Returns the tick at which the gate has the maximum opening.
A simple alias for a most commonly used TrackedTriggerGate type.
decltype(auto) gateDataIn(Gate &&gate)
Returns the trigger data (a TriggerGateData) from the specofied gate.
bool alwaysClosed() const
Returns whether this gate never opened.
std::pair< OpeningCount_t, OpeningCount_t > openingRange(ClockTick_t start, ClockTick_t end) const
Returns the range of trigger opening values in the specified range.
decltype(auto) gateIn(Gate &&gate)
Returns the trigger gate (a ReadoutTriggerGate) from the specified gate.