Extracts from event
the relevant information on the physics event.
More...
#include <EventInfoUtils.h>
Classes | |
struct | CategorizedInputTag |
Utility tag to identify a parameter as a specific type of tag. More... | |
Public Types | |
enum | InputType { InputType::EnergyDeposits, InputType::EnergyDepositSummary, InputType::SimChannels, InputType::Unknown } |
Enumerator of possible inputs. More... | |
using | simulation_time = detinfo::timescales::simulation_time |
using | TimeSpan_t = std::pair< simulation_time, simulation_time > |
using | SimEnergyDepositSummaryInputTag = CategorizedInputTag< InputType::EnergyDepositSummary > |
Utility tag to identify a parameter as for SimEnergyDepositSummary tag. More... | |
using | SimChannelsInputTag = CategorizedInputTag< InputType::SimChannels > |
Utility tag to identify a parameter as for sim::SimChannel tag. More... | |
using | EDepTags_t = std::variant< std::vector< art::InputTag >, SimEnergyDepositSummaryInputTag, SimChannelsInputTag > |
Type to specify the source of energy deposition information, if any. More... | |
Public Member Functions | |
bool | hasGenerated () const |
Returns whether we are extracting any generator information. More... | |
bool | hasEDep () const |
Returns whether we are extracting any energy deposition information. More... | |
template<typename Event > | |
auto | extractInfo (Event const &event) const -> EventInfo_t |
Constructors | |
Constructors are available to take advantage of specific art features, and for the generic art/_gallery_ compatible interfaces. | |
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. More... | |
template<typename ConsumesColl > | |
EventInfoExtractor (std::vector< art::InputTag > truthTags, std::vector< art::InputTag > edepTags, TimeSpan_t inSpillTimes, TimeSpan_t inPreSpillTimes, geo::GeometryCore const &geom, detinfo::DetectorPropertiesData const *detProps, detinfo::DetectorTimings const *detTimings, std::string logCategory, ConsumesColl &consumesCollector) | |
Constructor: configures, and declares consuming data product. More... | |
template<typename Event > | |
EventInfo_t | extractInfo (Event const &event) const |
Returns an EventInfo_t object with information from event . More... | |
template<typename Event > | |
EventInfo_t | operator() (Event const &event) const |
Static Public Member Functions | |
static bool | isEDepSummaryTag (EDepTags_t const &edepTag) |
Returns whether edepTags contains a energy deposition summary tag. More... | |
static bool | isEDepListTag (EDepTags_t const &edepTag) |
Returns whether edepTags contains energy deposition list tags. More... | |
static bool | isEDepSpecified (EDepTags_t const &edepTag) |
Returns whether edepTags contains any energy deposition tag. More... | |
Static Public Attributes | |
static EDepTags_t const | NoEDepTags {} |
Represents the absence of any energy deposition information. More... | |
Private Member Functions | |
bool | useEnergyDepositSummary () const |
Returns whether we use energy summary instead of full energy deposits. More... | |
void | fillGeneratorInfo (EventInfo_t &info, simb::MCTruth const &truth) const |
Fills info record with generation information from truth . More... | |
void | fillGeneratorNeutrinoInfo (EventInfo_t &info, simb::MCTruth const &truth) const |
Fills info record with generated neutrino information from truth . More... | |
void | setMainGeneratorNeutrinoInfo (EventInfo_t &info, simb::MCTruth const &truth) const |
void | addGeneratorNeutrinoInfo (EventInfo_t &info, simb::MCTruth const &truth) const |
void | addEnergyDepositionInfo (EventInfo_t &info, std::vector< sim::SimEnergyDeposit > const &energyDeposits) const |
Adds the energy depositions from energyDeposits into info record. More... | |
void | addEnergyDepositionInfo (EventInfo_t &info, std::vector< sim::SimChannel > const &channels) const |
Adds the energy depositions from channels into info record. More... | |
geo::TPCGeo const * | pointInTPC (geo::Point_t const &point) const |
Returns in which TPC volume point falls in (nullptr if none). More... | |
geo::TPCGeo const * | pointInActiveTPC (geo::Point_t const &point) const |
Returns in which active TPC volume point falls in (nullptr if none). More... | |
simulation_time | getInteractionTime (simb::MCTruth const &truth) const |
Static Private Member Functions | |
template<typename ConsumesColl > | |
static void | declareConsumables (ConsumesColl &consumesCollector, std::vector< art::InputTag > const &truthTags, EDepTags_t const &edepTags) |
Declares all the consumables to the collector. More... | |
Private Attributes | |
friend | EventInfoExtractorMaker |
std::vector< art::InputTag > const | fGeneratorTags |
List of truth data product tags (std::vector<simb::MCTruth> ). More... | |
EDepTags_t const | fEnergyDepositTags |
std::string const | fLogCategory |
Stream name for message facility. More... | |
geo::GeometryCore const & | fGeom |
Geometry service provider. More... | |
detinfo::DetectorPropertiesData const * | fDetProps = nullptr |
Detector timing conversion utility. More... | |
detinfo::DetectorTimings const * | fDetTimings = nullptr |
TimeSpan_t const | fInSpillTimes |
Start and stop time for "in spill" label. More... | |
TimeSpan_t const | fInPreSpillTimes |
Start and stop time for "pre-spill" label. More... | |
Extracts from event
the relevant information on the physics event.
This returns a EventInfo_t
object filled as completely as possible.
The EventInfo_t
is managed so that it contains all the information about the "main" neutrino interaction. All other neutrino interactions are acknowledged but their information is not stored, with minor exceptions. Currently:
Vertices()
) stored in the list; the order of the vertices in the list stays the same as the order they are filled, with the exception of the main interaction that is always moved in front()
of the list. This means that interaction vertices are not ordered by time unless that is how they were fed to this object.This class can read any data product in the event, and is completely configured at construction time via constructor arguments. If information is needed from a data product that is not read yet, the following actions are needed:
consumes()
or equivalent calls; this class can take care of that, if a art::ConsumesCollector
object is provided;The energy deposition information is event-wide and does not select depositions from any specific interaction.
The energy depositions are grouped according to whether they are within the time interval of the beam spill window, a pre-spill window, or at any time; and whether they are in the active volume or anywhere. The depositions can be collected from a sim::SimEnergyDeposit
list of data products or (not recommended) from a single sim::SimChannel
data product. In the latter case, the depositions are extracted from the channels on the first interaction plane (always plane 0
according to LArSoft definitions), which is usually the largest of the planes.
Definition at line 99 of file EventInfoUtils.h.
using icarus::trigger::details::EventInfoExtractor::EDepTags_t = std::variant< std::vector<art::InputTag>, SimEnergyDepositSummaryInputTag, SimChannelsInputTag > |
Type to specify the source of energy deposition information, if any.
Definition at line 149 of file EventInfoUtils.h.
using icarus::trigger::details::EventInfoExtractor::SimChannelsInputTag = CategorizedInputTag<InputType::SimChannels> |
Utility tag to identify a parameter as for sim::SimChannel
tag.
Definition at line 141 of file EventInfoUtils.h.
using icarus::trigger::details::EventInfoExtractor::SimEnergyDepositSummaryInputTag = CategorizedInputTag<InputType::EnergyDepositSummary> |
Utility tag to identify a parameter as for SimEnergyDepositSummary tag.
Definition at line 138 of file EventInfoUtils.h.
using icarus::trigger::details::EventInfoExtractor::simulation_time = detinfo::timescales::simulation_time |
Definition at line 103 of file EventInfoUtils.h.
using icarus::trigger::details::EventInfoExtractor::TimeSpan_t = std::pair<simulation_time, simulation_time> |
Definition at line 104 of file EventInfoUtils.h.
Enumerator of possible inputs.
Enumerator | |
---|---|
EnergyDeposits | |
EnergyDepositSummary | |
SimChannels | |
Unknown |
Definition at line 107 of file EventInfoUtils.h.
icarus::trigger::details::EventInfoExtractor::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.
truthTags | list of truth information data products to be read |
edepTags | list of energy deposition data products to be read |
inSpillTimes | start and end of spill, in simulation time |
inPreSpillTimes | start and end of pre-spill, in simulation time |
geom | LArSoft geometry service provider |
detTimingsPtr | pointer to LArSoft detector timings utility |
logCategory | name of message facility stream to sent messages to |
EventInfoExtractor(std::vector<art::InputTag> const&, ConsumesColl&)
In art framework context, prefer the EventInfoExtractor(std::vector<art::InputTag> const&, ConsumesColl&)
constructor.
Two formats of energy depositions are supported:
std::vector<sim::SimEnergyDeposit>
): specify a vector of input tags in edepTags
argument;SimEnergyDepositSummaryInputTag
parameter in edepTags
argument. Definition at line 97 of file EventInfoUtils.cxx.
icarus::trigger::details::EventInfoExtractor::EventInfoExtractor | ( | std::vector< art::InputTag > | truthTags, |
std::vector< art::InputTag > | edepTags, | ||
TimeSpan_t | inSpillTimes, | ||
TimeSpan_t | inPreSpillTimes, | ||
geo::GeometryCore const & | geom, | ||
detinfo::DetectorPropertiesData const * | detProps, | ||
detinfo::DetectorTimings const * | detTimings, | ||
std::string | logCategory, | ||
ConsumesColl & | consumesCollector | ||
) |
Constructor: configures, and declares consuming data product.
ConsumesColl | type with art::ConsumesCollector interface |
truthTags | list of truth information data products to be read |
edepTags | list of energy deposition data products to be read |
inSpillTimes | start and end of spill, in simulation time |
inPreSpillTimes | start and end of pre-spill, in simulation time |
geom | LArSoft geometry service provider |
detTimings | LArSoft detector timings utility |
logCategory | name of message facility stream to sent messages to |
consumesCollector | object to declare the consumed products to |
Typical usage is within a art module constructor:
Definition at line 458 of file EventInfoUtils.h.
|
private |
Adds the energy depositions from energyDeposits
into info
record.
Definition at line 229 of file EventInfoUtils.cxx.
|
private |
Adds the energy depositions from channels
into info
record.
Definition at line 265 of file EventInfoUtils.cxx.
|
private |
Adds selected information from the interaction in truth
to info
record.
Definition at line 206 of file EventInfoUtils.cxx.
|
staticprivate |
Declares all the consumables to the collector.
Definition at line 571 of file EventInfoUtils.h.
EventInfo_t icarus::trigger::details::EventInfoExtractor::extractInfo | ( | Event const & | event | ) | const |
Returns an EventInfo_t
object with information from event
.
Event | type of event to read data from (art or gallery event) |
event | event record to read the information from |
EventInfo_t
with information extracted from event
auto icarus::trigger::details::EventInfoExtractor::extractInfo | ( | Event const & | event | ) | const -> EventInfo_t |
Definition at line 482 of file EventInfoUtils.h.
|
private |
Fills info
record with generation information from truth
.
Definition at line 121 of file EventInfoUtils.cxx.
|
private |
Fills info
record with generated neutrino information from truth
.
If info
record already contains an interaction (the "main" interaction), the interaction in truth
becomes the new main interaction of info
only if it is earlier than the old main interaction. Otherwise the record is updated to take note that there was yet another interaction in the event, with little-to-no information about it stored.
Definition at line 131 of file EventInfoUtils.cxx.
|
private |
Returns the time of the neutrino interaction in truth
.
Undefined behaviour if the truth information does not describe a neutrino interaction.
Definition at line 345 of file EventInfoUtils.cxx.
|
inline |
Returns whether we are extracting any energy deposition information.
Definition at line 249 of file EventInfoUtils.h.
|
inline |
Returns whether we are extracting any generator information.
Definition at line 246 of file EventInfoUtils.h.
|
static |
Returns whether edepTags
contains energy deposition list tags.
Definition at line 440 of file EventInfoUtils.h.
|
inlinestatic |
Returns whether edepTags
contains any energy deposition tag.
Definition at line 263 of file EventInfoUtils.h.
|
static |
Returns whether edepTags
contains a energy deposition summary tag.
Definition at line 434 of file EventInfoUtils.h.
|
inline |
Definition at line 240 of file EventInfoUtils.h.
|
private |
Returns in which active TPC volume point
falls in (nullptr
if none).
Definition at line 337 of file EventInfoUtils.cxx.
|
private |
Returns in which TPC volume point
falls in (nullptr
if none).
Definition at line 328 of file EventInfoUtils.cxx.
|
private |
Extracts information from truth
and sets it as the "main" interaction information. Previous information is typically overwritten.
Definition at line 147 of file EventInfoUtils.cxx.
|
inlineprivate |
Returns whether we use energy summary instead of full energy deposits.
Definition at line 303 of file EventInfoUtils.h.
|
private |
Definition at line 269 of file EventInfoUtils.h.
|
private |
Detector timing conversion utility.
Definition at line 290 of file EventInfoUtils.h.
|
private |
Definition at line 293 of file EventInfoUtils.h.
|
private |
List of energy deposition product tags (std::vector<sim::SimEnergyDeposit>
) or their summary.
Definition at line 278 of file EventInfoUtils.h.
|
private |
List of truth data product tags (std::vector<simb::MCTruth>
).
Definition at line 274 of file EventInfoUtils.h.
|
private |
Geometry service provider.
Detector properties information.
Definition at line 287 of file EventInfoUtils.h.
|
private |
Start and stop time for "pre-spill" label.
Definition at line 298 of file EventInfoUtils.h.
|
private |
Start and stop time for "in spill" label.
Definition at line 295 of file EventInfoUtils.h.
|
private |
Stream name for message facility.
Definition at line 280 of file EventInfoUtils.h.
|
inlinestatic |
Represents the absence of any energy deposition information.
Definition at line 254 of file EventInfoUtils.h.