Combines discriminated PMT outputs into V1730 LVDS gates. More...
Classes | |
struct | Config |
struct | SourceInfo_t |
Information for each source. More... | |
Public Types | |
enum | ComboMode { ComboMode::disable, ComboMode::Input1, ComboMode::Input2, ComboMode::AND, ComboMode::OR } |
Available operations for the combination of channels. More... | |
using | TriggerGateData_t = icarus::trigger::OpticalTriggerGate::GateData_t |
using | Parameters = art::EDProducer::Table< Config > |
Public Member Functions | |
LVDSgates (Parameters const &config) | |
LVDSgates (LVDSgates const &)=delete | |
LVDSgates (LVDSgates &&)=delete | |
LVDSgates & | operator= (LVDSgates const &)=delete |
LVDSgates & | operator= (LVDSgates &&)=delete |
virtual void | produce (art::Event &event) override |
Fills the plots. Also extracts the information to fill them with. More... | |
template<typename Op > | |
auto | binaryCombineChannel (std::vector< TrackedTriggerGate_t > const &gates, std::vector< raw::Channel_t > const &pairing, Op combine) const -> TrackedTriggerGate_t |
Private Types | |
using | BinaryCombinationFunc_t = OpticalTriggerGate &(OpticalTriggerGate::*)(OpticalTriggerGate const &) |
Type of member function to combine the current gate with another one. More... | |
using | TrackedTriggerGate_t = icarus::trigger::TrackedOpticalTriggerGate< sbn::OpDetWaveformMeta > |
Reconstituted trigger gate type internally used. More... | |
Private Member Functions | |
void | produceThreshold (art::Event &event, icarus::trigger::OpDetWaveformMetaDataProductMap_t &waveformMap, std::string const &thresholdStr, SourceInfo_t const &srcInfo) const |
Completely processes the data for the specified threshold. More... | |
std::vector< std::vector < raw::Channel_t > > | removeChannels (std::vector< std::vector< raw::Channel_t >> channelPairing, std::vector< raw::Channel_t > const &ignoreChannels) const |
Removes all the channel in ignoreChannels from channelPairing . More... | |
TrackedTriggerGate_t | discardChannels (std::vector< TrackedTriggerGate_t > const &, std::vector< raw::Channel_t > const &pairing) const |
Combination function for the disable mode. More... | |
TrackedTriggerGate_t | selectChannel (std::vector< TrackedTriggerGate_t > const &, std::vector< raw::Channel_t > const &pairing, std::size_t chosenIndex) const |
Combination function for the input1 and input2 modes. More... | |
template<typename Op > | |
TrackedTriggerGate_t | binaryCombineChannel (std::vector< TrackedTriggerGate_t > const &gates, std::vector< raw::Channel_t > const &pairing, Op combine) const |
Combination function for the AND and OR modes; op is from GateOps . More... | |
TrackedTriggerGate_t | combineChannels (std::vector< TrackedTriggerGate_t > const &gates, std::vector< raw::Channel_t > const &pairing, ComboMode comboMode) const |
Performs the combination of a group of channels. More... | |
unsigned int | checkPairings () const |
void | checkInput (std::vector< TrackedTriggerGate_t > const &gates) const |
Input requirement check. Throws if requirements fail. More... | |
Static Private Member Functions | |
static void | UpdateWaveformMap (icarus::trigger::OpDetWaveformMetaDataProductMap_t &map, art::Assns< TriggerGateData_t, sbn::OpDetWaveformMeta > const &assns) |
Adds the associated waveforms into the map. More... | |
static std::vector < TrackedTriggerGate_t > | ReadTriggerGates (art::Event const &event, art::InputTag const &dataTag, icarus::trigger::OpDetWaveformMetaDataProductMap_t &waveformMap) |
Assembles trigger gates from dataTag data products in event . More... | |
static art::InputTag | makeTag (std::string const &thresholdStr, std::string const &defModule) |
Converts a threshold string into an input tag. More... | |
static std::string | makeOutputInstanceName (art::InputTag const &inputTag, std::string const &defModule) |
Converts an input tag into an instance name for the corresponding output. More... | |
Private Attributes | |
std::map< std::string, SourceInfo_t > | fADCthresholds |
ADC thresholds to read, and the input tag connected to their data. More... | |
std::vector< std::vector < raw::Channel_t > > | fChannelPairing |
Pairing of optical detector channels. More... | |
ComboMode | fComboMode |
The operation used to combinate channels. More... | |
std::vector< raw::Channel_t > | fIgnoreChannels |
bool | fProduceWaveformAssns |
Whether to produce gate/waveform associations. More... | |
std::string | fLogCategory |
Message facility stream category for output. More... | |
Combines discriminated PMT outputs into V1730 LVDS gates.
This module simulates the combination of discriminated PMT outputs by the V1730 board LVDS output.
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 optical waveform metadata. One set per threshold.The algorithms require that the list of discriminated waveforms has in each position the waveform from the optical detector channel number matching the position (e.g. entry 0
will be the discriminated waveform from channel 0, and so forth). No gaps are allowed: if no signal is present above threshold for a certain channel, a discriminated waveform should appear for that channel, with a gate always closed.
std::vector<icarus::trigger::OpticalTriggerGateData_t>
(instance name: concatenation of input module label and instance name of the input gates; the former is omitted if it is TriggerGatesTag
): sets of gates combined according to the configuration; one set per input threshold.art::Assns<icarus::trigger::OpticalTriggerGateData_t, sbn::OpDetWaveformMeta>
(instance name: same as above): associations between each produced gate and the metadata of the optical waveforms providing the original data.art::Assns<icarus::trigger::OpticalTriggerGateData_t, raw::OpDetWaveform>
(instance name: same as above; optional): 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.A terse description of the parameters is printed by running lar --print-description LVDSgates
.
TriggerGatesTag
(string, default: discrimopdaq
): 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. This value is used as module name for all thresholds which do not specify one.Thresholds
(list of tags, mandatory): list of the discrimination thresholds to consider. A data product containing a digital signal is read for each one of the thresholds; each threshold entry is expected to be a input tag in the form "[ModuleLabel:]InstanceName"
, and if the module label part is not specified, the one from TriggerGatesTag
is used as default. In this way, thresholds can be specified simply by a number, e.g. [ 200, 400, 600 ]
, which will be translated into e.g. "discrimopdaq:200"
, "discrimopdaq:400"
and "discrimopdaq:600"
, while a full specification can be also used: [ 200, "discrim:config" ]
will turn into "discrimopdaq:200"
and "discrim:config"
(to specify a label with no instance name, set it ending with a colon, like in "discrim:"
).ChannelPairing
(list of integral number lists): channels to combine; each element of this list is itself a list of optical detector channel numbers. The channels within each group are combined according to CombinationMode
, resulting in a single combined gate associated to all the channels in the group. All optical detector channels must appear in the configuration, and each channel can be combined only in one group. Groups must not be empty.IgnoreChannels
(list of integral numbers, optional): ID of the optical detector channels to skip.CombinationMode
(either: "disable"
, "input1"
, "input2"
, "AND"
or "OR"
): for each group of channels defined in ChannelPairing
, the selected operation is used to combine all the channels in the group:disable
: all channels are discarded, and the resulting gates are all closed all the way;input1
: the first channel in the pairing is kept, and the others are discarded;input2
: the second channel in the pairing is kept, and the others are discarded;AND
: all channels are combined in a AND, resulting in a gate open only at the time when all the channel gates in the group are open; if there is a single channel in the group, the combined gate is a copy of it;OR
: all channels are combined in a OR, resulting in a gate open at every time when any of the channel gates in the group is open; if there is a single channel in the group, the combined gate is a copy of it. All pairings undergo the same operation (it is not possible, for example, disabling only one group of channels and combining the other groups with a AND
).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). Definition at line 166 of file LVDSgates_module.cc.
|
private |
Type of member function to combine the current gate with another one.
Definition at line 277 of file LVDSgates_module.cc.
using icarus::trigger::LVDSgates::Parameters = art::EDProducer::Table<Config> |
Definition at line 248 of file LVDSgates_module.cc.
|
private |
Reconstituted trigger gate type internally used.
Definition at line 281 of file LVDSgates_module.cc.
using icarus::trigger::LVDSgates::TriggerGateData_t = icarus::trigger::OpticalTriggerGate::GateData_t |
Definition at line 170 of file LVDSgates_module.cc.
|
strong |
Available operations for the combination of channels.
Enumerator | |
---|---|
disable | |
Input1 | |
Input2 | |
AND | |
OR |
Definition at line 173 of file LVDSgates_module.cc.
|
explicit |
Definition at line 399 of file LVDSgates_module.cc.
|
delete |
|
delete |
|
private |
Combination function for the AND
and OR
modes; op
is from GateOps
.
auto icarus::trigger::LVDSgates::binaryCombineChannel | ( | std::vector< TrackedTriggerGate_t > const & | gates, |
std::vector< raw::Channel_t > const & | pairing, | ||
Op | combine | ||
) | const -> TrackedTriggerGate_t |
Definition at line 645 of file LVDSgates_module.cc.
|
private |
Input requirement check. Throws if requirements fail.
Definition at line 781 of file LVDSgates_module.cc.
|
private |
Checks the pairing configuration, throws on error. Returns the number of configured channels.
Definition at line 691 of file LVDSgates_module.cc.
|
private |
Performs the combination of a group of channels.
Definition at line 565 of file LVDSgates_module.cc.
|
private |
Combination function for the disable
mode.
Definition at line 614 of file LVDSgates_module.cc.
|
staticprivate |
Converts an input tag into an instance name for the corresponding output.
Definition at line 878 of file LVDSgates_module.cc.
|
staticprivate |
|
overridevirtual |
Fills the plots. Also extracts the information to fill them with.
Definition at line 469 of file LVDSgates_module.cc.
|
private |
Completely processes the data for the specified threshold.
Definition at line 485 of file LVDSgates_module.cc.
|
staticprivate |
Assembles trigger gates from dataTag
data products in event
.
Definition at line 841 of file LVDSgates_module.cc.
|
private |
Removes all the channel in ignoreChannels
from channelPairing
.
channelPairing
with no element from ignoreChannels
Channel lists in the returned list may become empty.
Definition at line 593 of file LVDSgates_module.cc.
|
private |
Combination function for the input1
and input2
modes.
Definition at line 626 of file LVDSgates_module.cc.
|
staticprivate |
Adds the associated waveforms into the map.
Definition at line 829 of file LVDSgates_module.cc.
|
private |
ADC thresholds to read, and the input tag connected to their data.
Definition at line 293 of file LVDSgates_module.cc.
|
private |
Pairing of optical detector channels.
Definition at line 296 of file LVDSgates_module.cc.
|
private |
The operation used to combinate channels.
Definition at line 297 of file LVDSgates_module.cc.
|
private |
Definition at line 299 of file LVDSgates_module.cc.
|
private |
Message facility stream category for output.
Definition at line 304 of file LVDSgates_module.cc.
|
private |
Whether to produce gate/waveform associations.
Definition at line 302 of file LVDSgates_module.cc.