ElectronNeutrinoSelection
 All Classes Functions Variables Groups
PandoraInterfaceHelper.h
1 
24 #ifndef PANDORAINTERFACEHELPER_H
25 #define PANDORAINTERFACEHELPER_H
26 
27 #include "HelperBase.h"
28 
29 #include "canvas/Persistency/Common/FindManyP.h"
30 #include "canvas/Persistency/Common/FindOneP.h"
31 #include "lardataobj/RecoBase/PFParticle.h"
32 #include "lardataobj/RecoBase/SpacePoint.h"
33 #include "lardataobj/RecoBase/Hit.h"
34 #include "larpandora/LArPandoraInterface/LArPandoraHelper.h"
35 
36 #include "nusimdata/SimulationBase/MCParticle.h"
37 #include "nusimdata/SimulationBase/MCTruth.h"
38 #include "lardataobj/AnalysisBase/BackTrackerMatchingData.h"
39 
40 namespace lar_pandora
41 {
42 typedef std::map<art::Ptr<recob::PFParticle>, art::Ptr<simb::MCParticle>> PFParticlesToMCParticles;
43 }
44 
45 namespace lee
46 {
47 
48 typedef std::map<art::Ptr<recob::PFParticle>, unsigned int>
49  RecoParticleToNMatchedHits;
50 typedef std::map<art::Ptr<simb::MCParticle>, RecoParticleToNMatchedHits>
51  ParticleMatchingMap;
52 typedef std::set<art::Ptr<recob::PFParticle>> PFParticleSet;
53 typedef std::set<art::Ptr<simb::MCParticle>> MCParticleSet;
54 
56 {
57  public:
60 
61  void reconfigure(fhicl::ParameterSet const &pset);
62 
71  const art::ValidHandle<std::vector<recob::PFParticle>> pfparticles,
72  size_t top_index, std::vector<size_t> &unordered_daugthers,
73  std::string _pfp_producer);
74 
84  std::vector<double> calculateChargeCenter(
85  size_t ipf,
86  const art::ValidHandle<std::vector<recob::PFParticle>> pfparticles,
87  const art::Event &evt,
88  std::string _pfp_producer);
89 
90  void get_daughter_tracks(std::vector<size_t> pf_ids, const art::Event &evt,
91  std::vector<art::Ptr<recob::Track>> &tracks,
92  std::string _pfp_producer);
93 
94  void get_daughter_showers(std::vector<size_t> pf_ids, const art::Event &evt,
95  std::vector<art::Ptr<recob::Shower>> &showers,
96  std::string _pfp_producer);
97 
99 
114  void GetRecoToTrueMatches(lar_pandora::PFParticlesToMCParticles &matchedParticles);
115 
116  void Configure(art::Event const &e,
117  std::string _pfp_producer,
118  std::string _spacepoint_producer,
119  std::string _hitfinder_producer,
120  std::string _geant_producer,
121  std::string _hit_mcp_producer);
122 
123  art::Ptr<simb::MCTruth> TrackIDToMCTruth(art::Event const &e, std::string _geant_producer, int geant_track_id);
124 
132  void CollectMCParticles(const art::Event &evt,
133  const std::string &label,
134  lar_pandora::MCParticleVector &particleVector);
143  void CollectMCParticles(const art::Event &evt,
144  const std::string &label,
145  lar_pandora::MCTruthToMCParticles &truthToParticles,
146  lar_pandora::MCParticlesToMCTruth &particlesToTruth);
147 
148  protected:
149  lar_pandora::HitsToMCParticles _hit_to_mcps_map;
150  lar_pandora::PFParticlesToHits _pfp_to_hits_map;
151  private:
152  bool _configured = false;
153  bool m_isOverlaidSample = false;
154  bool _debug = false;
155  bool _verbose = false;
156 };
157 }
158 
159 #endif
Definition: PandoraInterfaceHelper.h:55
void traversePFParticleTree(const art::ValidHandle< std::vector< recob::PFParticle >> pfparticles, size_t top_index, std::vector< size_t > &unordered_daugthers, std::string _pfp_producer)
Travers the tree of the daughters of a PFParticle.
Definition: PandoraInterfaceHelper.cxx:290
void GetRecoToTrueMatches(lar_pandora::PFParticlesToMCParticles &matchedParticles)
Configure function parameters.
Definition: PandoraInterfaceHelper.cxx:222
std::vector< double > calculateChargeCenter(size_t ipf, const art::ValidHandle< std::vector< recob::PFParticle >> pfparticles, const art::Event &evt, std::string _pfp_producer)
Measures the three-dimensional center of the deposited charge for a PFParticle.
Definition: PandoraInterfaceHelper.cxx:373
Definition: HelperBase.h:17
lar_pandora::HitsToMCParticles _hit_to_mcps_map
A map from recon hits to MCParticles.
Definition: PandoraInterfaceHelper.h:149
void CollectMCParticles(const art::Event &evt, const std::string &label, lar_pandora::MCParticleVector &particleVector)
Collect a vector of MCParticle objects from the ART event record.
Definition: PandoraInterfaceHelper.cxx:173
lar_pandora::PFParticlesToHits _pfp_to_hits_map
A map from PFParticles to recon hits.
Definition: PandoraInterfaceHelper.h:150