All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Protected Types | Protected Member Functions | Static Protected Member Functions | Static Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
icarus::trigger::TriggerEfficiencyPlotsBase Class Referenceabstract

Helper class to produce plots about trigger simulation and trigger efficiency. More...

#include <TriggerEfficiencyPlotsBase.h>

Inheritance diagram for icarus::trigger::TriggerEfficiencyPlotsBase:
icarus::trigger::MajorityTriggerEfficiencyPlots icarus::trigger::SlidingWindowTriggerEfficiencyPlots

Classes

struct  Config
 
struct  GatePack_t
 A collection of useful beam gates. Make one with makeGatePack(). More...
 
class  HistGetter
 
class  PlotCategory
 
struct  SettingsInfo_t
 Generic description of trigger settings. More...
 

Protected Types

using microseconds = util::quantities::intervals::microseconds
 
using nanoseconds = util::quantities::intervals::nanoseconds
 
using EventInfo_t = details::EventInfo_t
 
using PMTInfo_t = details::PMTInfo_t
 
using TriggerInfo_t = details::TriggerInfo_t
 
using PlotSandbox = icarus::trigger::PlotSandbox
 Import type. More...
 
using PlotSandboxRefs_t = std::vector< std::reference_wrapper< PlotSandbox const >>
 List of references to plot sandboxes. More...
 
using PlotCategories_t = std::vector< PlotCategory >
 
using InputTriggerGate_t = icarus::trigger::TrackedOpticalTriggerGate< sbn::OpDetWaveformMeta >
 Type of trigger gate extracted from the input event. More...
 
using TriggerGates_t = std::vector< InputTriggerGate_t >
 A list of trigger gates from input. More...
 
using TriggerGatesPerCryostat_t = std::vector< TriggerGates_t >
 Type of lists of gates, one list per cryostat (outer index: cryostat no). More...
 
using ChannelID_t = InputTriggerGate_t::TriggerGate_t::ChannelID_t
 Type representing the unique identifier of a optical detector channel. More...
 

Protected Member Functions

 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 initializePlotSet (PlotSandbox &plots, std::vector< SettingsInfo_t > const &settings) const
 Initializes full set of plots for (ADC threshold + category) into plots. 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 simulateAndPlot (std::size_t const thresholdIndex, TriggerGatesPerCryostat_t const &gates, EventInfo_t const &eventInfo, detinfo::DetectorClocksData const &clockData, PlotSandboxRefs_t const &selectedPlots)=0
 Simulates all triggers for a trigger setting and plots the results. More...
 
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
 

Static Protected Member Functions

static std::vector< ChannelID_textractActiveChannels (TriggerGatesPerCryostat_t const &cryoGates)
 Returns all channels contributing to the trigger gates. More...
 

Static Protected Attributes

static PlotCategories_t const DefaultPlotCategories
 List of event categories. More...
 

Private Member Functions

std::vector< std::string > selectPlotCategories (EventInfo_t const &info, PlotCategories_t const &categories) const
 Returns the names of the plot categories event qualifies for. More...
 
geo::TPCGeo const * pointInTPC (geo::Point_t const &point) const
 Returns the TPC point is within, nullptr if none. More...
 
geo::TPCGeo const * pointInActiveTPC (geo::Point_t const &point) const
 
TriggerGates_t readTriggerGates (art::Event const &event, art::InputTag const &dataTag) const
 
TriggerGatesPerCryostat_t splitByCryostat (TriggerGates_t &&gates) const
 Moves the data in gates in a collection of gates by cryostat. More...
 
bool deleteEmptyPlots (PlotSandbox &plots) const
 

Static Private Member Functions

static std::vector
< geo::CryostatID
makeChannelCryostatMap (geo::GeometryCore const &geom)
 Fills and returns a map of cryostat ID for each optical detector channel. More...
 
static std::string thrAndCatName (std::string const &boxName, std::string const &category)
 
static std::string thrAndCatName (PlotSandbox const &box, std::string const &category)
 
static
icarus::trigger::details::EventInfoExtractor::EDepTags_t 
makeEdepTag (fhicl::Sequence< art::InputTag > const &EnergyDepositTags, fhicl::OptionalAtom< art::InputTag > const &EnergyDepositSummaryTag)
 Creates a EDepTags_t out of the module configuration. More...
 

Private Attributes

art::InputTag fDetectorParticleTag
 Input simulated particles. More...
 
std::map< std::string,
art::InputTag > 
fADCthresholds
 ADC threshold tags to read, and the input tag connected to their data. More...
 
microseconds fBeamGateDuration
 Duration of the gate during with global optical triggers are accepted. More...
 
microseconds fBeamGateStart
 Start of the beam gate with respect to BeamGate(). More...
 
microseconds fPreSpillWindow
 Duration of the pre-spill gate. More...
 
microseconds fPreSpillStart
 Start of the pre-spill gate. More...
 
nanoseconds fTriggerTimeResolution
 Trigger resolution in time. More...
 
bool fPlotOnlyActiveVolume
 Plot only events in active volume. More...
 
std::vector< std::string > fOnlyPlotCategories
 
std::string const fLogCategory
 Message facility stream category for output. More...
 
std::string fLogEventDetails
 Steam where to print event info. More...
 
PlotCategories_t fPlotCategories
 Plot categories (via initializePlots()). More...
 
geo::GeometryCore const & fGeom
 
art::TFileDirectory fOutputDir
 ROOT directory where all the plots are written. More...
 
details::EventInfoExtractorMaker
const 
fEventInfoExtractorMaker
 Helper to extract information from the event. More...
 
std::vector< geo::CryostatID >
const 
fChannelCryostat
 ID of cryostat where each optical detector channel (vector index) is. More...
 
std::vector< PlotSandboxfThresholdPlots
 All plots, one set per ADC threshold. More...
 
std::unique_ptr
< details::EventIDTree
fIDTree
 Handler of ROOT tree output. More...
 
std::unique_ptr
< details::PlotInfoTree
fPlotTree
 Handler of ROOT tree output. More...
 
std::unique_ptr
< details::EventInfoTree
fEventTree
 Handler of ROOT tree output. More...
 
std::atomic< unsigned int > nEvents { 0U }
 Count of seen events. More...
 
std::atomic< unsigned int > nPlottedEvents { 0U }
 Count of plotted events. More...
 
icarus::ns::util::ThreadSafeChangeMonitor
< icarus::trigger::BeamGateStruct
fBeamGateChangeCheck
 Functor returning whether a gate has changed. More...
 
details::TriggerPassCounters fPassCounters
 Counters for all triggers. More...
 

Detailed Description

Helper class to produce plots about trigger simulation and trigger efficiency.

See Also
icarus::trigger::MajorityTriggerEfficiencyPlots

This helper class provides the foundation for writing a module producing sets of plots based on trigger primitives given in input.

The following documentation mainly deals with the most standard configuration and operations in ICARUS. Modules made with this helper and the modules upstream of them in data processing have quite some knobs that can be manipulated to test unorthodox configurations.

An example of module implemented with this class is icarus::trigger::MajorityTriggerEfficiencyPlots.

Overview of trigger simulation steps

This simulation only trigger primitives derived from the optical detector via hardware (V1730B boards). The trigger simulation branches from the standard simulation of optical detector waveforms (icarus::SimPMTIcarus module). From there, multiple steps are needed.

  1. Produce single-PMT-channel discriminated waveforms: the discrimination threshold can be chosen ("ADC threshold" or just "threshold" in the following), and the result is one binary discriminated waveform that has value 0 when the waveform is under threshold and 1 when it's above threshold, with the same time discretization as the PMT waveform. Each discriminated waveform spans the whole event readout time and therefore it may merge information from multiple readout waveforms (raw::OpDetWaveform), but all from the same optical detector channel. This step can be performed with the module icarus::trigger::DiscriminatePMTwaveforms.
  2. Combine the discriminated waveforms in pairs, in the same fashion as the V1730B readout board does to produce LVDS output. The output of this step is roughly half as many discriminated outputs as there were from the previous step (some channels are not paired). This output will be called trigger primitives because it is what the trigger logics is based on. We say that a trigger primitive is "on" when its level is 1. This step can be performed with the module icarus::trigger::LVDSgates.
  3. Simulate the trigger logic based on the trigger primitives _(see below)_. This usually includes the requirement of coincidence with the beam gate.

Trigger logic may be complex, being implemented in a FPGA. Many options are available, including:

This class is expected to support modules implementing different trigger logics.

Data objects for discriminated waveforms

A discriminated waveform is the information whether the level of a waveform is beyond threshold, as function of time. A discriminated waveform may be binary, i.e. with only levels 0 and 1 based on a single threshold, or with multiple levels. Also the numerical addition of two binary discriminated waveforms yields a multi-level waveform (in fact, three levels – 0, 1 and 2).

We represent this data in the forms of "events": an event is a change of level happening at a certain time. The class holding this information, icarus::trigger::TriggerGateData, covers the whole time, starting with a ground level 0. The next event will be a "opening" that increases the level, usually to 1. Other changing events may follow, and typically the last one will bring the level back to 0.

This information is joined by a list of channel numbers in order to represent a discriminated waveform e.g. from the optical detector. There may be one or more channels associated to a discriminated waveform, but for us there should always be at least one. The discriminated waveforms from PMT readout (raw::OpDetWaveform) are associated to a single channel, while LVDS trigger primitives are most often associated to two channels (some channels are not paired and will have only one channel). A sliding window will have as many channels as the PMT it covers. The global trigger should have all channels, while in ICARUS each of the two discriminated wabeforms from a cryostat should have half the channels. This information is represented in the class icarus::trigger::ReadoutTriggerGate, which inherits from icarus::trigger::TriggerGateData. This class is generic and can hold any representation for the time of the level changing events, for the levels, and for the identifiers of the channels. ICARUS specifies a data type for each of these quantities, and the resulting icarus::trigger::ReadoutTriggerGate class instance is called icarus::trigger::OpticalTriggerGateData_t.

Note
The class icarus::trigger::OpticalTriggerGateData_t is the one that gets written to disk in the art ROOT files. That is not a class by itself, but rather an alias of icarus::trigger::ReadoutTriggerGate, and many coding tools will call it in the latter way.

It is often convenient to track for each trigger gate object which input contributed to it, both in terms of channels and of single waveforms. The list of channels is embedded in icarus::trigger::ReadoutTriggerGate, while the list of source waveforms is not. An additional wrapper object, icarus::trigger::TrackedOpticalTriggerGate, contains a trigger gate proper (icarus::trigger::ReadoutTriggerGate) and a list of pointers to the source waveforms. In most of the code the source is represented by metadata (sbn::OpDetWaveformMeta) rather than the full waveforms (raw::OpDetWaveform) so that the bulk of the data is not necessary for the vast majority of the uses, and it can be dropped.

Utilities are available to manage the serialization of icarus::trigger::TrackedOpticalTriggerGate objects (icaruscode/PMT/Trigger/Utilities/TriggerDataUtils.h), which is implemented as a trigger gate collection and a association object

There are utilities available in icaruscode/PMT/Trigger/Utilities/TriggerDataUtils.h that can convert them into a collection of icarus::trigger::OpticalTriggerGateData_t objects plus a collection of art associations (for writing), and the other way around (for reading). Additional utilities allow to bridge between the waveform metadata and their original waveforms (icaruscode/PMT/Trigger/Utilities/OpDetWaveformMetaMatcher.h), which is needed when a producer utilising the metadata and combining trigger gates wants to save associations not only of the gates with the metadata, but also with the original waveforms. The module icarus::trigger::LVDSgates uses all of them and can be used as an illustration of the functionality.

A module is provided, called icarus::trigger::DumpTriggerGateData, which dumps on screen or on text file the information from a collection of discriminated waveforms in a (sort-of) human readable format. An example configuration for this module is provided in icaruscode, called dump_triggergatedata_icarus.fcl.

The main functions to manipulate the trigger gates are defined in the very base class, icarus::trigger::TriggerGateData: these allow e.g. to find events and query the level at a given time. Another important set of features is also present in icarus::trigger::TriggerGateData and replicated in the higher levels: the combination of trigger gates by sum (OR), multiplication (AND), minimum and maximum value.

Note
Combining a multi-level gate via Min() with a binary gate results into a binary gate which is logic AND of the two gates.

On the terminology

In this documentation, the "discriminated waveforms" are sometimes called "trigger gates" and sometimes "trigger primitives". Although these concepts are, strictly, different, usually the difference does not affect the meaning and they end up being exchanged carelessly.

Trigger logic algorithm

The trigger logic algorithm is completely absent from this helper, and it is entirely delegated to the derived classes (simulateAndPlot()). There are nevertheless a lot of functions that may help to process the input trigger primitives and fill some standard plots. Many of them are listed in the documentation of simulateAndPlot().

Event categories

Each event is assigned to a set of categories, and its information contributes to the plots of all those categories. The categories are passed to the helper in the initializePlots() call to create all the plots to be filled later. A default list of categories is provided as DefaultPlotCategories.

Module usage

The following aspects are common to all modules based on this helper.

Input data products

This module uses the following data products as input:

Output plots

The module produces a standard set of plots for each configured ADC threshold and for each event category. The plots are saved via art service TFileService in a ROOT file and they are organized in nested ROOT directories under the module label directory which is assigned by art:

Each of the inner ROOT directories contains a full set of plots, whose name is the standard plot name followed by its event category and threshold (e.g. Eff_NuCC_Thr15 for the trigger efficiency plot on neutrino charged current events with 15 ADC counts as PMT threshold).

Each set of plots, defined in icarus::trigger::TriggerEfficiencyPlots::initializePlotSet() (and, within, initializeEventPlots() and initializeEfficiencyPerTriggerPlots()), is contributed only by the events in the set category.

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.

A list of plots follows for each plot type. All the plots are always relative to a specific optical detector channel threshold (ADC) and a broad event category.

Plots independent of the triggers (including selection plots)

These plots are stored directly in a threshold/category folder:

Note
In fact, these plots usually do not even depend on the ADC threshold of the optical detector channels. Nevertheless, they are stored in the folders under specific thresholds, and they are duplicate.

Plots including different trigger requirements

These plots collect information from scenarios with different trigger requirements, but still with the same underlying optical detector channel ADC threshold. No plots are provided in this category by TriggerEfficiencyPlotsBase at the moment. Implementing modules can add plots by overriding the method initializePlotSet():

void MyTriggerEfficiencyPlots::initializePlotSet
(PlotSandbox& plots, std::vector<SettingsInfo_t> const& settings) const
{
// (inherited)
helper().TriggerEfficiencyPlotsBase::initializePlotSet(plots, settings);
// ... add more plot definitions, e.g.
plots.make<TEfficiency>(
"Eff",
"Efficiency of triggering;requested primitives;trigger efficiency",
settings.size(), 0, settings.size()
);
} // MyTriggerEfficiencyPlots::initializePlotSet()

Plots depending on a specific trigger definition

The following plots depend on the full definition of the trigger, including PMT thresholds and other requirements. They are hosted each in a subfolder of the threshold/category folder, with a name encoding the requirement: ReqXX for trigger with minimum required primitives XX.

The parameters are defined in the same way as in the selection plots, unless stated otherwise.

Plots depending on a specific trigger definition and response

These plots depend on the trigger definition, as the ones in the previous type, and on the actual trigger response. They are hosted each in a subfolder of the threshold/category/requirement folder, with a name encoding the response: triggering for triggering events, nontriggering for the others.

Their event pool is filtered to include only the events in the current category which also pass, or do not pass, the trigger requirement.

The plots are:

Configuration parameters

A terse description of the parameters is printed by running lar --print-description TriggerEfficiencyPlots.

An example job configuration is provided as maketriggerplots_icarus.fcl.

Technical description of the module

The modules based on this helper read trigger gate data products from different ADC thresholds, and for each threshold they combine the data into a trigger response depending on a ADC threshold. Then they apply different trigger settings and for each one they fill plots.

All the input sets (each with its own ADC treshold) are treated independently from each other.

Each event is assigned to event categories. These categories do not depend on trigger definition nor primitives. For example, a electron neutrino neutral current interaction event would be assigned to the neutral current neutrino interaction category, to the electron neutrino category, and so on. A set of plot is produced at once for each of the event categories.

This module is designed as follows:

Note that the plots depending on the response may require multiple fillings. For example, a trigger efficiency plot as function of the trigger settings is a single plot in the plot set which requires a filling for every trigger setting. In a similar fashion, the plot of trigger time requires one filling for each requirement level that is met.

Organization of the plots

Plots are written on disk via the standard art service TFileService, which puts them in a ROOT subdirectory named as the instance of this module being run.

As described above, there are two "dimensions" for the plot sets: there is one plot set for each ADC threshold and for each event category, the total number of plot sets being the product of the options in the two dimensions.

The code is structured to work by threshold by threshold, because the trigger response depends on the threshold but not by the event category: the response is computed once per threshold, then all the plots related to that response (including all the event categories) are filled.

The structure in the file reflects this logic, and there are two levels of ROOT directories inside the one assigned by art to this module:

In each inner directory, a complete set of plots is contained. The name of each plot is a base name for that plot (e.g. Eff for the efficiency plot) with the event category tag and the threshold tag appended (separated by an underscore character, "_"). The title of the plot is also modified to include the description of the plot category (as defined in PlotCategory::description()) and the ADC threshold. Therefore, within the same module directory, all plot names are different.

Adding a plot

When adding a plot, two actions are necessary:

  1. initialize the new plot
  2. fill the new plot

The initialization happens in icarus::trigger::TriggerEfficiencyPlots::initializePlotSet() method. A request must be issued to the plot sandbox to "make" the plot. In general it can be expected that all the arguments args in a call plots.make<PlotType>(args) are forwarded to the constructor of PlotType, so that to make a new PlotType object one has to consult only the constructor of that class. Be aware though that the library expects the first argument to be the ROOT name of the new object and the second to be its ROOT title. It is possible to work around this requirement with additional coding.

The method performing the plotting is simulateAndPlot(). The plots should be filled inside loops going through all plot sets. The existing code already does that in two loops, one for the plots depending on the trigger response requirement, and the other for the plots not depending on it.

About plot sandboxes

For the sake of this module, a plot sandbox is an object similar to a ROOT TDirectory, which can mangle the objects it contains to change ("process") their name and title, and that interacts properly with art::TFileDirectory so make TFileService happy. The processing of the name and title is used to add the category and threshold tags to the plot ROOT name and the corresponding annotations to the plot title, as described above.

Adding an event category

Event categories are specified to initializePlots() call: each category is described by a simple object PlotCategory which contains a name (used in ROOT directories, plot name tags and to univocally identify the category), a description (used in plot titles) and a condition for the event to fulfill in order to qualify for the category. The condition is a function object that accepts an EventInfo_t object with the relevant event information, and returns its decision (true if the event belongs to this category).

To add a category, it is enough to add an entry in the collection of plot categories passed to initializePlots(). The DefaultPlotCategories list can be used as a starting point.

The condition function adjudicates based on the information in EventInfo_t. It is likely though that if a new category is needed, the information currently available in EventInfo_t is not enough to decide the response. In that case, EventInfo_t must be extended to hold the newly required information. In addition, the method extractEventInfo() must be modified to set the new information. The documentation of that method expands on this topic.

Usage of the helper

An example of how to turn this helper class in a full blown art module is icarus::trigger::MajorityTriggerEfficiencyPlots.

Changing the trigger logic

The trigger logic is required to be coded in simulateAndPlot() of the derived class. Some details on implementing it can be found in the documentation of the method itself.

To implement a trigger logic, several components need to be coordinated:

  1. combination of trigger primitives;
  2. the data structure the combination is stored in;
  3. interpretation of that data structure in terms of trigger firing (which we call here "trigger settings");
  4. configuration of the trigger logic from user parameters.

A module may simulate a trigger which counts the number of primitives that are "on" and imposing a required minimum on that number for the trigger to fire. This is a possible implementation including those elements:

  1. combination of trigger primitives: primitives are summed into a single multilevel gate (with beam gate on top);
  2. the data structure the combination is stored in: a trigger gate object;
  3. interpretation of that data structure in terms of trigger firing: the logic requires a minimum number of primitives being on at the same time; the interpretation uses the level of the combined trigger gate as the number of primitives on at every time, and decides that the first time this number meets the requirement, the trigger fires;
  4. configuration of the trigger logic from user parameters: it's a parameter of the module itself (MinimumPrimitives).

An example of how a different trigger logic could be implemented following a similar model: let's assume we want a trigger based on two sliding windows. A window is a group of LVDS signals from neighboring channels. We can split the whole optical detector channels into many windows, and we can make the windows overlap: for example, a window includes the first 30 channels behind one anode plane, the second window includes 30 channels starting from the fifteenth, the third window includes 30 channels starting from the thirtieth, and so on. In ICARUS, 30 channels are served in 16 LVDS discriminated waveforms, i.e. 16 trigger primitives. We may require as a loose trigger that any window contains at least 10 primitives on at the same time (that is about 20 PMT channels beyond ADC threshold), and as a tighter trigger that there is a window with at least 8 trigger primitives on, and the corresponding window in the opposite TPC has at least 6 primitives on at the same time. Note that a splitting 7/7 won't do: one of the two windows must have 8 or more primitives on. The input primitives from the point of view of the module now become the "sliding window" combination of the LVDS trigger primitives, as produced e.g. by icarus::trigger::SlidingWindowTrigger module. How this can be implemented following the pattern of this module:

  1. combination of trigger primitives: we prepare two primitives: one describes the maximum level among all the windows, and the other describes the level of the window opposite to the maximum (the way to achieve this is quite complicate);
  2. the data structure the combination is stored in: two trigger gate objects;
  3. interpretation of that data structure in terms of trigger firing: for the loose trigger, we look for the first time the maximum window level reaches the designated threshold; for the tighter trigger, some additional logic is required, discriminating the maximum window level primitive to the higher threshold, the opposite window level on the lower threshold, and setting them in coincidence; then the time the resulting gate opens, if any, is the trigger time;
  4. configuration of trigger logic parameters: the two requirements (single window, double window with their minimum number of LVDS primitives) are read from the module FHiCL configuration; for computing efficiency, either in the constructor or in a beginJob() method we may also prepare the associations (pairing) between opposite windows or just channels;
Todo:
add ability to discriminate a trigger gate object? discrimination on level N (>=N -> 1, <N -> 0) can be obtained with adding a _-N_ uniform level, flooring on level 0 and (if needed) maxing on level 1.

Code style: quantities with units

To avoid issues with missing or wrong conversions, this code often uses LArSoft quantities library. A variable with a Quantity type is represented with a specific unit (e.g. microseconds) and can undergo only limited manipulation. The allowed manipulation should guarantee that the unit of the quantity is correctly preserved. For example, it is not possible to add to a microseconds interval a pure number (e.g. 9.0), but rather it is only possible to add time quantities (e.g. another microseconds variable, or a nanoseconds variable, or a literal value with unit, like 9.0_ns), and those quantities are properly converted, with the caveat that rounding errors may happen that a more careful explicit handling could avoid. Also, there are two types of variables that can feature the same unit, intervals and points. A point can't be scaled (e.g. you can't "double" the time the beam gate opens, while you can double the beam gate duration) and it can't be added to another point (the difference between two points is an interval).

To avoid mistakes in the conversion between different time scales, the LArSoft utility library detinfo::DetectorTimings is used, which is a wrapper of DetectorClocks service provider that makes the interface to convert times easier and uniform. Here we use it to convert time points from the simulation (which are expressed in nanoseconds and are starting at trigger time) into optical detector readout ticks, and vice versa. The values returned by this library have encoded in them which time scale they belong to, and in which unit they are measured.

Definition at line 974 of file TriggerEfficiencyPlotsBase.h.

Member Typedef Documentation

using icarus::trigger::TriggerEfficiencyPlotsBase::ChannelID_t = InputTriggerGate_t::TriggerGate_t::ChannelID_t
protected

Type representing the unique identifier of a optical detector channel.

Definition at line 1238 of file TriggerEfficiencyPlotsBase.h.

Definition at line 1086 of file TriggerEfficiencyPlotsBase.h.

Type of trigger gate extracted from the input event.

Definition at line 1229 of file TriggerEfficiencyPlotsBase.h.

Definition at line 980 of file TriggerEfficiencyPlotsBase.h.

Definition at line 981 of file TriggerEfficiencyPlotsBase.h.

Definition at line 1192 of file TriggerEfficiencyPlotsBase.h.

Import type.

Definition at line 1149 of file TriggerEfficiencyPlotsBase.h.

using icarus::trigger::TriggerEfficiencyPlotsBase::PlotSandboxRefs_t = std::vector<std::reference_wrapper<PlotSandbox const>>
protected

List of references to plot sandboxes.

Definition at line 1153 of file TriggerEfficiencyPlotsBase.h.

Definition at line 1087 of file TriggerEfficiencyPlotsBase.h.

A list of trigger gates from input.

Definition at line 1232 of file TriggerEfficiencyPlotsBase.h.

Type of lists of gates, one list per cryostat (outer index: cryostat no).

Definition at line 1235 of file TriggerEfficiencyPlotsBase.h.

Definition at line 1088 of file TriggerEfficiencyPlotsBase.h.

Constructor & Destructor Documentation

icarus::trigger::TriggerEfficiencyPlotsBase::TriggerEfficiencyPlotsBase ( Config const &  config,
art::ConsumesCollector &  consumer 
)
explicitprotected

Constructor; requires a configuration and module's consumesCollector().

Definition at line 494 of file TriggerEfficiencyPlotsBase.cxx.

496  : fDetectorParticleTag (config.DetectorParticleTag())
497  , fBeamGateDuration (config.BeamGateDuration())
498  , fBeamGateStart (config.BeamGateStart())
499  , fPreSpillWindow (config.PreSpillWindow())
501  (fBeamGateStart - config.PreSpillWindowGap() - fPreSpillWindow)
502  , fTriggerTimeResolution(config.TriggerTimeResolution())
503  , fPlotOnlyActiveVolume (config.PlotOnlyActiveVolume())
504  , fOnlyPlotCategories (sortCollection(config.OnlyPlotCategories()))
505  , fLogCategory (config.LogCategory())
506  // services
507  , fGeom (*lar::providerFrom<geo::Geometry>())
508  , fOutputDir (*art::ServiceHandle<art::TFileService>())
509  // cached
511  config.GeneratorTags(), // truthTags
512  makeEdepTag(config.EnergyDepositTags, config.EnergyDepositSummaryTag),
513  // edepTags
514  fGeom, // geom
515  nullptr, // detProps
516  nullptr, // detTimings
517  fLogCategory, // logCategory
518  consumer // consumesCollector
519  )
521 {
522  //
523  // more complex parameter parsing
524  //
525  if (config.EventDetailsLogCategory(fLogEventDetails)) {
526  // the parameter is somehow set, so fLogEventDetails won't be empty;
527  // but if the parameter value is specified empty, we set it to fLogCategory
528  if (fLogEventDetails.empty()) fLogEventDetails = fLogCategory;
529  } // if EventDetailsLogCategory is specified
530 
531  std::string const discrModuleLabel = config.TriggerGatesTag();
532  for (std::string const& threshold: config.Thresholds())
533  fADCthresholds[threshold] = art::InputTag{ discrModuleLabel, threshold };
534 
535 
536  if (config.EventTreeName.hasValue()) {
537 
538  std::string treeName;
539  config.EventTreeName(treeName);
540 
541  fIDTree = std::make_unique<details::EventIDTree>
542  (*(fOutputDir.make<TTree>(treeName.c_str(), "Event information")));
543  fEventTree = std::make_unique<details::EventInfoTree>
544  (fIDTree->tree(), useGen(), useEDep());
545  fPlotTree = std::make_unique<details::PlotInfoTree>(fIDTree->tree());
546 
547  } // if make tree
548 
549  //
550  // input data declaration
551  //
552  using icarus::trigger::OpticalTriggerGateData_t; // for convenience
553 
554  // trigger primitives
555  for (art::InputTag const& inputDataTag: util::const_values(fADCthresholds)) {
556  consumer.consumes<std::vector<OpticalTriggerGateData_t>>(inputDataTag);
557  consumer.consumes<art::Assns<OpticalTriggerGateData_t, raw::OpDetWaveform>>
558  (inputDataTag);
559  } // for
560 
561  {
562  mf::LogInfo log(fLogCategory);
563  log << "\nConfigured " << fADCthresholds.size() << " thresholds (ADC):";
564  for (auto const& [ thresholdTag, dataTag ]: fADCthresholds)
565  log << "\n * " << thresholdTag << " (from '" << dataTag.encode() << "')";
566 
567  } // local block
568 
569 
570  if (!useGen()) {
571  mf::LogVerbatim(fLogCategory)
572  << "Generation information will not be produced.";
573  }
574  if (!useEDep()) {
575  mf::LogVerbatim(fLogCategory)
576  << "Energy deposition information will not be produced.";
577  }
578 
579 } // icarus::trigger::TriggerEfficiencyPlots::TriggerEfficiencyPlots()
microseconds fPreSpillWindow
Duration of the pre-spill gate.
std::string fLogEventDetails
Steam where to print event info.
bool useGen() const
Returns whether we are using and filling generator information.
std::vector< geo::CryostatID > const fChannelCryostat
ID of cryostat where each optical detector channel (vector index) is.
std::string const fLogCategory
Message facility stream category for output.
decltype(auto) const_values(Coll &&coll)
Range-for loop helper iterating across the constant values of the specified collection.
static std::vector< geo::CryostatID > makeChannelCryostatMap(geo::GeometryCore const &geom)
Fills and returns a map of cryostat ID for each optical detector channel.
microseconds fBeamGateDuration
Duration of the gate during with global optical triggers are accepted.
std::unique_ptr< details::EventInfoTree > fEventTree
Handler of ROOT tree output.
art::TFileDirectory fOutputDir
ROOT directory where all the plots are written.
details::EventInfoExtractorMaker const fEventInfoExtractorMaker
Helper to extract information from the event.
icarus::trigger::ReadoutTriggerGate< TriggerGateTick_t, TriggerGateTicks_t, raw::Channel_t > OpticalTriggerGateData_t
Type of trigger gate data serialized into art data products.
art::InputTag fDetectorParticleTag
Input simulated particles.
std::map< std::string, art::InputTag > fADCthresholds
ADC threshold tags to read, and the input tag connected to their data.
std::unique_ptr< details::PlotInfoTree > fPlotTree
Handler of ROOT tree output.
microseconds fPreSpillStart
Start of the pre-spill gate.
std::unique_ptr< details::EventIDTree > fIDTree
Handler of ROOT tree output.
nanoseconds fTriggerTimeResolution
Trigger resolution in time.
bool fPlotOnlyActiveVolume
Plot only events in active volume.
static icarus::trigger::details::EventInfoExtractor::EDepTags_t makeEdepTag(fhicl::Sequence< art::InputTag > const &EnergyDepositTags, fhicl::OptionalAtom< art::InputTag > const &EnergyDepositSummaryTag)
Creates a EDepTags_t out of the module configuration.
bool useEDep() const
Returns whether we are using and filling energy deposition information.
microseconds fBeamGateStart
Start of the beam gate with respect to BeamGate().

Member Function Documentation

auto icarus::trigger::TriggerEfficiencyPlotsBase::ADCthresholds ( ) const
inlineprotected

Returns a iterable sequence of all configured PMT thresholds.

Definition at line 1132 of file TriggerEfficiencyPlotsBase.h.

1132 { return util::get_elements<0U>(fADCthresholds); }
std::map< std::string, art::InputTag > fADCthresholds
ADC threshold tags to read, and the input tag connected to their data.
std::string const& icarus::trigger::TriggerEfficiencyPlotsBase::ADCthresholdTag ( std::size_t  iThr) const
inlineprotected

Returns the ADC threshold tag value for PMT threshold index iThr.

Exceptions
std::out_of_rangeif iThr is not a valid threshold index
See Also
nADCthresholds()

Definition at line 1137 of file TriggerEfficiencyPlotsBase.h.

1138  { return next(fADCthresholds.begin(), iThr)->first; }
std::map< std::string, art::InputTag > fADCthresholds
ADC threshold tags to read, and the input tag connected to their data.
auto icarus::trigger::TriggerEfficiencyPlotsBase::createCountersForPattern ( std::string const &  patternName)
protected

Creates counters for all the thresholds of the specified trigger.

Parameters
patternNamean identified for the pattern
Returns
the index of the pattern in the counter list

Definition at line 1245 of file TriggerEfficiencyPlotsBase.cxx.

1246 {
1247 
1248  std::size_t patternIndex = fPassCounters.NoIndex;
1249  std::size_t iThr [[maybe_unused]] = 0U;
1250  for (std::string const& thresholdTag: util::get_elements<0U>(fADCthresholds))
1251  {
1252 
1253  auto const indices = fPassCounters.create(thresholdTag, patternName);
1254  if (patternIndex == fPassCounters.NoIndex) patternIndex = indices.second;
1255  else assert(indices.second == patternIndex);
1256 
1257  } // for thresholds
1258 
1259  return patternIndex;
1260 } // icarus::trigger::TriggerEfficiencyPlotsBase::createCountersForPattern()
IndexPair_t create(Threshold_t const &threshold, std::string const &patternName)
Creates and returns a new counter.
details::TriggerPassCounters fPassCounters
Counters for all triggers.
constexpr std::array< std::size_t, geo::vect::dimension< Vector >)> indices()
Returns a sequence of indices valid for a vector of the specified type.
std::map< std::string, art::InputTag > fADCthresholds
ADC threshold tags to read, and the input tag connected to their data.
static constexpr std::size_t NoIndex
Represents the index of a threshold or pattern that is not registered.
void icarus::trigger::TriggerEfficiencyPlotsBase::deleteEmptyPlots ( )
protected

Deletes plots with no entries, and directories which became empty.

Definition at line 1235 of file TriggerEfficiencyPlotsBase.cxx.

1236 {
1237 
1238  for (auto& thrPlots: fThresholdPlots) deleteEmptyPlots(thrPlots);
1239 
1240 } // icarus::trigger::TriggerEfficiencyPlotsBase::deleteEmptyPlots()
void deleteEmptyPlots()
Deletes plots with no entries, and directories which became empty.
std::vector< PlotSandbox > fThresholdPlots
All plots, one set per ADC threshold.
bool icarus::trigger::TriggerEfficiencyPlotsBase::deleteEmptyPlots ( PlotSandbox plots) const
private

Deletes from plots sandbox all plots and subboxes with no entries.

Returns
whether plots is now empty

Definition at line 1381 of file TriggerEfficiencyPlotsBase.cxx.

1382 {
1383  TDirectory* baseDir = plots.getDirectory();
1384  if (!baseDir) return true; // no content, nothing to do
1385 
1386  // our plots first
1387  unsigned int nEntries = 0U, nDirectories = 0U, nDeleted = 0U;
1388  for (TObject* obj: *(baseDir->GetList())) {
1389 
1390  // we do not deal with directories (except for subboxes below)
1391  if (dynamic_cast<TDirectory*>(obj)) {
1392  ++nDirectories;
1393  continue;
1394  }
1395 
1396  ++nEntries;
1397 
1398  // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1399  if (auto hist = dynamic_cast<TH1 const*>(obj)) {
1400  if (hist->GetEntries() > 0) continue;
1401  }
1402  // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1403  else if (auto graph = dynamic_cast<TGraph const*>(obj)) {
1404  if (graph->GetN() > 0) continue;
1405  }
1406  // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1407  else if (auto* eff = dynamic_cast<TEfficiency const*>(obj)) {
1408  auto const* hist = eff->GetTotalHistogram();
1409  if (hist && hist->GetEntries() > 0) continue;
1410  }
1411  // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1412  else if (auto* tree = dynamic_cast<TTree const*>(obj)) {
1413  if (tree->GetEntries() > 0) continue;
1414  }
1415  // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1416  // add here more supported object types
1417  // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1418  else continue; // we don't delete unknown objects
1419 
1420  mf::LogTrace(fLogCategory)
1421  << "Deleting empty " << obj->IsA()->GetName() << "['" << obj->GetName()
1422  << "'] from " << plots.name();
1423  delete obj;
1424  ++nDeleted;
1425 
1426  } // for objects in directory
1427 
1428  // if we have found no more directories than the ones expected
1429  // from the subboxes and all the other entries have been deleted,
1430  // this box might be empty
1431 
1432  bool empty
1433  = (nDeleted == nEntries) && (nDirectories <= plots.nSubSandboxes());
1434 
1435  // we can't delete the sandboxes while iterating on them...
1436  std::vector<std::string> toBeDeleted;
1437  for (PlotSandbox& subbox: plots.subSandboxes()) {
1438  if (!deleteEmptyPlots(subbox)) continue;
1439  toBeDeleted.push_back(subbox.name());
1440  mf::LogTrace(fLogCategory)
1441  << "Scheduling empty " << plots.name() << "/" << toBeDeleted.back() << " for deletion";
1442  } // for subboxes
1443  if (toBeDeleted.size() != plots.nSubSandboxes()) empty = false;
1444  for (std::string const& subName: toBeDeleted) {
1445  if (!plots.deleteSubSandbox(subName)) continue;
1446  mf::LogTrace(fLogCategory)
1447  << "Deleted box " << plots.name() << "/" << subName;
1448  } // for
1449 
1450  return empty;
1451 } // icarus::trigger::TriggerEfficiencyPlotsBase::deleteEmptyPlots()
std::string const fLogCategory
Message facility stream category for output.
void deleteEmptyPlots()
Deletes plots with no entries, and directories which became empty.
std::vector< PlotDef > plots
Definition: demo.h:54
icarus::trigger::PlotSandbox PlotSandbox
Import type.
bool empty(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:555
TTree* icarus::trigger::TriggerEfficiencyPlotsBase::eventTree ( )
inlineprotected

Returns a pointer to the tree where event information is written.

Definition at line 1120 of file TriggerEfficiencyPlotsBase.h.

1120 { return fIDTree? &(fIDTree->tree()): nullptr; }
std::unique_ptr< details::EventIDTree > fIDTree
Handler of ROOT tree output.
auto icarus::trigger::TriggerEfficiencyPlotsBase::extractActiveChannels ( TriggerGatesPerCryostat_t const &  cryoGates)
staticprotected

Returns all channels contributing to the trigger gates.

Parameters
cryoGatesall trigger gates
Returns
a list of ID of "active" channels

A channels is considered "active" when it is contributing to a trigger gate which is open at least one. Conversely, all channels belonging to gates which have no opening are excluded.

Definition at line 1351 of file TriggerEfficiencyPlotsBase.cxx.

1352 {
1353 
1354  //
1355  // get channels contributing to gates in a fired event
1356  //
1357 
1358  std::vector<ChannelID_t> channelList;
1359  for (auto const& gates: cryoGates) {
1360  for (auto const& gate: icarus::trigger::gatesIn(gates)) {
1361 
1362  if (gate.alwaysClosed()) continue;
1363  for (auto const channel: gate.channels()) {
1364  channelList.push_back(channel);
1365  }
1366  } // for gates
1367  } // for
1368 
1369  // remove duplicates
1370  std::sort(channelList.begin(), channelList.end());
1371  auto const firstDuplicate
1372  = std::unique(channelList.begin(), channelList.end());
1373  channelList.erase(firstDuplicate, channelList.end());
1374  return channelList;
1375 
1376 } // icarus::trigger::TriggerEfficiencyPlotsBase::extractActiveChannels()
auto gatesIn(TrackingGateColl &trackingGates)
void icarus::trigger::TriggerEfficiencyPlotsBase::fillAllEfficiencyPlots ( EventInfo_t const &  eventInfo,
PMTInfo_t const &  PMTinfo,
TriggerInfo_t const &  triggerInfo,
PlotSandbox const &  plots 
) const
protectedvirtual

Fills the plots as fillEfficiencyPlots() and also as fillEventPlots() for the proper category: triggered or not triggered.

Definition at line 1211 of file TriggerEfficiencyPlotsBase.cxx.

1216  {
1217 
1218  fillEfficiencyPlots(eventInfo, triggerInfo, plots);
1219 
1220  // plotting split for triggering/not triggering events
1222  eventInfo,
1223  plots.demandSandbox(triggerInfo.fired()? "triggering": "nontriggering")
1224  );
1225 
1226  fillPMTplots(
1227  PMTinfo,
1228  plots.demandSandbox(triggerInfo.fired()? "triggering": "nontriggering")
1229  );
1230 
1231 } // icarus::trigger::TriggerEfficiencyPlotsBase::fillAllEfficiencyPlots()
virtual void fillEventPlots(EventInfo_t const &eventInfo, PlotSandbox const &plots) const
Fills the plots (initializeEventPlots()) with info from eventInfo.
std::vector< PlotDef > plots
Definition: demo.h:54
virtual void fillPMTplots(PMTInfo_t const &PMTinfo, PlotSandbox const &plots) const
Fill the plots (initializePMTplots()) with info from PMTinfo.
virtual void fillEfficiencyPlots(EventInfo_t const &eventInfo, TriggerInfo_t const &triggerInfo, PlotSandbox const &plots) const
void icarus::trigger::TriggerEfficiencyPlotsBase::fillEfficiencyPlots ( EventInfo_t const &  eventInfo,
TriggerInfo_t const &  triggerInfo,
PlotSandbox const &  plots 
) const
protectedvirtual

Fills the plots (initializeEfficiencyPerTriggerPlots()) with info from eventInfo and triggerInfo.

Definition at line 1150 of file TriggerEfficiencyPlotsBase.cxx.

1154  {
1155 
1156  using namespace std::string_literals;
1158 
1160 
1161  HistGetter const getTrigEff { plots };
1162 
1163  bool const fired = triggerInfo.fired();
1164 
1165  // efficiency plots
1166  if (useEDep()) {
1167  getTrigEff.Eff("EffVsEnergyInSpill"s).Fill
1168  (fired, double(eventInfo.DepositedEnergyInSpill()));
1169  getTrigEff.Eff("EffVsEnergyInPreSpill"s).Fill
1170  (fired, double(eventInfo.DepositedEnergyInPreSpill()));
1171  getTrigEff.Eff("EffVsEnergyInSpillActive"s).Fill
1172  (fired, double(eventInfo.DepositedEnergyInSpillInActiveVolume()));
1173  getTrigEff.Eff("EffVsEnergyInPreSpillActive"s).Fill
1174  (fired, double(eventInfo.DepositedEnergyInPreSpillInActiveVolume()));
1175  } // if use energy deposits
1176  if (useGen()) {
1177  if (eventInfo.isNeutrino()) {
1178  getTrigEff.Eff("EffVsNeutrinoEnergy"s).Fill
1179  (fired, double(eventInfo.NeutrinoEnergy()));
1180  getTrigEff.Eff("EffVsLeptonEnergy"s).Fill
1181  (fired, double(eventInfo.LeptonEnergy()));
1182  }
1183  } // if use generated information
1184 
1185  if (fired) {
1186  detinfo::timescales::electronics_time const beamGateTime
1187  = detTimings.BeamGateTime();
1188 
1189  getTrigEff.Hist("TriggerTick"s).Fill(triggerInfo.atTick().value());
1190 
1191  // converts the tick in the argument into electronics time:
1192  auto openingTime = [&detTimings](OpeningInfo_t const& info)
1193  { return detTimings.toElectronicsTime(info.tick); };
1194 
1195  getTrigEff.Hist("TriggerTime"s).Fill
1196  ((openingTime(triggerInfo.main()) - beamGateTime).value());
1197 
1198  std::vector<OpeningInfo_t> const& allTriggerOpenings = triggerInfo.all();
1199 
1200  for (OpeningInfo_t const& opening : allTriggerOpenings) {
1201  getTrigEff.Hist("OpeningTimes"s).Fill
1202  ((openingTime(opening) - beamGateTime).value());
1203  } // for all trigger openings
1204 
1205  } // if fired
1206 
1207 } // icarus::trigger::TriggerEfficiencyPlotsBase::fillEfficiencyPlots()
bool useGen() const
Returns whether we are using and filling generator information.
std::vector< PlotDef > plots
Definition: demo.h:54
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
temporary value
fDetProps &fDetProps fDetProps &fDetProps detTimings
timescale_traits< ElectronicsTimeCategory >::time_point_t electronics_time
A point in time on the electronics time scale.
detinfo::DetectorTimings makeDetTimings(art::Event const *event)
Returns a detinfo::DetectorTimings from DetectorClocksService.
bool useEDep() const
Returns whether we are using and filling energy deposition information.
void icarus::trigger::TriggerEfficiencyPlotsBase::fillEventPlots ( EventInfo_t const &  eventInfo,
PlotSandbox const &  plots 
) const
protectedvirtual

Fills the plots (initializeEventPlots()) with info from eventInfo.

Definition at line 1097 of file TriggerEfficiencyPlotsBase.cxx.

1098 {
1099 
1100  using namespace std::string_literals;
1101 
1102  HistGetter const getTrig { plots };
1103 
1104  if (useEDep()) {
1105  assert(eventInfo.hasDepEnergy());
1106  getTrig.Hist("EnergyInSpill"s).Fill(double(eventInfo.DepositedEnergyInSpill()));
1107  getTrig.Hist("EnergyInSpillActive"s).Fill(double(eventInfo.DepositedEnergyInSpillInActiveVolume()));
1108  getTrig.Hist("EnergyInPreSpill"s)
1109  .Fill(double(eventInfo.DepositedEnergyInPreSpill()));
1110  getTrig.Hist("EnergyInPreSpillActive"s)
1111  .Fill(double(eventInfo.DepositedEnergyInPreSpillInActiveVolume()));
1112  getTrig.Hist2D("EnergyInPreSpillVsSpillActive"s).Fill(
1113  double(eventInfo.DepositedEnergyInSpillInActiveVolume()),
1114  double(eventInfo.DepositedEnergyInPreSpillInActiveVolume())
1115  );
1116  }
1117  if (useGen()) {
1118  if (eventInfo.isNeutrino()) {
1119  assert(eventInfo.hasGenerated());
1120  getTrig.Hist("NeutrinoEnergy"s).Fill(double(eventInfo.NeutrinoEnergy()));
1121  getTrig.Hist("InteractionType"s).Fill(eventInfo.InteractionType());
1122  getTrig.Hist("LeptonEnergy"s).Fill(double(eventInfo.LeptonEnergy()));
1123  getTrig.Hist("InteractionTypeNeutrinoEnergy"s).Fill(double(eventInfo.InteractionType()), double(eventInfo.NeutrinoEnergy()));
1124  } // if neutrino event
1125  TH2& vertexHist = getTrig.Hist2D("InteractionVertexYZ"s);
1126  for (auto const& point: eventInfo.Vertices())
1127  vertexHist.Fill(point.Z(), point.Y());
1128  } // if use generated information
1129 
1130 } // icarus::trigger::TriggerEfficiencyPlotsBase::fillEventPlots()
bool useGen() const
Returns whether we are using and filling generator information.
std::vector< PlotDef > plots
Definition: demo.h:54
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
bool useEDep() const
Returns whether we are using and filling energy deposition information.
void icarus::trigger::TriggerEfficiencyPlotsBase::fillPMTplots ( PMTInfo_t const &  PMTinfo,
PlotSandbox const &  plots 
) const
protectedvirtual

Fill the plots (initializePMTplots()) with info from PMTinfo.

Definition at line 1135 of file TriggerEfficiencyPlotsBase.cxx.

1136 {
1137 
1138  using namespace std::string_literals;
1139 
1140  HistGetter const getTrig { plots };
1141 
1142  auto& activePMThist = getTrig.Hist("ActivePMT"s);
1143  for (raw::Channel_t const channel: PMTinfo.activeChannels())
1144  activePMThist.Fill(channel);
1145 
1146 } // icarus::trigger::TriggerEfficiencyPlotsBase::fillPMTplots()
std::vector< PlotDef > plots
Definition: demo.h:54
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
geo::GeometryCore const& icarus::trigger::TriggerEfficiencyPlotsBase::geometry ( ) const
inlineprotected

Returns the detector geometry service provider.

Definition at line 1141 of file TriggerEfficiencyPlotsBase.h.

1141 { return fGeom; }
void icarus::trigger::TriggerEfficiencyPlotsBase::initializeEfficiencyPerTriggerPlots ( PlotSandbox plots) const
protectedvirtual

Initializes set of plots per complete trigger definition into plots.

Definition at line 826 of file TriggerEfficiencyPlotsBase.cxx.

827 {
828 
829  auto const [ detTimings, beamGate, preSpillWindow ] = makeGatePack();
830 
831  detinfo::timescales::optical_time_ticks const triggerResolutionTicks
832  { detTimings.toOpticalTicks(fTriggerTimeResolution) };
833 
834  auto const PreSpillDuration = preSpillWindow.asSimulationRange().duration();
835 
836  //
837  // Triggering efficiency vs. something else
838  //
839  if (useEDep()) {
840  plots.make<TEfficiency>(
841  "EffVsEnergyInSpill",
842  "Efficiency of triggering vs. energy deposited in spill"
843  ";energy deposited in spill [ GeV ]"
844  ";trigger efficiency [ / 50 MeV ]",
845  120, 0.0, 6.0 // 6 GeV should be enough for a MIP crossing 20 m of detector
846  );
847 
848  plots.make<TEfficiency>(
849  "EffVsEnergyInSpillActive",
850  "Efficiency of triggering vs. energy deposited in active volume"
851  ";energy deposited in active volume in spill [ GeV ]"
852  ";trigger efficiency [ / 50 MeV ]",
853  120, 0.0, 6.0 // 6 GeV should be enough for a MIP crossing 20 m of detector
854  );
855 
856  plots.make<TEfficiency>(
857  "EffVsEnergyInPreSpill",
858  (
859  "Efficiency of triggering vs. energy deposited in pre-spill ("
860  + to_string(PreSpillDuration) + ")"
861  ";energy deposited in pre-spill [ GeV ]"
862  ";trigger efficiency [ / 100 MeV ]"
863  ).c_str(),
864  120, 0.0, 12.0
865  );
866 
867  plots.make<TEfficiency>(
868  "EffVsEnergyInPreSpillActive",
869  (
870  "Efficiency of triggering vs. energy deposited in active volume"
871  " (pre-spill: " + to_string(PreSpillDuration) + ")"
872  ";energy deposited in active volume in pre-spill [ GeV ]"
873  ";trigger efficiency [ / 100 MeV ]"
874  ).c_str(),
875  120, 0.0, 12.0 // 6 GeV should be enough for a MIP crossing 20 m of detector
876  );
877  } // if plots with deposited energy
878 
879  if (useGen()) {
880  plots.make<TEfficiency>(
881  "EffVsNeutrinoEnergy",
882  "Efficiency of triggering vs. neutrino energy"
883  ";neutrino true energy [ GeV ]"
884  ";trigger efficiency [ / 50 MeV ]",
885  120, 0.0, 6.0 // 6 GeV is not that much for NuMI, but we should be ok
886  );
887 
888  plots.make<TEfficiency>(
889  "EffVsLeptonEnergy",
890  "Efficiency of triggering vs. outgoing lepton energy"
891  ";final state lepton true energy [ GeV ]"
892  ";trigger efficiency [ / 50 MeV ]",
893  120, 0.0, 6.0
894  );
895  } // if plots with generated info
896 
897  auto const& beamGateOpt = beamGate.asOptTickRange();
898  plots.make<TH1F>(
899  "TriggerTick",
900  "Trigger time tick"
901  ";optical time tick [ /" + util::to_string(triggerResolutionTicks) + " ]",
902  beamGateOpt.duration() / triggerResolutionTicks,
903  beamGateOpt.start().value(), beamGateOpt.end().value()
904  );
905 
906  // plots will be relative to the beam gate:
907  constexpr util::quantities::intervals::microseconds beamPlotPadding { 4_us };
908  icarus::ns::util::BinningSpecs const beamGateBinning = alignBinningTo(
910  (
911  std::min(
912  preSpillWindow.asElectronicsTimeRange().start(),
913  beamGate.asElectronicsTimeRange().start()
914  )
915  - beamGate.asElectronicsTimeRange().start()
916  - beamPlotPadding
917  ).value(),
918  (std::max(
919  preSpillWindow.asElectronicsTimeRange().end()
920  - beamGate.asElectronicsTimeRange().start(),
921  beamGate.duration()
922  ) + beamPlotPadding).value(),
923  fTriggerTimeResolution.value()
924  },
925  0.0
926  );
927 
928  plots.make<TH1F>(
929  "OpeningTimes",
930  "Times at which trigger logic was satisfied"
931  ";trigger time (relative to beam gate opening) [ us ]"
932  ";opened trigger gates",
933  beamGateBinning.nBins(), beamGateBinning.lower(), beamGateBinning.upper()
934  );
935 
936  plots.make<TH1F>(
937  "TriggerTime",
938  "Time of the trigger"
939  ";trigger time (relative to beam gate opening) [ us ]"
940  ";opened trigger gates",
941  beamGateBinning.nBins(), beamGateBinning.lower(), beamGateBinning.upper()
942  );
943 
944  //
945  // plots independent of the trigger primitive requirements
946  //
947 
948 } // icarus::trigger::TriggerEfficiencyPlotsBase::initializeEfficiencyPerTriggerPlots()
bool useGen() const
Returns whether we are using and filling generator information.
double lower() const
Returns the value of the lower end of the first bin.
Definition: BinningSpecs.h:187
BinningSpecs alignBinningTo(BinningSpecs const &binning, double boundary, bool extendCoverage=true)
Returns a binning shifted to align with the specified boundary.
timescale_traits< OpticalTimeCategory >::tick_interval_t optical_time_ticks
Data structure holding binning information.
Definition: BinningSpecs.h:170
decltype(auto) constexpr to_string(T &&obj)
ADL-aware version of std::to_string.
std::vector< PlotDef > plots
Definition: demo.h:54
GatePack_t makeGatePack(art::Event const *event=nullptr) const
Creates a GatePack_t from the specified event.
An interval (duration, length, distance) between two quantity points.
Definition: intervals.h:114
double upper() const
Returns the value of the upper end of the last bin.
Definition: BinningSpecs.h:190
std::string to_string(WindowPattern const &pattern)
temporary value
fDetProps &fDetProps fDetProps &fDetProps detTimings
unsigned long nBins() const
Returns the number of bins.
Definition: BinningSpecs.h:196
nanoseconds fTriggerTimeResolution
Trigger resolution in time.
bool useEDep() const
Returns whether we are using and filling energy deposition information.
void icarus::trigger::TriggerEfficiencyPlotsBase::initializeEventPlots ( PlotSandbox plots) const
protectedvirtual

Initializes a single, trigger-independent plot set into plots.

Definition at line 953 of file TriggerEfficiencyPlotsBase.cxx.

954 {
955 
956  auto const [ detTimings, beamGate, preSpillWindow ] = makeGatePack();
957 
958  auto const BeamGateDuration = beamGate.asSimulationRange().duration();
959  auto const PreSpillDuration = preSpillWindow.asSimulationRange().duration();
960 
961  //
962  // Selection-related plots
963  //
964  if (useGen()) {
965  plots.make<TH1F>(
966  "NeutrinoEnergy",
967  "True Neutrino Energy"
968  ";neutrino energy [GeV]"
969  ";events",
970  120, 0.0, 6.0 // GeV
971  );
972  }
973 
974  if (useEDep()) {
975  plots.make<TH1F>(
976  "EnergyInSpill",
977  "Energy deposited during the beam gate opening"
978  ";energy deposited in spill [ GeV ]"
979  ";events [ / 50 MeV ]",
980  120, 0.0, 6.0 // 6 GeV should be enough for a MIP crossing 20 m of detector
981  );
982  plots.make<TH1F>(
983  "EnergyInPreSpill",
984  (
985  "Energy deposited during the pre-spill window ("
986  + to_string(PreSpillDuration) + ")"
987  ";energy deposited in pre-spill [ GeV ]"
988  ";events [ / 100 MeV ]"
989  ).c_str(),
990  120, 0.0, 12.0
991  );
992  plots.make<TH1F>(
993  "EnergyInSpillActive",
994  "Energy deposited during the beam gate opening in active volume"
995  ";energy deposited in active volume in spill [ GeV ]"
996  ";events [ / 50 MeV ]",
997  120, 0.0, 6.0 // 6 GeV should be enough for a MIP crossing 20 m of detector
998  );
999  plots.make<TH1F>(
1000  "EnergyInPreSpillActive",
1001  (
1002  "Energy deposited in active volume during the pre-spill window ("
1003  + to_string(PreSpillDuration) + ")"
1004  ";energy deposited in active volume in pre-spill [ GeV ]"
1005  ";events [ / 100 MeV ]"
1006  ).c_str(),
1007  120, 0.0, 12.0
1008  );
1009  plots.make<TH2F>(
1010  "EnergyInPreSpillVsSpillActive",
1011  (
1012  "Energy deposited in active volume"
1013  ";energy in spill window (" + to_string(BeamGateDuration) + ") [ GeV ]"
1014  ";energy in pre-spill window (" + to_string(PreSpillDuration)
1015  + ") [ GeV ]"
1016  ).c_str(),
1017  120, 0.0, 6.0, 120, 0.0, 12.0
1018  );
1019  } // if use energy deposition
1020 
1021  if (useGen()) {
1022  plots.make<TH1I>(
1023  "InteractionType",
1024  "Interaction type"
1025  ";Interaction Type"
1026  ";events",
1027  200, 999.5, 1199.5
1028  );
1029  plots.make<TH1F>(
1030  "LeptonEnergy",
1031  "Energy of outgoing lepton"
1032  ";deposited energy [ GeV ]"
1033  ";events [ / 50 MeV ]",
1034  120, 0.0, 6.0
1035  );
1036  plots.make<TH2F>(
1037  "InteractionVertexYZ",
1038  "Vertex of triggered interaction"
1039  ";beam direction (z) [ / 20 cm ]"
1040  ";vertical direction (y) [ / 5 cm ]",
1041  120, -1200., +1200.,
1042  100, -250., +250.
1043  );
1044 
1045  plots.make<TH2F>(
1046  "InteractionTypeNeutrinoEnergy",
1047  "Interaction Type vs Neutrino Energy"
1048  ";InteractionType"
1049  ";Neutrino Energy",
1050  200,999.5,1199.5,
1051  120, 0.0, 6.0
1052  );
1053 
1054  } // if generated information
1055 
1056 } // icarus::trigger::TriggerEfficiencyPlotsBase::initializeEventPlots()
bool useGen() const
Returns whether we are using and filling generator information.
std::vector< PlotDef > plots
Definition: demo.h:54
GatePack_t makeGatePack(art::Event const *event=nullptr) const
Creates a GatePack_t from the specified event.
std::string to_string(WindowPattern const &pattern)
fDetProps &fDetProps fDetProps &fDetProps detTimings
bool useEDep() const
Returns whether we are using and filling energy deposition information.
void icarus::trigger::TriggerEfficiencyPlotsBase::initializePlots ( PlotCategories_t  categories,
std::vector< SettingsInfo_t > const &  settings 
)
protectedvirtual

Initializes all the plot sets, one per PMT threshold.

Definition at line 703 of file TriggerEfficiencyPlotsBase.cxx.

704 {
705  using namespace std::string_literals;
706 
707  auto const beamGate = icarus::trigger::makeBeamGateStruct
709 
710  fBeamGateChangeCheck(beamGate);
711 
712  if (fOnlyPlotCategories.empty()) fPlotCategories = std::move(categories);
713  else {
714  auto const plotThisCategory = [this](std::string const& name)
715  {
716  return std::binary_search
717  (fOnlyPlotCategories.begin(), fOnlyPlotCategories.end(), name);
718  };
719 
720  fPlotCategories.clear();
721  for (auto&& plotCategory: categories) {
722  if (!plotThisCategory(plotCategory.name())) continue;
723  fPlotCategories.push_back(std::move(plotCategory));
724  } // for
725  }
726 
727 
728  {
729  mf::LogTrace(fLogCategory)
730  << "Beam gate:"
731  << "\n - electronics time: " << beamGate.asGate()
732  << "\n - simulation time: " << beamGate.asSimulationRange()
733  << "\n - optical ticks: " << beamGate.asOptTickRange()
734  ;
735 
736  mf::LogInfo log(fLogCategory);
737  log << "\nConfigured " << fADCthresholds.size() << " thresholds (ADC):";
738  for (auto const& [ thresholdTag, dataTag ]: fADCthresholds)
739  log << "\n * " << thresholdTag << " (from '" << dataTag.encode() << "')";
740  log << "\nBeam gate for plots is " << beamGate.asSimulationRange();
741 
742  log << "\nConfigured " << fPlotCategories.size() << " plot categories"
743  << (fPlotCategories.empty()? '.': ':');
744  for (auto const& plotCategory: fPlotCategories) {
745  log << "\n ['" << plotCategory.name() << "'] "
746  << plotCategory.description();
747  } // for
748 
749  } // local block
750 
751 
752  for (std::string const& thresholdTag: util::get_elements<0U>(fADCthresholds))
753  {
754  // create a plot sandbox inside `fOutputDir` with a name/prefix `Thr###`
756  { fOutputDir, "Thr"s + thresholdTag, "(thr: "s + thresholdTag + ")"s };
757 
758  // create a subbox for each plot category
759  for (PlotCategory const& category: fPlotCategories) {
760  PlotSandbox& plots = thrPlots.addSubSandbox(
761  category.name(),
762  category.description()
763  );
764 
765  initializePlotSet(plots, settings);
766  } // for plot category
767  fThresholdPlots.push_back(std::move(thrPlots));
768  } // for thresholds
769 
770  mf::LogTrace log(fLogCategory);
771  log << "Created " << fThresholdPlots.size() << " plot boxes:\n";
772  for (auto const& box: fThresholdPlots) {
773  box.dump(log, " ");
774  } // for
775 
776 } // icarus::trigger::TriggerEfficiencyPlotsBase::initializePlots()
PlotCategories_t fPlotCategories
Plot categories (via initializePlots()).
std::string const fLogCategory
Message facility stream category for output.
microseconds fBeamGateDuration
Duration of the gate during with global optical triggers are accepted.
art::TFileDirectory fOutputDir
ROOT directory where all the plots are written.
virtual void initializePlotSet(PlotSandbox &plots, std::vector< SettingsInfo_t > const &settings) const
Initializes full set of plots for (ADC threshold + category) into plots.
std::vector< PlotDef > plots
Definition: demo.h:54
std::map< std::string, art::InputTag > fADCthresholds
ADC threshold tags to read, and the input tag connected to their data.
BeamGateStruct makeBeamGateStruct(detinfo::DetectorTimings const &detTimings, util::quantities::intervals::microseconds duration, util::quantities::intervals::microseconds delay=util::quantities::intervals::microseconds{0.0})
Creates a BeamGateStruct object of specified duration and start.
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
then echo fcl name
icarus::trigger::PlotSandbox PlotSandbox
Import type.
std::vector< PlotSandbox > fThresholdPlots
All plots, one set per ADC threshold.
detinfo::DetectorTimings makeDetTimings(art::Event const *event)
Returns a detinfo::DetectorTimings from DetectorClocksService.
microseconds fBeamGateStart
Start of the beam gate with respect to BeamGate().
icarus::ns::util::ThreadSafeChangeMonitor< icarus::trigger::BeamGateStruct > fBeamGateChangeCheck
Functor returning whether a gate has changed.
A helper to manage ROOT objects with consistent naming.
Definition: PlotSandbox.h:95
void icarus::trigger::TriggerEfficiencyPlotsBase::initializePlots ( std::vector< SettingsInfo_t > const &  settings)
inlineprotected

Initializes sets of default plots, one per PMT threshold.

Definition at line 1255 of file TriggerEfficiencyPlotsBase.h.

1256  { initializePlots(DefaultPlotCategories, settings); }
static PlotCategories_t const DefaultPlotCategories
List of event categories.
virtual void initializePlots(PlotCategories_t categories, std::vector< SettingsInfo_t > const &settings)
Initializes all the plot sets, one per PMT threshold.
void icarus::trigger::TriggerEfficiencyPlotsBase::initializePlotSet ( PlotSandbox plots,
std::vector< SettingsInfo_t > const &  settings 
) const
protectedvirtual

Initializes full set of plots for (ADC threshold + category) into plots.

Reimplemented in icarus::trigger::SlidingWindowTriggerEfficiencyPlots, and icarus::trigger::MajorityTriggerEfficiencyPlots.

Definition at line 781 of file TriggerEfficiencyPlotsBase.cxx.

782 {
783 
784  //
785  // Selection-related plots
786  //
788 
790 
791  //
792  // Plots per trigger setting, split in triggering and not triggering events;
793  // the plot set is the same as the "global" one.
794  //
795  using SS_t = std::pair<std::string, std::string>;
796  std::array<SS_t, 2U> const classes {
797  SS_t{ "triggering", "triggering events" },
798  SS_t{ "nontriggering", "non-triggering events" }
799  };
800  for (auto const& settingsDesc: settings) {
801 
802  // this defines a specific trigger, with its thresholds and settings
803  PlotSandbox& reqBox
804  = plots.addSubSandbox(settingsDesc.tag, settingsDesc.description);
805 
807 
808  for (auto const& [ name, desc ]: classes) {
809 
810  PlotSandbox& box = reqBox.addSubSandbox(name, desc);
811 
813 
814  initializePMTplots(box);
815 
816  } // for triggering requirement
817  } // for triggering classes
818 
819 
820 } // icarus::trigger::TriggerEfficiencyPlotsBase::initializePlotSet()
virtual void initializeEventPlots(PlotSandbox &plots) const
Initializes a single, trigger-independent plot set into plots.
virtual void initializePMTplots(PlotSandbox &plots) const
std::vector< PlotDef > plots
Definition: demo.h:54
SandboxType & addSubSandbox(std::string const &name, std::string const &desc, Args &&...args)
Creates a new sandbox contained in this one.
Definition: PlotSandbox.h:723
then echo fcl name
icarus::trigger::PlotSandbox PlotSandbox
Import type.
virtual void initializeEfficiencyPerTriggerPlots(PlotSandbox &plots) const
Initializes set of plots per complete trigger definition into plots.
void icarus::trigger::TriggerEfficiencyPlotsBase::initializePMTplots ( PlotSandbox plots) const
protectedvirtual

Initializes a single, trigger-independent, threshold-dependent plot set into plots.

Definition at line 1061 of file TriggerEfficiencyPlotsBase.cxx.

1062 {
1063 
1064  unsigned int const nOpChannels = fGeom.NOpChannels();
1065 
1066  //
1067  // plots independent of the trigger primitive requirements
1068  //
1069  plots.make<TH1I>(
1070  "ActivePMT",
1071  "PMT channels contributing to the trigger"
1072  ";channel with opened trigger gate"
1073  ";events",
1074  nOpChannels, // large number, zoom in presentations!
1075  0.0, static_cast<double>(nOpChannels)
1076  );
1077 
1078 } // icarus::trigger::TriggerEfficiencyPlotsBase::initializePMTplots()
unsigned int NOpChannels() const
Number of electronics channels for all the optical detectors.
std::vector< PlotDef > plots
Definition: demo.h:54
std::string const& icarus::trigger::TriggerEfficiencyPlotsBase::logCategory ( ) const
inlineprotected

Returns the name of the log category.

Definition at line 1117 of file TriggerEfficiencyPlotsBase.h.

1117 { return fLogCategory; }
std::string const fLogCategory
Message facility stream category for output.
auto icarus::trigger::TriggerEfficiencyPlotsBase::makeChannelCryostatMap ( geo::GeometryCore const &  geom)
staticprivate

Fills and returns a map of cryostat ID for each optical detector channel.

Definition at line 1456 of file TriggerEfficiencyPlotsBase.cxx.

1457 {
1458 
1459  auto const nOpChannels = geom.NOpChannels();
1460 
1461  std::vector<geo::CryostatID> channelCryostatMap(nOpChannels);
1462 
1463  for (auto const opChannel: util::counter(nOpChannels)) {
1464  if (!geom.IsValidOpChannel(opChannel)) continue;
1465  channelCryostatMap.at(opChannel)
1466  = geom.OpDetGeoFromOpChannel(opChannel).ID();
1467  } // for all channels
1468 
1469  return channelCryostatMap;
1470 
1471 } // icarus::trigger::TriggerEfficiencyPlotsBase::makeChannelCryostatMap()
auto counter(T begin, T end)
Returns an object to iterate values from begin to end in a range-for loop.
Definition: counter.h:285
icarus::trigger::details::EventInfoExtractor::EDepTags_t icarus::trigger::TriggerEfficiencyPlotsBase::makeEdepTag ( fhicl::Sequence< art::InputTag > const &  EnergyDepositTags,
fhicl::OptionalAtom< art::InputTag > const &  EnergyDepositSummaryTag 
)
staticprivate

Creates a EDepTags_t out of the module configuration.

Definition at line 1476 of file TriggerEfficiencyPlotsBase.cxx.

1479  {
1480 
1481  if (auto summaryTag = util::fhicl::getOptionalValue(EnergyDepositSummaryTag))
1482  {
1483  return {
1485  { *summaryTag }
1486  };
1487  }
1488  else {
1489 
1490  return { EnergyDepositTags() };
1491 
1492  }
1493 
1494 } // icarus::trigger::MakeTriggerSimulationTree::makeEdepTag()
std::optional< typename Optional::value_type > getOptionalValue(Optional const &parameter)
Returns the value of an optional parameter as std::optional.
Definition: FHiCLutils.h:188
Utility tag to identify a parameter as a specific type of tag.
auto icarus::trigger::TriggerEfficiencyPlotsBase::makeGatePack ( art::Event const *  event = nullptr) const
protected

Creates a GatePack_t from the specified event.

Parameters
eventthe event to extract beam for (if nullptr, uses job info)
Returns
a set of relevant gates

Use it C++17-fancy!

auto const [ detTimings, beamGate, preSpillWindow ] = makeGatePack(&event);

(the arguments are mapped to the GatePack_t members by position).

Definition at line 1277 of file TriggerEfficiencyPlotsBase.cxx.

1278 {
1279  auto const detTimings = icarus::ns::util::makeDetTimings(event);
1280  return GatePack_t{
1281  detTimings,
1286  };
1287 
1288 } // icarus::trigger::TriggerEfficiencyPlotsBase::makeGatePack()
microseconds fPreSpillWindow
Duration of the pre-spill gate.
microseconds fBeamGateDuration
Duration of the gate during with global optical triggers are accepted.
BeamGateStruct makeBeamGateStruct(detinfo::DetectorTimings const &detTimings, util::quantities::intervals::microseconds duration, util::quantities::intervals::microseconds delay=util::quantities::intervals::microseconds{0.0})
Creates a BeamGateStruct object of specified duration and start.
microseconds fPreSpillStart
Start of the pre-spill gate.
fDetProps &fDetProps fDetProps &fDetProps detTimings
detinfo::DetectorTimings makeDetTimings(art::Event const *event)
Returns a detinfo::DetectorTimings from DetectorClocksService.
microseconds fBeamGateStart
Start of the beam gate with respect to BeamGate().
icarus::trigger::ApplyBeamGateClass icarus::trigger::TriggerEfficiencyPlotsBase::makeMyBeamGate ( detinfo::DetectorClocksData const &  clockData) const
inlineprotected

Shortcut to create an ApplyBeamGate with the current configuration.

Definition at line 1415 of file TriggerEfficiencyPlotsBase.h.

1416  {
1417  return makeApplyBeamGate
1419  }
ApplyBeamGateClass makeApplyBeamGate(util::quantities::intervals::microseconds duration, util::quantities::intervals::microseconds delay, detinfo::DetectorClocksData const &clockData, std::string const &logCategory="ApplyBeamGateClass")
Returns a new ApplyBeamGateClass object with the specified gate.
std::string const fLogCategory
Message facility stream category for output.
microseconds fBeamGateDuration
Duration of the gate during with global optical triggers are accepted.
microseconds fBeamGateStart
Start of the beam gate with respect to BeamGate().
icarus::trigger::ApplyBeamGateClass icarus::trigger::TriggerEfficiencyPlotsBase::makeMyBeamGate ( art::Event const *  event = nullptr) const
inlineprotected

Definition at line 1421 of file TriggerEfficiencyPlotsBase.h.

icarus::trigger::ApplyBeamGateClass makeMyBeamGate(detinfo::DetectorClocksData const &clockData) const
Shortcut to create an ApplyBeamGate with the current configuration.
detinfo::DetectorClocksData makeDetClockData(art::Event const *event)
Returns a detinfo::DetectorClocksData from DetectorClocksService.
icarus::trigger::ApplyBeamGateClass icarus::trigger::TriggerEfficiencyPlotsBase::makeMyBeamGate ( art::Event const &  event) const
inlineprotected

Definition at line 1424 of file TriggerEfficiencyPlotsBase.h.

1424 { return makeMyBeamGate(&event); }
icarus::trigger::ApplyBeamGateClass makeMyBeamGate(detinfo::DetectorClocksData const &clockData) const
Shortcut to create an ApplyBeamGate with the current configuration.
std::size_t icarus::trigger::TriggerEfficiencyPlotsBase::nADCthresholds ( ) const
inlineprotected

Returns the number of configured PMT thresholds.

Definition at line 1129 of file TriggerEfficiencyPlotsBase.h.

1129 { return fADCthresholds.size(); }
std::map< std::string, art::InputTag > fADCthresholds
ADC threshold tags to read, and the input tag connected to their data.
geo::TPCGeo const* icarus::trigger::TriggerEfficiencyPlotsBase::pointInActiveTPC ( geo::Point_t const &  point) const
private

Returns in which TPC point is within the active volume of; nullptr if none.

geo::TPCGeo const* icarus::trigger::TriggerEfficiencyPlotsBase::pointInTPC ( geo::Point_t const &  point) const
private

Returns the TPC point is within, nullptr if none.

void icarus::trigger::TriggerEfficiencyPlotsBase::printSummary ( ) const
protected

Prints end-of-job summaries.

Definition at line 691 of file TriggerEfficiencyPlotsBase.cxx.

691  {
692 
693  mf::LogInfo log(fLogCategory);
694  log << nPlottedEvents << "/" << nEvents << " events plotted.";
695 
696  log << "\n" << fPassCounters;
697 
698 } // icarus::trigger::TriggerEfficiencyPlotsBase::printSummary()
std::atomic< unsigned int > nEvents
Count of seen events.
std::string const fLogCategory
Message facility stream category for output.
std::atomic< unsigned int > nPlottedEvents
Count of plotted events.
details::TriggerPassCounters fPassCounters
Counters for all triggers.
void icarus::trigger::TriggerEfficiencyPlotsBase::process ( art::Event const &  event)
protected

Fills the plots. Also extracts the information to fill them with.

Definition at line 584 of file TriggerEfficiencyPlotsBase.cxx.

585 {
586 
587  /*
588  * 1. find out the features of the event and the categories it belongs to
589  * 2. for each threshold:
590  * 1. read the trigger primitives
591  * 2. pick the plots to be filled
592  * 3. combine the trigger primitives, apply the beam gate,
593  * generate the trigger response, add the response to all the plots
594  * (delegated)
595  *
596  */
597 
598  ++nEvents;
599 
600  //
601  // 1. find out the features of the event and the categories it belongs to
602  //
603 
604  auto const [ detTimings, beamGate, preSpillWindow ] = makeGatePack(&event);
605 
606  if (auto oldGate = fBeamGateChangeCheck(beamGate); oldGate) {
607  mf::LogDebug(fLogCategory)
608  << "Beam gate has changed from " << oldGate->asOptTickRange()
609  << " to " << beamGate.asOptTickRange() << " (optical tick)!";
610  }
611 
612  EventInfo_t const eventInfo = fEventInfoExtractorMaker
613  (beamGate.asSimulationRange(), preSpillWindow.asSimulationRange())(event);
614 
615 
616  bool const bPlot = shouldPlotEvent(eventInfo);
617  if (bPlot) ++nPlottedEvents;
618 
619  if (fIDTree) fIDTree->assignID(event.id());
620  if (fPlotTree) fPlotTree->assign(bPlot);
621  if (fEventTree) fEventTree->assignEvent(eventInfo);
622 
623  std::vector<std::string> selectedPlotCategories
625  {
626  mf::LogTrace log(fLogCategory);
627  log
628  << "Event " << event.id() << " falls in " << selectedPlotCategories.size()
629  << " categories:"
630  ;
631  for (std::string const& name: selectedPlotCategories)
632  log << " \"" << name << "\"";
633  // print the information on the event
634  } // local block
635  if (!fLogEventDetails.empty()) {
636  mf::LogTrace(fLogEventDetails)
637  << "Event " << event.id() << ": " << eventInfo;
638  }
639 
640  //
641  // 2. for each PMT threshold:
642  //
643  auto const clockData
644  = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(event);
645  for (auto&& [ iThr, thrPair, thrPlots ]
647  ) {
648 
649  auto const& [ thresholdTag, dataTag ] = thrPair;
650 
651  //
652  // 2.1. read the trigger primitives
653  //
654 
655  TriggerGatesPerCryostat_t const& cryoGates
656  = splitByCryostat(readTriggerGates(event, dataTag));
657 
658  //
659  // 2.2. pick the plots to be filled
660  //
661  PlotSandboxRefs_t selectedPlots;
662 
663  if (bPlot) {
664  for (std::string const& name: selectedPlotCategories)
665  selectedPlots.emplace_back(*(thrPlots.findSandbox(name)));
666  }
667 
668  //
669  // 2.3. combine the trigger primitives, apply the beam gate,
670  // generate the trigger response, add the response to all the plots
671  //
673  iThr, // settings index
674  cryoGates,
675  eventInfo,
676  clockData,
677  selectedPlots
678  );
679 
680  } // for thresholds
681 
682  //
683  // store information in output tree if any
684  //
685  if (fIDTree) fIDTree->tree().Fill();
686 
687 } // icarus::trigger::TriggerEfficiencyPlotsBase::process()
std::string fLogEventDetails
Steam where to print event info.
std::atomic< unsigned int > nEvents
Count of seen events.
std::vector< std::string > selectPlotCategories(EventInfo_t const &info, PlotCategories_t const &categories) const
Returns the names of the plot categories event qualifies for.
PlotCategories_t fPlotCategories
Plot categories (via initializePlots()).
std::string const fLogCategory
Message facility stream category for output.
std::atomic< unsigned int > nPlottedEvents
Count of plotted events.
TriggerGatesPerCryostat_t splitByCryostat(TriggerGates_t &&gates) const
Moves the data in gates in a collection of gates by cryostat.
auto enumerate(Iterables &&...iterables)
Range-for loop helper tracking the number of iteration.
Definition: enumerate.h:69
TriggerGates_t readTriggerGates(art::Event const &event, art::InputTag const &dataTag) const
Information about the event.
std::unique_ptr< details::EventInfoTree > fEventTree
Handler of ROOT tree output.
details::EventInfoExtractorMaker const fEventInfoExtractorMaker
Helper to extract information from the event.
virtual bool shouldPlotEvent(EventInfo_t const &eventInfo) const
GatePack_t makeGatePack(art::Event const *event=nullptr) const
Creates a GatePack_t from the specified event.
std::map< std::string, art::InputTag > fADCthresholds
ADC threshold tags to read, and the input tag connected to their data.
virtual void simulateAndPlot(std::size_t const thresholdIndex, TriggerGatesPerCryostat_t const &gates, EventInfo_t const &eventInfo, detinfo::DetectorClocksData const &clockData, PlotSandboxRefs_t const &selectedPlots)=0
Simulates all triggers for a trigger setting and plots the results.
std::unique_ptr< details::PlotInfoTree > fPlotTree
Handler of ROOT tree output.
then echo fcl name
std::vector< std::reference_wrapper< PlotSandbox const >> PlotSandboxRefs_t
List of references to plot sandboxes.
fDetProps &fDetProps fDetProps &fDetProps detTimings
std::unique_ptr< details::EventIDTree > fIDTree
Handler of ROOT tree output.
std::vector< PlotSandbox > fThresholdPlots
All plots, one set per ADC threshold.
std::vector< TriggerGates_t > TriggerGatesPerCryostat_t
Type of lists of gates, one list per cryostat (outer index: cryostat no).
icarus::ns::util::ThreadSafeChangeMonitor< icarus::trigger::BeamGateStruct > fBeamGateChangeCheck
Functor returning whether a gate has changed.
auto icarus::trigger::TriggerEfficiencyPlotsBase::readTriggerGates ( art::Event const &  event,
art::InputTag const &  dataTag 
) const
private

Reads a set of input gates from the event

Returns
trigger gates, converted into InputTriggerGate_t

Definition at line 1308 of file TriggerEfficiencyPlotsBase.cxx.

1310 {
1311 
1312  using icarus::trigger::OpticalTriggerGateData_t; // for convenience
1313 
1314  // currently the associations are a waste of time memory...
1315  auto const& gates
1316  = event.getProduct<std::vector<OpticalTriggerGateData_t>>(dataTag);
1317  auto const& gateToWaveforms = event.getProduct
1318  <art::Assns<OpticalTriggerGateData_t, sbn::OpDetWaveformMeta>>(dataTag);
1319 
1320  try {
1321  return icarus::trigger::FillTriggerGates(gates, gateToWaveforms);
1322  }
1323  catch (cet::exception const& e) {
1324  throw cet::exception("TriggerEfficiencyPlots", "", e)
1325  << "Error encountered while reading data products from '"
1326  << dataTag.encode() << "'\n";
1327  }
1328 
1329 } // icarus::trigger::TriggerEfficiencyPlotsBase::readTriggerGates()
icarus::trigger::ReadoutTriggerGate< TriggerGateTick_t, TriggerGateTicks_t, raw::Channel_t > OpticalTriggerGateData_t
Type of trigger gate data serialized into art data products.
do i e
std::vector< icarus::trigger::TrackedOpticalTriggerGate< OpDetInfo > > FillTriggerGates(std::vector< icarus::trigger::OpticalTriggerGateData_t > const &gates, art::Assns< icarus::trigger::OpticalTriggerGateData_t, OpDetInfo > const &gateToWaveformInfo)
Creates a gate object out of trigger gate data products.
void icarus::trigger::TriggerEfficiencyPlotsBase::registerTriggerResult ( std::size_t  threshold,
std::size_t  pattern,
bool  fired 
)
protected

Registers the outcome of the specified trigger.

Definition at line 1265 of file TriggerEfficiencyPlotsBase.cxx.

1266  { fPassCounters(threshold, pattern).add(fired); }
details::TriggerPassCounters fPassCounters
Counters for all triggers.
void icarus::trigger::TriggerEfficiencyPlotsBase::registerTriggerResult ( std::size_t  threshold,
std::size_t  pattern,
TriggerInfo_t const &  triggerInfo 
)
protected

Definition at line 1271 of file TriggerEfficiencyPlotsBase.cxx.

1272  { registerTriggerResult(threshold, pattern, triggerInfo.fired()); }
void registerTriggerResult(std::size_t threshold, std::size_t pattern, bool fired)
Registers the outcome of the specified trigger.
std::vector< std::string > icarus::trigger::TriggerEfficiencyPlotsBase::selectPlotCategories ( EventInfo_t const &  info,
PlotCategories_t const &  categories 
) const
private

Returns the names of the plot categories event qualifies for.

Definition at line 1294 of file TriggerEfficiencyPlotsBase.cxx.

1295 {
1296  std::vector<std::string> selected;
1297 
1298  for (auto const& category: categories)
1299  if (category(info)) selected.push_back(category);
1300 
1301  return selected;
1302 
1303 } // icarus::trigger::TriggerEfficiencyPlotsBase::selectPlotCategories()
bool icarus::trigger::TriggerEfficiencyPlotsBase::shouldPlotEvent ( EventInfo_t const &  eventInfo) const
protectedvirtual

Returns whether an event with the specified information should be included in the plots at all (it's a filter).

Definition at line 1083 of file TriggerEfficiencyPlotsBase.cxx.

1084 {
1086  && eventInfo.hasVertex() && !eventInfo.isInActiveVolume())
1087  {
1088  return false;
1089  }
1090 
1091  return true;
1092 } // icarus::trigger::TriggerEfficiencyPlotsBase::shouldPlotEvent()
bool fPlotOnlyActiveVolume
Plot only events in active volume.
virtual void icarus::trigger::TriggerEfficiencyPlotsBase::simulateAndPlot ( std::size_t const  thresholdIndex,
TriggerGatesPerCryostat_t const &  gates,
EventInfo_t const &  eventInfo,
detinfo::DetectorClocksData const &  clockData,
PlotSandboxRefs_t const &  selectedPlots 
)
protectedpure virtual

Simulates all triggers for a trigger setting and plots the results.

Parameters
thresholdIndexthe index of the PMT threshold of input primitives
gatesthe trigger primitives used to simulate the trigger response
eventInfogeneral information about the event being simulated
selectedPlotslist of boxes containing plots to be filled

This pure virtual function is the core of the customization of this class. The simulateAndPlot() method is expected to:

  1. combine the trigger primitives
  2. apply the beam gate
  3. generate the trigger response
  4. fill all plots

for each trigger setting. Note that this helper class has no knowledge of those settings: how many they are, what they mean, which are their parameters. It is simulateAndPlot() task to properly process all of them at once, i.e. within a single call.

Big deal! The second and fourth step (application of beam gate and plots filling) have some helpers in this same class:

Combination of primitive can be helped with icarus::trigger::TriggerGateData

All plots must have already been initialized via initializePlots() and its helpers.

The method is required to perform the simulation of the trigger primitives specified in input. These primitives are provided in gates as many collections, one per cryostat. While this interface splits the primitives by cryostat, the trigger simulation gets to choose how to handle that information, e.g. performing an independent simulation per cryostat and then combining them all, or just merging back the two collections and treating the two cryostats as a single entity.

The input trigger primitives are extracted from PMT waveforms with a certain PMT threshold, which is documented by its index thresholdIndex; the threshold value can be obtained from ADCthreshold(thresholdIndex), and in the future more information may become available as well.

Plots will need information from the event being simulated: that information is precooked, extracted from the event and stored in eventInfo. If more information is needed, EventInfo_t needs to be updated in this helper, as no way is provided to perform that customization in the derived class.

It is expected that all PMT thresholds settings identified by the specified index. This helper class does not know the definition of any trigger, and it is expected that settings are tracked by the derived classes and each is associated to an index.

Implemented in icarus::trigger::SlidingWindowTriggerEfficiencyPlots, and icarus::trigger::MajorityTriggerEfficiencyPlots.

auto icarus::trigger::TriggerEfficiencyPlotsBase::splitByCryostat ( TriggerGates_t &&  gates) const
private

Moves the data in gates in a collection of gates by cryostat.

Definition at line 1334 of file TriggerEfficiencyPlotsBase.cxx.

1335 {
1336 
1337  TriggerGatesPerCryostat_t gatesPerCryostat{ fGeom.Ncryostats() };
1338 
1339  for (auto& gate: gates) {
1340  gatesPerCryostat[fChannelCryostat.at(gate.channels().front()).Cryostat]
1341  .push_back(std::move(gate));
1342  } // for gates
1343 
1344  return gatesPerCryostat;
1345 
1346 } // icarus::trigger::TriggerEfficiencyPlotsBase::splitByCryostat()
std::vector< geo::CryostatID > const fChannelCryostat
ID of cryostat where each optical detector channel (vector index) is.
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
std::vector< TriggerGates_t > TriggerGatesPerCryostat_t
Type of lists of gates, one list per cryostat (outer index: cryostat no).
static std::string icarus::trigger::TriggerEfficiencyPlotsBase::thrAndCatName ( std::string const &  boxName,
std::string const &  category 
)
inlinestaticprivate

Definition at line 1553 of file TriggerEfficiencyPlotsBase.h.

1554  { return boxName + "_" + category; }
static std::string icarus::trigger::TriggerEfficiencyPlotsBase::thrAndCatName ( PlotSandbox const &  box,
std::string const &  category 
)
inlinestaticprivate

Definition at line 1556 of file TriggerEfficiencyPlotsBase.h.

1557  { return thrAndCatName(box.name(), category); }
static std::string thrAndCatName(std::string const &boxName, std::string const &category)
nanoseconds icarus::trigger::TriggerEfficiencyPlotsBase::triggerTimeResolution ( ) const
inlineprotected

Returns the resolution of trigger timing clock [ns].

Definition at line 1144 of file TriggerEfficiencyPlotsBase.h.

1144 { return fTriggerTimeResolution; }
nanoseconds fTriggerTimeResolution
Trigger resolution in time.
bool icarus::trigger::TriggerEfficiencyPlotsBase::useEDep ( ) const
inlineprotected

Returns whether we are using and filling energy deposition information.

Definition at line 1126 of file TriggerEfficiencyPlotsBase.h.

1126 { return fEventInfoExtractorMaker.hasEDep(); }
details::EventInfoExtractorMaker const fEventInfoExtractorMaker
Helper to extract information from the event.
bool hasEDep() const
Returns whether we are extracting any energy deposition information.
bool icarus::trigger::TriggerEfficiencyPlotsBase::useGen ( ) const
inlineprotected

Returns whether we are using and filling generator information.

Definition at line 1123 of file TriggerEfficiencyPlotsBase.h.

bool hasGenerated() const
Returns whether we are extracting any generator information.
details::EventInfoExtractorMaker const fEventInfoExtractorMaker
Helper to extract information from the event.

Member Data Documentation

icarus::trigger::TriggerEfficiencyPlotsBase::PlotCategories_t const icarus::trigger::TriggerEfficiencyPlotsBase::DefaultPlotCategories
staticprotected

List of event categories.

category name condition
All any event

—Nu_mu | —Nu_e | NuCC | at least one generated charged current neutrino interaction —Nu_mu | —Nu_e | NuNC | at least one generated neutral current neutrino interaction —Nu_mu | —Nu_e |

Definition at line 1429 of file TriggerEfficiencyPlotsBase.h.

std::map<std::string, art::InputTag> icarus::trigger::TriggerEfficiencyPlotsBase::fADCthresholds
private

ADC threshold tags to read, and the input tag connected to their data.

Definition at line 1455 of file TriggerEfficiencyPlotsBase.h.

icarus::ns::util::ThreadSafeChangeMonitor<icarus::trigger::BeamGateStruct> icarus::trigger::TriggerEfficiencyPlotsBase::fBeamGateChangeCheck
private

Functor returning whether a gate has changed.

Definition at line 1517 of file TriggerEfficiencyPlotsBase.h.

microseconds icarus::trigger::TriggerEfficiencyPlotsBase::fBeamGateDuration
private

Duration of the gate during with global optical triggers are accepted.

Definition at line 1458 of file TriggerEfficiencyPlotsBase.h.

microseconds icarus::trigger::TriggerEfficiencyPlotsBase::fBeamGateStart
private

Start of the beam gate with respect to BeamGate().

Definition at line 1461 of file TriggerEfficiencyPlotsBase.h.

std::vector<geo::CryostatID> const icarus::trigger::TriggerEfficiencyPlotsBase::fChannelCryostat
private

ID of cryostat where each optical detector channel (vector index) is.

Definition at line 1501 of file TriggerEfficiencyPlotsBase.h.

art::InputTag icarus::trigger::TriggerEfficiencyPlotsBase::fDetectorParticleTag
private

Input simulated particles.

Definition at line 1452 of file TriggerEfficiencyPlotsBase.h.

details::EventInfoExtractorMaker const icarus::trigger::TriggerEfficiencyPlotsBase::fEventInfoExtractorMaker
private

Helper to extract information from the event.

Definition at line 1498 of file TriggerEfficiencyPlotsBase.h.

std::unique_ptr<details::EventInfoTree> icarus::trigger::TriggerEfficiencyPlotsBase::fEventTree
private

Handler of ROOT tree output.

Definition at line 1509 of file TriggerEfficiencyPlotsBase.h.

geo::GeometryCore const& icarus::trigger::TriggerEfficiencyPlotsBase::fGeom
private

Definition at line 1487 of file TriggerEfficiencyPlotsBase.h.

std::unique_ptr<details::EventIDTree> icarus::trigger::TriggerEfficiencyPlotsBase::fIDTree
private

Handler of ROOT tree output.

Definition at line 1507 of file TriggerEfficiencyPlotsBase.h.

std::string const icarus::trigger::TriggerEfficiencyPlotsBase::fLogCategory
private

Message facility stream category for output.

Definition at line 1475 of file TriggerEfficiencyPlotsBase.h.

std::string icarus::trigger::TriggerEfficiencyPlotsBase::fLogEventDetails
private

Steam where to print event info.

Definition at line 1477 of file TriggerEfficiencyPlotsBase.h.

std::vector<std::string> icarus::trigger::TriggerEfficiencyPlotsBase::fOnlyPlotCategories
private

Definition at line 1472 of file TriggerEfficiencyPlotsBase.h.

art::TFileDirectory icarus::trigger::TriggerEfficiencyPlotsBase::fOutputDir
private

ROOT directory where all the plots are written.

Definition at line 1490 of file TriggerEfficiencyPlotsBase.h.

details::TriggerPassCounters icarus::trigger::TriggerEfficiencyPlotsBase::fPassCounters
private

Counters for all triggers.

Definition at line 1519 of file TriggerEfficiencyPlotsBase.h.

PlotCategories_t icarus::trigger::TriggerEfficiencyPlotsBase::fPlotCategories
private

Plot categories (via initializePlots()).

Definition at line 1480 of file TriggerEfficiencyPlotsBase.h.

bool icarus::trigger::TriggerEfficiencyPlotsBase::fPlotOnlyActiveVolume
private

Plot only events in active volume.

Only apply these categories (empty applies all).

Definition at line 1469 of file TriggerEfficiencyPlotsBase.h.

std::unique_ptr<details::PlotInfoTree> icarus::trigger::TriggerEfficiencyPlotsBase::fPlotTree
private

Handler of ROOT tree output.

Definition at line 1508 of file TriggerEfficiencyPlotsBase.h.

microseconds icarus::trigger::TriggerEfficiencyPlotsBase::fPreSpillStart
private

Start of the pre-spill gate.

Definition at line 1465 of file TriggerEfficiencyPlotsBase.h.

microseconds icarus::trigger::TriggerEfficiencyPlotsBase::fPreSpillWindow
private

Duration of the pre-spill gate.

Definition at line 1463 of file TriggerEfficiencyPlotsBase.h.

std::vector<PlotSandbox> icarus::trigger::TriggerEfficiencyPlotsBase::fThresholdPlots
private

All plots, one set per ADC threshold.

Definition at line 1504 of file TriggerEfficiencyPlotsBase.h.

nanoseconds icarus::trigger::TriggerEfficiencyPlotsBase::fTriggerTimeResolution
private

Trigger resolution in time.

Definition at line 1467 of file TriggerEfficiencyPlotsBase.h.

std::atomic<unsigned int> icarus::trigger::TriggerEfficiencyPlotsBase::nEvents { 0U }
private

Count of seen events.

Definition at line 1512 of file TriggerEfficiencyPlotsBase.h.

std::atomic<unsigned int> icarus::trigger::TriggerEfficiencyPlotsBase::nPlottedEvents { 0U }
private

Count of plotted events.

Definition at line 1513 of file TriggerEfficiencyPlotsBase.h.


The documentation for this class was generated from the following files: