19 #define BOOST_TEST_MODULE ( TriggerGateData_test )
20 #include <boost/test/unit_test.hpp>
129 auto [ lower2031, upper2031 ] = gate.
openingRange(20, 30);
130 BOOST_TEST((lower2031 == 1));
131 BOOST_TEST((upper2031 == 4));
154 BOOST_TEST((extract.openThreshold() == 2U));
155 BOOST_TEST((extract.closeThreshold() == 1U));
156 BOOST_TEST((extract.minGap() == 0U));
157 BOOST_TEST((extract.minWidth() == 1U));
159 BOOST_CHECK((!extract.atEnd()));
161 auto opening = extract.findNextOpening();
162 BOOST_CHECK((!!opening));
163 BOOST_TEST((opening.value().tick.value() == -4));
164 BOOST_TEST((opening.value().level == 2));
165 BOOST_CHECK((!extract.atEnd()));
167 opening = extract.findNextOpening();
168 BOOST_CHECK((!!opening));
169 BOOST_TEST((opening.value().tick.value() == 4));
170 BOOST_TEST((opening.value().level == 2));
171 BOOST_CHECK((!extract.atEnd()));
173 opening = extract.findNextOpening();
174 BOOST_CHECK((!!opening));
175 BOOST_TEST((opening.value().tick.value() == 10));
176 BOOST_TEST((opening.value().level == 4));
177 BOOST_CHECK((!extract.atEnd()));
179 opening = extract.findNextOpening();
180 BOOST_CHECK((!!opening));
181 BOOST_TEST((opening.value().tick.value() == 26));
182 BOOST_TEST((opening.value().level == 2));
183 BOOST_CHECK((!extract.atEnd()));
185 opening = extract.findNextOpening();
186 BOOST_CHECK((!!opening));
187 BOOST_TEST((opening.value().tick.value() == 34));
188 BOOST_TEST((opening.value().level == 4));
189 BOOST_CHECK((extract.atEnd()));
191 opening = extract.findNextOpening();
192 BOOST_CHECK((!opening));
193 BOOST_CHECK((extract.atEnd()));
void GateOpeningInfoExtractor_test()
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.
A logical multilevel gate for triggering.
OpeningCount_t openingCount(ClockTick_t tick) const
Returns the opening count of the gate at the specified tick.
icarus::trigger::TriggerGateData< int, int > TestedInputGate()
void openAt(ClockTick_t tick, OpeningDiff_t count)
Open this gate at the specified time (increase the opening by count).
Helper class to store transient trigger result.
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.
Logical multi-level 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.