15 #include "cetlib_except/exception.h" 38 #include "Objects/ParticleFlowObject.h" 39 #include "Pandora/PandoraInternal.h" 40 #include "Pandora/PdgTable.h" 48 const std::string& label,
55 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) {
64 wireVector.push_back(wire);
71 const std::string& label,
78 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) {
87 hitVector.push_back(hit);
94 const std::string& label,
101 mf::LogDebug(
"LArPandora") <<
" Failed to find particles... " << std::endl;
105 mf::LogDebug(
"LArPandora") <<
" Found: " << theParticles->size() <<
" PFParticles " 109 for (
unsigned int i = 0; i < theParticles->size(); ++i) {
111 particleVector.push_back(particle);
118 const std::string& label,
124 evt, label, spacePointVector, spacePointsToHits, hitsToSpacePoints);
130 const std::string& label,
138 if (!theSpacePoints.
isValid()) {
139 mf::LogDebug(
"LArPandora") <<
" Failed to find spacepoints... " << std::endl;
143 mf::LogDebug(
"LArPandora") <<
" Found: " << theSpacePoints->size() <<
" SpacePoints " 148 for (
unsigned int i = 0; i < theSpacePoints->size(); ++i) {
150 spacePointVector.push_back(spacepoint);
152 spacePointsToHits[spacepoint] = hit;
153 hitsToSpacePoints[hit] = spacepoint;
160 const std::string& label,
168 mf::LogDebug(
"LArPandora") <<
" Failed to find clusters... " << std::endl;
172 mf::LogDebug(
"LArPandora") <<
" Found: " << theClusters->size() <<
" Clusters " << std::endl;
176 for (
unsigned int i = 0; i < theClusters->size(); ++i) {
178 clusterVector.push_back(cluster);
180 const std::vector<art::Ptr<recob::Hit>>
hits = theHitAssns.at(i);
181 for (
unsigned int j = 0; j < hits.size(); ++j) {
183 clustersToHits[cluster].push_back(hit);
191 const std::string& label,
199 mf::LogDebug(
"LArPandora") <<
" Failed to find particles... " << std::endl;
203 mf::LogDebug(
"LArPandora") <<
" Found: " << theParticles->size() <<
" PFParticles " 208 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) {
215 particlesToSpacePoints[particle].push_back(spacepoint);
223 const std::string& label,
231 mf::LogDebug(
"LArPandora") <<
" Failed to find particles... " << std::endl;
235 mf::LogDebug(
"LArPandora") <<
" Found: " << theParticles->size() <<
" PFParticles " 240 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) {
247 particlesToClusters[particle].push_back(cluster);
255 const std::string& label,
263 mf::LogDebug(
"LArPandora") <<
" Failed to find particles... " << std::endl;
267 mf::LogDebug(
"LArPandora") <<
" Found: " << theParticles->size() <<
" PFParticles " 272 for (
unsigned int i = 0; i < theParticles->size(); ++i) {
274 particleVector.push_back(particle);
276 const std::vector<art::Ptr<larpandoraobj::PFParticleMetadata>> pfParticleMetadataList =
277 theMetadataAssns.at(i);
278 for (
unsigned int j = 0; j < pfParticleMetadataList.size(); ++j) {
280 pfParticleMetadataList.at(j);
281 particlesToMetadata[particle].push_back(pfParticleMetadata);
289 const std::string& label,
297 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) {
307 showerVector.push_back(shower);
309 const std::vector<art::Ptr<recob::PFParticle>> particles = theShowerAssns.at(i);
310 for (
unsigned int j = 0; j < particles.size(); ++j) {
312 particlesToShowers[particle].push_back(shower);
320 const std::string& label,
328 mf::LogDebug(
"LArPandora") <<
" Failed to find tracks... " << std::endl;
332 mf::LogDebug(
"LArPandora") <<
" Found: " << theTracks->size() <<
" Tracks " << std::endl;
336 for (
unsigned int i = 0; i < theTracks->size(); ++i) {
338 trackVector.push_back(track);
340 const std::vector<art::Ptr<recob::PFParticle>> particles = theTrackAssns.at(i);
341 for (
unsigned int j = 0; j < particles.size(); ++j) {
343 particlesToTracks[particle].push_back(track);
351 const std::string& label,
359 mf::LogDebug(
"LArPandora") <<
" Failed to find tracks... " << std::endl;
363 mf::LogDebug(
"LArPandora") <<
" Found: " << theTracks->size() <<
" Tracks " << std::endl;
367 for (
unsigned int i = 0; i < theTracks->size(); ++i) {
369 trackVector.push_back(track);
371 const std::vector<art::Ptr<recob::Hit>>
hits = theHitAssns.at(i);
372 for (
unsigned int j = 0; j < hits.size(); ++j) {
374 tracksToHits[
track].push_back(hit);
382 const std::string& label,
390 mf::LogDebug(
"LArPandora") <<
" Failed to find showers... " << std::endl;
394 mf::LogDebug(
"LArPandora") <<
" Found: " << theShowers->size() <<
" Showers " << std::endl;
398 for (
unsigned int i = 0; i < theShowers->size(); ++i) {
400 showerVector.push_back(shower);
402 const std::vector<art::Ptr<recob::Hit>>
hits = theHitAssns.at(i);
403 for (
unsigned int j = 0; j < hits.size(); ++j) {
405 showersToHits[shower].push_back(hit);
413 const std::string& label,
421 mf::LogDebug(
"LArPandora") <<
" Failed to find seeds... " << std::endl;
425 mf::LogDebug(
"LArPandora") <<
" Found: " << theSeeds->size() <<
" Seeds " << std::endl;
429 for (
unsigned int i = 0; i < theSeeds->size(); ++i) {
431 seedVector.push_back(seed);
433 const std::vector<art::Ptr<recob::PFParticle>> particles = theSeedAssns.at(i);
434 for (
unsigned int j = 0; j < particles.size(); ++j) {
436 particlesToSeeds[particle].push_back(seed);
444 const std::string& label,
452 mf::LogDebug(
"LArPandora") <<
" Failed to find seeds... " << std::endl;
456 mf::LogDebug(
"LArPandora") <<
" Found: " << theSeeds->size() <<
" Seeds " << std::endl;
461 if (!theHitAssns.isValid()) {
462 mf::LogDebug(
"LArPandora") <<
" Failed to find seed associations... " << std::endl;
466 for (
unsigned int i = 0; i < theSeeds->size(); ++i) {
468 seedVector.push_back(seed);
470 seedsToHits[
seed] = hit;
477 const std::string& label,
485 mf::LogDebug(
"LArPandora") <<
" Failed to find vertices... " << std::endl;
489 mf::LogDebug(
"LArPandora") <<
" Found: " << theVertices->size() <<
" Vertices " << std::endl;
493 for (
unsigned int i = 0; i < theVertices->size(); ++i) {
495 vertexVector.push_back(vertex);
497 const std::vector<art::Ptr<recob::PFParticle>> particles = theVerticesAssns.at(i);
498 for (
unsigned int j = 0; j < particles.size(); ++j) {
500 particlesToVertices[particle].push_back(vertex);
519 iterEnd1 = particleVector.end();
523 particleMap[particle->
Self()] = particle;
528 iterEnd1 = particlesToSpacePoints.end();
544 iterEnd2 = spacePointVector.end();
550 if (spacePointsToHits.end() == iter3)
551 throw cet::exception(
"LArPandora") <<
" PandoraCollector::BuildPFParticleHitMaps --- " 552 "Found a space point without an associated hit ";
556 particlesToHits[particle].push_back(hit);
557 hitsToParticles[hit] = particle;
575 iterEnd1 = particleVector.end();
579 particleMap[particle->
Self()] = particle;
584 iterEnd1 = particlesToClusters.end();
599 iterEnd2 = clusterVector.end();
605 if (clustersToHits.end() == iter3)
606 throw cet::exception(
"LArPandora") <<
" PandoraCollector::BuildPFParticleHitMaps --- " 607 "Found a space point without an associated hit ";
609 const HitVector& hitVector = iter3->second;
615 particlesToHits[particle].push_back(hit);
616 hitsToParticles[hit] = particle;
625 const std::string& label,
629 const bool useClusters)
632 evt, label, label, particlesToHits, hitsToParticles, daughterMode, useClusters);
638 const std::string& label_pfpart,
639 const std::string& label_middle,
643 const bool useClusters)
673 evt, label_pfpart, particleVector, particlesToSpacePoints);
677 particlesToSpacePoints,
691 iterEnd = inputParticles.end();
709 iterEnd = inputParticles.end();
713 particleMap[particle->
Self()] = particle;
718 iterEnd = inputParticles.end();
724 outputParticles.push_back(particle);
731 const std::string& label,
740 theCosmicTags, evt, label);
741 for (
unsigned int i = 0; i < theCosmicTags->size(); ++i) {
744 tracksToCosmicTags[
track].push_back(
746 cosmicTagVector.push_back(cosmicTag);
754 const std::string& label,
763 for (
unsigned int i = 0; i < theT0s->size(); ++i) {
765 t0Vector.push_back(theT0);
767 const std::vector<art::Ptr<recob::PFParticle>> particles = theAssns.at(i);
768 for (
unsigned int j = 0; j < particles.size(); ++j) {
770 particlesToT0s[theParticle].push_back(
780 const std::string& label,
782 bool& areSimChannelsValid)
787 if (!theSimChannels.
isValid()) {
788 mf::LogDebug(
"LArPandora") <<
" Failed to find sim channels... " << std::endl;
789 areSimChannelsValid =
false;
793 mf::LogDebug(
"LArPandora") <<
" Found: " << theSimChannels->size() <<
" SimChannels " 795 areSimChannelsValid =
true;
798 for (
unsigned int i = 0; i < theSimChannels->size(); ++i) {
800 simChannelVector.push_back(channel);
807 const std::string& label,
814 mf::LogDebug(
"LArPandora") <<
" Failed to find MC particles... " << std::endl;
818 mf::LogDebug(
"LArPandora") <<
" Found: " << theParticles->size() <<
" MC particles " 822 for (
unsigned int i = 0; i < theParticles->size(); ++i) {
824 particleVector.push_back(particle);
831 const std::string& label,
837 if (!mcTruthBlocks.
isValid()) {
838 mf::LogDebug(
"LArPandora") <<
" Failed to find MC truth blocks from generator... " 843 mf::LogDebug(
"LArPandora") <<
" Found: " << mcTruthBlocks->size() <<
" MC truth blocks " 847 if (mcTruthBlocks->size() != 1)
848 throw cet::exception(
"LArPandora") <<
" PandoraCollector::CollectGeneratorMCParticles --- " 849 "Unexpected number of MC truth blocks ";
853 for (
int i = 0; i < mcTruth->
NParticles(); ++i) {
861 const std::string& label,
869 mf::LogDebug(
"LArPandora") <<
" Failed to find MC particles... " << std::endl;
873 mf::LogDebug(
"LArPandora") <<
" Found: " << theParticles->size() <<
" MC particles " 879 for (
unsigned int i = 0, iEnd = theParticles->size(); i < iEnd; ++i) {
882 truthToParticles[truth].push_back(particle);
883 particlesToTruth[particle] = truth;
894 auto const clock_data =
900 iterEnd = simChannelVector.end();
904 simChannelMap.insert(SimChannelMap::value_type(simChannel->
Channel(), simChannel));
913 if (simChannelMap.end() == sIter)
continue;
918 const unsigned int start_tdc((start_tick < 0) ? 0 : start_tick);
919 const unsigned int end_tdc(end_tick);
921 if (start_tdc > end_tdc)
continue;
926 if (trackCollection.empty())
continue;
928 for (
unsigned int iTrack = 0, iTrackEnd = trackCollection.size(); iTrack < iTrackEnd;
931 hitsToTrackIDEs[hit].push_back(trackIDE);
948 iterEnd1 = truthToParticles.end();
953 iterEnd2 = particleVector.end();
957 particleMap[particle->
TrackId()] = particle;
963 iterEnd1 = hitsToTrackIDEs.end();
970 float bestEnergyFrac(0.
f);
973 iterEnd2 = trackCollection.end();
980 if (energyFrac > bestEnergyFrac) {
981 bestEnergyFrac = energyFrac;
982 bestTrackID = trackID;
986 if (bestTrackID >= 0) {
988 if (particleMap.end() == iter3)
989 throw cet::exception(
"LArPandora") <<
" PandoraCollector::BuildMCParticleHitMaps --- " 990 "Found a track ID without an MC Particle ";
997 (
kAddDaughters == daughterMode) ? primaryParticle : thisParticle);
999 if ((
kIgnoreDaughters == daughterMode) && (selectedParticle != primaryParticle))
continue;
1003 particlesToHits[selectedParticle].push_back(hit);
1004 hitsToParticles[hit] = selectedParticle;
1015 const std::string& label,
1026 bool areSimChannelsValid(
false);
1032 hitsToTrackIDEs, truthToParticles, particlesToHits, hitsToParticles, daughterMode);
1038 const std::string& hitLabel,
1039 const std::string& backtrackLabel,
1047 mf::LogDebug(
"LArPandora") <<
" Failed to find hits... " << std::endl;
1053 for (
unsigned int i = 0; i < theHits->size(); ++i) {
1055 hitVector.push_back(hit);
1059 std::vector<anab::BackTrackerHitMatchingData const*> backtrackerVector;
1064 theHits, evt, backtrackLabel);
1066 if (!particles_per_hit.isValid()) {
1067 mf::LogDebug(
"LArPandora") <<
" Failed to find reco-truth matching... " << std::endl;
1077 particleVector.clear();
1078 backtrackerVector.clear();
1079 particles_per_hit.
get(hit.
key(), particleVector, backtrackerVector);
1081 for (
unsigned int j = 0; j < particleVector.size(); ++j) {
1086 trackIDE.
energy = backtrackerVector[j]->energy;
1087 trackIDE.
energyFrac = backtrackerVector[j]->ideFraction;
1089 hitsToTrackIDEs[hit].push_back(trackIDE);
1097 const std::string& truthLabel,
1098 const std::string& hitLabel,
1099 const std::string& backtrackLabel,
1111 hitsToTrackIDEs, truthToParticles, particlesToHits, hitsToParticles, daughterMode);
1116 template <
typename T>
1118 const std::string& label,
1128 if (indexVector !=
nullptr) {
1129 if (inputVector.size() != indexVector->size())
1130 throw cet::exception(
"LArPandora") <<
" PandoraHelper::GetAssociatedHits --- trying to use " 1131 "an index vector not matching input vector";
1134 for (
int index : (*indexVector)) {
1135 const art::Ptr<T>& element = inputVector.at(index);
1137 associatedHits.insert(associatedHits.end(), hits.begin(), hits.end());
1144 associatedHits.insert(associatedHits.end(), hits.begin(), hits.end());
1155 iterEnd = particleVector.end();
1159 particleMap[particle->
TrackId()] = particle;
1160 particleMap[particle->
TrackId()] = particle;
1170 iterEnd = particleVector.end();
1174 particleMap[particle->
Self()] = particle;
1185 int primaryTrackID(inputParticle->
Self());
1190 if (particleMap.end() == pIter1)
1191 throw cet::exception(
"LArPandora") <<
" PandoraCollector::GetParentPFParticle --- Found " 1192 "a PFParticle without a particle ID ";
1195 if (primaryParticle->
IsPrimary())
break;
1197 primaryTrackID = primaryParticle->
Parent();
1202 if (particleMap.end() == pIter2)
1204 <<
" PandoraCollector::GetParentPFParticle --- Found a PFParticle without a particle ID ";
1207 return outputParticle;
1217 int primaryTrackID(inputParticle->
Self());
1220 int parentTrackID(inputParticle->
Parent());
1224 if (particleMap.end() == pIter1)
1225 throw cet::exception(
"LArPandora") <<
" PandoraCollector::GetFinalStatePFParticle --- " 1226 "Found a PFParticle without a particle ID ";
1231 primaryTrackID = parentTrackID;
1235 parentTrackID = parentParticle->
Parent();
1240 if (particleMap.end() == pIter2)
1241 throw cet::exception(
"LArPandora") <<
" PandoraCollector::GetFinalStatePFParticle --- Found " 1242 "a PFParticle without a particle ID ";
1245 return outputParticle;
1255 int primaryTrackID(inputParticle->
TrackId());
1256 int parentTrackID(inputParticle->
Mother());
1260 if (particleMap.end() == pIter1)
break;
1264 primaryTrackID = parentTrackID;
1265 parentTrackID = particle->
Mother();
1269 if (particleMap.end() == pIter2)
1271 <<
" PandoraCollector::GetParentMCParticle --- Found a track ID without a MC particle ";
1274 return outputParticle;
1286 int trackID(inputParticle->
TrackId());
1290 if (particleMap.end() == pIter)
break;
1293 mcVector.push_back(particle);
1295 trackID = particle->
Mother();
1299 for (MCParticleVector::const_reverse_iterator iter = mcVector.rbegin(),
1300 iterEnd = mcVector.rend();
1319 if (particlesToTracks.end() == tIter || tIter->second.empty())
1321 <<
" PandoraCollector::GetPrimaryTrack --- Failed to find associated track ";
1323 if (tIter->second.size() != 1)
1325 <<
" PandoraCollector::GetPrimaryTrack --- Found more than one associated track ";
1328 return primaryTrack;
1337 int nGenerations(0);
1338 int primaryTrackID(inputParticle->
Self());
1342 if (particleMap.end() == pIter)
1344 <<
" PandoraCollector::GetGeneration --- Found a PFParticle without a particle ID ";
1349 if (primaryParticle->
IsPrimary())
break;
1351 primaryTrackID = primaryParticle->
Parent();
1354 return nGenerations;
1367 if (parentParticle->
IsPrimary())
return 0;
1369 const int parentID(parentParticle->
Parent());
1372 if (particleMap.end() == pIter)
1374 <<
" PandoraCollector::GetParentNeutrino --- Found a PFParticle without a particle ID ";
1377 return neutrinoParticle->
PdgCode();
1387 if (daughterParticle->
IsPrimary())
return true;
1389 const int parentID(daughterParticle->
Parent());
1392 if (particleMap.end() == pIter)
1394 <<
" PandoraCollector::IsFinalState --- Found a PFParticle without a particle ID ";
1407 const int pdg(particle->
PdgCode());
1410 return ((pandora::NU_E ==
std::abs(pdg)) || (pandora::NU_MU ==
std::abs(pdg)) ||
1411 (pandora::NU_TAU ==
std::abs(pdg)));
1418 const int pdg(particle->
PdgCode());
1421 return ((pandora::MU_MINUS ==
std::abs(pdg)) || (pandora::PI_PLUS ==
std::abs(pdg)) ||
1429 const int pdg(particle->
PdgCode());
1432 return ((pandora::E_MINUS ==
std::abs(pdg)) || (pandora::PHOTON ==
std::abs(pdg)));
1440 const int pdg(particle->
PdgCode());
1442 if ((pandora::E_MINUS ==
std::abs(pdg)) || (pandora::MU_MINUS ==
std::abs(pdg)) ||
1443 (pandora::PROTON ==
std::abs(pdg)) || (pandora::PI_PLUS ==
std::abs(pdg)) ||
1444 (pandora::K_PLUS ==
std::abs(pdg)) || (pandora::SIGMA_MINUS ==
std::abs(pdg)) ||
1445 (pandora::SIGMA_PLUS ==
std::abs(pdg)) || (pandora::HYPERON_MINUS ==
std::abs(pdg)) ||
1457 const pandora::ParticleFlowObject*
const pPfo)
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::map< art::Ptr< recob::Hit >, art::Ptr< simb::MCParticle > > HitsToMCParticles
static void BuildPFParticleMap(const PFParticleVector &particleVector, PFParticleMap &particleMap)
Build particle maps for reconstructed particles.
std::map< int, art::Ptr< sim::SimChannel > > SimChannelMap
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...
size_t Self() const
Returns the index of this particle.
std::map< art::Ptr< recob::PFParticle >, ClusterVector > PFParticlesToClusters
static bool IsNeutrino(const art::Ptr< recob::PFParticle > particle)
Determine whether a particle has been reconstructed as a neutrino.
Declaration of signal hit object.
std::map< art::Ptr< simb::MCParticle >, art::Ptr< simb::MCTruth > > MCParticlesToMCTruth
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.
constexpr auto abs(T v)
Returns the absolute value of the argument.
static bool IsShower(const art::Ptr< recob::PFParticle > particle)
Determine whether a particle has been reconstructed as shower-like.
int PdgCode() const
Return the type of particle as a PDG ID.
std::vector< art::Ptr< recob::Shower > > ShowerVector
std::vector< int > IntVector
std::vector< art::Ptr< anab::CosmicTag > > CosmicTagVector
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::map< art::Ptr< recob::PFParticle >, TrackVector > PFParticlesToTracks
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 >, VertexVector > PFParticlesToVertices
std::map< int, art::Ptr< recob::PFParticle > > PFParticleMap
std::map< art::Ptr< recob::Track >, CosmicTagVector > TracksToCosmicTags
int TDCtick_t
Type representing a TDC tick.
std::map< int, art::Ptr< simb::MCParticle > > MCParticleMap
std::map< art::Ptr< recob::Hit >, TrackIDEVector > HitsToTrackIDEs
bool isValid() const noexcept
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.
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.
std::vector< art::Ptr< recob::Seed > > SeedVector
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.
static bool IsVisible(const art::Ptr< simb::MCParticle > particle)
Determine whether a particle is visible (i.e. long-lived charged particle)
std::map< art::Ptr< recob::PFParticle >, MetadataVector > PFParticlesToMetadata
std::map< art::Ptr< recob::PFParticle >, T0Vector > PFParticlesToT0s
std::map< art::Ptr< recob::PFParticle >, ShowerVector > PFParticlesToShowers
std::vector< simb::MCParticle > RawMCParticleVector
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...
Metadata associated to PFParticles.
std::map< art::Ptr< simb::MCParticle >, HitVector > MCParticlesToHits
std::map< art::Ptr< recob::PFParticle >, SeedVector > PFParticlesToSeeds
std::vector< art::Ptr< recob::PFParticle > > PFParticleVector
std::map< art::Ptr< recob::Cluster >, HitVector > ClustersToHits
std::map< art::Ptr< recob::Shower >, HitVector > ShowersToHits
std::map< art::Ptr< simb::MCTruth >, MCParticleVector > MCTruthToMCParticles
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.
key_type key() const noexcept
std::vector< art::Ptr< recob::SpacePoint > > SpacePointVector
static art::Ptr< recob::Track > GetPrimaryTrack(const PFParticlesToTracks &particlesToTracks, const art::Ptr< recob::PFParticle > particle)
Return the primary track associated with a PFParticle.
std::map< art::Ptr< recob::PFParticle >, HitVector > PFParticlesToHits
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.
float energyFrac
fraction of hit energy from the particle with this trackID
std::map< art::Ptr< recob::Hit >, art::Ptr< recob::SpacePoint > > HitsToSpacePoints
std::vector< art::Ptr< simb::MCParticle > > MCParticleVector
std::vector< sim::TrackIDE > TrackIDEVector
static void CollectSimChannels(const art::Event &evt, const std::string &label, SimChannelVector &simChannelVector, bool &areSimChannelsValid)
Collect a vector of SimChannel objects from the ART event record.
Provides recob::Track data product.
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.
std::vector< art::Ptr< recob::Track > > TrackVector
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.
std::map< art::Ptr< recob::PFParticle >, SpacePointVector > PFParticlesToSpacePoints
Declaration of cluster object.
std::map< art::Ptr< recob::Track >, HitVector > TracksToHits
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.
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.
DaughterMode
DaughterMode enumeration.
const simb::MCParticle & GetParticle(int i) const
static void SelectNeutrinoPFParticles(const PFParticleVector &inputParticles, PFParticleVector &outputParticles)
Select reconstructed neutrino particles from a list of all reconstructed particles.
raw::ChannelID_t Channel() const
Returns the readout channel this object describes.
std::vector< art::Ptr< recob::Hit > > HitVector
int trackID
Geant4 supplied trackID.
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
std::vector< art::Ptr< sim::SimChannel > > SimChannelVector
std::vector< art::Ptr< recob::Wire > > WireVector
std::map< art::Ptr< recob::Hit >, art::Ptr< recob::PFParticle > > HitsToPFParticles
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.
std::vector< art::Ptr< recob::Vertex > > VertexVector
Declaration of basic channel signal object.
size_type get(size_type i, reference item, data_reference data) const
std::vector< art::Ptr< recob::Cluster > > ClusterVector
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)
std::vector< art::Ptr< anab::T0 > > T0Vector
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.
std::map< art::Ptr< recob::Seed >, art::Ptr< recob::Hit > > SeedsToHits
static void BuildMCParticleHitMaps(const art::Event &evt, const HitVector &hitVector, const SimChannelVector &simChannelVector, HitsToTrackIDEs &hitsToTrackIDEs)
Collect the links from reconstructed hits to their true energy deposits.
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...
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.
std::map< art::Ptr< recob::SpacePoint >, art::Ptr< recob::Hit > > SpacePointsToHits
cet::coded_exception< error, detail::translate > exception
static larpandoraobj::PFParticleMetadata GetPFParticleMetadata(const pandora::ParticleFlowObject *const pPfo)
Get metadata associated to a PFO.
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.
static void BuildMCParticleMap(const MCParticleVector &particleVector, MCParticleMap &particleMap)
Build particle maps for true particles.