Applies sliding window patterns to discriminated waveforms. More...
#include <SlidingWindowPatternAlg.h>
Classes | |
struct | AllTriggerInfo_t |
Complete information from this algorithm, standard + non-standard (extra). More... | |
struct | MoreInfo_t |
Additional information on the trigger. More... | |
struct | WindowTriggerInfo_t |
Data structure to communicate internally a trigger response. More... | |
Public Types | |
using | TriggerInfo_t = icarus::trigger::details::TriggerInfo_t |
Record of the trigger response. More... | |
using | InputTriggerGate_t = icarus::trigger::TrackedOpticalTriggerGate< sbn::OpDetWaveformMeta > |
Type of trigger gate provided as input. More... | |
using | TriggerGates_t = std::vector< InputTriggerGate_t > |
A list of trigger gates from input. More... | |
using | TriggerGateData_t = icarus::trigger::OpticalTriggerGateData_t |
Type of gate data without channel information (gate levels only). More... | |
using | WindowTopology_t = icarus::trigger::WindowChannelMap |
Type holding information about composition and topology of all windows. More... | |
using | WindowPattern_t = icarus::trigger::WindowPattern |
Type representing the requirement pattern for a window. More... | |
Public Member Functions | |
SlidingWindowPatternAlg (WindowTopology_t windowTopology, WindowPattern_t windowPattern, icarus::trigger::ApplyBeamGateClass beamGate, std::string const &logCategory="SlidingWindowPatternAlg") | |
Constructor: configures window topology and times. More... | |
SlidingWindowPatternAlg (WindowTopology_t windowTopology, WindowPattern_t windowPattern, std::string const &logCategory="SlidingWindowPatternAlg") | |
Constructor: configures window topology and times. More... | |
AllTriggerInfo_t | simulateResponse (TriggerGates_t const &gates) const |
Returns the trigger response from the specified gates . More... | |
TriggerGates_t | applyBeamGate (TriggerGates_t const &gates) const |
Returns a new collection of gates, set each in coincidence with beam gate. More... | |
bool | hasBeamGate () const |
Returns whether a beam gate is being applied. More... | |
void | setBeamGate (icarus::trigger::ApplyBeamGateClass beamGate) |
Changes the beam gate to the specified value. More... | |
void | clearBeamGate () |
Do not apply any beam gate. More... | |
TriggerInfo_t | applyWindowPattern (WindowTopology_t::WindowInfo_t const &windowInfo, WindowPattern_t const &pattern, TriggerGates_t const &gates) const |
Returns the trigger response for the specified window pattern. More... | |
Public Member Functions inherited from icarus::ns::util::mfLoggingClass | |
mfLoggingClass (std::string const &logCategory) | |
Constructor: initializes with the specified log category. More... | |
std::string | logCategory () const |
Returns the logging category string for this object. More... | |
mfLoggingClass const & | loggingClass () const |
Returns this object (as a logging class object). More... | |
mf::LogError | mfLogError (std::string const &file={}, int const lineNumber=0) const |
Returns a mf::LogError() stream for logging. More... | |
mf::LogWarning | mfLogWarning (std::string const &file={}, int const lineNumber=0) const |
Returns a mf::LogWarning() stream for logging. More... | |
mf::LogProblem | mfLogProblem (std::string const &file={}, int const lineNumber=0) const |
Returns a mf::LogProblem() stream for logging. More... | |
mf::LogInfo | mfLogInfo (std::string const &file={}, int const lineNumber=0) const |
Returns a mf::LogInfo() stream for logging. More... | |
mf::LogVerbatim | mfLogVerbatim (std::string const &file={}, int const lineNumber=0) const |
Returns a mf::LogVerbatim() stream for logging. More... | |
mf::LogDebug | mfLogDebug (std::string const &file={}, int const lineNumber=0) const |
Returns a mf::LogDebug() stream for logging. More... | |
mf::LogTrace | mfLogTrace (std::string const &file={}, int const lineNumber=0) const |
Returns a mf::LogTrace() stream for logging. More... | |
Private Member Functions | |
TriggerInfo_t | applyWindowPattern (WindowPattern_t const &pattern, std::size_t iWindow, TriggerGates_t const &gates) const |
Returns the trigger response for the specified window pattern. More... | |
void | verifyInputTopology (TriggerGates_t const &gates) const |
Checks gates are compatible with the current window configuration. More... | |
Private Attributes | |
WindowTopology_t const | fWindowTopology |
Definition of the neighborhood of each window in terms of window indices. More... | |
WindowPattern_t const | fWindowPattern |
Requirement pattern to be applied to each window. More... | |
std::optional < icarus::trigger::ApplyBeamGateClass const > | fBeamGate |
Time interval when to evaluate the trigger. More... | |
Applies sliding window patterns to discriminated waveforms.
This algorithm takes as input one trigger gate for each window. Each window is identified by an index, and the input gates are assigned one per window, in order.
The window mapping that defines the topology of the windows is passed to the algorithm.
If a beam gate is present, it is applied to all input before simulating the pattern. Otherwise, the full input is used.
For the definition of the windows, see icarus::trigger::WindowChannelMap
.
Definition at line 51 of file SlidingWindowPatternAlg.h.
using icarus::trigger::SlidingWindowPatternAlg::InputTriggerGate_t = icarus::trigger::TrackedOpticalTriggerGate<sbn::OpDetWaveformMeta> |
Type of trigger gate provided as input.
Definition at line 62 of file SlidingWindowPatternAlg.h.
using icarus::trigger::SlidingWindowPatternAlg::TriggerGateData_t = icarus::trigger::OpticalTriggerGateData_t |
Type of gate data without channel information (gate levels only).
Definition at line 68 of file SlidingWindowPatternAlg.h.
using icarus::trigger::SlidingWindowPatternAlg::TriggerGates_t = std::vector<InputTriggerGate_t> |
A list of trigger gates from input.
Definition at line 65 of file SlidingWindowPatternAlg.h.
using icarus::trigger::SlidingWindowPatternAlg::TriggerInfo_t = icarus::trigger::details::TriggerInfo_t |
Record of the trigger response.
Definition at line 58 of file SlidingWindowPatternAlg.h.
Type representing the requirement pattern for a window.
Definition at line 74 of file SlidingWindowPatternAlg.h.
using icarus::trigger::SlidingWindowPatternAlg::WindowTopology_t = icarus::trigger::WindowChannelMap |
Type holding information about composition and topology of all windows.
Definition at line 71 of file SlidingWindowPatternAlg.h.
icarus::trigger::SlidingWindowPatternAlg::SlidingWindowPatternAlg | ( | WindowTopology_t | windowTopology, |
WindowPattern_t | windowPattern, | ||
icarus::trigger::ApplyBeamGateClass | beamGate, | ||
std::string const & | logCategory = "SlidingWindowPatternAlg" |
||
) |
Constructor: configures window topology and times.
windowTopology | full composition and topology description of windows |
windowPattern | the pattern that this algorithm applies |
beamGate | object applying the beam gate to trigger gates |
logCategory | category tag for algorithm messages on screen |
Window topology can be computed with icarus::trigger::WindowTopologyAlg
starting from a (complete) set of trigger gates.
A beam gate application class can be constructed via icarus::trigger::makeApplyBeamGate()
helper function.
Definition at line 34 of file SlidingWindowPatternAlg.cxx.
icarus::trigger::SlidingWindowPatternAlg::SlidingWindowPatternAlg | ( | WindowTopology_t | windowTopology, |
WindowPattern_t | windowPattern, | ||
std::string const & | logCategory = "SlidingWindowPatternAlg" |
||
) |
Constructor: configures window topology and times.
windowTopology | full composition and topology description of windows |
windowPattern | the pattern that this algorithm applies |
logCategory | category tag for algorithm messages on screen |
Window topology can be computed with icarus::trigger::WindowTopologyAlg
starting from a (complete) set of trigger gates.
The beam gate is set to be empty; it must be set before simulating the response (simulateResponse()
) via setBeamGate()
.
Definition at line 48 of file SlidingWindowPatternAlg.cxx.
TriggerGates_t icarus::trigger::SlidingWindowPatternAlg::applyBeamGate | ( | TriggerGates_t const & | gates | ) | const |
Returns a new collection of gates, set each in coincidence with beam gate.
auto icarus::trigger::SlidingWindowPatternAlg::applyWindowPattern | ( | WindowTopology_t::WindowInfo_t const & | windowInfo, |
WindowPattern_t const & | pattern, | ||
TriggerGates_t const & | gates | ||
) | const |
Returns the trigger response for the specified window pattern.
windowInfo | the topology of the windows |
pattern | the trigger requirement pattern |
gates | trigger gates, one per window |
TriggerInfo_t
record with the response of the patternThe input gates
represent all the trigger gates relevant to the trigger determination, in a list by window index: the first gate belongs to the window 0
, the second one to the window 1
and so on. The topology windowInfo
identifies a window and its topology, i.e. its neighbours, by window index. It is required and assumed that the values of the window indices match the ones in the gates
list. This function applies the requirements in the specified pattern
to the window identified by windowInfo
, using the actual trigger gates from the gates
list as needed.
The return value includes the first tick at which the requirements have been all met. Note that if a beam gate needs to be applied, it should be applies to all gates
before calling this function (see e.g. applyBeamGate()
).
Definition at line 205 of file SlidingWindowPatternAlg.cxx.
|
private |
Returns the trigger response for the specified window pattern.
pattern | the trigger requirement pattern |
iWindow | index of the window to be tested |
gates | trigger gates, one per window |
TriggerInfo_t
record with the response of the pattern applyWindowPattern(WindowChannelMap::WindowInfo const&, WindowPattern_t const&, TriggerGates_t const&)
Applies the specified pattern
to the window with index iWindow
of the configured window topology.
See the static version of applyWindowPattern()
for details.
Definition at line 328 of file SlidingWindowPatternAlg.cxx.
void icarus::trigger::SlidingWindowPatternAlg::clearBeamGate | ( | ) |
Do not apply any beam gate.
Definition at line 133 of file SlidingWindowPatternAlg.cxx.
bool icarus::trigger::SlidingWindowPatternAlg::hasBeamGate | ( | ) | const |
Returns whether a beam gate is being applied.
Definition at line 122 of file SlidingWindowPatternAlg.cxx.
void icarus::trigger::SlidingWindowPatternAlg::setBeamGate | ( | icarus::trigger::ApplyBeamGateClass | beamGate | ) |
Changes the beam gate to the specified value.
Definition at line 128 of file SlidingWindowPatternAlg.cxx.
auto icarus::trigger::SlidingWindowPatternAlg::simulateResponse | ( | TriggerGates_t const & | gates | ) | const |
Returns the trigger response from the specified gates
.
gates | the trigger gates to be used as input, one per window |
applyWindowPattern(WindowChannelMap::WindowInfo const&, WindowPattern_t const&, TriggerGates_t const&)
The return value comprises a "standard" TriggerInfo_t
object, which stores whether the pattern fired and when, and some extra
information, including which window made the trigger fire first (in case of ties, the window with the smallest index is reported).
The list gates
must contain a single trigger gate for each window, with the gate index in the list matching the window index in the configured window topology.
See the static version of applyWindowPattern()
for more details.
Definition at line 61 of file SlidingWindowPatternAlg.cxx.
|
private |
Checks gates
are compatible with the current window configuration.
gates | the combined sliding window trigger gates, per cryostat |
cet::exception | (category: SlidingWindowTriggerEfficiencyPlots ) or derived, if an incompatibility is found |
The method verifies that the current channel mapping is compatible with the gates.
This currently means that the gates
are in the expected order and have the expected channel content.
Definition at line 139 of file SlidingWindowPatternAlg.cxx.
|
private |
Time interval when to evaluate the trigger.
Definition at line 224 of file SlidingWindowPatternAlg.h.
|
private |
Requirement pattern to be applied to each window.
Definition at line 221 of file SlidingWindowPatternAlg.h.
|
private |
Definition of the neighborhood of each window in terms of window indices.
Definition at line 218 of file SlidingWindowPatternAlg.h.