Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
LArPandoraSliceIdHelper.h
Go to the documentation of this file.
1
7#ifndef LAR_PANDORA_SLICE_ID_HELPER_H
8#define LAR_PANDORA_SLICE_ID_HELPER_H
9
12
13namespace recob {
14 class Hit;
15}
16
17namespace simb {
18 class MCNeutrino;
19 class MCTruth;
20}
21
22namespace art {
23 class Event;
24}
25
26#include "canvas/Persistency/Common/Ptr.h"
27
28#include <string>
29#include <unordered_map>
30#include <vector>
31
32namespace lar_pandora {
33
38 public:
43 public:
48
49 float m_purity;
51 unsigned int m_nHits;
53 };
54
55 typedef std::vector<SliceMetadata> SliceMetadataVector;
56
72 static void GetSliceMetadata(const SliceVector& slices,
73 const art::Event& evt,
74 const std::string& truthLabel,
75 const std::string& mcParticleLabel,
76 const std::string& hitLabel,
77 const std::string& backtrackLabel,
78 const std::string& pandoraLabel,
79 SliceMetadataVector& sliceMetadata,
80 simb::MCNeutrino& mcNeutrino);
81
82 private:
83 typedef std::unordered_map<art::Ptr<recob::Hit>, bool> HitToBoolMap;
84
93 static art::Ptr<simb::MCTruth> GetBeamNeutrinoMCTruth(const art::Event& evt,
94 const std::string& truthLabel);
95
105 static void CollectNeutrinoMCParticles(const art::Event& evt,
106 const std::string& truthLabel,
107 const std::string& mcParticleLabel,
108 const art::Ptr<simb::MCTruth>& beamNuMCTruth,
109 MCParticleVector& mcParticles);
110
121 static void GetHitOrigins(const art::Event& evt,
122 const std::string& hitLabel,
123 const std::string& backtrackLabel,
124 const MCParticleVector& mcParticles,
125 HitVector& hits,
126 HitToBoolMap& hitToIsNuInducedMap);
127
136 static unsigned int CountNeutrinoHits(const HitVector& hits,
137 const HitToBoolMap& hitToIsNuInducedMap);
138
146 static void GetPFParticleToHitsMap(const art::Event& evt,
147 const std::string& pandoraLabel,
148 PFParticlesToHits& pfParticleToHitsMap);
149
157 static void GetReconstructedHitsInSlice(const Slice& slice,
158 const PFParticlesToHits& pfParticleToHitsMap,
159 HitVector& hits);
160
168 static void CollectHits(const PFParticleVector& pfParticles,
169 const PFParticlesToHits& pfParticleToHitsMap,
170 HitVector& hits);
171
181 static void GetSliceMetadata(const SliceVector& slices,
182 const PFParticlesToHits& pfParticleToHitsMap,
183 const HitToBoolMap& hitToIsNuInducedMap,
184 const unsigned int nNuHits,
185 SliceMetadataVector& sliceMetadata);
186 };
187
188} // namespace lar_pandora
189
190#endif // LAR_PANDORA_SLICE_ID_HELPER_H
helper function for LArPandoraInterface producer module
header for the lar pandora slice class
float m_completeness
The fraction of all neutrino induced hits that are in the slice.
float m_purity
The fraction of hits in the slice that are neutrino induced.
bool m_isMostComplete
If the slice has the highest completeness in the event.
unsigned int m_nHits
The number of hits in the slice.
Helper class for slice id tools.
static unsigned int CountNeutrinoHits(const HitVector &hits, const HitToBoolMap &hitToIsNuInducedMap)
Count the number of hits in an input vector that are neutrino induced.
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.
std::unordered_map< art::Ptr< recob::Hit >, bool > HitToBoolMap
static void CollectHits(const PFParticleVector &pfParticles, const PFParticlesToHits &pfParticleToHitsMap, HitVector &hits)
Collect the hits in a given vector of PFParticles.
static void GetPFParticleToHitsMap(const art::Event &evt, const std::string &pandoraLabel, PFParticlesToHits &pfParticleToHitsMap)
Get the mapping from PFParticles to associated hits (via clusters)
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.
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 partic...
std::vector< SliceMetadata > SliceMetadataVector
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 hypot...
static art::Ptr< simb::MCTruth > GetBeamNeutrinoMCTruth(const art::Event &evt, const std::string &truthLabel)
Get the MCTruth block for the simulated beam neutrino.
Slice class.
Definition Slice.h:17
std::map< art::Ptr< recob::PFParticle >, HitVector > PFParticlesToHits
std::vector< art::Ptr< recob::Hit > > HitVector
std::vector< Slice > SliceVector
Definition Slice.h:70
std::vector< art::Ptr< recob::PFParticle > > PFParticleVector
std::vector< art::Ptr< simb::MCParticle > > MCParticleVector