9 #include "art/Framework/Core/ModuleMacros.h"
10 #include "art/Framework/Core/EDFilter.h"
13 #include "fhiclcpp/ParameterSet.h"
14 #include "art/Framework/Services/Registry/ServiceHandle.h"
15 #include "messagefacility/MessageLogger/MessageLogger.h"
19 #include "nug4/ParticleNavigation/ParticleList.h"
33 bool filter(art::Event&)
override;
46 : EDFilter{pset}, fPrimaryVec{pset.get<std::vector<int> >(
"PrimaryParticles")}
54 art::ServiceHandle<cheat::ParticleInventoryService const> pi_serv;
55 art::ServiceHandle<geo::Geometry const> geom;
58 const sim::ParticleList& Particles = pi_serv->ParticleList();
59 std::vector<const simb::MCParticle*> pvec;
60 pvec.reserve(Particles.size());
61 for (
const auto& PartPair: Particles) {
62 pvec.push_back(PartPair.second);
66 bool pdgDesired(
false);
67 for(
unsigned int i = 0; i < pvec.size(); ++i)
71 const std::string sprim(
"primary");
72 if(pvec[i]->PdgCode() ==
pdg)
75 for(
unsigned int s = 0;
s < pvec[i]->Process().length(); ++
s)
76 *(tProcess+
s) = pvec[i]->Process()[
s];
77 std::string sProcess(tProcess);
78 if (!sProcess.compare(sprim))
80 mf::LogInfo(
"FilterPrimaryPDG") <<
" Found a primary " <<
pdg <<
" in event.";
95 DEFINE_ART_MODULE(FilterPrimaryPDG)
bool filter(art::Event &) override
FilterPrimaryPDG(fhicl::ParameterSet const &pset)
std::vector< int > fPrimaryVec
then echo File list $list not found else cat $list while read file do echo $file sed s
std::string fG4ModuleLabel
Tools and modules for checking out the basics of the Monte Carlo.
art framework interface to geometry description