8 #include "cetlib_except/exception.h" 33 #include "Objects/ParticleFlowObject.h" 34 #include "Pandora/PdgTable.h" 35 #include "Pandora/PandoraInternal.h" 53 mf::LogDebug(
"LArPandora") <<
" Failed to find wires... " << std::endl;
58 mf::LogDebug(
"LArPandora") <<
" Found: " << theWires->size() <<
" Wires " << std::endl;
61 for (
unsigned int i = 0; i < theWires->size(); ++i)
64 wireVector.push_back(wire);
77 mf::LogDebug(
"LArPandora") <<
" Failed to find hits... " << std::endl;
82 mf::LogDebug(
"LArPandora") <<
" Found: " << theHits->size() <<
" Hits " << std::endl;
85 for (
unsigned int i = 0; i < theHits->size(); ++i)
88 hitVector.push_back(hit);
101 mf::LogDebug(
"LArPandora") <<
" Failed to find particles... " << std::endl;
106 mf::LogDebug(
"LArPandora") <<
" Found: " << theParticles->size() <<
" PFParticles " << std::endl;
109 for (
unsigned int i = 0; i < theParticles->size(); ++i)
112 particleVector.push_back(particle);
135 mf::LogDebug(
"LArPandora") <<
" Failed to find spacepoints... " << std::endl;
140 mf::LogDebug(
"LArPandora") <<
" Found: " << theSpacePoints->size() <<
" SpacePoints " << std::endl;
144 for (
unsigned int i = 0; i < theSpacePoints->size(); ++i)
147 spacePointVector.push_back(spacepoint);
149 spacePointsToHits[spacepoint] = hit;
150 hitsToSpacePoints[hit] = spacepoint;
164 mf::LogDebug(
"LArPandora") <<
" Failed to find clusters... " << std::endl;
169 mf::LogDebug(
"LArPandora") <<
" Found: " << theClusters->size() <<
" Clusters " << std::endl;
173 for (
unsigned int i = 0; i < theClusters->size(); ++i)
176 clusterVector.push_back(cluster);
178 const std::vector< art::Ptr<recob::Hit> >
hits = theHitAssns.at(i);
179 for (
unsigned int j=0; j<hits.size(); ++j)
182 clustersToHits[cluster].push_back(hit);
197 mf::LogDebug(
"LArPandora") <<
" Failed to find particles... " << std::endl;
202 mf::LogDebug(
"LArPandora") <<
" Found: " << theParticles->size() <<
" PFParticles " << std::endl;
206 for (
unsigned int i = 0; i < theParticles->size(); ++i)
209 particleVector.push_back(particle);
211 const std::vector< art::Ptr<recob::SpacePoint> > spacepoints = theSpacePointAssns.at(i);
212 for (
unsigned int j=0; j<spacepoints.size(); ++j)
215 particlesToSpacePoints[particle].push_back(spacepoint);
230 mf::LogDebug(
"LArPandora") <<
" Failed to find particles... " << std::endl;
235 mf::LogDebug(
"LArPandora") <<
" Found: " << theParticles->size() <<
" PFParticles " << std::endl;
239 for (
unsigned int i = 0; i < theParticles->size(); ++i)
242 particleVector.push_back(particle);
244 const std::vector< art::Ptr<recob::Cluster> > clusters = theClusterAssns.at(i);
245 for (
unsigned int j=0; j<clusters.size(); ++j)
248 particlesToClusters[particle].push_back(cluster);
263 mf::LogDebug(
"LArPandora") <<
" Failed to find particles... " << std::endl;
268 mf::LogDebug(
"LArPandora") <<
" Found: " << theParticles->size() <<
" PFParticles " << std::endl;
272 for (
unsigned int i = 0; i < theParticles->size(); ++i)
275 particleVector.push_back(particle);
277 const std::vector< art::Ptr<larpandoraobj::PFParticleMetadata> > pfParticleMetadataList = theMetadataAssns.at(i);
278 for (
unsigned int j=0; j<pfParticleMetadataList.size(); ++j)
281 particlesToMetadata[particle].push_back(pfParticleMetadata);
296 mf::LogDebug(
"LArPandora") <<
" Failed to find showers... " << std::endl;
301 mf::LogDebug(
"LArPandora") <<
" Found: " << theShowers->size() <<
" Showers " << std::endl;
305 for (
unsigned int i = 0; i < theShowers->size(); ++i)
308 showerVector.push_back(shower);
310 const std::vector< art::Ptr<recob::PFParticle> > particles = theShowerAssns.at(i);
311 for (
unsigned int j=0; j<particles.size(); ++j)
314 particlesToShowers[particle].push_back(shower);
329 mf::LogDebug(
"LArPandora") <<
" Failed to find tracks... " << std::endl;
334 mf::LogDebug(
"LArPandora") <<
" Found: " << theTracks->size() <<
" Tracks " << std::endl;
338 for (
unsigned int i = 0; i < theTracks->size(); ++i)
341 trackVector.push_back(track);
343 const std::vector< art::Ptr<recob::PFParticle> > particles = theTrackAssns.at(i);
344 for (
unsigned int j=0; j<particles.size(); ++j)
347 particlesToTracks[particle].push_back(track);
361 mf::LogDebug(
"LArPandora") <<
" Failed to find tracks... " << std::endl;
366 mf::LogDebug(
"LArPandora") <<
" Found: " << theTracks->size() <<
" Tracks " << std::endl;
370 for (
unsigned int i = 0; i < theTracks->size(); ++i)
373 trackVector.push_back(track);
375 const std::vector< art::Ptr<recob::Hit> >
hits = theHitAssns.at(i);
376 for (
unsigned int j=0; j<hits.size(); ++j)
379 tracksToHits[
track].push_back(hit);
393 mf::LogDebug(
"LArPandora") <<
" Failed to find showers... " << std::endl;
398 mf::LogDebug(
"LArPandora") <<
" Found: " << theShowers->size() <<
" Showers " << std::endl;
402 for (
unsigned int i = 0; i < theShowers->size(); ++i)
405 showerVector.push_back(shower);
407 const std::vector< art::Ptr<recob::Hit> >
hits = theHitAssns.at(i);
408 for (
unsigned int j=0; j<hits.size(); ++j)
411 showersToHits[shower].push_back(hit);
426 mf::LogDebug(
"LArPandora") <<
" Failed to find seeds... " << std::endl;
431 mf::LogDebug(
"LArPandora") <<
" Found: " << theSeeds->size() <<
" Seeds " << std::endl;
435 for (
unsigned int i = 0; i < theSeeds->size(); ++i)
438 seedVector.push_back(seed);
440 const std::vector< art::Ptr<recob::PFParticle> > particles = theSeedAssns.at(i);
441 for (
unsigned int j=0; j<particles.size(); ++j)
444 particlesToSeeds[particle].push_back(seed);
458 mf::LogDebug(
"LArPandora") <<
" Failed to find seeds... " << std::endl;
463 mf::LogDebug(
"LArPandora") <<
" Found: " << theSeeds->size() <<
" Seeds " << std::endl;
468 if (!theHitAssns.isValid())
470 mf::LogDebug(
"LArPandora") <<
" Failed to find seed associations... " << std::endl;
474 for (
unsigned int i = 0; i < theSeeds->size(); ++i)
477 seedVector.push_back(seed);
479 seedsToHits[
seed] = hit;
493 mf::LogDebug(
"LArPandora") <<
" Failed to find vertices... " << std::endl;
498 mf::LogDebug(
"LArPandora") <<
" Found: " << theVertices->size() <<
" Vertices " << std::endl;
502 for (
unsigned int i = 0; i < theVertices->size(); ++i)
505 vertexVector.push_back(vertex);
507 const std::vector< art::Ptr<recob::PFParticle> > particles = theVerticesAssns.at(i);
508 for (
unsigned int j=0; j<particles.size(); ++j)
511 particlesToVertices[particle].push_back(vertex);
528 particleMap[particle->
Self()] = particle;
533 iter1 != iterEnd1; ++iter1)
549 if (spacePointsToHits.end() == iter3)
550 throw cet::exception(
"LArPandora") <<
" PandoraCollector::BuildPFParticleHitMaps --- Found a space point without an associated hit ";
554 particlesToHits[particle].push_back(hit);
555 hitsToParticles[hit] = particle;
572 particleMap[particle->
Self()] = particle;
577 iter1 != iterEnd1; ++iter1)
592 if (clustersToHits.end() == iter3)
593 throw cet::exception(
"LArPandora") <<
" PandoraCollector::BuildPFParticleHitMaps --- Found a space point without an associated hit ";
595 const HitVector &hitVector = iter3->second;
600 particlesToHits[particle].push_back(hit);
601 hitsToParticles[hit] = particle;
633 particlesToHits, hitsToParticles, daughterMode);
649 particlesToHits, hitsToParticles, daughterMode);
662 outputParticles.push_back(particle);
676 particleMap[particle->
Self()] = particle;
685 outputParticles.push_back(particle);
700 for (
unsigned int i = 0; i < theCosmicTags->size(); ++i)
704 tracksToCosmicTags[
track].push_back(cosmicTag);
705 cosmicTagVector.push_back(cosmicTag);
720 for (
unsigned int i = 0; i < theT0s->size(); ++i)
723 t0Vector.push_back(theT0);
725 const std::vector< art::Ptr<recob::PFParticle> > particles = theAssns.at(i);
726 for (
unsigned int j=0; j<particles.size(); ++j)
729 particlesToT0s[theParticle].push_back(theT0);
740 throw cet::exception(
"LArPandora") <<
" PandoraCollector::CollectSimChannels --- Trying to access MC truth from real data ";
747 mf::LogDebug(
"LArPandora") <<
" Failed to find sim channels... " << std::endl;
752 mf::LogDebug(
"LArPandora") <<
" Found: " << theSimChannels->size() <<
" SimChannels " << std::endl;
755 for (
unsigned int i = 0; i < theSimChannels->size(); ++i)
758 simChannelVector.push_back(channel);
767 throw cet::exception(
"LArPandora") <<
" PandoraCollector::CollectMCParticles --- Trying to access MC truth from real data ";
774 mf::LogDebug(
"LArPandora") <<
" Failed to find MC particles... " << std::endl;
779 mf::LogDebug(
"LArPandora") <<
" Found: " << theParticles->size() <<
" MC particles " << std::endl;
782 for (
unsigned int i = 0; i < theParticles->size(); ++i)
785 particleVector.push_back(particle);
794 throw cet::exception(
"LArPandora") <<
" PandoraCollector::CollectGeneratorMCParticles --- Trying to access MC truth from real data ";
801 mf::LogDebug(
"LArPandora") <<
" Failed to find MC truth blocks from generator... " << std::endl;
806 mf::LogDebug(
"LArPandora") <<
" Found: " << mcTruthBlocks->size() <<
" MC truth blocks " << std::endl;
809 if (mcTruthBlocks->size() != 1)
810 throw cet::exception(
"LArPandora") <<
" PandoraCollector::CollectGeneratorMCParticles --- Unexpected number of MC truth blocks ";
814 for (
int i = 0; i < mcTruth->
NParticles(); ++i)
827 throw cet::exception(
"LArPandora") <<
" PandoraCollector::CollectMCParticles --- Trying to access MC truth from real data ";
834 mf::LogDebug(
"LArPandora") <<
" Failed to find MC particles... " << std::endl;
839 mf::LogDebug(
"LArPandora") <<
" Found: " << theParticles->size() <<
" MC particles " << std::endl;
844 for (
unsigned int i = 0, iEnd = theParticles->size(); i < iEnd; ++i)
848 truthToParticles[truth].push_back(particle);
849 particlesToTruth[particle] = truth;
859 auto const* ts = lar::providerFrom<detinfo::DetectorClocksService>();
866 simChannelMap.insert(SimChannelMap::value_type(simChannel->
Channel(), simChannel));
874 if (simChannelMap.end() == sIter)
880 const unsigned int start_tdc((start_tick < 0) ? 0 : start_tick);
881 const unsigned int end_tdc(end_tick);
883 if (start_tdc > end_tdc)
889 if (trackCollection.empty())
892 for (
unsigned int iTrack = 0, iTrackEnd = trackCollection.size(); iTrack < iTrackEnd; ++iTrack)
895 hitsToTrackIDEs[hit].push_back(trackIDE);
914 particleMap[particle->
TrackId()] = particle;
925 float bestEnergyFrac(0.
f);
930 const int trackID(std::abs(trackIDE.
trackID));
933 if (energyFrac > bestEnergyFrac)
935 bestEnergyFrac = energyFrac;
936 bestTrackID = trackID;
940 if (bestTrackID >= 0)
943 if (particleMap.end() == iter3)
944 throw cet::exception(
"LArPandora") <<
" PandoraCollector::BuildMCParticleHitMaps --- Found a track ID without an MC Particle ";
952 if ((
kIgnoreDaughters == daughterMode) && (selectedParticle != primaryParticle))
958 particlesToHits[selectedParticle].push_back(hit);
959 hitsToParticles[hit] = selectedParticle;
995 mf::LogDebug(
"LArPandora") <<
" Failed to find hits... " << std::endl;
1001 for (
unsigned int i = 0; i < theHits->size(); ++i)
1004 hitVector.push_back(hit);
1008 std::vector<anab::BackTrackerHitMatchingData const*> backtrackerVector;
1014 if (!particles_per_hit.isValid())
1016 mf::LogDebug(
"LArPandora") <<
" Failed to find reco-truth matching... " << std::endl;
1025 particleVector.clear(); backtrackerVector.clear();
1026 particles_per_hit.
get(hit.
key(), particleVector, backtrackerVector);
1028 for (
unsigned int j = 0; j < particleVector.size(); ++j)
1034 trackIDE.
energy = backtrackerVector[j]->energy;
1035 trackIDE.
energyFrac = backtrackerVector[j]->ideFraction;
1037 hitsToTrackIDEs[hit].push_back(trackIDE);
1058 template <
typename T>
1067 if (indexVector !=
nullptr)
1070 for (
int index : (*indexVector))
1072 const art::Ptr<T> &element = inputVector.at(index);
1074 associatedHits.insert(associatedHits.end(), hits.begin(), hits.end());
1081 associatedHits.insert(associatedHits.end(), hits.begin(), hits.end());
1093 particleMap[particle->
TrackId()] = particle;
1104 particleMap[particle->
Self()] = particle;
1113 int primaryTrackID(inputParticle->
Self());
1120 if (particleMap.end() == pIter1)
1121 throw cet::exception(
"LArPandora") <<
" PandoraCollector::GetParentPFParticle --- Found a PFParticle without a particle ID ";
1127 primaryTrackID = primaryParticle->
Parent();
1132 if (particleMap.end() == pIter2)
1133 throw cet::exception(
"LArPandora") <<
" PandoraCollector::GetParentPFParticle --- Found a PFParticle without a particle ID ";
1136 return outputParticle;
1144 int primaryTrackID(inputParticle->
Self());
1148 int parentTrackID(inputParticle->
Parent());
1153 if (particleMap.end() == pIter1)
1154 throw cet::exception(
"LArPandora") <<
" PandoraCollector::GetFinalStatePFParticle --- Found a PFParticle without a particle ID ";
1160 primaryTrackID = parentTrackID;
1165 parentTrackID = parentParticle->
Parent();
1170 if (particleMap.end() == pIter2)
1171 throw cet::exception(
"LArPandora") <<
" PandoraCollector::GetFinalStatePFParticle --- Found a PFParticle without a particle ID ";
1174 return outputParticle;
1182 int primaryTrackID(inputParticle->
TrackId());
1183 int parentTrackID(inputParticle->
Mother());
1188 if (particleMap.end() == pIter1)
1193 primaryTrackID = parentTrackID;
1194 parentTrackID = particle->
Mother();
1198 if (particleMap.end() == pIter2)
1199 throw cet::exception(
"LArPandora") <<
" PandoraCollector::GetParentMCParticle --- Found a track ID without a MC particle ";
1202 return outputParticle;
1212 int trackID(inputParticle->
TrackId());
1217 if (particleMap.end() == pIter)
1221 mcVector.push_back(particle);
1223 trackID = particle->
Mother();
1227 for (MCParticleVector::const_reverse_iterator iter = mcVector.rbegin(), iterEnd = mcVector.rend(); iter != iterEnd; ++iter)
1232 return nextParticle;
1244 if (particlesToTracks.end() == tIter || tIter->second.empty())
1245 throw cet::exception(
"LArPandora") <<
" PandoraCollector::GetPrimaryTrack --- Failed to find associated track ";
1247 if (tIter->second.size() != 1)
1248 throw cet::exception(
"LArPandora") <<
" PandoraCollector::GetPrimaryTrack --- Found more than one associated track ";
1251 return primaryTrack;
1259 int nGenerations(0);
1260 int primaryTrackID(inputParticle->
Self());
1265 if (particleMap.end() == pIter)
1266 throw cet::exception(
"LArPandora") <<
" PandoraCollector::GetGeneration --- Found a PFParticle without a particle ID ";
1274 primaryTrackID = primaryParticle->
Parent();
1277 return nGenerations;
1287 return parentParticle->
PdgCode();
1292 const int parentID(parentParticle->
Parent());
1295 if (particleMap.end() == pIter)
1296 throw cet::exception(
"LArPandora") <<
" PandoraCollector::GetParentNeutrino --- Found a PFParticle without a particle ID ";
1299 return neutrinoParticle->
PdgCode();
1312 const int parentID(daughterParticle->
Parent());
1315 if (particleMap.end() == pIter)
1316 throw cet::exception(
"LArPandora") <<
" PandoraCollector::IsFinalState --- Found a PFParticle without a particle ID ";
1330 const int pdg(particle->
PdgCode());
1333 return ((pandora::NU_E == std::abs(pdg)) || (pandora::NU_MU == std::abs(pdg)) || (pandora::NU_TAU == std::abs(pdg)));
1340 const int pdg(particle->
PdgCode());
1343 return ((pandora::MU_MINUS == std::abs(pdg)) || (pandora::PI_PLUS == std::abs(pdg)) || (pandora::PROTON == std::abs(pdg)) ||
1344 (pandora::K_PLUS == std::abs(pdg)));
1351 const int pdg(particle->
PdgCode());
1354 return ((pandora::E_MINUS == std::abs(pdg)) || (pandora::PHOTON == std::abs(pdg)));
1362 const int pdg(particle->
PdgCode());
1364 if ((pandora::E_MINUS == std::abs(pdg)) || (pandora::MU_MINUS == std::abs(pdg)) || (pandora::PROTON == std::abs(pdg)) ||
1365 (pandora::PI_PLUS == std::abs(pdg)) || (pandora::K_PLUS == std::abs(pdg)) ||
1366 (pandora::SIGMA_MINUS == std::abs(pdg)) || (pandora::SIGMA_PLUS == std::abs(pdg)) || (pandora::HYPERON_MINUS == std::abs(pdg)) ||
1367 (pandora::PHOTON == std::abs(pdg)) || (pandora::NEUTRON == std::abs(pdg)))
static void BuildPFParticleHitMaps(const PFParticleVector &particleVector, const PFParticlesToSpacePoints &particlesToSpacePoints, const SpacePointsToHits &spacePointsToHits, PFParticlesToHits &particlesToHits, HitsToPFParticles &hitsToParticles, const DaughterMode daughterMode=kUseDaughters)
Build mapping between PFParticles and Hits using PFParticle/SpacePoint/Hit maps.
static void CollectClusters(const art::Event &evt, const std::string &label, ClusterVector &clusterVector, ClustersToHits &clustersToHits)
Collect the reconstructed Clusters and associated hits from the ART event record. ...
std::vector< sim::TrackIDE > TrackIDEVector
std::map< art::Ptr< recob::Hit >, TrackIDEVector > HitsToTrackIDEs
std::vector< art::Ptr< recob::Seed > > SeedVector
std::map< int, art::Ptr< sim::SimChannel > > SimChannelMap
static void BuildPFParticleMap(const PFParticleVector &particleVector, PFParticleMap &particleMap)
Build particle maps for reconstructed particles.
std::map< art::Ptr< recob::SpacePoint >, art::Ptr< recob::Hit > > SpacePointsToHits
std::map< art::Ptr< recob::Hit >, art::Ptr< recob::PFParticle > > HitsToPFParticles
static int GetParentNeutrino(const PFParticleMap &particleMap, const art::Ptr< recob::PFParticle > daughterParticle)
Return the parent neutrino PDG code (or zero for cosmics) for a given reconstructed particle...
std::map< art::Ptr< recob::PFParticle >, ClusterVector > PFParticlesToClusters
size_t Self() const
Returns the index of this particle.
static bool IsNeutrino(const art::Ptr< recob::PFParticle > particle)
Determine whether a particle has been reconstructed as a neutrino.
std::map< art::Ptr< recob::Shower >, HitVector > ShowersToHits
std::vector< art::Ptr< recob::PFParticle > > PFParticleVector
std::map< art::Ptr< simb::MCTruth >, MCParticleVector > MCTruthToMCParticles
Declaration of signal hit object.
static art::Ptr< recob::PFParticle > GetFinalStatePFParticle(const PFParticleMap &particleMap, const art::Ptr< recob::PFParticle > daughterParticle)
Return the final-state parent particle by navigating up the chain of parent/daughter associations...
static void CollectWires(const art::Event &evt, const std::string &label, WireVector &wireVector)
Collect the reconstructed wires from the ART event record.
static bool IsShower(const art::Ptr< recob::PFParticle > particle)
Determine whether a particle has been reconstructed as shower-like.
std::map< int, art::Ptr< simb::MCParticle > > MCParticleMap
int PdgCode() const
Return the type of particle as a PDG ID.
std::map< art::Ptr< recob::Track >, HitVector > TracksToHits
std::vector< int > IntVector
Cluster finding and building.
float energy
energy from the particle with this trackID [MeV]
static art::Ptr< recob::PFParticle > GetParentPFParticle(const PFParticleMap &particleMap, const art::Ptr< recob::PFParticle > daughterParticle)
Return the top-level parent particle by navigating up the chain of parent/daughter associations...
std::vector< art::Ptr< simb::MCParticle > > MCParticleVector
Metadata associated with a pandora produced PFParticle.
std::map< art::Ptr< recob::PFParticle >, std::vector< art::Ptr< larpandoraobj::PFParticleMetadata > > > PFParticlesToMetadata
static void CollectGeneratorMCParticles(const art::Event &evt, const std::string &label, RawMCParticleVector &particleVector)
Collect a vector of MCParticle objects from the generator in the ART event record. ATTN: This function is needed as accessing generator (opposed to Geant4) level MCParticles requires use of MCTruth block.
std::map< art::Ptr< recob::PFParticle >, SeedVector > PFParticlesToSeeds
std::map< art::Ptr< simb::MCParticle >, art::Ptr< simb::MCTruth > > MCParticlesToMCTruth
int TDCtick_t
Type representing a TDC tick.
std::vector< art::Ptr< recob::Track > > TrackVector
std::vector< art::Ptr< sim::SimChannel > > SimChannelVector
static void CollectSpacePoints(const art::Event &evt, const std::string &label, SpacePointVector &spacePointVector, SpacePointsToHits &spacePointsToHits)
Collect the reconstructed SpacePoints and associated hits from the ART event record.
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
static void CollectSeeds(const art::Event &evt, const std::string &label, SeedVector &seedVector, PFParticlesToSeeds &particlesToSeeds)
Collect the reconstructed PFParticles and associated Seeds from the ART event record.
std::map< int, art::Ptr< recob::PFParticle > > PFParticleMap
static void BuildMCParticleHitMaps(const HitVector &hitVector, const SimChannelVector &simChannelVector, HitsToTrackIDEs &hitsToTrackIDEs)
Collect the links from reconstructed hits to their true energy deposits.
static bool IsVisible(const art::Ptr< simb::MCParticle > particle)
Determine whether a particle is visible (i.e. long-lived charged particle)
static art::Ptr< simb::MCParticle > GetParentMCParticle(const MCParticleMap &particleMap, const art::Ptr< simb::MCParticle > daughterParticle)
Return the top-level parent particle by navigating up the chain of parent/daughter associations...
std::map< art::Ptr< recob::PFParticle >, T0Vector > PFParticlesToT0s
std::map< art::Ptr< recob::Hit >, art::Ptr< recob::SpacePoint > > HitsToSpacePoints
static void GetAssociatedHits(const art::Event &evt, const std::string &label, const std::vector< art::Ptr< T > > &inputVector, HitVector &associatedHits, const pandora::IntVector *const indexVector=nullptr)
Get all hits associated with input clusters.
std::map< art::Ptr< recob::Cluster >, HitVector > ClustersToHits
static void CollectShowers(const art::Event &evt, const std::string &label, ShowerVector &showerVector, PFParticlesToShowers &particlesToShowers)
Collect the reconstructed PFParticles and associated Showers from the ART event record.
std::vector< art::Ptr< recob::Wire > > WireVector
static art::Ptr< recob::Track > GetPrimaryTrack(const PFParticlesToTracks &particlesToTracks, const art::Ptr< recob::PFParticle > particle)
Return the primary track associated with a PFParticle.
std::vector< sim::TrackIDE > TrackIDEs(TDC_t startTDC, TDC_t endTDC) const
Returns energies collected for each track within a time interval.
static void CollectVertices(const art::Event &evt, const std::string &label, VertexVector &vertexVector, PFParticlesToVertices &particlesToVertices)
Collect the reconstructed PFParticles and associated Vertices from the ART event record.
std::map< art::Ptr< recob::PFParticle >, VertexVector > PFParticlesToVertices
float energyFrac
fraction of hit energy from the particle with this trackID
std::vector< art::Ptr< anab::T0 > > T0Vector
bool IsPrimary() const
Returns whether the particle is the root of the flow.
static void SelectFinalStatePFParticles(const PFParticleVector &inputParticles, PFParticleVector &outputParticles)
Select final-state reconstructed particles from a list of all reconstructed particles.
static void CollectPFParticleMetadata(const art::Event &evt, const std::string &label, PFParticleVector &particleVector, PFParticlesToMetadata &particlesToMetadata)
Collect the reconstructed PFParticle Metadata from the ART event record.
Declaration of cluster object.
std::map< art::Ptr< recob::PFParticle >, ShowerVector > PFParticlesToShowers
Provides recob::Track data product.
static void CollectTracks(const art::Event &evt, const std::string &label, TrackVector &trackVector, PFParticlesToTracks &particlesToTracks)
Collect the reconstructed PFParticles and associated Tracks from the ART event record.
float PeakTimeMinusRMS(float sigmas=+1.) const
Returns a time sigmas RMS away from the peak time.
static void CollectPFParticles(const art::Event &evt, const std::string &label, PFParticleVector &particleVector)
Collect the reconstructed PFParticles from the ART event record.
std::vector< art::Ptr< recob::Shower > > ShowerVector
std::vector< art::Ptr< recob::SpacePoint > > SpacePointVector
std::vector< art::Ptr< recob::Hit > > HitVector
static void CollectSimChannels(const art::Event &evt, const std::string &label, SimChannelVector &simChannelVector)
Collect a vector of SimChannel objects from the ART event record.
std::map< art::Ptr< recob::PFParticle >, TrackVector > PFParticlesToTracks
static void CollectHits(const art::Event &evt, const std::string &label, HitVector &hitVector)
Collect the reconstructed Hits from the ART event record.
Detector simulation of raw signals on wires.
std::map< art::Ptr< recob::PFParticle >, HitVector > PFParticlesToHits
DaughterMode
DaughterMode enumeration.
const simb::MCParticle & GetParticle(int i) const
std::vector< art::Ptr< recob::Cluster > > ClusterVector
static void SelectNeutrinoPFParticles(const PFParticleVector &inputParticles, PFParticleVector &outputParticles)
Select reconstructed neutrino particles from a list of all reconstructed particles.
std::map< art::Ptr< recob::Seed >, art::Ptr< recob::Hit > > SeedsToHits
raw::ChannelID_t Channel() const
Returns the readout channel this object describes.
std::vector< simb::MCParticle > RawMCParticleVector
std::map< art::Ptr< recob::Track >, CosmicTagVector > TracksToCosmicTags
std::map< art::Ptr< simb::MCParticle >, HitVector > MCParticlesToHits
int trackID
Geant4 supplied trackID.
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
std::vector< art::Ptr< anab::CosmicTag > > CosmicTagVector
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
static bool IsTrack(const art::Ptr< recob::PFParticle > particle)
Determine whether a particle has been reconstructed as track-like.
Declaration of basic channel signal object.
std::map< art::Ptr< recob::PFParticle >, SpacePointVector > PFParticlesToSpacePoints
size_type get(size_type i, reference item, data_reference data) const
float PeakTimePlusRMS(float sigmas=+1.) const
Returns a time sigmas RMS away from the peak time.
static int GetGeneration(const PFParticleMap &particleMap, const art::Ptr< recob::PFParticle > daughterParticle)
Return the generation of this particle (first generation if primary)
static void CollectT0s(const art::Event &evt, const std::string &label, T0Vector &t0Vector, PFParticlesToT0s &particlesToT0s)
Collect a vector of T0s from the ART event record.
static void CollectMCParticles(const art::Event &evt, const std::string &label, MCParticleVector &particleVector)
Collect a vector of MCParticle objects from the ART event record.
helper function for LArPandoraInterface producer module
Ionization energy from a Geant4 track.
raw::ChannelID_t Channel() const
ID of the readout channel the hit was extracted from.
static art::Ptr< simb::MCParticle > GetFinalStateMCParticle(const MCParticleMap &particleMap, const art::Ptr< simb::MCParticle > daughterParticle)
Return the final-state parent particle by navigating up the chain of parent/daughter associations...
std::map< art::Ptr< recob::Hit >, art::Ptr< simb::MCParticle > > HitsToMCParticles
art framework interface to geometry description
static bool IsFinalState(const PFParticleMap &particleMap, const art::Ptr< recob::PFParticle > daughterParticle)
Determine whether a particle has been reconstructed as a final-state particle.
cet::coded_exception< error, detail::translate > exception
static void CollectCosmicTags(const art::Event &evt, const std::string &label, CosmicTagVector &cosmicTagVector, TracksToCosmicTags &tracksToCosmicTags)
Collect a vector of cosmic tags from the ART event record.
std::vector< art::Ptr< recob::Vertex > > VertexVector
static void BuildMCParticleMap(const MCParticleVector &particleVector, MCParticleMap &particleMap)
Build particle maps for true particles.