35 art::Handle< std::vector<recob::PFParticle> > pfParticleHandle;
38 art::FindManyP<larpandoraobj::PFParticleMetadata> PFPMetaDataAssoc(pfParticleHandle, event,
fPandoraLabel);
41 for(
auto const pfp : (*pfParticleHandle)){
43 const std::vector< art::Ptr<recob::Track> > associatedTracks(pfPartToTrackAssoc.at(pfp.Self()));
44 if(associatedTracks.size() != 1)
continue;
46 if(trk.
ID() != track.
ID())
continue;
63 std::map<
size_t, art::Ptr<recob::PFParticle> > pfParticleMap,
const art::Event& event){
66 art::Handle< std::vector<recob::PFParticle> > pfParticleHandle;
69 art::FindManyP<larpandoraobj::PFParticleMetadata> PFPMetaDataAssoc(pfParticleHandle, event,
fPandoraLabel);
87 art::Ptr<recob::PFParticle> parentPFP= pfParticleMap.at(pfparticle.
Parent());
93 const std::vector<recob::PFParticle>& pfpVec){
98 size_t parentID = pfparticle.
Parent();
99 auto parentPFPIter = std::find_if(pfpVec.begin(), pfpVec.end(),
100 [&](
const auto& pfp){
return pfp.Self()==parentID;});
102 if (parentPFPIter==pfpVec.end()){
111 art::FindManyP<larpandoraobj::PFParticleMetadata> PFPMetaDataAssoc){
113 const std::vector<art::Ptr<larpandoraobj::PFParticleMetadata> > pfpMetaVec =
114 PFPMetaDataAssoc.at(pfparticle.
Self());
116 if (pfpMetaVec.size() !=1){
117 std::cout<<
"Cannot get PFPMetadata"<<std::endl;
121 art::Ptr<larpandoraobj::PFParticleMetadata> pfpMeta = pfpMetaVec.front();
124 auto propertiesMapIter = propertiesMap.find(
"NuScore");
125 if (propertiesMapIter == propertiesMap.end()){
126 std::cout<<
"Cannot get PFP Nu Score in Metadata"<<std::endl;
131 return propertiesMapIter->second;
fhicl::Atom< art::InputTag > PandoraLabel
art::InputTag fPandoraLabel
size_t Self() const
Returns the index of this particle.
void reconfigure(const Config &config)
int PdgCode() const
Return the type of particle as a PDG ID.
std::map< std::string, float > PropertiesMap
process_name use argoneut_mc_hitfinder track
recob::PFParticle GetPFPNeutrino(recob::PFParticle pfparticle, std::map< size_t, art::Ptr< recob::PFParticle > > &pfParticleMap)
float GetPandoraNuScore(recob::PFParticle pfparticle, art::FindManyP< larpandoraobj::PFParticleMetadata > PFPMetaDataAssoc)
~PandoraNuScoreCosmicIdAlg()
fhicl::Atom< float > NuScoreCut
Hierarchical representation of particle flow.
bool PandoraNuScoreCosmicId(recob::Track track, const art::Event &event)
stream1 can override from command line with o or output services user sbnd
art::InputTag fTpcTrackModuleLabel
fhicl::Atom< art::InputTag > TpcTrackModuleLabel
PandoraNuScoreCosmicIdAlg(const Config &config)
BEGIN_PROLOG could also be cout
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track: