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::OpDetWaveformMetaMaker Class Reference

Extracts and saves the time coverage of optical detector waveforms. More...

Inheritance diagram for icarus::trigger::OpDetWaveformMetaMaker:

Classes

struct  Config
 

Public Types

using Parameters = art::SharedProducer::Table< Config >
 

Public Member Functions

 OpDetWaveformMetaMaker (Parameters const &config, art::ProcessingFrame const &)
 
virtual void produce (art::Event &event, art::ProcessingFrame const &) override
 Fills the plots. Also extracts the information to fill them with. More...
 

Private Attributes

art::InputTag const fWaveformTag
 Input waveforms. More...
 
std::string const fLogCategory
 Message facility stream category for output. More...
 

Detailed Description

Extracts and saves the time coverage of optical detector waveforms.

This module writes a list of sbn::OpDetWaveformMeta objects matching the information of each optical detector waveform.

It may be used as input to modules which require all the information of a PMT waveform except the actual content of the waveform. For such uses, the large waveforms may be dropped and this summary information be kept instead.

Input data products

This module acts on a selection of tracks, which implies that the input is a set of pointers to tracks rather than to an actual track collection. For each track, an associated time is required.

Output data products

Configuration parameters

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

Definition at line 93 of file OpDetWaveformMetaMaker_module.cc.

Member Typedef Documentation

using icarus::trigger::OpDetWaveformMetaMaker::Parameters = art::SharedProducer::Table<Config>

Definition at line 118 of file OpDetWaveformMetaMaker_module.cc.

Constructor & Destructor Documentation

icarus::trigger::OpDetWaveformMetaMaker::OpDetWaveformMetaMaker ( Parameters const &  config,
art::ProcessingFrame const &   
)
explicit

Definition at line 168 of file OpDetWaveformMetaMaker_module.cc.

169  : art::SharedProducer(config)
170  // configuration
171  , fWaveformTag(config().Waveforms())
172  , fLogCategory(config().LogCategory())
173 {
174 
175  async<art::InEvent>();
176 
177  //
178  // output data declaration
179  //
180  produces<std::vector<sbn::OpDetWaveformMeta>>();
181  produces<art::Assns<sbn::OpDetWaveformMeta, raw::OpDetWaveform>>();
182 
183  //
184  // configuration report (short)
185  //
186 
187  mf::LogInfo{ fLogCategory }
188  << "Configuration:"
189  << "\n - input waveforms: '" << fWaveformTag.encode() << '\''
190  ;
191 
192 } // icarus::trigger::OpDetWaveformMetaMaker::OpDetWaveformMetaMaker()
std::string const fLogCategory
Message facility stream category for output.
art::InputTag const fWaveformTag
Input waveforms.

Member Function Documentation

void icarus::trigger::OpDetWaveformMetaMaker::produce ( art::Event &  event,
art::ProcessingFrame const &   
)
overridevirtual

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

Definition at line 197 of file OpDetWaveformMetaMaker_module.cc.

198 {
199 
201 
202  //
203  // get the timing information for this event
204  //
206  (art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(event))
207  ;
208 
209  //
210  // fetch input
211  //
212  auto const& waveformHandle
213  = event.getValidHandle<std::vector<raw::OpDetWaveform>>(fWaveformTag);
214 
215  {
216  electronics_time const triggerTime = detTimings.TriggerTime();
217  electronics_time const beamGateTime = detTimings.BeamGateTime();
218  mf::LogDebug(fLogCategory)
219  << "Event " << event.id() << " has beam gate starting at " << beamGateTime
220  << " and trigger at " << triggerTime << "."
221  << "\nNow extracting information from " << waveformHandle->size()
222  << " waveforms."
223  ;
224  }
225 
226  //
227  // create the content
228  //
230 
231  std::vector<sbn::OpDetWaveformMeta> PMTinfo;
232  art::Assns<sbn::OpDetWaveformMeta, raw::OpDetWaveform> infoToWaveform;
233 
234  art::PtrMaker<sbn::OpDetWaveformMeta> const makeInfoPtr { event };
235  art::PtrMaker<raw::OpDetWaveform> const makeWaveformPtr
236  { event, waveformHandle.id() };
237 
238  for (auto const& [ iWaveform, waveform ]: util::enumerate(*waveformHandle)) {
239  assert(iWaveform == PMTinfo.size());
240 
241  PMTinfo.push_back(makeOpDetWaveformMeta(waveform));
242 
243  {
244  sbn::OpDetWaveformMeta const& info = PMTinfo.back();
245  mf::LogTrace log{ fLogCategory };
246  log << "Coverage for waveform #" << iWaveform
247  << " on channel " << info.channel << ": "
248  << info.startTime << " -- " << info.endTime;
249  if (info.withTrigger()) log << "; includes trigger";
250  if (info.withBeamGate()) log << "; includes beam gate start";
251  }
252 
253  infoToWaveform.addSingle
254  (makeInfoPtr(iWaveform), makeWaveformPtr(iWaveform));
255 
256  } // for
257 
258  //
259  // store output
260  //
261  event.put(moveToUniquePtr(PMTinfo));
262  event.put(moveToUniquePtr(infoToWaveform));
263 
264 } // icarus::trigger::OpDetWaveformMetaMaker::produce()
electronics_time BeamGateTime() const
OpDetWaveformMeta makeOpDetWaveformMeta(raw::OpDetWaveform const &waveform, detinfo::DetectorTimings const &detTimings)
Creates a sbn::OpDetWaveformMeta out of a raw::OpDetWaveform.
Derivative information from raw::OpDetWaveform data.
double endTime
Time at the end of the last sample in the waveform [us].
auto enumerate(Iterables &&...iterables)
Range-for loop helper tracking the number of iteration.
Definition: enumerate.h:69
std::string const fLogCategory
Message facility stream category for output.
bool withBeamGate() const
Returns whether the time interval includes for sure the beam opening time.
art::InputTag const fWaveformTag
Input waveforms.
detinfo::DetectorTimings makeDetectorTimings(detinfo::DetectorClocksData const &detClocks)
bool withTrigger() const
Returns whether the time interval includes for sure the trigger time.
electronics_time TriggerTime() const
Converter from raw::OpDetWaveform into sbn::OpDetWaveformMeta.
raw::Channel_t channel
ID of the PMT channel.
A class exposing an upgraded interface of detinfo::DetectorClocksData.
fDetProps &fDetProps fDetProps &fDetProps detTimings
double startTime
Time of the first sample in the waveform [us].
timescale_traits< ElectronicsTimeCategory >::time_point_t electronics_time
A point in time on the electronics time scale.

Member Data Documentation

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

Message facility stream category for output.

Definition at line 146 of file OpDetWaveformMetaMaker_module.cc.

art::InputTag const icarus::trigger::OpDetWaveformMetaMaker::fWaveformTag
private

Input waveforms.

Definition at line 143 of file OpDetWaveformMetaMaker_module.cc.


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