All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
icarus::trigger::DumpTriggerGateData Class Reference

Produces plots to inform trigger design. More...

Inheritance diagram for icarus::trigger::DumpTriggerGateData:

Classes

struct  Config
 

Public Types

using TriggerGateData_t = icarus::trigger::OpticalTriggerGate::GateData_t
 The type of data this dumper is dumping. More...
 
using Parameters = art::EDAnalyzer::Table< Config >
 

Public Member Functions

 DumpTriggerGateData (Parameters const &config)
 
 DumpTriggerGateData (DumpTriggerGateData const &)=delete
 
 DumpTriggerGateData (DumpTriggerGateData &&)=delete
 
DumpTriggerGateDataoperator= (DumpTriggerGateData const &)=delete
 
DumpTriggerGateDataoperator= (DumpTriggerGateData &&)=delete
 
virtual void analyze (art::Event const &event) override
 Fills the plots. Also extracts the information to fill them with. More...
 

Private Attributes

art::InputTag fTriggerGateDataTag
 Input trigger gate data tag. More...
 
bool fPrintChannels
 Whether to print associated optical waveform info. More...
 
std::string fOutputCategory
 Category used for message facility stream. More...
 

Detailed Description

Produces plots to inform trigger design.

This module produces sets of plots based on the configured trigger settings.

Input data products

Output plots

For each event category, a set of plots is left into a ROOT subdirectory.

Todo:
Document which plots these are!

Configuration parameters

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

Todo:
Complete the documentation

Definition at line 83 of file DumpTriggerGateData_module.cc.

Member Typedef Documentation

Definition at line 116 of file DumpTriggerGateData_module.cc.

The type of data this dumper is dumping.

Definition at line 88 of file DumpTriggerGateData_module.cc.

Constructor & Destructor Documentation

icarus::trigger::DumpTriggerGateData::DumpTriggerGateData ( Parameters const &  config)
explicit

Definition at line 173 of file DumpTriggerGateData_module.cc.

174  : art::EDAnalyzer(config)
175  // configuration
176  , fTriggerGateDataTag(config().TriggerGateDataTag())
177  , fPrintChannels (config().PrintChannels())
178  , fOutputCategory (config().OutputCategory())
179 {
180  consumes<std::vector<TriggerGateData_t>>(fTriggerGateDataTag);
181  if (fPrintChannels) {
182  consumes<art::Assns<TriggerGateData_t, raw::OpDetWaveform>>
184  }
185 
186 } // icarus::trigger::DumpTriggerGateData::DumpTriggerGateData()
bool fPrintChannels
Whether to print associated optical waveform info.
std::string fOutputCategory
Category used for message facility stream.
art::InputTag fTriggerGateDataTag
Input trigger gate data tag.
icarus::trigger::DumpTriggerGateData::DumpTriggerGateData ( DumpTriggerGateData const &  )
delete
icarus::trigger::DumpTriggerGateData::DumpTriggerGateData ( DumpTriggerGateData &&  )
delete

Member Function Documentation

void icarus::trigger::DumpTriggerGateData::analyze ( art::Event const &  event)
overridevirtual

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

Definition at line 190 of file DumpTriggerGateData_module.cc.

190  {
191 
192  //
193  // do the work
194  //
195  auto const& gates =
196  *(event.getValidHandle<std::vector<TriggerGateData_t>>(fTriggerGateDataTag));
197  auto const* gateToWaveforms = fPrintChannels
198  ? event.getHandle<art::Assns<TriggerGateData_t, raw::OpDetWaveform>>
199  (fTriggerGateDataTag).product()
200  : nullptr
201  ;
202 
203  auto maybeItOpDetWave { gateToWaveforms
204  ? std::make_optional(gateToWaveforms->begin()): std::nullopt
205  };
206 
207  mf::LogVerbatim log(fOutputCategory);
208  log << event.id() << ": '" << fTriggerGateDataTag.encode() << "' has "
209  << gates.size() << " trigger gates:";
210  for (auto const& [ iGate, gate ]: util::enumerate(gates)) {
211  log << "\n[#" << iGate << "] " << compactdump(gate);
212  if (gateToWaveforms) {
213  auto& itOpDetWave = maybeItOpDetWave.value();
214  auto const owend = gateToWaveforms->end();
215 
216  /*
217  * Associations are expected to be in the same order as the trigger gates;
218  * so we look for the first one matching this gate
219  * (matching by the position in the data product collection)
220  * and then for the last one; if there is none... well, we say so.
221  */
222  while (itOpDetWave != owend) {
223  if (itOpDetWave->first.key() == iGate) break;
224  ++itOpDetWave;
225  } // while
226  if (itOpDetWave == owend) {
227  log << "\n (not associated with any optical detector waveform!)";
228  continue;
229  }
230  auto const firstOpDetWave = itOpDetWave;
231  std::set<raw::Channel_t> channels;
232  while (itOpDetWave != owend) {
233  if (itOpDetWave->first.key() != iGate) break;
234  channels.insert(itOpDetWave->second->ChannelNumber());
235  ++itOpDetWave;
236  } // while
237 
238  log << "\n associated with "
239  << std::distance(firstOpDetWave, itOpDetWave)
240  << " optical detector waveforms on ";
241  if (channels.size() == 1U) {
242  log << "channel " << *(channels.cbegin());
243  }
244  else {
245  log << channels.size() << " channels:";
246  for (auto const& channel: channels) log << " " << channel;
247  }
248 
249  } // if printing associated information
250  } // for
251 
252 } // icarus::trigger::DumpTriggerGateData::analyze()
bool fPrintChannels
Whether to print associated optical waveform info.
std::string fOutputCategory
Category used for message facility stream.
auto enumerate(Iterables &&...iterables)
Range-for loop helper tracking the number of iteration.
Definition: enumerate.h:69
double distance(geo::Point_t const &point, CathodeDesc_t const &cathode)
Returns the distance of a point from the cathode.
art::InputTag fTriggerGateDataTag
Input trigger gate data tag.
auto compactdump(ReadoutTriggerGate< Tick, TickInterval, ChannelIDType > const &gate) -> details::CompactFormatter< ReadoutTriggerGate< Tick, TickInterval, ChannelIDType >>
Manipulator-like function for compact format of trigger gates.
DumpTriggerGateData& icarus::trigger::DumpTriggerGateData::operator= ( DumpTriggerGateData const &  )
delete
DumpTriggerGateData& icarus::trigger::DumpTriggerGateData::operator= ( DumpTriggerGateData &&  )
delete

Member Data Documentation

std::string icarus::trigger::DumpTriggerGateData::fOutputCategory
private

Category used for message facility stream.

Definition at line 147 of file DumpTriggerGateData_module.cc.

bool icarus::trigger::DumpTriggerGateData::fPrintChannels
private

Whether to print associated optical waveform info.

Definition at line 145 of file DumpTriggerGateData_module.cc.

art::InputTag icarus::trigger::DumpTriggerGateData::fTriggerGateDataTag
private

Input trigger gate data tag.

Definition at line 144 of file DumpTriggerGateData_module.cc.


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