Helper to extract OpeningInfo_t
from a trigger gate.
More...
#include <TriggerInfo_t.h>
Classes | |
struct | Config_t |
Configuration of the algorithm. More... | |
Public Types | |
using | ClockTick_t = typename GateData_t::ClockTick_t |
using | OpeningCount_t = icarus::trigger::details::TriggerInfo_t::Opening_t |
using | OpeningInfo_t = icarus::trigger::details::TriggerInfo_t::OpeningInfo_t |
using | LocationID_t = icarus::trigger::details::TriggerInfo_t::LocationID_t |
Public Member Functions | |
GateOpeningInfoExtractor (Gate_t const &gate) | |
Constructor: uses default configuration. More... | |
GateOpeningInfoExtractor (Gate_t const &gate, Config_t config) | |
Constructor: sets all configuration parameters. More... | |
GateOpeningInfoExtractor (Gate_t const &gate, OpeningCount_t threshold) | |
Constructor: sets all configuration parameters. More... | |
void | configure (Config_t config) |
Sets the configuration. More... | |
bool | atEnd () const |
operator bool () const | |
bool | operator! () const |
void | restart (ClockTick_t fromTick=MinTick) |
Resets the search from the specified time tick (beginning by default). More... | |
std::optional< OpeningInfo_t > | operator() () |
The returned gate is at least minWidth ticks wide. More... | |
std::optional< OpeningInfo_t > | findNextOpening () |
Configuration access | |
Config_t const & | configuration () const |
OpeningCount_t | openThreshold () const |
OpeningCount_t | closeThreshold () const |
unsigned int | minGap () const |
unsigned int | minWidth () const |
LocationID_t | location () const |
void | setLocation (LocationID_t location) |
Private Types | |
using | Gate_t = Gate |
using | GateData_t = std::decay_t< decltype(gateDataIn(std::declval< Gate_t >()))> |
Private Member Functions | |
ClockTick_t | findOpen (ClockTick_t start) const |
ClockTick_t | findClose (ClockTick_t start) const |
std::pair< ClockTick_t, ClockTick_t > | findNextCloseAndOpen (ClockTick_t start) const |
Returns the first closing and reopening above threshold from start on. More... | |
Private Attributes | |
Gate_t const & | gateSrc |
Config_t | config |
GateData_t const & | gate |
ClockTick_t | nextStart = MinTick |
Static Private Attributes | |
static constexpr ClockTick_t | MinTick = GateData_t::MinTick |
static constexpr ClockTick_t | MaxTick = GateData_t::MaxTick |
Helper to extract OpeningInfo_t
from a trigger gate.
Example of usage:
fills triggerInfo
with all the openings equal or above level 6U
. Each opening is defined as from when gate
reaches a specified threshold ("opening threshold") to when it reaches or goes below another one ("closing
threshold"), with no dead time afterward. The time of the opening is the time when threshold is passed, but the reported level is the maximum in the opening range. By default, the closing threshold is one less than the opening one (i.e. as soon as the level goes below the opening threshold, the gate closes).
This algorithm will not work in multi-threading.
Definition at line 30 of file TriggerInfo_t.h.
using icarus::trigger::details::GateOpeningInfoExtractor< Gate >::ClockTick_t = typename GateData_t::ClockTick_t |
Definition at line 242 of file TriggerInfo_t.h.
|
private |
Definition at line 238 of file TriggerInfo_t.h.
|
private |
Definition at line 239 of file TriggerInfo_t.h.
using icarus::trigger::details::GateOpeningInfoExtractor< Gate >::LocationID_t = icarus::trigger::details::TriggerInfo_t::LocationID_t |
Definition at line 245 of file TriggerInfo_t.h.
using icarus::trigger::details::GateOpeningInfoExtractor< Gate >::OpeningCount_t = icarus::trigger::details::TriggerInfo_t::Opening_t |
Definition at line 243 of file TriggerInfo_t.h.
using icarus::trigger::details::GateOpeningInfoExtractor< Gate >::OpeningInfo_t = icarus::trigger::details::TriggerInfo_t::OpeningInfo_t |
Definition at line 244 of file TriggerInfo_t.h.
|
inline |
Constructor: uses default configuration.
gate | the gate to operate on |
config | configuration of the algorithm |
configure()
Definition at line 280 of file TriggerInfo_t.h.
|
inline |
Constructor: sets all configuration parameters.
gate | the gate to operate on |
config | configuration of the algorithm (see configure() ) |
Definition at line 289 of file TriggerInfo_t.h.
|
inline |
Constructor: sets all configuration parameters.
gate | the gate to operate on |
threshold | both opening and closing threshold |
configure()
Definition at line 299 of file TriggerInfo_t.h.
|
inline |
Definition at line 324 of file TriggerInfo_t.h.
|
inline |
Definition at line 339 of file TriggerInfo_t.h.
|
inline |
Definition at line 336 of file TriggerInfo_t.h.
|
inline |
Sets the configuration.
Constructor: sets all configuration parameters.
gate | the gate to operate on |
config | configuration of the algorithm |
The configuration includes:
openThreshold
, closeThreshold
: the opening and closing thresholdsminWidth
: minimum width of each opening rangeminGap
: minimum gap between successive opening rangeslocation
: location ID to add to the produced OpeningInfo_t
records Definition at line 315 of file TriggerInfo_t.h.
|
inlineprivate |
Definition at line 368 of file TriggerInfo_t.h.
|
private |
Returns the first closing and reopening above threshold from start
on.
Definition at line 445 of file TriggerInfo_t.h.
auto icarus::trigger::details::GateOpeningInfoExtractor< Gate >::findNextOpening | ( | ) |
Definition at line 417 of file TriggerInfo_t.h.
|
inlineprivate |
Definition at line 366 of file TriggerInfo_t.h.
|
inline |
Definition at line 342 of file TriggerInfo_t.h.
|
inline |
Definition at line 340 of file TriggerInfo_t.h.
|
inline |
Definition at line 341 of file TriggerInfo_t.h.
|
inline |
Definition at line 338 of file TriggerInfo_t.h.
|
inline |
Definition at line 325 of file TriggerInfo_t.h.
|
inline |
Definition at line 326 of file TriggerInfo_t.h.
|
inline |
The returned gate is at least minWidth
ticks wide.
Definition at line 319 of file TriggerInfo_t.h.
|
inline |
Resets the search from the specified time tick (beginning by default).
Definition at line 329 of file TriggerInfo_t.h.
|
inline |
Definition at line 344 of file TriggerInfo_t.h.
|
private |
Definition at line 357 of file TriggerInfo_t.h.
|
private |
Definition at line 361 of file TriggerInfo_t.h.
|
private |
Definition at line 356 of file TriggerInfo_t.h.
|
staticprivate |
Definition at line 352 of file TriggerInfo_t.h.
|
staticprivate |
Definition at line 351 of file TriggerInfo_t.h.
|
private |
Definition at line 363 of file TriggerInfo_t.h.