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

Produces energy deposition summary data products. More...

Inheritance diagram for icarus::trigger::ExtractEnergyDepositionSummary:

Classes

struct  Config
 
struct  TimingPack_t
 

Public Types

using microseconds = util::quantities::intervals::microseconds
 
using Parameters = art::EDProducer::Table< Config >
 

Public Member Functions

 ExtractEnergyDepositionSummary (Parameters const &config)
 
virtual void produce (art::Event &event) override
 Creates the data products. More...
 

Private Types

using EDepTags_t = details::EventInfoExtractorMaker::EDepTags_t
 

Static Private Member Functions

static EDepTags_t makeEnergyDepSourceTag (fhicl::Sequence< art::InputTag > const &energyDepositTags, fhicl::OptionalAtom< art::InputTag > const &simChannelTag)
 Fills a energy deposition tag object from the specified configuration. More...
 

Private Attributes

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...
 
std::string const fLogCategory
 Category name for the console output stream. More...
 
geo::GeometryCore const & fGeom
 Access to detector geometry information. More...
 
std::optional< TimingPack_tfDetProps
 All information about detector timings and properties. More...
 
icarus::ns::util::ThreadSafeChangeMonitor
< icarus::trigger::BeamGateStruct
fBeamGateChangeCheck
 Functor returning whether a gate has changed. More...
 
details::EventInfoExtractorMaker
const 
fEventInfoExtractorMaker
 

Detailed Description

Produces energy deposition summary data products.

The data product produced by this module is an alternative to storing the whole energy deposition, which can be huge.

This module takes its information from sim::SimEnergyDeposits data product in input, simply providing a sum of it within the specified time interval.

Output data products

Input data products

Service requirements

The following services are required:

Configuration parameters

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

Definition at line 121 of file ExtractEnergyDepositionSummary_module.cc.

Member Typedef Documentation

Definition at line 195 of file ExtractEnergyDepositionSummary_module.cc.

Definition at line 125 of file ExtractEnergyDepositionSummary_module.cc.

Definition at line 175 of file ExtractEnergyDepositionSummary_module.cc.

Constructor & Destructor Documentation

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

Definition at line 274 of file ExtractEnergyDepositionSummary_module.cc.

275  : art::EDProducer(config)
276  // configuration
277  , fBeamGateDuration (config().BeamGateDuration())
278  , fBeamGateStart (config().BeamGateStart())
279  , fPreSpillWindow (config().PreSpillWindow())
281  (fBeamGateStart - config().PreSpillWindowGap() - fPreSpillWindow)
282  , fLogCategory(config().OutputCategory())
283  // services
284  , fGeom(*(lar::providerFrom<geo::Geometry>()))
285  , fDetProps{
286  config().SimChannelTag.hasValue()
287  ? std::make_optional<TimingPack_t>(
288  art::ServiceHandle<detinfo::DetectorClocksService const>()
289  ->DataForJob(),
290  art::ServiceHandle<detinfo::DetectorPropertiesService const>()
291  ->DataForJob()
292  )
293  : std::nullopt
294  }
295  // algorithms
297  {} // truthTags: none
geo::GeometryCore const & fGeom
Access to detector geometry information.
microseconds fPreSpillWindow
Duration of the pre-spill gate.
microseconds fBeamGateDuration
Duration of the gate during with global optical triggers are accepted.
std::string const fLogCategory
Category name for the console output stream.
microseconds fBeamGateStart
Start of the beam gate with respect to BeamGate().
std::optional< TimingPack_t > fDetProps
All information about detector timings and properties.

Member Function Documentation

auto icarus::trigger::ExtractEnergyDepositionSummary::makeEnergyDepSourceTag ( fhicl::Sequence< art::InputTag > const &  energyDepositTags,
fhicl::OptionalAtom< art::InputTag > const &  simChannelTag 
)
staticprivate

Fills a energy deposition tag object from the specified configuration.

Definition at line 360 of file ExtractEnergyDepositionSummary_module.cc.

364 {
365  EDepTags_t edepTags;
366 
367  if (auto const tag = util::fhicl::getOptionalValue(simChannelTag)) {
368  edepTags
370  ;
371  }
372  else {
373  edepTags = energyDepositTags();
374  }
375 
376  return edepTags;
377 } // icarus::trigger::ExtractEnergyDepositionSummary::makeEnergyDepSourceTag()
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.
void icarus::trigger::ExtractEnergyDepositionSummary::produce ( art::Event &  event)
overridevirtual

Creates the data products.

Definition at line 312 of file ExtractEnergyDepositionSummary_module.cc.

313 {
314 
315  //
316  // prepare the information extractor and extract the information
317  //
318 
319  // we need to convert the two relevant gates with the proper parameters
320  auto const detTimings = icarus::ns::util::makeDetTimings(event);
321 
322  auto const beamGate = icarus::trigger::makeBeamGateStruct
324 
325  if (auto oldGate = fBeamGateChangeCheck(beamGate); oldGate) {
326  mf::LogWarning(fLogCategory)
327  << "Beam gate has changed from " << oldGate->asOptTickRange()
328  << " to " << beamGate.asOptTickRange() << " (optical tick)!";
329  }
330 
331  details::EventInfo_t const info = fEventInfoExtractorMaker(
332  beamGate.asSimulationRange(),
336  )(event);
337  assert(info.hasDepEnergy());
338 
339  //
340  // move the information into the data product
341  //
343  summary.Total = info.DepositedEnergy().value();
344  summary.Spill = info.DepositedEnergyInSpill().value();
345  summary.PreSpill = info.DepositedEnergyInPreSpill().value();
346  summary.Active = info.DepositedEnergyInActiveVolume().value();
347  summary.SpillActive = info.DepositedEnergyInSpillInActiveVolume().value();
348  summary.PreSpillActive = info.DepositedEnergyInPreSpillInActiveVolume().value();
349 
350  //
351  // finish
352  //
353  event.put
354  (std::make_unique<icarus::SimEnergyDepositSummary>(std::move(summary)));
355 
356 } // icarus::trigger::ExtractEnergyDepositionSummary::produce()
float Total
Total deposited energy [GeV].
microseconds fPreSpillWindow
Duration of the pre-spill gate.
Data structure containing summary information about deposited energy.
TimeRange< simulation_time > const & asSimulationRange() const
Returns the gate as start/stop pair in simulation time scale.
microseconds fBeamGateDuration
Duration of the gate during with global optical triggers are accepted.
icarus::ns::util::ThreadSafeChangeMonitor< icarus::trigger::BeamGateStruct > fBeamGateChangeCheck
Functor returning whether a gate has changed.
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.
std::string const fLogCategory
Category name for the console output stream.
microseconds fBeamGateStart
Start of the beam gate with respect to BeamGate().
fDetProps &fDetProps fDetProps &fDetProps detTimings
detinfo::DetectorTimings makeDetTimings(art::Event const *event)
Returns a detinfo::DetectorTimings from DetectorClocksService.

Member Data Documentation

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

Functor returning whether a gate has changed.

Definition at line 251 of file ExtractEnergyDepositionSummary_module.cc.

microseconds icarus::trigger::ExtractEnergyDepositionSummary::fBeamGateDuration
private

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

Definition at line 201 of file ExtractEnergyDepositionSummary_module.cc.

microseconds icarus::trigger::ExtractEnergyDepositionSummary::fBeamGateStart
private

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

Definition at line 204 of file ExtractEnergyDepositionSummary_module.cc.

std::optional<TimingPack_t> icarus::trigger::ExtractEnergyDepositionSummary::fDetProps
private

All information about detector timings and properties.

Definition at line 242 of file ExtractEnergyDepositionSummary_module.cc.

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

Definition at line 253 of file ExtractEnergyDepositionSummary_module.cc.

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

Access to detector geometry information.

Definition at line 239 of file ExtractEnergyDepositionSummary_module.cc.

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

Category name for the console output stream.

Definition at line 210 of file ExtractEnergyDepositionSummary_module.cc.

microseconds icarus::trigger::ExtractEnergyDepositionSummary::fPreSpillStart
private

Start of the pre-spill gate.

Definition at line 208 of file ExtractEnergyDepositionSummary_module.cc.

microseconds icarus::trigger::ExtractEnergyDepositionSummary::fPreSpillWindow
private

Duration of the pre-spill gate.

Definition at line 206 of file ExtractEnergyDepositionSummary_module.cc.


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