LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
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 
13 namespace recob {
14  class Hit;
15 }
16 
17 namespace simb {
18  class MCNeutrino;
19  class MCTruth;
20 }
21 
22 namespace art {
23  class Event;
24 }
25 
27 
28 #include <string>
29 #include <unordered_map>
30 #include <vector>
31 
32 namespace lar_pandora {
33 
38  public:
42  class SliceMetadata {
43  public:
47  SliceMetadata();
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
std::unordered_map< art::Ptr< recob::Hit >, bool > HitToBoolMap
Slice class.
Definition: Slice.h:17
float m_purity
The fraction of hits in the slice that are neutrino induced.
Reconstruction base classes.
unsigned int m_nHits
The number of hits in the slice.
std::vector< SliceMetadata > SliceMetadataVector
Helper class for slice id tools.
float m_completeness
The fraction of all neutrino induced hits that are in the slice.
void hits()
Definition: readHits.C:15
std::vector< art::Ptr< recob::PFParticle > > PFParticleVector
std::map< art::Ptr< recob::PFParticle >, HitVector > PFParticlesToHits
std::vector< art::Ptr< simb::MCParticle > > MCParticleVector
ART objects.
std::vector< TCSlice > slices
Definition: DataStructs.cxx:13
std::vector< art::Ptr< recob::Hit > > HitVector
std::vector< Slice > SliceVector
Definition: Slice.h:70
header for the lar pandora slice class
Definition: MVAAlg.h:12
bool m_isMostComplete
If the slice has the highest completeness in the event.
TCEvent evt
Definition: DataStructs.cxx:8
Event generator information.
Definition: MCNeutrino.h:18
helper function for LArPandoraInterface producer module