9 #include "canvas/Persistency/Common/FindManyP.h" 10 #include "canvas/Persistency/Common/FindOneP.h" 11 #include "cetlib_except/exception.h" 35 #include "Objects/ParticleFlowObject.h" 36 #include "Pandora/PandoraInternal.h" 37 #include "Pandora/PdgTable.h" 62 for (
unsigned int i = 0; i < theWires->size(); ++i) {
64 wireVector.push_back(wire);
86 for (
unsigned int i = 0; i < theHits->size(); ++i) {
88 hitVector.push_back(hit);
107 mf::LogDebug(
"LArPandora") <<
" Found: " << theParticles->size() <<
" PFParticles " 111 for (
unsigned int i = 0; i < theParticles->size(); ++i) {
113 particleVector.push_back(particle);
127 evt, label, spacePointVector, spacePointsToHits, hitsToSpacePoints);
142 if (!theSpacePoints.
isValid()) {
147 mf::LogDebug(
"LArPandora") <<
" Found: " << theSpacePoints->size() <<
" SpacePoints " 151 art::FindOneP<recob::Hit> theHitAssns(theSpacePoints, evt, label);
152 for (
unsigned int i = 0; i < theSpacePoints->size(); ++i) {
154 spacePointVector.push_back(spacepoint);
156 spacePointsToHits[spacepoint] =
hit;
157 hitsToSpacePoints[
hit] = spacepoint;
180 art::FindManyP<recob::Hit> theHitAssns(theClusters, evt, label);
181 for (
unsigned int i = 0; i < theClusters->size(); ++i) {
183 clusterVector.push_back(cluster);
185 const std::vector<art::Ptr<recob::Hit>> hits = theHitAssns.at(i);
186 for (
unsigned int j = 0; j < hits.size(); ++j) {
188 clustersToHits[
cluster].push_back(hit);
209 mf::LogDebug(
"LArPandora") <<
" Found: " << theParticles->size() <<
" PFParticles " 213 art::FindManyP<recob::SpacePoint> theSpacePointAssns(theParticles, evt, label);
214 for (
unsigned int i = 0; i < theParticles->size(); ++i) {
216 particleVector.push_back(particle);
218 const std::vector<art::Ptr<recob::SpacePoint>> spacepoints = theSpacePointAssns.at(i);
219 for (
unsigned int j = 0; j < spacepoints.size(); ++j) {
221 particlesToSpacePoints[particle].push_back(spacepoint);
242 mf::LogDebug(
"LArPandora") <<
" Found: " << theParticles->size() <<
" PFParticles " 246 art::FindManyP<recob::Cluster> theClusterAssns(theParticles, evt, label);
247 for (
unsigned int i = 0; i < theParticles->size(); ++i) {
249 particleVector.push_back(particle);
251 const std::vector<art::Ptr<recob::Cluster>> clusters = theClusterAssns.at(i);
252 for (
unsigned int j = 0; j < clusters.size(); ++j) {
254 particlesToClusters[particle].push_back(cluster);
275 mf::LogDebug(
"LArPandora") <<
" Found: " << theParticles->size() <<
" PFParticles " 279 art::FindManyP<larpandoraobj::PFParticleMetadata> theMetadataAssns(theParticles, evt, label);
280 for (
unsigned int i = 0; i < theParticles->size(); ++i) {
282 particleVector.push_back(particle);
284 const std::vector<art::Ptr<larpandoraobj::PFParticleMetadata>> pfParticleMetadataList =
285 theMetadataAssns.at(i);
286 for (
unsigned int j = 0; j < pfParticleMetadataList.size(); ++j) {
288 pfParticleMetadataList.at(j);
289 particlesToMetadata[particle].push_back(pfParticleMetadata);
313 art::FindManyP<recob::PFParticle> theShowerAssns(theShowers, evt, label);
314 for (
unsigned int i = 0; i < theShowers->size(); ++i) {
316 showerVector.push_back(shower);
318 const std::vector<art::Ptr<recob::PFParticle>> particles = theShowerAssns.at(i);
319 for (
unsigned int j = 0; j < particles.size(); ++j) {
321 particlesToShowers[particle].push_back(shower);
345 art::FindManyP<recob::PFParticle> theTrackAssns(theTracks, evt, label);
346 for (
unsigned int i = 0; i < theTracks->size(); ++i) {
348 trackVector.push_back(track);
350 const std::vector<art::Ptr<recob::PFParticle>> particles = theTrackAssns.at(i);
351 for (
unsigned int j = 0; j < particles.size(); ++j) {
353 particlesToTracks[particle].push_back(track);
377 art::FindManyP<recob::Hit> theHitAssns(theTracks, evt, label);
378 for (
unsigned int i = 0; i < theTracks->size(); ++i) {
380 trackVector.push_back(track);
382 const std::vector<art::Ptr<recob::Hit>> hits = theHitAssns.at(i);
383 for (
unsigned int j = 0; j < hits.size(); ++j) {
385 tracksToHits[track].push_back(hit);
409 art::FindManyP<recob::Hit> theHitAssns(theShowers, evt, label);
410 for (
unsigned int i = 0; i < theShowers->size(); ++i) {
412 showerVector.push_back(shower);
414 const std::vector<art::Ptr<recob::Hit>> hits = theHitAssns.at(i);
415 for (
unsigned int j = 0; j < hits.size(); ++j) {
417 showersToHits[shower].push_back(hit);
441 art::FindManyP<recob::PFParticle> theSeedAssns(theSeeds, evt, label);
442 for (
unsigned int i = 0; i < theSeeds->size(); ++i) {
444 seedVector.push_back(seed);
446 const std::vector<art::Ptr<recob::PFParticle>> particles = theSeedAssns.at(i);
447 for (
unsigned int j = 0; j < particles.size(); ++j) {
449 particlesToSeeds[particle].push_back(seed);
473 art::FindOneP<recob::Hit> theHitAssns(theSeeds, evt, label);
475 if (!theHitAssns.isValid()) {
480 for (
unsigned int i = 0; i < theSeeds->size(); ++i) {
482 seedVector.push_back(seed);
484 seedsToHits[seed] =
hit;
507 art::FindManyP<recob::PFParticle> theVerticesAssns(theVertices, evt, label);
508 for (
unsigned int i = 0; i < theVertices->size(); ++i) {
510 vertexVector.push_back(vertex);
512 const std::vector<art::Ptr<recob::PFParticle>> particles = theVerticesAssns.at(i);
513 for (
unsigned int j = 0; j < particles.size(); ++j) {
515 particlesToVertices[particle].push_back(vertex);
534 iterEnd1 = particleVector.end();
538 particleMap[particle->
Self()] = particle;
543 iterEnd1 = particlesToSpacePoints.end();
559 iterEnd2 = spacePointVector.end();
565 if (spacePointsToHits.end() == iter3)
566 throw cet::exception(
"LArPandora") <<
" PandoraCollector::BuildPFParticleHitMaps --- " 567 "Found a space point without an associated hit ";
571 particlesToHits[particle].push_back(hit);
572 hitsToParticles[
hit] = particle;
591 iterEnd1 = particleVector.end();
595 particleMap[particle->
Self()] = particle;
600 iterEnd1 = particlesToClusters.end();
615 iterEnd2 = clusterVector.end();
621 if (clustersToHits.end() == iter3)
622 throw cet::exception(
"LArPandora") <<
" PandoraCollector::BuildPFParticleHitMaps --- " 623 "Found a space point without an associated hit ";
625 const HitVector& hitVector = iter3->second;
631 particlesToHits[particle].push_back(hit);
632 hitsToParticles[
hit] = particle;
646 const bool useClusters)
649 evt, label, label, particlesToHits, hitsToParticles, daughterMode, useClusters);
661 const bool useClusters)
691 evt, label_pfpart, particleVector, particlesToSpacePoints);
695 particlesToSpacePoints,
710 iterEnd = inputParticles.end();
729 iterEnd = inputParticles.end();
733 particleMap[particle->
Self()] = particle;
738 iterEnd = inputParticles.end();
744 outputParticles.push_back(particle);
760 art::FindOneP<recob::Track> theCosmicAssns(
761 theCosmicTags, evt, label);
762 for (
unsigned int i = 0; i < theCosmicTags->size(); ++i) {
765 tracksToCosmicTags[track].push_back(
767 cosmicTagVector.push_back(cosmicTag);
784 art::FindManyP<recob::PFParticle> theAssns(theT0s, evt, label);
785 for (
unsigned int i = 0; i < theT0s->size(); ++i) {
787 t0Vector.push_back(theT0);
789 const std::vector<art::Ptr<recob::PFParticle>> particles = theAssns.at(i);
790 for (
unsigned int j = 0; j < particles.size(); ++j) {
792 particlesToT0s[theParticle].push_back(
805 bool& areSimChannelsValid)
810 if (!theSimChannels.
isValid()) {
812 areSimChannelsValid =
false;
816 mf::LogDebug(
"LArPandora") <<
" Found: " << theSimChannels->size() <<
" SimChannels " 818 areSimChannelsValid =
true;
821 for (
unsigned int i = 0; i < theSimChannels->size(); ++i) {
823 simChannelVector.push_back(channel);
842 mf::LogDebug(
"LArPandora") <<
" Found: " << theParticles->size() <<
" MC particles " 846 for (
unsigned int i = 0; i < theParticles->size(); ++i) {
848 particleVector.push_back(particle);
862 if (!mcTruthBlocks.
isValid()) {
863 mf::LogDebug(
"LArPandora") <<
" Failed to find MC truth blocks from generator... " 868 mf::LogDebug(
"LArPandora") <<
" Found: " << mcTruthBlocks->size() <<
" MC truth blocks " 872 if (mcTruthBlocks->size() != 1)
873 throw cet::exception(
"LArPandora") <<
" PandoraCollector::CollectGeneratorMCParticles --- " 874 "Unexpected number of MC truth blocks ";
878 for (
int i = 0; i < mcTruth->
NParticles(); ++i) {
899 mf::LogDebug(
"LArPandora") <<
" Found: " << theParticles->size() <<
" MC particles " 903 art::FindOneP<simb::MCTruth> theTruthAssns(theParticles, evt, label);
905 for (
unsigned int i = 0, iEnd = theParticles->size(); i < iEnd; ++i) {
908 truthToParticles[truth].push_back(particle);
909 particlesToTruth[particle] = truth;
921 auto const clock_data =
927 iterEnd = simChannelVector.end();
931 simChannelMap.insert(SimChannelMap::value_type(simChannel->
Channel(), simChannel));
940 if (simChannelMap.end() == sIter)
continue;
945 const unsigned int start_tdc((start_tick < 0) ? 0 : start_tick);
946 const unsigned int end_tdc(end_tick);
948 if (start_tdc > end_tdc)
continue;
953 if (trackCollection.empty())
continue;
955 for (
unsigned int iTrack = 0, iTrackEnd = trackCollection.size(); iTrack < iTrackEnd;
958 hitsToTrackIDEs[
hit].push_back(trackIDE);
976 iterEnd1 = truthToParticles.end();
981 iterEnd2 = particleVector.end();
985 particleMap[particle->
TrackId()] = particle;
991 iterEnd1 = hitsToTrackIDEs.end();
998 float bestEnergyFrac(0.
f);
1001 iterEnd2 = trackCollection.end();
1008 if (energyFrac > bestEnergyFrac) {
1009 bestEnergyFrac = energyFrac;
1010 bestTrackID = trackID;
1014 if (bestTrackID >= 0) {
1016 if (particleMap.end() == iter3)
1017 throw cet::exception(
"LArPandora") <<
" PandoraCollector::BuildMCParticleHitMaps --- " 1018 "Found a track ID without an MC Particle ";
1025 (
kAddDaughters == daughterMode) ? primaryParticle : thisParticle);
1027 if ((
kIgnoreDaughters == daughterMode) && (selectedParticle != primaryParticle))
continue;
1031 particlesToHits[selectedParticle].push_back(hit);
1032 hitsToParticles[
hit] = selectedParticle;
1055 bool areSimChannelsValid(
false);
1061 hitsToTrackIDEs, truthToParticles, particlesToHits, hitsToParticles, daughterMode);
1083 for (
unsigned int i = 0; i < theHits->size(); ++i) {
1085 hitVector.push_back(hit);
1089 std::vector<anab::BackTrackerHitMatchingData const*> backtrackerVector;
1093 art::FindManyP<simb::MCParticle, anab::BackTrackerHitMatchingData> particles_per_hit(
1094 theHits, evt, backtrackLabel);
1096 if (!particles_per_hit.isValid()) {
1107 particleVector.clear();
1108 backtrackerVector.clear();
1109 particles_per_hit.get(hit.
key(), particleVector, backtrackerVector);
1111 for (
unsigned int j = 0; j < particleVector.size(); ++j) {
1116 trackIDE.
energy = backtrackerVector[j]->energy;
1117 trackIDE.
energyFrac = backtrackerVector[j]->ideFraction;
1119 hitsToTrackIDEs[
hit].push_back(trackIDE);
1142 hitsToTrackIDEs, truthToParticles, particlesToHits, hitsToParticles, daughterMode);
1147 template <
typename T>
1158 art::FindManyP<recob::Hit> hitAssoc(handle, evt, label);
1160 if (indexVector !=
nullptr) {
1161 if (inputVector.size() != indexVector->size())
1162 throw cet::exception(
"LArPandora") <<
" PandoraHelper::GetAssociatedHits --- trying to use " 1163 "an index vector not matching input vector";
1166 for (
int index : (*indexVector)) {
1169 associatedHits.insert(associatedHits.end(), hits.begin(), hits.end());
1175 const HitVector& hits = hitAssoc.at(element.key());
1176 associatedHits.insert(associatedHits.end(), hits.begin(), hits.end());
1188 iterEnd = particleVector.end();
1192 particleMap[particle->
TrackId()] = particle;
1193 particleMap[particle->
TrackId()] = particle;
1204 iterEnd = particleVector.end();
1208 particleMap[particle->
Self()] = particle;
1219 int primaryTrackID(inputParticle->
Self());
1224 if (particleMap.end() == pIter1)
1225 throw cet::exception(
"LArPandora") <<
" PandoraCollector::GetParentPFParticle --- Found " 1226 "a PFParticle without a particle ID ";
1229 if (primaryParticle->
IsPrimary())
break;
1231 primaryTrackID = primaryParticle->
Parent();
1236 if (particleMap.end() == pIter2)
1238 <<
" PandoraCollector::GetParentPFParticle --- Found a PFParticle without a particle ID ";
1241 return outputParticle;
1251 int primaryTrackID(inputParticle->
Self());
1254 int parentTrackID(inputParticle->
Parent());
1258 if (particleMap.end() == pIter1)
1259 throw cet::exception(
"LArPandora") <<
" PandoraCollector::GetFinalStatePFParticle --- " 1260 "Found a PFParticle without a particle ID ";
1265 primaryTrackID = parentTrackID;
1269 parentTrackID = parentParticle->
Parent();
1274 if (particleMap.end() == pIter2)
1275 throw cet::exception(
"LArPandora") <<
" PandoraCollector::GetFinalStatePFParticle --- Found " 1276 "a PFParticle without a particle ID ";
1279 return outputParticle;
1289 int primaryTrackID(inputParticle->
TrackId());
1290 int parentTrackID(inputParticle->
Mother());
1294 if (particleMap.end() == pIter1)
break;
1298 primaryTrackID = parentTrackID;
1299 parentTrackID = particle->
Mother();
1303 if (particleMap.end() == pIter2)
1305 <<
" PandoraCollector::GetParentMCParticle --- Found a track ID without a MC particle ";
1308 return outputParticle;
1320 int trackID(inputParticle->
TrackId());
1324 if (particleMap.end() == pIter)
break;
1327 mcVector.push_back(particle);
1329 trackID = particle->
Mother();
1333 for (MCParticleVector::const_reverse_iterator iter = mcVector.rbegin(),
1334 iterEnd = mcVector.rend();
1353 if (particlesToTracks.end() == tIter || tIter->second.empty())
1355 <<
" PandoraCollector::GetPrimaryTrack --- Failed to find associated track ";
1357 if (tIter->second.size() != 1)
1359 <<
" PandoraCollector::GetPrimaryTrack --- Found more than one associated track ";
1362 return primaryTrack;
1372 int nGenerations(0);
1373 int primaryTrackID(inputParticle->
Self());
1377 if (particleMap.end() == pIter)
1379 <<
" PandoraCollector::GetGeneration --- Found a PFParticle without a particle ID ";
1384 if (primaryParticle->
IsPrimary())
break;
1386 primaryTrackID = primaryParticle->
Parent();
1389 return nGenerations;
1403 if (parentParticle->
IsPrimary())
return 0;
1405 const int parentID(parentParticle->
Parent());
1408 if (particleMap.end() == pIter)
1410 <<
" PandoraCollector::GetParentNeutrino --- Found a PFParticle without a particle ID ";
1413 return neutrinoParticle->
PdgCode();
1424 if (daughterParticle->
IsPrimary())
return true;
1426 const int parentID(daughterParticle->
Parent());
1429 if (particleMap.end() == pIter)
1431 <<
" PandoraCollector::IsFinalState --- Found a PFParticle without a particle ID ";
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
void cluster(In first, In last, Out result, Pred *pred)
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.
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.
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.
art framework interface to geometry description
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.
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.
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
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.
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
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
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
Declaration of signal hit object.
int trackID
Geant4 supplied trackID.
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.
Provides recob::Track data product.
std::vector< art::Ptr< recob::Vertex > > VertexVector
Declaration of basic channel signal object.
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...
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.
QTextStream & endl(QTextStream &s)
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.