Produces plots about trigger simulation and trigger efficiency. More...
Classes | |
struct | Config |
Public Types | |
using | Parameters = art::EDAnalyzer::Table< Config > |
Public Member Functions | |
SlidingWindowTriggerEfficiencyPlots (Parameters const &config) | |
virtual void | beginJob () override |
Initializes the plots. More... | |
virtual void | analyze (art::Event const &event) override |
Fills the plots. Also extracts the information to fill them with. More... | |
virtual void | endJob () override |
Prints end-of-job summaries. More... | |
Private Member Functions | |
virtual void | initializePlotSet (PlotSandbox &plots, std::vector< SettingsInfo_t > const &settings) const override |
Initializes full set of plots for (ADC threshold + category). More... | |
virtual void | simulateAndPlot (std::size_t const thresholdIndex, TriggerGatesPerCryostat_t const &gates, EventInfo_t const &eventInfo, detinfo::DetectorClocksData const &clockData, PlotSandboxRefs_t const &selectedPlots) override |
Simulates all trigger minimum requirements plots the results. More... | |
void | plotResponse (std::size_t iThr, std::string const &threshold, std::size_t iPattern, WindowPattern const &pattern, PlotSandboxRefs_t const &plotSets, EventInfo_t const &eventInfo, PMTInfo_t const &PMTinfo, WindowTriggerInfo_t const &triggerInfo) const |
Fills plots with the specified trigger response. More... | |
void | initializePatternAlgorithms () |
void | fillAllEventPlots (PlotSandboxRefs_t const &plotSets, EventInfo_t const &eventInfo) const |
Fills all event plots with data from eventInfo as in fillEventPlots() . More... | |
void | fillAllPMTplots (PlotSandboxRefs_t const &plotSets, PMTInfo_t const &PMTinfo) const |
Fills all PMY plots with data from PMTinfo as in fillPMTplots() . More... | |
SlidingWindowTriggerEfficiencyPlots const & | helper () const |
Access to the helper. More... | |
SlidingWindowTriggerEfficiencyPlots & | helper () |
Private Member Functions inherited from icarus::trigger::TriggerEfficiencyPlotsBase | |
TriggerEfficiencyPlotsBase (Config const &config, art::ConsumesCollector &consumer) | |
Constructor; requires a configuration and module's consumesCollector() . More... | |
void | process (art::Event const &event) |
Fills the plots. Also extracts the information to fill them with. More... | |
void | printSummary () const |
Prints end-of-job summaries. More... | |
std::string const & | logCategory () const |
Returns the name of the log category. More... | |
TTree * | eventTree () |
Returns a pointer to the tree where event information is written. More... | |
bool | useGen () const |
Returns whether we are using and filling generator information. More... | |
bool | useEDep () const |
Returns whether we are using and filling energy deposition information. More... | |
std::size_t | nADCthresholds () const |
Returns the number of configured PMT thresholds. More... | |
auto | ADCthresholds () const |
Returns a iterable sequence of all configured PMT thresholds. More... | |
std::string const & | ADCthresholdTag (std::size_t iThr) const |
geo::GeometryCore const & | geometry () const |
Returns the detector geometry service provider. More... | |
nanoseconds | triggerTimeResolution () const |
Returns the resolution of trigger timing clock [ns]. More... | |
virtual void | initializePlots (PlotCategories_t categories, std::vector< SettingsInfo_t > const &settings) |
Initializes all the plot sets, one per PMT threshold. More... | |
void | initializePlots (std::vector< SettingsInfo_t > const &settings) |
Initializes sets of default plots, one per PMT threshold. More... | |
virtual void | initializeEfficiencyPerTriggerPlots (PlotSandbox &plots) const |
Initializes set of plots per complete trigger definition into plots . More... | |
virtual void | initializeEventPlots (PlotSandbox &plots) const |
Initializes a single, trigger-independent plot set into plots . More... | |
virtual void | initializePMTplots (PlotSandbox &plots) const |
virtual bool | shouldPlotEvent (EventInfo_t const &eventInfo) const |
virtual void | fillEventPlots (EventInfo_t const &eventInfo, PlotSandbox const &plots) const |
Fills the plots (initializeEventPlots() ) with info from eventInfo . More... | |
virtual void | fillPMTplots (PMTInfo_t const &PMTinfo, PlotSandbox const &plots) const |
Fill the plots (initializePMTplots() ) with info from PMTinfo . More... | |
virtual void | fillEfficiencyPlots (EventInfo_t const &eventInfo, TriggerInfo_t const &triggerInfo, PlotSandbox const &plots) const |
virtual void | fillAllEfficiencyPlots (EventInfo_t const &eventInfo, PMTInfo_t const &PMTinfo, TriggerInfo_t const &triggerInfo, PlotSandbox const &plots) const |
void | deleteEmptyPlots () |
Deletes plots with no entries, and directories which became empty. More... | |
std::size_t | createCountersForPattern (std::string const &patternName) |
Creates counters for all the thresholds of the specified trigger. More... | |
GatePack_t | makeGatePack (art::Event const *event=nullptr) const |
Creates a GatePack_t from the specified event. More... | |
void | registerTriggerResult (std::size_t threshold, std::size_t pattern, bool fired) |
Registers the outcome of the specified trigger. More... | |
void | registerTriggerResult (std::size_t threshold, std::size_t pattern, TriggerInfo_t const &triggerInfo) |
icarus::trigger::ApplyBeamGateClass | makeMyBeamGate (detinfo::DetectorClocksData const &clockData) const |
Shortcut to create an ApplyBeamGate with the current configuration. More... | |
icarus::trigger::ApplyBeamGateClass | makeMyBeamGate (art::Event const *event=nullptr) const |
icarus::trigger::ApplyBeamGateClass | makeMyBeamGate (art::Event const &event) const |
Private Attributes | |
WindowPatterns_t const | fPatterns |
Configured sliding window requirement patterns. More... | |
icarus::trigger::WindowTopologyManager | fWindowMapMan |
Mapping of each sliding window with location and topological information. More... | |
std::vector < icarus::trigger::SlidingWindowPatternAlg > | fPatternAlgs |
All algorithm instances, one per pattern. More... | |
std::unique_ptr< ResponseTree > | fResponseTree |
Handler of ROOT tree output. More... | |
Additional Inherited Members | |
Static Private Member Functions inherited from icarus::trigger::TriggerEfficiencyPlotsBase | |
static std::vector< ChannelID_t > | extractActiveChannels (TriggerGatesPerCryostat_t const &cryoGates) |
Returns all channels contributing to the trigger gates. More... | |
Static Private Attributes inherited from icarus::trigger::TriggerEfficiencyPlotsBase | |
static PlotCategories_t const | DefaultPlotCategories |
List of event categories. More... | |
Produces plots about trigger simulation and trigger efficiency.
This module is an implementation of TriggerEfficiencyPlotsBase
for a trigger defined as a pattern of sliding windows.
Note that the multi-level logical waveforms from the sliding windows are expected to be provided as input.
The single sliding window with the highest activity is picked as a reference. A requirement on the number of trigger primitives "on" in that window is imposed. Additional requirements may be imposed on three other sliding windows: the upstream one (if any), the downstream one (if any) and the opposite one in the same cryostat.
As usual for TriggerEfficiencyPlotsBase
based modules, this happens for every configured PMT discrimination threshold.
This section describes the trigger logic algorithm used in icarus::trigger::SlidingWindowTriggerEfficiencyPlots
and its assumptions.
The module receives as input a multi-level trigger gate for each of the windows to be considered. On the first input (i.e. the first event), that input is parsed to learn the windows and their relative position from the input trigger gates (initializeTopologicalMaps()
). This topology will be used to apply the configured patterns. On the following events, their input is checked to confirm the compatibility of the composition of its windows with the one from that first event (verifyTopologicalMap()
).
All multi-level gates are set in coincidence with the beam gate by multiplying the multi-level and the beam gates. Beacuse of this, trigger gates are suppressed everywhere except than during the beam gate. The beam gate opens at a time configured in DetectorClocks
service provider (detinfo::DetectorClocks::BeamGateTime()
) and has a duration configured in this module (BeamGateDuration
).
The algorithm handles independently multiple trigger patterns. On each input, each configured pattern is applied based on the window topology. Each pattern describes a minimum level of the trigger gate in the window, that usually means the number of LVDS signals in coincidence at any given time ("majority"). A pattern may have requirements on the neighbouring windows in addition to the main one. The pattern is satisfied if all involved windows pass their specific requirements at the same time (coincidence between windows). Each pattern is applied in turn to each of the windows (which is the "main" window). The neighborhood described in the pattern is applied with respect to that main window. The method applyWindowPattern()
performs this combination. The trigger fires if one or more of the windows satisfy the pattern, and the trigger time is the one of the earliest satisfied pattern (more precisely, the earliest tick when the coincidence required by that pattern is satisfied).
All windows in the detector are considered independently, but the supported patterns may only include components in the same cryostat. Therefore, triggers are effectively on a single cryostat.
Eventually, for each event there are as many different trigger responses as how many different patterns are configured (Patterns
configuration parameter), times how many ADC thresholds are provided in input, configured in Thresholds
.
While there is a parameter describing the time resolution of the trigger (TriggerTimeResolution
), this is currently only used for aesthetic purposes to choose the binning of some plots: the resolution is not superimposed to the gates (yet).
The set of plots and their organization are described in the documentation of icarus::trigger::TriggerEfficiencyPlotsBase
. In the following documentation only the additions are described.
A generic "setting" of icarus::trigger::TriggerEfficiencyPlotsBase
is in this module represented by a tag encoding the characteristics of the pattern (see WindowPattern::tag()
). The folders and plots will identify each requirement with tags like M8
or M5O2
.
There are different "types" of plots. Some do not depend on triggering at all, like the deposited energy distribution. Others cross different trigger definitions, like the trigger efficiency as function of trigger requirement. Others still assume a single trigger definition: this is the case of trigger efficiency plots versus energy. Finally, there are plots that depend on a specific trigger definition and outcome: this is the case of all the plots including only triggering or non-triggering events.
There are a few plots that are produced by this module in addition to the ones in TriggerEfficiencyPlotsBase
. They are described below.
All the plots are always relative to a specific optical detector channel threshold (ADC) and a broad event category.
Only the standard plots from TriggerEfficiencyPlotsBase
are produced in this category.
In addition to the plots from TriggerEfficiencyPlotsBase
, the following plots are also produced:
Eff
: trigger efficiency defined as number of triggered events over the total number of events, as function of the pattern (as encoded above); uncertainties are managed by TEfficiency
.Triggers
: trigger count as function of the pattern (as encoded above).TriggerTick
: distribution of the time of the earliest trigger for the event, as function of the pattern (as in Eff
). Each event appears at most once for each trigger pattern. Only the standard plots from TriggerEfficiencyPlotsBase
are produced in this category.
Only the standard plots from TriggerEfficiencyPlotsBase
are produced in this category.
In addition to all the configuration parameters from TriggerEfficiencyPlotsBase
, the following one is also present:
Patterns
(list of pattern specifications, mandatory): a list of alternative pattern requirements for the definition of a trigger; each value is a table on its own, with the following elements:inMainWindow
(integer, mandatory): the minimum number of primitives to be fired in the central ("main") window of the patterninDownstreamWindow
(integer, default: 0
): the minimum number of primitives to be fired in the window downstream of the main one (downstream is farther from the face beam neutrinos enter the detector through, i.e. larger z)inUpstreamWindow
(integer, default: 0
): the minimum number of primitives to be fired in the window upstream of the main one (upstream is closer to the face beam neutrinos enter the detector through, i.e. smaller z)inOppositeWindow
(integer, default: 0
): the minimum number of primitives to be fired in the window opposite to the main onerequireDownstreamWindow
(flag, default: false
): if set, this pattern is applied only on main windows that have a window downstream of them, i.e. farther from the face of the detector the beam enters through (larger z coordinate); if set to false
, if a main window has no downstream window, the downstream window requirement is always considered passedrequireUpstreamWindow
(flag, default: false
): if set, this pattern is applied only on main windows that have a window upstream of them, in the same way as for the requireDownstreamWindow
setting described aboveAn example job configuration is provided as makeslidingwindowtriggerplots_icarus.fcl
.
This module class is derived from icarus::trigger::TriggerEfficiencyPlotsBase
, which provides a backbone to perform the simulation of triggers and plotting of their efficiency.
There is no superior design involved in this separation, but rather the goal to share most code possible between different modules which simulate different trigger patterns and as a consequence might have specific plots to fill.
This module redefines:
initializePlotSet()
to define the few additional plots needed;simulateAndPlot()
, which must always be defined, and which connects the simulation pieces and the plotting.It does not redefine initializeEfficiencyPerTriggerPlots()
nor initializeEventPlots()
because there are no additional plots of the types these functions deal with.
The event categories are from the default list (DefaultPlotCategories
) too.
Definition at line 332 of file SlidingWindowTriggerEfficiencyPlots_module.cc.
using icarus::trigger::SlidingWindowTriggerEfficiencyPlots::Parameters = art::EDAnalyzer::Table<Config> |
Definition at line 352 of file SlidingWindowTriggerEfficiencyPlots_module.cc.
|
private |
Definition at line 382 of file SlidingWindowTriggerEfficiencyPlots_module.cc.
|
private |
List of configured patterns.
Definition at line 380 of file SlidingWindowTriggerEfficiencyPlots_module.cc.
|
private |
Data structure to communicate internally a trigger response.
Definition at line 386 of file SlidingWindowTriggerEfficiencyPlots_module.cc.
|
explicit |
Definition at line 552 of file SlidingWindowTriggerEfficiencyPlots_module.cc.
|
overridevirtual |
Fills the plots. Also extracts the information to fill them with.
Definition at line 626 of file SlidingWindowTriggerEfficiencyPlots_module.cc.
|
overridevirtual |
Initializes the plots.
Definition at line 602 of file SlidingWindowTriggerEfficiencyPlots_module.cc.
|
overridevirtual |
Prints end-of-job summaries.
Definition at line 638 of file SlidingWindowTriggerEfficiencyPlots_module.cc.
|
private |
Fills all event plots with data from eventInfo
as in fillEventPlots()
.
Definition at line 830 of file SlidingWindowTriggerEfficiencyPlots_module.cc.
|
private |
Fills all PMY plots with data from PMTinfo
as in fillPMTplots()
.
Definition at line 852 of file SlidingWindowTriggerEfficiencyPlots_module.cc.
|
inlineprivate |
Access to the helper.
Definition at line 412 of file SlidingWindowTriggerEfficiencyPlots_module.cc.
|
inlineprivate |
Definition at line 413 of file SlidingWindowTriggerEfficiencyPlots_module.cc.
|
private |
Constructs all the pattern algorithms. Must be called after setting the window topology.
Definition at line 820 of file SlidingWindowTriggerEfficiencyPlots_module.cc.
|
overrideprivatevirtual |
Initializes full set of plots for (ADC threshold + category).
This customization of TriggerEfficiencyPlotsBase::initializePlotSet()
adds some trigger-definition specific plots and some overview plots across different trigger definitions.
Reimplemented from icarus::trigger::TriggerEfficiencyPlotsBase.
Definition at line 650 of file SlidingWindowTriggerEfficiencyPlots_module.cc.
|
private |
Fills plots with the specified trigger response.
iThr | index of PMT threshold (used in tree output) |
threshold | PMT threshold tag (for printing) |
iPattern | index of the pattern being plotted |
pattern | the pattern being plotted |
plotSets | set of plot boxes to fill (from initializePlotSet() ) |
eventInfo | event information for plotting |
triggerInfo | the information about the response of this trigger |
This method fills all the relevant plots for the specified trigger pattern and threshold. The trigger response is passed as a parameter.
Definition at line 872 of file SlidingWindowTriggerEfficiencyPlots_module.cc.
|
overrideprivatevirtual |
Simulates all trigger minimum requirements plots the results.
thresholdIndex | the index of the PMT threshold of input primitives |
gates | the trigger primitives used to simulate the trigger response |
eventInfo | general information about the event being simulated |
selectedPlots | list of boxes containing plots to be filled |
This method is expected to perform the following steps for each trigger primitive requirement in MinimumPrimitives
:
combineTriggerPrimitives()
;applyBeamGateToAll()
on the combined primitives;plotResponse()
;plotResponse()
.Details are in the documentation of the relevant methods.
This method is invoked once per PMT threshold.
Implements icarus::trigger::TriggerEfficiencyPlotsBase.
Definition at line 724 of file SlidingWindowTriggerEfficiencyPlots_module.cc.
|
private |
All algorithm instances, one per pattern.
Definition at line 403 of file SlidingWindowTriggerEfficiencyPlots_module.cc.
|
private |
Configured sliding window requirement patterns.
Definition at line 391 of file SlidingWindowTriggerEfficiencyPlots_module.cc.
|
private |
Handler of ROOT tree output.
Definition at line 405 of file SlidingWindowTriggerEfficiencyPlots_module.cc.
|
mutableprivate |
Mapping of each sliding window with location and topological information.
Definition at line 400 of file SlidingWindowTriggerEfficiencyPlots_module.cc.