All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EventInfoUtils.h
Go to the documentation of this file.
1 /**
2  * @file icaruscode/PMT/Trigger/Algorithms/details/EventInfoUtils.h
3  * @brief Functions dealing with `icarus::trigger::details::EventInfo_t`.
4  * @author Gianluca Petrillo (petrillo@slac.stanford.edu)
5  * @date May 15, 2020
6  * @see icaruscode/PMT/Trigger/Algorithms/details/EventInfoUtils.cxx
7  */
8 
9 #ifndef ICARUSCODE_PMT_TRIGGER_ALGORITHM_DETAILS_EVENTINFOUTILS_H
10 #define ICARUSCODE_PMT_TRIGGER_ALGORITHM_DETAILS_EVENTINFOUTILS_H
11 
12 
13 // ICARUS libraries
16 
17 // LArSoft libraries
20 #include "lardataalg/DetectorInfo/DetectorTimingTypes.h" // simulation_time
21 #include "lardataalg/Utilities/quantities/energy.h" // gigaelectronvolt, ...
24 #include "larcoreobj/SimpleTypesAndConstants/geo_vectors.h" // geo::Point_t
25 #include "nusimdata/SimulationBase/MCTruth.h"
26 
27 // framework information
28 #include "canvas/Utilities/InputTag.h"
29 #include "messagefacility/MessageLogger/MessageLogger.h" // mf namespace
30 
31 // C/C++ standard libraries
32 #include <vector>
33 #include <string>
34 #include <variant>
35 #include <cassert>
36 
37 
38 //------------------------------------------------------------------------------
39 //---forward declarations
40 //---
41 namespace geo {
42  class TPCGeo;
43  class GeometryCore;
44 } // namespace geo
45 
46 //------------------------------------------------------------------------------
47 namespace icarus::trigger::details {
48  class EventInfoExtractor;
49  class EventInfoExtractorMaker;
50 } // namespace icarus::trigger::details
51 
52 /**
53  * @brief Extracts from `event` the relevant information on the physics event.
54  *
55  * This returns a `EventInfo_t` object filled as completely as possible.
56  *
57  * The `EventInfo_t` is managed so that it contains all the information about
58  * the "main" neutrino interaction. All other neutrino interactions are
59  * acknowledged but their information is not stored, with minor exceptions.
60  * Currently:
61  *
62  * * the main interaction is the interaction happening the earliest;
63  * * the other interactions have only their location (`Vertices()`) stored in
64  * the list; the order of the vertices in the list stays the same as the order
65  * they are filled, with the exception of the main interaction that is always
66  * moved in `front()` of the list. This means that _interaction vertices are
67  * not ordered by time_ unless that is how they were fed to this object.
68  *
69  * This class can read any data product in the event, and is completely
70  * configured at construction time via constructor arguments.
71  * If information is needed from a data product that is not read yet,
72  * the following actions are needed:
73  *
74  * 1. decide the input tag of the data product(s) to be read; this is usually
75  * delegated to the user via a configuration parameter;
76  * 2. the required input tags need to be stored into data members;
77  * 3. _art_ needs to be informed of the intention of reading the data products
78  * via `consumes()` or equivalent calls; this class can take care of that,
79  * if a `art::ConsumesCollector` object is provided;
80  * 4. the data product can be read with the usual means.
81  *
82  *
83  * Energy deposition
84  * ------------------
85  *
86  * The energy deposition information is event-wide and does not select
87  * depositions from any specific interaction.
88  *
89  * The energy depositions are grouped according to whether they are within the
90  * time interval of the beam spill window, a pre-spill window, or at any time;
91  * and whether they are in the active volume or anywhere.
92  * The depositions can be collected from a `sim::SimEnergyDeposit` list of data
93  * products or (not recommended) from a single `sim::SimChannel` data product.
94  * In the latter case, the depositions are extracted from the channels on the
95  * first interaction plane (always plane `0` according to LArSoft definitions),
96  * which is usually the largest of the planes.
97  *
98  */
100 
101  public:
102 
104  using TimeSpan_t = std::pair<simulation_time, simulation_time>;
105 
106  /// Enumerator of possible inputs.
107  enum class InputType {
110  SimChannels,
111  Unknown
112  }; // InputType
113 
114  /// Utility tag to identify a parameter as a specific type of tag.
115  template <InputType Category>
117 
118  static constexpr InputType InputCategory { Category };
120 
121  explicit CategorizedInputTag(art::InputTag tag): fTag(std::move(tag)) {}
122 
123  art::InputTag const& tag() const { return fTag; }
124  explicit operator art::InputTag const& () const { return tag(); }
125 
126  bool operator== (InputTag_t const& other) const
127  { return fTag == other.fTag; }
128  bool operator!= (InputTag_t const& other) const
129  { return fTag != other.fTag; }
130 
131  private:
132  art::InputTag fTag;
133  }; // CategorizedInputTag
134 
135 
136  /// Utility tag to identify a parameter as for SimEnergyDepositSummary tag.
139 
140  /// Utility tag to identify a parameter as for `sim::SimChannel` tag.
142 
143 
144  /// Type to specify the source of energy deposition information, if any.
145  using EDepTags_t = std::variant<
146  std::vector<art::InputTag>, // LArSoft energy deposition collections
147  SimEnergyDepositSummaryInputTag, // ICARUS energy deposition summary
148  SimChannelsInputTag // LArSoft SimChannel objects
149  >;
150 
151  /**
152  * @name Constructors
153  *
154  * Constructors are available to take advantage of specific _art_ features,
155  * and for the generic _art_/_gallery_ compatible interfaces.
156  */
157  /// @{
158 
159  /**
160  * @brief Constructor: configures the object.
161  * @param truthTags list of truth information data products to be read
162  * @param edepTags list of energy deposition data products to be read
163  * @param inSpillTimes start and end of spill, in simulation time
164  * @param inPreSpillTimes start and end of pre-spill, in simulation time
165  * @param geom LArSoft geometry service provider
166  * @param detTimingsPtr pointer to LArSoft detector timings utility
167  * @param logCategory name of message facility stream to sent messages to
168  * @see `EventInfoExtractor(std::vector<art::InputTag> const&, ConsumesColl&)`
169  *
170  * In _art_ framework context, prefer the
171  * `EventInfoExtractor(std::vector<art::InputTag> const&, ConsumesColl&)`
172  * constructor.
173  *
174  * Two formats of energy depositions are supported:
175  * * standard LArSoft (`std::vector<sim::SimEnergyDeposit>`): specify a vector
176  * of input tags in `edepTags` argument;
177  * * ICARUS deposited energy summary: specify an input tag converted into a
178  * `SimEnergyDepositSummaryInputTag` parameter in `edepTags` argument.
179  */
181  std::vector<art::InputTag> truthTags,
182  EDepTags_t edepTags,
183  TimeSpan_t inSpillTimes,
184  TimeSpan_t inPreSpillTimes,
185  geo::GeometryCore const& geom,
188  std::string logCategory = "EventInfoExtractor"
189  );
190 
191  /**
192  * @brief Constructor: configures, and declares consuming data product.
193  * @tparam ConsumesColl type with `art::ConsumesCollector` interface
194  * @param truthTags list of truth information data products to be read
195  * @param edepTags list of energy deposition data products to be read
196  * @param inSpillTimes start and end of spill, in simulation time
197  * @param inPreSpillTimes start and end of pre-spill, in simulation time
198  * @param geom LArSoft geometry service provider
199  * @param detTimings LArSoft detector timings utility
200  * @param logCategory name of message facility stream to sent messages to
201  * @param consumesCollector object to declare the consumed products to
202  *
203  * Typical usage is within a _art_ module constructor:
204  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
205  * icarus::trigger::details::EventInfoExtractor const eventInfoFrom {
206  * { art:InputTag{ "generator" } },
207  * consumesCollector()
208  * };
209  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
210  *
211  */
212  template <typename ConsumesColl>
214  std::vector<art::InputTag> truthTags,
215  std::vector<art::InputTag> edepTags,
216  TimeSpan_t inSpillTimes,
217  TimeSpan_t inPreSpillTimes,
218  geo::GeometryCore const& geom,
221  std::string logCategory,
222  ConsumesColl& consumesCollector
223  );
224 
225  /// @}
226 
227 
228  // @{
229  /**
230  * @brief Returns an `EventInfo_t` object with information from `event`.
231  * @tparam Event type of event to read data from (_art_ or _gallery_ event)
232  * @param event event record to read the information from
233  * @return a `EventInfo_t` with information extracted from `event`
234  *
235  */
236  template <typename Event>
237  EventInfo_t extractInfo(Event const& event) const;
238 
239  template <typename Event>
240  EventInfo_t operator() (Event const& event) const
241  { return extractInfo(event); }
242 
243  // @}
244 
245  /// Returns whether we are extracting any generator information.
246  bool hasGenerated() const { return !fGeneratorTags.empty(); }
247 
248  /// Returns whether we are extracting any energy deposition information.
249  bool hasEDep() const { return isEDepSpecified(fEnergyDepositTags); }
250 
251  // --- BEGIN -- EdepTag protocol ---------------------------------------------
252 
253  /// Represents the absence of any energy deposition information.
254  static EDepTags_t const NoEDepTags; // C++20: make this constexpr
255 
256  /// Returns whether `edepTags` contains a energy deposition summary tag.
257  static bool isEDepSummaryTag(EDepTags_t const& edepTag);
258 
259  /// Returns whether `edepTags` contains energy deposition list tags.
260  static bool isEDepListTag(EDepTags_t const& edepTag);
261 
262  /// Returns whether `edepTags` contains any energy deposition tag.
263  static bool isEDepSpecified(EDepTags_t const& edepTag)
264  { return edepTag != NoEDepTags; }
265 
266  // --- END -- EdepTag protocol -----------------------------------------------
267  private:
268 
270 
271  // --- BEGIN -- Configuration variables --------------------------------------
272 
273  /// List of truth data product tags (`std::vector<simb::MCTruth>`).
274  std::vector<art::InputTag> const fGeneratorTags;
275 
276  /// List of energy deposition product tags
277  /// (`std::vector<sim::SimEnergyDeposit>`) or their summary.
279 
280  std::string const fLogCategory; ///< Stream name for message facility.
281 
282  // --- END -- Configuration variables ----------------------------------------
283 
284 
285  // --- BEGIN -- Set up ------------------------------------------------------
286 
287  geo::GeometryCore const& fGeom; ///< Geometry service provider.
288 
289  ///< Detector properties information.
291 
292  ///< Detector timing conversion utility.
294 
295  TimeSpan_t const fInSpillTimes; ///< Start and stop time for "in spill" label.
296 
297  /// Start and stop time for "pre-spill" label.
299 
300  // --- END -- Set up --------------------------------------------------------
301 
302  /// Returns whether we use energy summary instead of full energy deposits.
305 
306  /// Fills `info` record with generation information from `truth`.
307  void fillGeneratorInfo(EventInfo_t& info, simb::MCTruth const& truth) const;
308 
309  /**
310  * @brief Fills `info` record with generated neutrino information from
311  * `truth`.
312  *
313  * If `info` record already contains an interaction (the "main" interaction),
314  * the interaction in `truth` becomes the new main interaction of `info`
315  * only if it is earlier than the old main interaction.
316  * Otherwise the record is updated to take note that there was yet another
317  * interaction in the event, with little-to-no information about it stored.
318  */
320  (EventInfo_t& info, simb::MCTruth const& truth) const;
321 
322  /// Extracts information from `truth` and sets it as the "main" interaction
323  /// information. Previous information is typically overwritten.
325  (EventInfo_t& info, simb::MCTruth const& truth) const;
326 
327  /// Adds selected information from the interaction in `truth` to `info`
328  /// record.
330  (EventInfo_t& info, simb::MCTruth const& truth) const;
331 
332  /// Adds the energy depositions from `energyDeposits` into `info` record.
334  EventInfo_t& info, std::vector<sim::SimEnergyDeposit> const& energyDeposits
335  ) const;
336 
337  /// Adds the energy depositions from `channels` into `info` record.
339  (EventInfo_t& info, std::vector<sim::SimChannel> const& channels) const;
340 
341  /// Returns in which TPC volume `point` falls in (`nullptr` if none).
342  geo::TPCGeo const* pointInTPC(geo::Point_t const& point) const;
343 
344  /// Returns in which active TPC volume `point` falls in (`nullptr` if none).
345  geo::TPCGeo const* pointInActiveTPC(geo::Point_t const& point) const;
346 
347  /// Returns the time of the neutrino interaction in `truth`.
348  ///
349  /// Undefined behaviour if the truth information does not describe a neutrino
350  /// interaction.
351  simulation_time getInteractionTime(simb::MCTruth const& truth) const;
352 
353 
354  /// Declares all the consumables to the collector.
355  template <typename ConsumesColl>
356  static void declareConsumables(
357  ConsumesColl& consumesCollector,
358  std::vector<art::InputTag> const& truthTags,
359  EDepTags_t const& edepTags
360  );
361 
362 }; // class icarus::trigger::details::EventInfoExtractor
363 
364 
365 // -----------------------------------------------------------------------------
366 /// A helper class creating a `EventInfoExtractor` with a specific setup.
368 
369  public:
370 
373 
374  /// Constructor: stores parameters for construction of `EventInfoExtractor`.
376  std::vector<art::InputTag> truthTags,
377  EDepTags_t edepTags,
378  geo::GeometryCore const& geom,
381  std::string logCategory
382  );
383 
384  /// Constructor: stores parameters for construction of `EventInfoExtractor`
385  /// and declares consumables.
386  template <typename ConsumesColl>
388  std::vector<art::InputTag> truthTags,
389  EDepTags_t edepTags,
390  geo::GeometryCore const& geom,
393  std::string logCategory,
394  ConsumesColl& consumesCollector
395  );
396 
397 
398  //@{
399  /// Creates and returns a new `EventInfoExtractor` object.
401  (TimeSpan_t inSpillTimes, TimeSpan_t inPreSpillTimes) const;
402 
403  EventInfoExtractor operator()
404  (TimeSpan_t inSpillTimes, TimeSpan_t inPreSpillTimes) const
405  { return make(inSpillTimes, inPreSpillTimes); }
406 
407  //@}
408 
409  /// Returns whether we are extracting any generator information.
410  bool hasGenerated() const { return !fGeneratorTags.empty(); }
411 
412  /// Returns whether we are extracting any energy deposition information.
413  bool hasEDep() const
415 
416 
417  private:
418 
419  std::vector<art::InputTag> const fGeneratorTags;
421  std::string const fLogCategory;
425 
426 }; // class icarus::trigger::details::EventInfoExtractor
427 
428 // -----------------------------------------------------------------------------
429 // --- inline implementation
430 // -----------------------------------------------------------------------------
431 // --- icarus::trigger::details::EventInfoExtractor
432 // -----------------------------------------------------------------------------
434  (EDepTags_t const& edepTag)
435  { return std::holds_alternative<SimEnergyDepositSummaryInputTag>(edepTag); }
436 
437 
438 // -----------------------------------------------------------------------------
440  (EDepTags_t const& edepTag)
441 {
442  auto const* edeplist = std::get_if<std::vector<art::InputTag>>(&edepTag);
443  return edeplist && !edeplist->empty();
444 } // icarus::trigger::details::EventInfoExtractor::isEDepListTag()
445 
446 
447 // -----------------------------------------------------------------------------
448 // --- template implementation
449 // -----------------------------------------------------------------------------
450 // --- icarus::trigger::details::EventInfoExtractor
451 // -----------------------------------------------------------------------------
454 
455 
456 // -----------------------------------------------------------------------------
457 template <typename ConsumesColl>
459  std::vector<art::InputTag> truthTags,
460  std::vector<art::InputTag> edepTags,
461  TimeSpan_t inSpillTimes,
462  TimeSpan_t inPreSpillTimes,
463  geo::GeometryCore const& geom,
466  std::string logCategory,
467  ConsumesColl& consumesCollector
468  )
470  std::move(truthTags), std::move(edepTags),
471  inSpillTimes, inPreSpillTimes,
472  geom, detProps, detTimings, std::move(logCategory)
473  }
474 {
475  declareConsumables(consumesCollector, fGeneratorTags, fEnergyDepositTags);
476 } // icarus::trigger::details::EventInfoExtractor::EventInfoExtractor(coll)
477 
478 
479 // -----------------------------------------------------------------------------
480 template <typename Event>
482  (Event const& event) const -> EventInfo_t
483 {
484 
486 
487  //
488  // generator information
489  //
490  for (art::InputTag const& inputTag: fGeneratorTags) {
491 
492  auto const& truthRecords
493  = event.template getProduct<std::vector<simb::MCTruth>>(inputTag);
494 
495  for (simb::MCTruth const& truth: truthRecords) {
496 
497  fillGeneratorInfo(info, truth);
498 
499  } // for truth records
500 
501  } // for generators
502 
503  //
504  // propagation in the detector
505  //
506  if (auto* summaryTag
507  = std::get_if<SimEnergyDepositSummaryInputTag>(&fEnergyDepositTags)
508  ) {
509 
511 
512  auto const& energyDeposits = event
513  .template getProduct<icarus::SimEnergyDepositSummary>(summaryTag->tag());
514 
515  info.SetDepositedEnergy (GeV(energyDeposits.Total));
516  info.SetDepositedEnergyInSpill (GeV(energyDeposits.Spill));
517  info.SetDepositedEnergyInPreSpill (GeV(energyDeposits.PreSpill));
518  info.SetDepositedEnergyInActiveVolume (GeV(energyDeposits.Active));
519  info.SetDepositedEnergyInSpillInActiveVolume (GeV(energyDeposits.SpillActive));
520  info.SetDepositedEnergyInPreSpillInActiveVolume(GeV(energyDeposits.PreSpillActive));
521 
522  }
523  else if
524  (auto* channelsTag = std::get_if<SimChannelsInputTag>(&fEnergyDepositTags))
525  {
526 
527  auto const& channels
528  = event.template getProduct<std::vector<sim::SimChannel>>
529  (channelsTag->tag())
530  ;
531  mf::LogTrace(fLogCategory)
532  << "Event " << event.id() << " has " << channels.size()
533  << " energy deposits recorded in '" << channelsTag->tag().encode() << "'";
534 
535  addEnergyDepositionInfo(info, channels);
536 
537  }
538  else if (
539  auto* edepListTag
540  = std::get_if<std::vector<art::InputTag>>(&fEnergyDepositTags)
541  ) {
542 
543  for (art::InputTag const& edepTag: *edepListTag) {
544 
545  auto const& energyDeposits
546  = event.template getProduct<std::vector<sim::SimEnergyDeposit>>(edepTag);
547  mf::LogTrace(fLogCategory)
548  << "Event " << event.id() << " has " << energyDeposits.size()
549  << " energy deposits recorded in '" << edepTag.encode() << "'";
550 
551  addEnergyDepositionInfo(info, energyDeposits);
552 
553  } // for all energy deposit tags
554 
555  }
556  else {
557  throw std::logic_error(
558  "icarus::trigger::details::EventInfoExtractor::EventInfoExtractor(): "
559  "unexpected type from EDepTags_t"
560  );
561  }
562 
563  mf::LogTrace(fLogCategory) << "Event " << event.id() << ": " << info;
564 
565  return info;
566 } // icarus::trigger::details::EventInfoExtractor::extractInfo()
567 
568 
569 // -----------------------------------------------------------------------------
570 template <typename ConsumesColl>
572  ConsumesColl& consumesCollector,
573  std::vector<art::InputTag> const& truthTags,
574  EDepTags_t const& edepTags
575 ) {
576 
577  for (art::InputTag const& inputTag: truthTags)
578  consumesCollector.template consumes<std::vector<simb::MCTruth>>(inputTag);
579 
580  if (
581  auto* summaryTag = std::get_if<SimEnergyDepositSummaryInputTag>(&edepTags);
582  summaryTag
583  ) {
584 
585  consumesCollector.template consumes<icarus::SimEnergyDepositSummary>
586  (static_cast<art::InputTag const&>(*summaryTag));
587 
588  }
589  else if (
590  auto* edepListTag = std::get_if<std::vector<art::InputTag>>(&edepTags);
591  edepListTag
592  ) {
593  // may be empty
594  for (art::InputTag const& inputTag: *edepListTag) {
595  consumesCollector.template consumes<std::vector<sim::SimEnergyDeposit>>
596  (inputTag);
597  }
598  }
599 
600 } // icarus::trigger::details::EventInfoExtractor::declareConsumables()
601 
602 
603 //------------------------------------------------------------------------------
604 //--- icarus::trigger::details::EventInfoExtractorMaker
605 //------------------------------------------------------------------------------
606 template <typename ConsumesColl>
608  std::vector<art::InputTag> truthTags,
609  EDepTags_t edepTags,
610  geo::GeometryCore const& geom,
613  std::string logCategory,
614  ConsumesColl& consumesCollector
615  )
617  std::move(truthTags), std::move(edepTags),
618  geom, detProps, detTimings, std::move(logCategory)
619  )
620 {
622  (consumesCollector, fGeneratorTags, fEnergyDepositTags);
623 } // icarus::trigger::details::EventInfoExtractorMaker::EventInfoExtractorMaker()
624 
625 
626 //------------------------------------------------------------------------------
627 
628 
629 #endif // ICARUSCODE_PMT_TRIGGER_ALGORITHM_DETAILS_EVENTINFOUTILS_H
630 
util::quantities::gigaelectronvolt GeV
bool hasGenerated() const
Returns whether we are extracting any generator information.
fDetProps &fDetProps detProps
static bool isEDepSummaryTag(EDepTags_t const &edepTag)
Returns whether edepTags contains a energy deposition summary tag.
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
Definition: UtilFunc.cxx:42
EventInfo_t operator()(Event const &event) const
TimeSpan_t const fInPreSpillTimes
Start and stop time for &quot;pre-spill&quot; label.
geo::TPCGeo const * pointInActiveTPC(geo::Point_t const &point) const
Returns in which active TPC volume point falls in (nullptr if none).
static bool isEDepSpecified(EDepTags_t const &edepTag)
Returns whether edepTags contains any energy deposition tag.
bool useEnergyDepositSummary() const
Returns whether we use energy summary instead of full energy deposits.
TimeSpan_t const fInSpillTimes
Start and stop time for &quot;in spill&quot; label.
Extracts from event the relevant information on the physics event.
Object storing a summary of energy depositions in the detector.
simulation_time getInteractionTime(simb::MCTruth const &truth) const
std::vector< art::InputTag > const fGeneratorTags
Geometry information for a single TPC.
Definition: TPCGeo.h:38
void SetDepositedEnergyInSpill(GeV e)
Sets the energy of the event deposited during beam gate [GeV].
Definition: EventInfo_t.h:217
InputType
Enumerator of possible inputs.
detinfo::timescales::simulation_time simulation_time
std::variant< std::vector< art::InputTag >, SimEnergyDepositSummaryInputTag, SimChannelsInputTag > EDepTags_t
Type to specify the source of energy deposition information, if any.
static EDepTags_t const NoEDepTags
Represents the absence of any energy deposition information.
geo::TPCGeo const * pointInTPC(geo::Point_t const &point) const
Returns in which TPC volume point falls in (nullptr if none).
static void declareConsumables(ConsumesColl &consumesCollector, std::vector< art::InputTag > const &truthTags, EDepTags_t const &edepTags)
Declares all the consumables to the collector.
void fillGeneratorInfo(EventInfo_t &info, simb::MCTruth const &truth) const
Fills info record with generation information from truth.
Interface to detinfo::DetectorClocks.
EventInfoExtractorMaker(std::vector< art::InputTag > truthTags, EDepTags_t edepTags, geo::GeometryCore const &geom, detinfo::DetectorPropertiesData const *detProps, detinfo::DetectorTimings const *detTimings, std::string logCategory)
Constructor: stores parameters for construction of EventInfoExtractor.
fDetProps &fDetProps fDetProps &fDetProps fLogCategory
void SetDepositedEnergyInPreSpillInActiveVolume(GeV e)
Definition: EventInfo_t.h:233
void SetDepositedEnergyInPreSpill(GeV e)
Sets the energy of the event deposited during pre-spill window [GeV].
Definition: EventInfo_t.h:220
detinfo::DetectorPropertiesData const * fDetProps
Detector timing conversion utility.
detinfo::DetectorTimings const * fDetTimings
std::pair< simulation_time, simulation_time > TimeSpan_t
CategorizedInputTag< InputType::EnergyDepositSummary > SimEnergyDepositSummaryInputTag
Utility tag to identify a parameter as for SimEnergyDepositSummary tag.
Definitions of geometry vector data types.
timescale_traits< SimulationTimeCategory >::time_point_t simulation_time
A point in time on the simulation time scale.
A value measured in the specified unit.
Definition: quantities.h:566
bool hasEDep() const
Returns whether we are extracting any energy deposition information.
Description of geometry of one entire detector.
static bool isEDepListTag(EDepTags_t const &edepTag)
Returns whether edepTags contains energy deposition list tags.
gigaelectronvolt_as<> gigaelectronvolt
Type of energy stored in gigaelectronvolt, in double precision.
Definition: energy.h:129
EventInfo_t extractInfo(Event const &event) const
Returns an EventInfo_t object with information from event.
void addEnergyDepositionInfo(EventInfo_t &info, std::vector< sim::SimEnergyDeposit > const &energyDeposits) const
Adds the energy depositions from energyDeposits into info record.
geo::GeometryCore const & fGeom
Geometry service provider.
detinfo::DetectorTimings const * fDetTimings
A helper class creating a EventInfoExtractor with a specific setup.
EventInfoExtractor(std::vector< art::InputTag > truthTags, EDepTags_t edepTags, TimeSpan_t inSpillTimes, TimeSpan_t inPreSpillTimes, geo::GeometryCore const &geom, detinfo::DetectorPropertiesData const *detProps, detinfo::DetectorTimings const *detTimings, std::string logCategory="EventInfoExtractor")
Constructor: configures the object.
Dimensioned variables representing energy.
bool hasGenerated() const
Returns whether we are extracting any generator information.
Class hosting selected information about the event.
void setMainGeneratorNeutrinoInfo(EventInfo_t &info, simb::MCTruth const &truth) const
contains information for a single step in the detector simulation
std::vector< art::InputTag > const fGeneratorTags
List of truth data product tags (std::vector&lt;simb::MCTruth&gt;).
A class exposing an upgraded interface of detinfo::DetectorClocksData.
void SetDepositedEnergy(GeV e)
Sets the total deposited energy of the event [GeV].
Definition: EventInfo_t.h:214
Data types for detinfo::DetectorTimings.
object containing MC truth information necessary for making RawDigits and doing back tracking ...
Selected information about the event.
Definition: EventInfo_t.h:45
detinfo::DetectorPropertiesData const * fDetProps
void fillGeneratorNeutrinoInfo(EventInfo_t &info, simb::MCTruth const &truth) const
Fills info record with generated neutrino information from truth.
fDetProps &fDetProps fDetProps &fDetProps detTimings
bool hasEDep() const
Returns whether we are extracting any energy deposition information.
void addGeneratorNeutrinoInfo(EventInfo_t &info, simb::MCTruth const &truth) const
Utility tag to identify a parameter as a specific type of tag.
EventInfoExtractor make(TimeSpan_t inSpillTimes, TimeSpan_t inPreSpillTimes) const
Creates and returns a new EventInfoExtractor object.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:184
void SetDepositedEnergyInActiveVolume(GeV e)
Sets the total deposited energy of the event in active volume [GeV].
Definition: EventInfo_t.h:223
std::string const fLogCategory
Stream name for message facility.
fDetProps &fDetProps fDetProps &fDetProps consumesCollector())