Produces discriminated optical waveforms. More...
Classes | |
struct | ADCvalueSetting_t |
Information on the current setting of a threshold. More... | |
struct | ChannelConfig |
struct | ChannelInfo_t |
Collection of settings for one channel. More... | |
struct | Config |
Public Types | |
using | TriggerGateData_t = icarus::trigger::OpticalTriggerGate::GateData_t |
The type of data produced for a single channel. More... | |
using | Parameters = art::EDProducer::Table< Config > |
Public Member Functions | |
DiscriminatePMTwaveformsByChannel (Parameters const &config) | |
virtual void | beginRun (art::Run &run) override |
virtual void | produce (art::Event &event) override |
Creates the data products. More... | |
Private Types | |
enum | Source_t { Source_t::Default, Source_t::List, Source_t::Unset, Source_t::Run, Source_t::Event, Source_t::PMTconfig, Source_t::ChannelSpec } |
using | ADCCounts_t = icarus::trigger::ADCCounts_t |
Private Member Functions | |
void | refreshCurrentThresholds () |
Updates fCurrentThresholds with the current status of the object. More... | |
void | refreshCurrentBaselines () |
Updates fCurrentBaselines with the current status of the object. More... | |
template<typename Logger = mf::LogInfo> | |
void | printCurrentThresholdsAndBaselines () const |
Prints the current thresholds to the message logger. More... | |
Static Private Member Functions | |
static unsigned int | getNOpDetChannels (fhicl::OptionalAtom< unsigned int > const ¶m) |
Creates a collection with one gate per channel and no gaps. More... | |
static std::vector< ChannelInfo_t > | readChannelInfoSpecs (std::vector< ChannelInfo_t > const &config) |
Private Attributes | |
art::InputTag const | fOpDetWaveformTag |
Input optical waveform tag. More... | |
std::optional< art::InputTag > const | fBaselineTag |
std::optional< float > const | fBaseline |
A constant baseline level. More... | |
unsigned int const | fNOpDetChannels |
Number of optical detector channels. More... | |
std::optional < raw::ADC_Count_t > const | fDefaultThreshold |
Default threshold. More... | |
std::vector< raw::ADC_Count_t > const | fThresholdList |
The thresholds configured by a sequence parameter. More... | |
std::optional< art::InputTag > const | fThresholdsFromPMTconfig |
Tag of PMTconfiguration data product to read thresholds from. More... | |
std::vector< ChannelInfo_t > const | fChannelInfos |
A map of thresholds: channel ID -> relative threshold value [ADC]. More... | |
std::string const | fOutputInstanceName |
Instance name for output. More... | |
bool const | fSavePMTcoverage |
Whether to save also sbn::OpDetWaveformMeta . More... | |
std::string const | fLogCategory |
Category name for the console output stream. More... | |
std::optional < sbn::PMTconfiguration > | fPMTconfig |
PMT readout configuration for the current run. More... | |
std::vector < icarus::WaveformBaseline > | fBaselinesRun |
Current baseline list from run (one per channel). More... | |
std::vector< ADCvalueSetting_t > | fCurrentThresholds |
A map of current thresholds: channel ID -> relative threshold value [ADC]. More... | |
std::vector< ADCvalueSetting_t > | fCurrentBaselines |
A map of current baselines: channel ID -> baseline [ADC]. More... | |
std::unique_ptr < icarus::trigger::TriggerGateBuilder > | fTriggerGateBuilder |
Algorithms to simulate trigger gates out of optical channel output. More... | |
Produces discriminated optical waveforms.
This module produces a "discriminated waveform" for each optical detector channel and for a single set of discrimination thresholds. The thresholds are specified one per channel.
The output data products can be assigned an instance name (OutputInstanceName
configuration parameter) if desired. They are:
std::vector<icarus::trigger::OpticalTriggerGate::GateData_t>
, with one entry per optical channel, including all optical channels (even when no signal above threshold is ever present); each gate object has as index in the vector the number of the optical channel;art::Assns<icarus::trigger::OpticalTriggerGate::GateData_t, raw::OpDetWaveform>
; similarly, if SavePMTcoverage
parameter was set, also an association art::Assns<icarus::trigger::OpticalTriggerGate::GateData_t, sbn::OpDetWaveformMeta>
is produced.std::vector<sbn::OpDetWaveformMeta>
parallel to the input optical detector waveforms, if SavePMTcoverage
parameter is set; each entry in the collection is matched with the corresponding one in the input waveform collection; an association art::Assns<sbn::OpDetWaveformMeta, raw::OpDetWaveform>
is also produced.std::vector<raw::OpDetWaveform>
: a single waveform for each recorded optical detector activity; the activity belongs to a single channel, but there may be multiple waveforms on the same channel. The time stamp is expected to be from the electronics time scale and therefore expressed in microseconds.The following services are required:
detinfo::DetectorClocksService
There are several (too many?) ways to specify the discrimination thresholds. In the end, all PMT channels must be assigned a threshold: if at any time, on any event, a channel is found whose threshold was not set, an exception is thrown. All threshold specifications are relative to the baseline. There are currently four levels of threshold setting:
NChannels
(positive integer) and DefaultThreshold
(integral number) are both specified, the first NChannels
PMT channels are assigned the DefaultThreshold
; note that they both need to be specified at the same time, and when they are, channels with ID equal or larger than NChannels
are still not configured, i.e. they will not be assigned the DefaultThreshold
and if encountered an exception will be thrown;ThresholdList
(list of integers) will define a threshold for each channel starting with ID 0
on; thresholds already set with the previous step will be overridden;ThresholdsFromPMTconfig
(input tag) points to a data product with a PMT configuration (sbn::PMTconfiguration
) which contains information on each channel, including the thresholds; thresholds are set for each channel from the value returned by sbn::V1730channelConfiguration::relativeThreshold()
for that channel; only channel configuration entries that have a offline channel ID (sbn::V1730channelConfiguration::hasChannelID()
) are configured in this way; thresholds already set with the previous steps will be overridden; when using this parameter, NChannels
is also mandatory and channels with ID greater or equal than NChannels
will trigger an exception.Thresholds
(list of tables): in each entry, a threshold is specified for a single channel; the format of the entry is:Channel
(integral, mandatory): channel number;Threshold
(integral, mandatory): the threshold for that channel.All these are optional (but if the configuration has none, not much can be done since there will be no channel configured).
A terse description of the remaining parameters follows.
OpticalWaveforms
(input tag): the data product containing all optical detector waveforms.Baselines
(input tag): the data product containing one baseline per waveform in data product (from OpticalWaveforms
).NChannels
(integral): if specified, only channels with ID from 0
to NChannels - 1
are processed; waveforms from channels with higher ID will be ignored. If DefaultThreshold
or ThresholdsFromConfiguration
parameters are specified (see above), then NChannels
is mandatory; otherwise, its value is deduced from the highest channel configured with one of the other threshold parameters.TriggerGateBuilder
(tool configuration): template configuration of the art tool used to discriminate the optional waveforms; the tool interface is icarus::trigger::TriggerGateBuilder
. Note that the threshold settings of this configuration is going to be ignored.SavePMTcoverage
(flag, default: true
): also produces a collection of sbn::OpDetWaveformMeta
representing each of the input waveforms; trigger tools can use this information in place for the more space-hungry waveforms for further processing.OutputCategory
(string, default: "DiscriminatePMTwaveformsByChannel"
): label for the category of messages in the console output; this is the label that can be used for filtering messages via MessageFacility service. configuration. Definition at line 188 of file DiscriminatePMTwaveformsByChannel_module.cc.
|
private |
Definition at line 331 of file DiscriminatePMTwaveformsByChannel_module.cc.
using icarus::trigger::DiscriminatePMTwaveformsByChannel::Parameters = art::EDProducer::Table<Config> |
Definition at line 307 of file DiscriminatePMTwaveformsByChannel_module.cc.
using icarus::trigger::DiscriminatePMTwaveformsByChannel::TriggerGateData_t = icarus::trigger::OpticalTriggerGate::GateData_t |
The type of data produced for a single channel.
Definition at line 194 of file DiscriminatePMTwaveformsByChannel_module.cc.
|
strongprivate |
Enumerator | |
---|---|
Default | |
List | |
Unset | |
Run | |
Event | |
PMTconfig | |
ChannelSpec |
Definition at line 379 of file DiscriminatePMTwaveformsByChannel_module.cc.
|
explicit |
Definition at line 477 of file DiscriminatePMTwaveformsByChannel_module.cc.
|
overridevirtual |
Prepares the plots to be filled. Prepares the plots to be filled.
Definition at line 558 of file DiscriminatePMTwaveformsByChannel_module.cc.
|
staticprivate |
Creates a collection with one gate per channel and no gaps.
gates | the trigger gates to be put in the collection |
The returned collection includes one gate per channel, and at least fNOpDetChannels
channels (more if there are channels with higher number than that). For each channel, a gate is set in the item of the collection with index the channel ID (i.e. the first gate in the collection will be the one for channel 0
, the next the one for channel 1
and so on). It is assumed that there is only at most one gate per channel. The gates
specified in the argument are moved to the proper item in the returned collection. The other gates are assigned the proper channel number but are closed gates and associated with no waveform.Fetches the optical detector count from geometry unless in param
.
Definition at line 949 of file DiscriminatePMTwaveformsByChannel_module.cc.
|
private |
Prints the current thresholds to the message logger.
Definition at line 893 of file DiscriminatePMTwaveformsByChannel_module.cc.
|
overridevirtual |
Creates the data products.
Definition at line 575 of file DiscriminatePMTwaveformsByChannel_module.cc.
|
staticprivate |
Definition at line 959 of file DiscriminatePMTwaveformsByChannel_module.cc.
|
private |
Updates fCurrentBaselines
with the current status of the object.
Definition at line 854 of file DiscriminatePMTwaveformsByChannel_module.cc.
|
private |
Updates fCurrentThresholds
with the current status of the object.
Definition at line 784 of file DiscriminatePMTwaveformsByChannel_module.cc.
|
private |
A constant baseline level.
Definition at line 340 of file DiscriminatePMTwaveformsByChannel_module.cc.
|
private |
Current baseline list from run (one per channel).
Definition at line 377 of file DiscriminatePMTwaveformsByChannel_module.cc.
|
private |
Definition at line 338 of file DiscriminatePMTwaveformsByChannel_module.cc.
|
private |
A map of thresholds: channel ID -> relative threshold value [ADC].
Definition at line 354 of file DiscriminatePMTwaveformsByChannel_module.cc.
|
private |
A map of current baselines: channel ID -> baseline [ADC].
Definition at line 393 of file DiscriminatePMTwaveformsByChannel_module.cc.
|
private |
A map of current thresholds: channel ID -> relative threshold value [ADC].
Definition at line 390 of file DiscriminatePMTwaveformsByChannel_module.cc.
|
private |
Default threshold.
Definition at line 345 of file DiscriminatePMTwaveformsByChannel_module.cc.
|
private |
Category name for the console output stream.
Definition at line 361 of file DiscriminatePMTwaveformsByChannel_module.cc.
|
private |
Number of optical detector channels.
Definition at line 342 of file DiscriminatePMTwaveformsByChannel_module.cc.
|
private |
Input optical waveform tag.
Input waveform baseline tag.
Definition at line 335 of file DiscriminatePMTwaveformsByChannel_module.cc.
|
private |
Instance name for output.
Definition at line 356 of file DiscriminatePMTwaveformsByChannel_module.cc.
|
private |
PMT readout configuration for the current run.
Definition at line 374 of file DiscriminatePMTwaveformsByChannel_module.cc.
|
private |
Whether to save also sbn::OpDetWaveformMeta
.
Definition at line 358 of file DiscriminatePMTwaveformsByChannel_module.cc.
|
private |
The thresholds configured by a sequence parameter.
Definition at line 348 of file DiscriminatePMTwaveformsByChannel_module.cc.
|
private |
Tag of PMTconfiguration
data product to read thresholds from.
Definition at line 351 of file DiscriminatePMTwaveformsByChannel_module.cc.
|
private |
Algorithms to simulate trigger gates out of optical channel output.
Definition at line 396 of file DiscriminatePMTwaveformsByChannel_module.cc.