8 #include "cetlib_except/exception.h" 35 #include "Objects/ParticleFlowObject.h" 36 #include "Pandora/PdgTable.h" 37 #include "Pandora/PandoraInternal.h" 54 mf::LogDebug(
"LArPandora") <<
" Failed to find wires... " << std::endl;
59 mf::LogDebug(
"LArPandora") <<
" Found: " << theWires->size() <<
" Wires " << std::endl;
62 for (
unsigned int i = 0; i < theWires->size(); ++i)
65 wireVector.push_back(wire);
78 mf::LogDebug(
"LArPandora") <<
" Failed to find hits... " << std::endl;
83 mf::LogDebug(
"LArPandora") <<
" Found: " << theHits->size() <<
" Hits " << std::endl;
86 for (
unsigned int i = 0; i < theHits->size(); ++i)
89 hitVector.push_back(hit);
102 mf::LogDebug(
"LArPandora") <<
" Failed to find particles... " << std::endl;
107 mf::LogDebug(
"LArPandora") <<
" Found: " << theParticles->size() <<
" PFParticles " << std::endl;
110 for (
unsigned int i = 0; i < theParticles->size(); ++i)
113 particleVector.push_back(particle);
136 mf::LogDebug(
"LArPandora") <<
" Failed to find spacepoints... " << std::endl;
141 mf::LogDebug(
"LArPandora") <<
" Found: " << theSpacePoints->size() <<
" SpacePoints " << std::endl;
145 for (
unsigned int i = 0; i < theSpacePoints->size(); ++i)
148 spacePointVector.push_back(spacepoint);
150 spacePointsToHits[spacepoint] = hit;
151 hitsToSpacePoints[hit] = spacepoint;
165 mf::LogDebug(
"LArPandora") <<
" Failed to find clusters... " << std::endl;
170 mf::LogDebug(
"LArPandora") <<
" Found: " << theClusters->size() <<
" Clusters " << std::endl;
174 for (
unsigned int i = 0; i < theClusters->size(); ++i)
177 clusterVector.push_back(cluster);
179 const std::vector< art::Ptr<recob::Hit> >
hits = theHitAssns.at(i);
180 for (
unsigned int j=0; j<hits.size(); ++j)
183 clustersToHits[cluster].push_back(hit);
198 mf::LogDebug(
"LArPandora") <<
" Failed to find particles... " << std::endl;
203 mf::LogDebug(
"LArPandora") <<
" Found: " << theParticles->size() <<
" PFParticles " << std::endl;
207 for (
unsigned int i = 0; i < theParticles->size(); ++i)
210 particleVector.push_back(particle);
212 const std::vector< art::Ptr<recob::SpacePoint> > spacepoints = theSpacePointAssns.at(i);
213 for (
unsigned int j=0; j<spacepoints.size(); ++j)
216 particlesToSpacePoints[particle].push_back(spacepoint);
231 mf::LogDebug(
"LArPandora") <<
" Failed to find particles... " << std::endl;
236 mf::LogDebug(
"LArPandora") <<
" Found: " << theParticles->size() <<
" PFParticles " << std::endl;
240 for (
unsigned int i = 0; i < theParticles->size(); ++i)
243 particleVector.push_back(particle);
245 const std::vector< art::Ptr<recob::Cluster> > clusters = theClusterAssns.at(i);
246 for (
unsigned int j=0; j<clusters.size(); ++j)
249 particlesToClusters[particle].push_back(cluster);
264 mf::LogDebug(
"LArPandora") <<
" Failed to find particles... " << std::endl;
269 mf::LogDebug(
"LArPandora") <<
" Found: " << theParticles->size() <<
" PFParticles " << std::endl;
273 for (
unsigned int i = 0; i < theParticles->size(); ++i)
276 particleVector.push_back(particle);
278 const std::vector< art::Ptr<larpandoraobj::PFParticleMetadata> > pfParticleMetadataList = theMetadataAssns.at(i);
279 for (
unsigned int j=0; j<pfParticleMetadataList.size(); ++j)
282 particlesToMetadata[particle].push_back(pfParticleMetadata);
297 mf::LogDebug(
"LArPandora") <<
" Failed to find showers... " << std::endl;
302 mf::LogDebug(
"LArPandora") <<
" Found: " << theShowers->size() <<
" Showers " << std::endl;
306 for (
unsigned int i = 0; i < theShowers->size(); ++i)
309 showerVector.push_back(shower);
311 const std::vector< art::Ptr<recob::PFParticle> > particles = theShowerAssns.at(i);
312 for (
unsigned int j=0; j<particles.size(); ++j)
315 particlesToShowers[particle].push_back(shower);
330 mf::LogDebug(
"LArPandora") <<
" Failed to find tracks... " << std::endl;
335 mf::LogDebug(
"LArPandora") <<
" Found: " << theTracks->size() <<
" Tracks " << std::endl;
339 for (
unsigned int i = 0; i < theTracks->size(); ++i)
342 trackVector.push_back(track);
344 const std::vector< art::Ptr<recob::PFParticle> > particles = theTrackAssns.at(i);
345 for (
unsigned int j=0; j<particles.size(); ++j)
348 particlesToTracks[particle].push_back(track);
362 mf::LogDebug(
"LArPandora") <<
" Failed to find tracks... " << std::endl;
367 mf::LogDebug(
"LArPandora") <<
" Found: " << theTracks->size() <<
" Tracks " << std::endl;
371 for (
unsigned int i = 0; i < theTracks->size(); ++i)
374 trackVector.push_back(track);
376 const std::vector< art::Ptr<recob::Hit> >
hits = theHitAssns.at(i);
377 for (
unsigned int j=0; j<hits.size(); ++j)
380 tracksToHits[
track].push_back(hit);
394 mf::LogDebug(
"LArPandora") <<
" Failed to find showers... " << std::endl;
399 mf::LogDebug(
"LArPandora") <<
" Found: " << theShowers->size() <<
" Showers " << std::endl;
403 for (
unsigned int i = 0; i < theShowers->size(); ++i)
406 showerVector.push_back(shower);
408 const std::vector< art::Ptr<recob::Hit> >
hits = theHitAssns.at(i);
409 for (
unsigned int j=0; j<hits.size(); ++j)
412 showersToHits[shower].push_back(hit);
427 mf::LogDebug(
"LArPandora") <<
" Failed to find seeds... " << std::endl;
432 mf::LogDebug(
"LArPandora") <<
" Found: " << theSeeds->size() <<
" Seeds " << std::endl;
436 for (
unsigned int i = 0; i < theSeeds->size(); ++i)
439 seedVector.push_back(seed);
441 const std::vector< art::Ptr<recob::PFParticle> > particles = theSeedAssns.at(i);
442 for (
unsigned int j=0; j<particles.size(); ++j)
445 particlesToSeeds[particle].push_back(seed);
459 mf::LogDebug(
"LArPandora") <<
" Failed to find seeds... " << std::endl;
464 mf::LogDebug(
"LArPandora") <<
" Found: " << theSeeds->size() <<
" Seeds " << std::endl;
469 if (!theHitAssns.isValid())
471 mf::LogDebug(
"LArPandora") <<
" Failed to find seed associations... " << std::endl;
475 for (
unsigned int i = 0; i < theSeeds->size(); ++i)
478 seedVector.push_back(seed);
480 seedsToHits[
seed] = hit;
494 mf::LogDebug(
"LArPandora") <<
" Failed to find vertices... " << std::endl;
499 mf::LogDebug(
"LArPandora") <<
" Found: " << theVertices->size() <<
" Vertices " << std::endl;
503 for (
unsigned int i = 0; i < theVertices->size(); ++i)
506 vertexVector.push_back(vertex);
508 const std::vector< art::Ptr<recob::PFParticle> > particles = theVerticesAssns.at(i);
509 for (
unsigned int j=0; j<particles.size(); ++j)
512 particlesToVertices[particle].push_back(vertex);
529 particleMap[particle->
Self()] = particle;
534 iter1 != iterEnd1; ++iter1)
550 if (spacePointsToHits.end() == iter3)
551 throw cet::exception(
"LArPandora") <<
" PandoraCollector::BuildPFParticleHitMaps --- Found a space point without an associated hit ";
555 particlesToHits[particle].push_back(hit);
556 hitsToParticles[hit] = particle;
573 particleMap[particle->
Self()] = particle;
578 iter1 != iterEnd1; ++iter1)
593 if (clustersToHits.end() == iter3)
594 throw cet::exception(
"LArPandora") <<
" PandoraCollector::BuildPFParticleHitMaps --- Found a space point without an associated hit ";
596 const HitVector &hitVector = iter3->second;
601 particlesToHits[particle].push_back(hit);
602 hitsToParticles[hit] = particle;
634 particlesToHits, hitsToParticles, daughterMode);
650 particlesToHits, hitsToParticles, daughterMode);
663 outputParticles.push_back(particle);
677 particleMap[particle->
Self()] = particle;
686 outputParticles.push_back(particle);
701 for (
unsigned int i = 0; i < theCosmicTags->size(); ++i)
705 tracksToCosmicTags[
track].push_back(cosmicTag);
706 cosmicTagVector.push_back(cosmicTag);
721 for (
unsigned int i = 0; i < theT0s->size(); ++i)
724 t0Vector.push_back(theT0);
726 const std::vector< art::Ptr<recob::PFParticle> > particles = theAssns.at(i);
727 for (
unsigned int j=0; j<particles.size(); ++j)
730 particlesToT0s[theParticle].push_back(theT0);
741 throw cet::exception(
"LArPandora") <<
" PandoraCollector::CollectSimChannels --- Trying to access MC truth from real data ";
748 mf::LogDebug(
"LArPandora") <<
" Failed to find sim channels... " << std::endl;
753 mf::LogDebug(
"LArPandora") <<
" Found: " << theSimChannels->size() <<
" SimChannels " << std::endl;
756 for (
unsigned int i = 0; i < theSimChannels->size(); ++i)
759 simChannelVector.push_back(channel);
768 throw cet::exception(
"LArPandora") <<
" PandoraCollector::CollectMCParticles --- Trying to access MC truth from real data ";
775 mf::LogDebug(
"LArPandora") <<
" Failed to find MC particles... " << std::endl;
780 mf::LogDebug(
"LArPandora") <<
" Found: " << theParticles->size() <<
" MC particles " << std::endl;
783 for (
unsigned int i = 0; i < theParticles->size(); ++i)
786 particleVector.push_back(particle);
795 throw cet::exception(
"LArPandora") <<
" PandoraCollector::CollectGeneratorMCParticles --- Trying to access MC truth from real data ";
802 mf::LogDebug(
"LArPandora") <<
" Failed to find MC truth blocks from generator... " << std::endl;
807 mf::LogDebug(
"LArPandora") <<
" Found: " << mcTruthBlocks->size() <<
" MC truth blocks " << std::endl;
810 if (mcTruthBlocks->size() != 1)
811 throw cet::exception(
"LArPandora") <<
" PandoraCollector::CollectGeneratorMCParticles --- Unexpected number of MC truth blocks ";
815 for (
int i = 0; i < mcTruth->
NParticles(); ++i)
828 throw cet::exception(
"LArPandora") <<
" PandoraCollector::CollectMCParticles --- Trying to access MC truth from real data ";
835 mf::LogDebug(
"LArPandora") <<
" Failed to find MC particles... " << std::endl;
840 mf::LogDebug(
"LArPandora") <<
" Found: " << theParticles->size() <<
" MC particles " << std::endl;
845 for (
unsigned int i = 0, iEnd = theParticles->size(); i < iEnd; ++i)
849 truthToParticles[truth].push_back(particle);
850 particlesToTruth[particle] = truth;
860 auto const* ts = lar::providerFrom<detinfo::DetectorClocksService>();
867 simChannelMap.insert(SimChannelMap::value_type(simChannel->
Channel(), simChannel));
875 if (simChannelMap.end() == sIter)
881 const unsigned int start_tdc((start_tick < 0) ? 0 : start_tick);
882 const unsigned int end_tdc(end_tick);
884 if (start_tdc > end_tdc)
890 if (trackCollection.empty())
893 for (
unsigned int iTrack = 0, iTrackEnd = trackCollection.size(); iTrack < iTrackEnd; ++iTrack)
896 hitsToTrackIDEs[hit].push_back(trackIDE);
915 particleMap[particle->
TrackId()] = particle;
926 float bestEnergyFrac(0.
f);
931 const int trackID(std::abs(trackIDE.
trackID));
934 if (energyFrac > bestEnergyFrac)
936 bestEnergyFrac = energyFrac;
937 bestTrackID = trackID;
941 if (bestTrackID >= 0)
944 if (particleMap.end() == iter3)
945 throw cet::exception(
"LArPandora") <<
" PandoraCollector::BuildMCParticleHitMaps --- Found a track ID without an MC Particle ";
953 if ((
kIgnoreDaughters == daughterMode) && (selectedParticle != primaryParticle))
959 particlesToHits[selectedParticle].push_back(hit);
960 hitsToParticles[hit] = selectedParticle;
996 mf::LogDebug(
"LArPandora") <<
" Failed to find hits... " << std::endl;
1002 for (
unsigned int i = 0; i < theHits->size(); ++i)
1005 hitVector.push_back(hit);
1009 std::vector<anab::BackTrackerHitMatchingData const*> backtrackerVector;
1015 if (!particles_per_hit.isValid())
1017 mf::LogDebug(
"LArPandora") <<
" Failed to find reco-truth matching... " << std::endl;
1026 particleVector.clear(); backtrackerVector.clear();
1027 particles_per_hit.
get(hit.
key(), particleVector, backtrackerVector);
1029 for (
unsigned int j = 0; j < particleVector.size(); ++j)
1035 trackIDE.
energy = backtrackerVector[j]->energy;
1036 trackIDE.
energyFrac = backtrackerVector[j]->ideFraction;
1038 hitsToTrackIDEs[hit].push_back(trackIDE);
1059 template <
typename T>
1068 if (indexVector !=
nullptr)
1070 if (inputVector.size() != indexVector->size())
1071 throw cet::exception(
"LArPandora") <<
" PandoraHelper::GetAssociatedHits --- trying to use an index vector not matching input vector";
1074 for (
int index : (*indexVector))
1076 const art::Ptr<T> &element = inputVector.at(index);
1078 associatedHits.insert(associatedHits.end(), hits.begin(), hits.end());
1087 associatedHits.insert(associatedHits.end(), hits.begin(), hits.end());
1099 particleMap[particle->
TrackId()] = particle;
1100 particleMap[particle->
TrackId()] = particle;
1111 particleMap[particle->
Self()] = particle;
1120 int primaryTrackID(inputParticle->
Self());
1127 if (particleMap.end() == pIter1)
1128 throw cet::exception(
"LArPandora") <<
" PandoraCollector::GetParentPFParticle --- Found a PFParticle without a particle ID ";
1134 primaryTrackID = primaryParticle->
Parent();
1139 if (particleMap.end() == pIter2)
1140 throw cet::exception(
"LArPandora") <<
" PandoraCollector::GetParentPFParticle --- Found a PFParticle without a particle ID ";
1143 return outputParticle;
1151 int primaryTrackID(inputParticle->
Self());
1155 int parentTrackID(inputParticle->
Parent());
1160 if (particleMap.end() == pIter1)
1161 throw cet::exception(
"LArPandora") <<
" PandoraCollector::GetFinalStatePFParticle --- Found a PFParticle without a particle ID ";
1167 primaryTrackID = parentTrackID;
1172 parentTrackID = parentParticle->
Parent();
1177 if (particleMap.end() == pIter2)
1178 throw cet::exception(
"LArPandora") <<
" PandoraCollector::GetFinalStatePFParticle --- Found a PFParticle without a particle ID ";
1181 return outputParticle;
1189 int primaryTrackID(inputParticle->
TrackId());
1190 int parentTrackID(inputParticle->
Mother());
1195 if (particleMap.end() == pIter1)
1200 primaryTrackID = parentTrackID;
1201 parentTrackID = particle->
Mother();
1205 if (particleMap.end() == pIter2)
1206 throw cet::exception(
"LArPandora") <<
" PandoraCollector::GetParentMCParticle --- Found a track ID without a MC particle ";
1209 return outputParticle;
1219 int trackID(inputParticle->
TrackId());
1224 if (particleMap.end() == pIter)
1228 mcVector.push_back(particle);
1230 trackID = particle->
Mother();
1234 for (MCParticleVector::const_reverse_iterator iter = mcVector.rbegin(), iterEnd = mcVector.rend(); iter != iterEnd; ++iter)
1239 return nextParticle;
1251 if (particlesToTracks.end() == tIter || tIter->second.empty())
1252 throw cet::exception(
"LArPandora") <<
" PandoraCollector::GetPrimaryTrack --- Failed to find associated track ";
1254 if (tIter->second.size() != 1)
1255 throw cet::exception(
"LArPandora") <<
" PandoraCollector::GetPrimaryTrack --- Found more than one associated track ";
1258 return primaryTrack;
1266 int nGenerations(0);
1267 int primaryTrackID(inputParticle->
Self());
1272 if (particleMap.end() == pIter)
1273 throw cet::exception(
"LArPandora") <<
" PandoraCollector::GetGeneration --- Found a PFParticle without a particle ID ";
1281 primaryTrackID = primaryParticle->
Parent();
1284 return nGenerations;
1294 return parentParticle->
PdgCode();
1299 const int parentID(parentParticle->
Parent());
1302 if (particleMap.end() == pIter)
1303 throw cet::exception(
"LArPandora") <<
" PandoraCollector::GetParentNeutrino --- Found a PFParticle without a particle ID ";
1306 return neutrinoParticle->
PdgCode();
1319 const int parentID(daughterParticle->
Parent());
1322 if (particleMap.end() == pIter)
1323 throw cet::exception(
"LArPandora") <<
" PandoraCollector::IsFinalState --- Found a PFParticle without a particle ID ";
1337 const int pdg(particle->
PdgCode());
1340 return ((pandora::NU_E == std::abs(pdg)) || (pandora::NU_MU == std::abs(pdg)) || (pandora::NU_TAU == std::abs(pdg)));
1347 const int pdg(particle->
PdgCode());
1350 return ((pandora::MU_MINUS == std::abs(pdg)) || (pandora::PI_PLUS == std::abs(pdg)) || (pandora::PROTON == std::abs(pdg)) ||
1351 (pandora::K_PLUS == std::abs(pdg)));
1358 const int pdg(particle->
PdgCode());
1361 return ((pandora::E_MINUS == std::abs(pdg)) || (pandora::PHOTON == std::abs(pdg)));
1369 const int pdg(particle->
PdgCode());
1371 if ((pandora::E_MINUS == std::abs(pdg)) || (pandora::MU_MINUS == std::abs(pdg)) || (pandora::PROTON == std::abs(pdg)) ||
1372 (pandora::PI_PLUS == std::abs(pdg)) || (pandora::K_PLUS == std::abs(pdg)) ||
1373 (pandora::SIGMA_MINUS == std::abs(pdg)) || (pandora::SIGMA_PLUS == std::abs(pdg)) || (pandora::HYPERON_MINUS == std::abs(pdg)) ||
1374 (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
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...
Provides recob::Track data product.
Metadata associated to PFParticles.
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
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 larpandoraobj::PFParticleMetadata GetPFParticleMetadata(const pandora::ParticleFlowObject *const pPfo)
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.