11 #include "canvas/Utilities/InputTag.h"
20 #include "fhiclcpp/ParameterSet.h"
22 #include "nusimdata/SimulationBase/MCParticle.h"
24 #include "canvas/Persistency/Common/FindManyP.h"
25 #include "nusimdata/SimulationBase/MCTruth.h"
47 fMCParticleTag = config ? config->get<std::string>(
"MCParticleTag",
"largeant") :
"largeant";
62 bool ProcessEvent(
const gallery::Event& ev,
const std::vector<event::Interaction> &truth, std::vector<event::RecoInteraction>&
reco) {
64 auto const &mcparticle_handle = ev.getValidHandle<std::vector<simb::MCParticle>>(
fMCParticleTag);;
65 const std::vector<simb::MCParticle> &mcparticles = *mcparticle_handle;
66 art::FindManyP<simb::MCTruth, sim::GeneratedParticleInfo> particles_to_truth(mcparticle_handle, ev,
fMCParticleTag);
67 for (
unsigned i = 0; i < mcparticles.size(); i++) {
68 const simb::MCParticle &part = mcparticles[i];
69 std::cout <<
"TrackID: " << part.TrackId() <<
" Mother: " << part.Mother() <<
" index: " << i<< std::endl;
71 const simb::MCTruth &mctruth = *particles_to_truth.at(i).at(0);
75 std::cout <<
"Gen track ID: " << gen_track_id << std::endl;
void Initialize(fhicl::ParameterSet *config=NULL)
Contains data associated to particles from detector simulation.
process_name opflashCryoW ana
bool ProcessEvent(const gallery::Event &ev, const std::vector< event::Interaction > &truth, std::vector< event::RecoInteraction > &reco)
Simulation objects for optical detectors.
process_name standard_reco_uboone reco
std::string fMCParticleTag
Electron neutrino event selection.
#define DECLARE_SBN_PROCESSOR(classname)
Base class for event selections.
Contains information about a generated particle.
GeneratedParticleIndex_t generatedParticleIndex() const
Returns the generated particle index.
BEGIN_PROLOG could also be cout