![]() |
LArSoft
v09_93_00
Liquid Argon Software toolkit - https://larsoft.org/
|
Helper class for slice id tools. More...
#include "LArPandoraSliceIdHelper.h"
Classes | |
| class | SliceMetadata |
| Class to hold MC metdata about slices. More... | |
Public Types | |
| typedef std::vector< SliceMetadata > | SliceMetadataVector |
Static Public Member Functions | |
| static void | GetSliceMetadata (const SliceVector &slices, const art::Event &evt, const std::string &truthLabel, const std::string &mcParticleLabel, const std::string &hitLabel, const std::string &backtrackLabel, const std::string &pandoraLabel, SliceMetadataVector &sliceMetadata, simb::MCNeutrino &mcNeutrino) |
| Get MC metadata about each slice. More... | |
Private Types | |
| typedef std::unordered_map< art::Ptr< recob::Hit >, bool > | HitToBoolMap |
Static Private Member Functions | |
| static art::Ptr< simb::MCTruth > | GetBeamNeutrinoMCTruth (const art::Event &evt, const std::string &truthLabel) |
| Get the MCTruth block for the simulated beam neutrino. More... | |
| static void | CollectNeutrinoMCParticles (const art::Event &evt, const std::string &truthLabel, const std::string &mcParticleLabel, const art::Ptr< simb::MCTruth > &beamNuMCTruth, MCParticleVector &mcParticles) |
| Collect all MCParticles that come from the beam neutrino interaction. More... | |
| static void | GetHitOrigins (const art::Event &evt, const std::string &hitLabel, const std::string &backtrackLabel, const MCParticleVector &mcParticles, HitVector &hits, HitToBoolMap &hitToIsNuInducedMap) |
| For each hit in the event, determine if any of it's charge was deposited by a neutrino induced particle. More... | |
| static unsigned int | CountNeutrinoHits (const HitVector &hits, const HitToBoolMap &hitToIsNuInducedMap) |
| Count the number of hits in an input vector that are neutrino induced. More... | |
| static void | GetPFParticleToHitsMap (const art::Event &evt, const std::string &pandoraLabel, PFParticlesToHits &pfParticleToHitsMap) |
| Get the mapping from PFParticles to associated hits (via clusters) More... | |
| static void | GetReconstructedHitsInSlice (const Slice &slice, const PFParticlesToHits &pfParticleToHitsMap, HitVector &hits) |
| Collect the hits in the slice that have been added to a PFParticle (under either reconstruction hypothesis) More... | |
| static void | CollectHits (const PFParticleVector &pfParticles, const PFParticlesToHits &pfParticleToHitsMap, HitVector &hits) |
| Collect the hits in a given vector of PFParticles. More... | |
| static void | GetSliceMetadata (const SliceVector &slices, const PFParticlesToHits &pfParticleToHitsMap, const HitToBoolMap &hitToIsNuInducedMap, const unsigned int nNuHits, SliceMetadataVector &sliceMetadata) |
| Calculate the MC slice metadata. More... | |
Helper class for slice id tools.
Definition at line 37 of file LArPandoraSliceIdHelper.h.
|
private |
Definition at line 83 of file LArPandoraSliceIdHelper.h.
| typedef std::vector<SliceMetadata> lar_pandora::LArPandoraSliceIdHelper::SliceMetadataVector |
Definition at line 55 of file LArPandoraSliceIdHelper.h.
|
staticprivate |
Collect the hits in a given vector of PFParticles.
| pfParticles | the input vector of PFParticles |
| pfParticleToHitsMap | the input mapping from PFParticles to hits |
| hits | the output vector of hits |
Definition at line 248 of file LArPandoraSliceIdHelper.cxx.
References part.
Referenced by GetReconstructedHitsInSlice().
|
staticprivate |
Collect all MCParticles that come from the beam neutrino interaction.
| evt | the art event |
| truthLabel | the label of the MCTruth producer |
| mcParticleLabel | the label of the MCParticle producer |
| beamNuMCTruth | the MCTruth block for the beam neutrino |
| mcParticles | the output vector of neutrino induced MCParticles |
Definition at line 99 of file LArPandoraSliceIdHelper.cxx.
References art::ProductRetriever::getByLabel(), and art::Handle< T >::isValid().
Referenced by GetSliceMetadata().
|
staticprivate |
Count the number of hits in an input vector that are neutrino induced.
| hits | the input vector of hits |
| hitToIsNuInducedMap | the mapping from hits to isNuInduced boolean |
Definition at line 166 of file LArPandoraSliceIdHelper.cxx.
Referenced by GetSliceMetadata().
|
staticprivate |
Get the MCTruth block for the simulated beam neutrino.
| evt | the art event |
| truthLabel | the label of the MCTruth producer |
Definition at line 59 of file LArPandoraSliceIdHelper.cxx.
References simb::MCParticle::E(), art::ProductRetriever::getByLabel(), simb::MCTruth::GetNeutrino(), art::Handle< T >::isValid(), simb::kBeamNeutrino, simb::MCNeutrino::Nu(), and simb::MCTruth::Origin().
Referenced by GetSliceMetadata().
|
staticprivate |
For each hit in the event, determine if any of it's charge was deposited by a neutrino induced particle.
| evt | the art event |
| hitLabel | the label of the Hit producer |
| backtrackLabel | the label of the Hit->MCParticle association producer - backtracker |
| mcParticles | the input vector of neutrino induced MCParticles |
| hits | the output vector of all hits |
| hitToIsNuInducedMap | the output mapping from hits to a bool = true if hit is neutrino induced |
Definition at line 124 of file LArPandoraSliceIdHelper.cxx.
References art::ProductRetriever::getByLabel(), art::Handle< T >::isValid(), art::Ptr< T >::key(), and part.
Referenced by GetSliceMetadata().
|
staticprivate |
Get the mapping from PFParticles to associated hits (via clusters)
| evt | the art event |
| pandoraLabel | the label of the PFParticle <-> Cluster and Cluster <-> Hit associations - Pandora pattern recognition |
| pfParticleToHitsMap | the output mapping from PFParticles to associated hits |
Definition at line 186 of file LArPandoraSliceIdHelper.cxx.
References art::ProductRetriever::getByLabel(), hits(), art::Handle< T >::isValid(), art::Ptr< T >::key(), and part.
Referenced by GetSliceMetadata().
|
staticprivate |
Collect the hits in the slice that have been added to a PFParticle (under either reconstruction hypothesis)
| slice | the input slice |
| pfParticleToHitsMap | the input mapping from PFParticles to hits |
| hits | the output vector of reconstructed hits in the slice |
Definition at line 236 of file LArPandoraSliceIdHelper.cxx.
References CollectHits(), lar_pandora::Slice::GetCosmicRayHypothesis(), lar_pandora::Slice::GetTargetHypothesis(), and hits().
Referenced by GetSliceMetadata().
|
static |
Get MC metadata about each slice.
| slices | the input vector of slices |
| evt | the art event |
| truthLabel | the label of the MCTruth producer |
| mcParticleLabel | the label of the MCParticle producer |
| hitLabel | the label of the Hit producer |
| backtrackLabel | the label of the Hit -> MCParticle association producer |
| pandoraLabel | the label of the Pandora all outcomes producer |
| sliceMetadata | the output vector of slice metadata (mapping 1:1 to the slices) |
| interactionType | the output true interaction type code of the MCNeutrino |
| nuEnergy | the output true energy of the neutrino |
| nuNeutrino | the mc neutrino from the beam neutrino MCTruth block |
Definition at line 21 of file LArPandoraSliceIdHelper.cxx.
References CollectNeutrinoMCParticles(), CountNeutrinoHits(), GetBeamNeutrinoMCTruth(), GetHitOrigins(), GetPFParticleToHitsMap(), and hits().
|
staticprivate |
Calculate the MC slice metadata.
| slices | the input vector of slices |
| pfParticleToHitsMap | the input mapping from PFParticles to hits |
| hitToIsNuInducedMap | the input mapping from hits to isNuInduced boolean |
| nNuHits | the total number of neutrino induced hits in the event |
| sliceMetadata | the output vector of metadata objects correspoinding 1:1 to the input slices |
Definition at line 268 of file LArPandoraSliceIdHelper.cxx.
References CountNeutrinoHits(), f, GetReconstructedHitsInSlice(), hits(), lar_pandora::LArPandoraSliceIdHelper::SliceMetadata::m_completeness, lar_pandora::LArPandoraSliceIdHelper::SliceMetadata::m_isMostComplete, lar_pandora::LArPandoraSliceIdHelper::SliceMetadata::m_nHits, and lar_pandora::LArPandoraSliceIdHelper::SliceMetadata::m_purity.