11 #include "canvas/Utilities/InputTag.h"
23 #include "canvas/Persistency/Common/FindManyP.h"
24 #include "fhiclcpp/ParameterSet.h"
47 fPandoraTags = config ? config->get<std::vector<std::string>>(
"PandoraTags", {
"pandora"}) : std::vector<std::string>(1,
"pandora");
62 bool ProcessEvent(
const gallery::Event& ev,
const std::vector<event::Interaction> &truth, std::vector<event::RecoInteraction>&
reco) {
65 auto const &slices_handle = ev.getValidHandle<std::vector<recob::Slice>>(
fPandoraTags[j]);
66 auto const &particles_handle = ev.getValidHandle<std::vector<recob::PFParticle>>(
fPandoraTags[j]);
68 art::FindManyP<recob::PFParticle, void> slice_to_particle(slices_handle, ev,
fPandoraTags[j]);
69 art::FindManyP<larpandoraobj::PFParticleMetadata, void> particles_to_metadata(particles_handle, ev,
fPandoraTags[j]);
71 for (
unsigned i = 0; i < slices_handle->size(); i++) {
74 const std::vector<art::Ptr<recob::PFParticle>> slice_particles = slice_to_particle.at(i);
75 for (
unsigned k = 0;
k < slice_particles.size();
k++) {
76 const art::Ptr<recob::PFParticle> pfp_part = slice_particles[
k];
77 if (pfp_part->IsPrimary()) {
80 if (properties.count(
"NuScore")) {
81 std::cout <<
"NuScore: " << properties.at(
"NuScore") << std::endl;
90 auto const &particles_handle = ev.getValidHandle<std::vector<recob::PFParticle>>(
fPandoraTags[j]);
91 art::FindManyP<larpandoraobj::PFParticleMetadata, void> particles_to_metadata(particles_handle, ev,
fPandoraTags[j]);
93 for (
unsigned i = 0; i < particles_handle->size(); i++) {
94 std::cout <<
"Particle PDG: " << particles_handle->at(i).PdgCode() << std::endl;
95 std::vector<art::Ptr<larpandoraobj::PFParticleMetadata>> metadatas = particles_to_metadata.at(i);
96 if (metadatas.size() > 0) {
97 assert(metadatas.size() == 1);
100 for (
auto const &prop_pair: metadata.GetPropertiesMap()) {
101 std::cout << prop_pair.first <<
" " << prop_pair.second << std::endl;
process_name opflashCryoW ana
process_name standard_reco_uboone reco
Metadata associated to PFParticles.
const PropertiesMap & GetPropertiesMap() const
#define DECLARE_SBN_PROCESSOR(classname)
Base class for event selections.
BEGIN_PROLOG could also be cout