Combines trigger channels (V1730 LVDS gates) into sliding windows. More...
Classes | |
struct | Config |
Public Types | |
using | Parameters = art::EDProducer::Table< Config > |
Public Member Functions | |
SlidingWindowTrigger (Parameters const &config) | |
SlidingWindowTrigger (SlidingWindowTrigger const &)=delete | |
SlidingWindowTrigger (SlidingWindowTrigger &&)=delete | |
SlidingWindowTrigger & | operator= (SlidingWindowTrigger const &)=delete |
SlidingWindowTrigger & | operator= (SlidingWindowTrigger &&)=delete |
virtual void | produce (art::Event &event) override |
Fills the plots. Also extracts the information to fill them with. More... | |
Private Types | |
using | WindowDefs_t = icarus::trigger::TriggerWindowDefs_t |
Definition of all windows. More... | |
using | TriggerGateData_t = icarus::trigger::OpticalTriggerGate::GateData_t |
using | TrackedTriggerGate_t = icarus::trigger::TrackedOpticalTriggerGate< sbn::OpDetWaveformMeta > |
Reconstituted trigger gate type internally used. More... | |
Private Member Functions | |
unsigned int | nDisabledWindows () const noexcept |
Returns the number of disabled windows. More... | |
void | produceThreshold (art::Event &event, icarus::trigger::OpDetWaveformMetaDataProductMap_t &waveformMap, std::string const &threshold, art::InputTag const &dataTag) const |
Performs the combination for data with a specified threshold. More... | |
std::vector < icarus::trigger::TrackedOpticalTriggerGate < sbn::OpDetWaveformMeta > > | ReadTriggerGates (art::Event const &event, art::InputTag const &dataTag, icarus::trigger::OpDetWaveformMetaDataProductMap_t &waveformMap) const |
Reads a set of input gates from the event and updates waveformMap . More... | |
WindowDefs_t | defineWindows () const |
Defines the channels falling in each window. More... | |
Static Private Member Functions | |
static std::vector< std::size_t > | makeEnabledWindowIndices (std::size_t nWindows, fhicl::OptionalSequence< std::size_t > const &enabled, fhicl::OptionalSequence< std::size_t > const &disabled) |
Returns a list of enabled window indices. More... | |
static void | UpdateWaveformMap (icarus::trigger::OpDetWaveformMetaDataProductMap_t &map, art::Assns< TriggerGateData_t, sbn::OpDetWaveformMeta > const &assns) |
Adds the waveforms in the specified association to the waveform map . More... | |
Private Attributes | |
std::map< std::string, art::InputTag > | fADCthresholds |
ADC thresholds to read, and the input tag connected to their data. More... | |
unsigned int const | fWindowSize |
Sliding window size in number of channels. More... | |
unsigned int const | fWindowStride |
Sliding window base offset. More... | |
WindowDefs_t const | fWindowChannels |
Channel content of each window. More... | |
std::vector< std::size_t > const | fEnabledWindows |
List of windows to be included. More... | |
bool | fProduceWaveformAssns |
Whether to produce gate/waveform associations. More... | |
std::string const | fLogCategory |
Message facility stream category for output. More... | |
icarus::trigger::SlidingWindowCombinerAlg const | fCombiner |
Combining algorithm. More... | |
Combines trigger channels (V1730 LVDS gates) into sliding windows.
This module combines the input discriminated waveforms into a set of new multi-level discriminated gates according to the geometric criterion of a sliding window.
The combination is a sum of all the discriminated waveforms within the window. Different optical detector planes are treated independently and separately. It is expected that the input is from V1730 LVDS gates (see icarus::trigger::LVDSgates
module) which combine (usually) two optical detector channels each.
The size of the window is specified in terms on number of optical detector channels per window and of stride. The windows are allowed to overlap, but they have all the same number of channels. If the parameters yield an invalid configuration, the module will throw an exception.
The definition of a valid window configuration is quite restrictive. Optical detector channels are grouped by the TPC width coordinate (z) into "towers". In ICARUS, a tower is made of either two or three channels, depending on the position in z. A window can't split a tower, but rather has to include whole towers. In addition, the input discriminated waveforms may include information from multiple channels (that is the common case if the input is LVDS gates). A window can't cover only part of the channels of any input, but rather must extend wide enough so that all the channels in the included gates are covered. Channels may be exempted by marking them as "missing". Finally, all the channels which are not "missing" must be covered by at least one window.
For the sliding window configuration to be valid, all the windows starting with an offset multiple of the stride must be valid.
For the standard pairing of LVDS gates in ICARUS, this translates into the only allowed window sizes are by 10 and 15 channels or their multiples, with a stride also in multiples of 10 or 15 respectively. For example, the following configurations are all valid:
std::vector<icarus::trigger::OpticalTriggerGateData_t>
(labels out of TriggerGatesTag
and Thresholds
): full sets of discriminated waveforms, each waveform possibly covering multiple optical channels, and their associations to waveform metadata (sbn::OpDetWaveformMeta
). One set per threshold.The algorithms require that in each set all optical channels are covered.
std::vector<icarus::trigger::OpticalTriggerGateData_t>
(instance name: same as the input gates): sets of gates combined according to the window configuration; one set per input threshold.art::Assns<icarus::trigger::OpticalTriggerGateData_t, sbn::OpDetWaveformMeta>
(instance name: same as the input gates): associations between each produced gate and the metadata of optical waveforms providing the original data.art::Assns<icarus::trigger::OpticalTriggerGateData_t, raw::OpDetWaveform>
(instance name: same as the input gates): associations between each produced gate and the optical waveforms providing the original data. It is produced only if ProduceWaveformAssns
configuration parameter is true
, and it relies on the assumption that there is an association available between each sbn::OpDetWaveformMeta
and its raw::OpDetWaveform
, produced by the same module (i.e. with the same input tag) as the one of the original sbn::OpDetWaveformMeta
data product itself.If window selection is requested (with EnableOnlyWindows
or DisableWindows
configuration parameters), only the selected windows will have an output entry. While each trigger data object comes with all the channels it covers, there is no explicit information of the index of the surviving windows.
art::Assns
would not support it, requiring distinct types for the associated objects.A terse description of the parameters is printed by running lar --print-description SlidingWindowTrigger
.
TriggerGatesTag
(string, mandatory): name of the module instance which produced the discriminated waveforms; it must not include any instance name, as the instance names will be automatically added from Thresholds
parameter.Thresholds
(list of strings, mandatory): list of the discrimination thresholds to consider. A data product containing a digital signal is read for each one of the thresholds, and the tag of the data product is expected to be the module label TriggerGatesTag
with as instance name the value of the entry in this list. While it is common for this entry to be the actual threshold value in ADC (e.g. "400"
), this is not required.WindowSize
(integral, mandatory): the number of optical detector channels that every window must include. Note that this is not equivalent to the number of input objects from the TriggerGatesTag
data products: for example, in the standard ICARUS configuration, a window spanning 15 channels is generated out of only 8 LVDS input gates.Stride
(integral, default: as WindowSize
): the base offset, in number of optical detector channels, where to start a new window. Windows are started at all multiples of Stride
. For example, windows of 30 channels with Stride
15 will start after 0, 15, 30, 45 and 60 channels on each optical detector plane.EnableOnlyWindows
(list of integers, default: omitted): if specified, only the windows with index in this list will be processed and output; mutually exclusive with DisableWindows
.DisableWindows
(list of integers, default: omitted): if specified, the windows with index in this list will be excluded from processing and from output; mutually exclusive with EnableOnlyWindows
.MissingChannels
(list of integers, default: empty): the channels whose ID is included in this list are expected and required not to be present in the input (i.e. no input gate should include them).ProduceWaveformAssns
(flag, default: true
): produce also associations between each gate and the raw::OpDetWaveform
which contributed to it.LogCategory
(string): name of the output stream category for console messages (managed by MessageFacility library).Note: when using EnableOnlyWindows
or DisableWindows
it may be useful to check the output of the module (at construction) to verify that the selected indices match the intended windows.
Definition at line 213 of file SlidingWindowTrigger_module.cc.
using icarus::trigger::SlidingWindowTrigger::Parameters = art::EDProducer::Table<Config> |
Definition at line 280 of file SlidingWindowTrigger_module.cc.
|
private |
Reconstituted trigger gate type internally used.
Definition at line 313 of file SlidingWindowTrigger_module.cc.
|
private |
Definition at line 309 of file SlidingWindowTrigger_module.cc.
|
private |
Definition of all windows.
Definition at line 307 of file SlidingWindowTrigger_module.cc.
|
explicit |
Definition at line 403 of file SlidingWindowTrigger_module.cc.
|
delete |
|
delete |
|
private |
Defines the channels falling in each window.
Definition at line 499 of file SlidingWindowTrigger_module.cc.
|
staticprivate |
Returns a list of enabled window indices.
Definition at line 588 of file SlidingWindowTrigger_module.cc.
|
inlineprivatenoexcept |
Returns the number of disabled windows.
Definition at line 342 of file SlidingWindowTrigger_module.cc.
|
delete |
|
delete |
|
overridevirtual |
Fills the plots. Also extracts the information to fill them with.
Definition at line 485 of file SlidingWindowTrigger_module.cc.
|
private |
Performs the combination for data with a specified threshold.
Definition at line 515 of file SlidingWindowTrigger_module.cc.
|
private |
Reads a set of input gates from the event
and updates waveformMap
.
Definition at line 628 of file SlidingWindowTrigger_module.cc.
|
staticprivate |
Adds the waveforms in the specified association to the waveform map
.
Definition at line 616 of file SlidingWindowTrigger_module.cc.
|
private |
ADC thresholds to read, and the input tag connected to their data.
Definition at line 318 of file SlidingWindowTrigger_module.cc.
|
private |
Combining algorithm.
Definition at line 338 of file SlidingWindowTrigger_module.cc.
|
private |
List of windows to be included.
Definition at line 327 of file SlidingWindowTrigger_module.cc.
|
private |
Message facility stream category for output.
Definition at line 333 of file SlidingWindowTrigger_module.cc.
|
private |
Whether to produce gate/waveform associations.
Definition at line 330 of file SlidingWindowTrigger_module.cc.
|
private |
Channel content of each window.
Definition at line 324 of file SlidingWindowTrigger_module.cc.
|
private |
Sliding window size in number of channels.
Definition at line 320 of file SlidingWindowTrigger_module.cc.
|
private |
Sliding window base offset.
Definition at line 321 of file SlidingWindowTrigger_module.cc.