LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
Hierarchical representation of particle flow. More...
#include "PFParticle.h"
Public Member Functions | |
PFParticle () | |
Default constructor necessary for gccxml - not really for public use. More... | |
PFParticle (int pdgCode, size_t self, size_t parent, const std::vector< size_t > &daughters) | |
Primary constructor. More... | |
PFParticle (int pdgCode, size_t self, size_t parent, std::vector< size_t > &&daughters) | |
~PFParticle ()=default | |
Destructor definition. More... | |
PFParticle (const PFParticle &other)=default | |
Copy constructor (using defaults) More... | |
PFParticle (PFParticle &&other)=default | |
PFParticle & | operator= (const PFParticle &other)=default |
Copy assignment operator (using defaults) More... | |
PFParticle & | operator= (PFParticle &&other)=default |
Accessors | |
int | PdgCode () const |
Return the type of particle as a PDG ID. More... | |
bool | IsPrimary () const |
Returns whether the particle is the root of the flow. More... | |
int | NumDaughters () const |
Returns the number of daughter particles flowing from this one. More... | |
size_t | Self () const |
Returns the index of this particle. More... | |
size_t | Parent () const |
size_t | Daughter (size_t idx) const |
Returns the ID of the specified daughter. More... | |
const std::vector< size_t > & | Daughters () const |
Returns the collection of daughter particles. More... | |
Static Public Attributes | |
static constexpr size_t | kPFParticlePrimary = std::numeric_limits<size_t>::max() |
Define index to signify primary particle. More... | |
Private Attributes | |
int | fPdgCode |
A preliminary estimate of the PFParticle type using the PDG code. More... | |
size_t | fSelf |
Self reference. More... | |
size_t | fParent |
Index into PFParticle collection for parent. More... | |
std::vector< size_t > | fDaughters |
Vector of indices into PFParticle Collection for daughters. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &o, const PFParticle &c) |
bool | operator< (const PFParticle &a, const PFParticle &b) |
Hierarchical representation of particle flow.
The "Particle Flow" Particle is an object connecting to others of the same type to define a hierarchy of a single parent generating multiple daughter particles.
This structure was originally proposed to accommodate the information produced by Pandora. The PFParticle is a small entity that is expected to be associated with recob::Track
, recob::Cluster
, recob::Hit
, recob::Vertex
and also recob::Seed
to describe all the reconstructed quantities related to it.
The parentage relationships are expressed by indices in the collection all the particles belong to. This requires additional care when creating that collection, since each relation is defined in the particles with indices pointing to a collection that does not yet exist when the particle is created. The relation is expressed as one parent and many daughters. For "primary" particles, which have no parent, the special parent value recob::PFParticle::kPFParticlePrimary
must be used.
Note that the parentage relation can not be expressed as simple art associations, which can't express relations between two objects of the same type.
Definition at line 44 of file PFParticle.h.
recob::PFParticle::PFParticle | ( | ) |
Default constructor necessary for gccxml - not really for public use.
Definition at line 17 of file PFParticle.cxx.
recob::PFParticle::PFParticle | ( | int | pdgCode, |
size_t | self, | ||
size_t | parent, | ||
const std::vector< size_t > & | daughters | ||
) |
Primary constructor.
Definition at line 19 of file PFParticle.cxx.
recob::PFParticle::PFParticle | ( | int | pdgCode, |
size_t | self, | ||
size_t | parent, | ||
std::vector< size_t > && | daughters | ||
) |
Definition at line 26 of file PFParticle.cxx.
|
default |
Destructor definition.
|
default |
Copy constructor (using defaults)
|
default |
|
inline |
Returns the ID of the specified daughter.
idx | index of the daughter to be queried (0 to NumDaughters()-1 ) |
std::out_of_range | if the requested daughter does not exist |
The returned value describes the ID of the idx
-th daughter of this PFParticle. Note that this is not the same as the index of that PFParticle in the data product or PFParticle collection.
This function checks the validity of the index (idx
). For unchecked access, use Daughters()[idx]
instead.
Definition at line 107 of file PFParticle.h.
References Daughters().
|
inline |
Returns the collection of daughter particles.
Definition at line 110 of file PFParticle.h.
References fDaughters, operator<, and operator<<.
Referenced by CRHitRemoval::collectPFParticleHits(), Daughter(), evd::RecoBaseDrawer::DrawPFParticle3D(), evd::RecoBaseDrawer::DrawPFParticleOrtho(), trkf::Geometric3DVertexFitter::fitPFP(), lar_pandora::ConsolidatedPFParticleAnalysisTemplate::GetFinalStatePFParticleVectors(), lar_pandora::LArPandoraEventDump::PrintParticle(), trkf::VertexFitter::produce(), and CRHitRemovalByPCA::removeTaggedHits().
|
inline |
Returns whether the particle is the root of the flow.
Definition at line 82 of file PFParticle.h.
References kPFParticlePrimary.
Referenced by lar_pandora::PFParticleAnalysis::analyze(), lar_pandora::PFParticleHitDumper::FillReco3D(), lar_pandora::PFParticleCosmicAna::FillRecoTree(), trkf::Geometric3DVertexFitter::fitPFP(), lar_pandora::LArPandoraHelper::GetFinalStatePFParticle(), lar_pandora::ConsolidatedPFParticleAnalysisTemplate::GetFinalStatePFParticleVectors(), lar_pandora::LArPandoraHelper::GetGeneration(), lar_pandora::LArPandoraHelper::GetParentNeutrino(), lar_pandora::LArPandoraHelper::GetParentPFParticle(), lar_pandora::LArPandoraHelper::IsFinalState(), recob::operator<<(), lar_pandora::LArPandoraEventDump::PrintParticle(), lar_pandora::LArPandoraEventDump::PrintPFParticleHierarchy(), NuSliceHitsProducer::produce(), CRHitRemoval::produce(), trkf::VertexFitter::produce(), and CRHitRemovalByPCA::produce().
|
inline |
Returns the number of daughter particles flowing from this one.
Definition at line 85 of file PFParticle.h.
Referenced by lar_pandora::PFParticleAnalysis::analyze(), evd::RecoBaseDrawer::DrawPFParticle3D(), evd::RecoBaseDrawer::DrawPFParticleOrtho(), trkf::Geometric3DVertexFitter::fitPFP(), recob::operator<<(), lar_pandora::LArPandoraEventDump::PrintParticle(), and trkf::VertexFitter::produce().
|
default |
Copy assignment operator (using defaults)
|
default |
|
inline |
Returns the index of the parent particle (PFParticle::kPFParticlePrimary
if primary).
Definition at line 92 of file PFParticle.h.
References fParent.
Referenced by lar_pandora::PFParticleAnalysis::analyze(), lar_pandora::PFParticleHitDumper::FillReco3D(), lar_pandora::LArPandoraHelper::GetFinalStatePFParticle(), lar_pandora::LArPandoraHelper::GetGeneration(), lar_pandora::PFParticleValidation::GetMCPrimaryMatchingMap(), lar_pandora::LArPandoraHelper::GetParentNeutrino(), lar_pandora::LArPandoraHelper::GetParentPFParticle(), lar_pandora::LArPandoraHelper::IsFinalState(), lar_pandora::LArPandoraEventDump::PrintParticle(), and CRHitRemoval::produce().
|
inline |
Return the type of particle as a PDG ID.
Definition at line 79 of file PFParticle.h.
References fPdgCode.
Referenced by lar_pandora::PFParticleAnalysis::analyze(), lar_pandora::PFParticleMonitoring::analyze(), pfpf::PFPAna::analyze(), lar_pandora::PFParticleHitDumper::FillAssociated2DHits(), lar_pandora::PFParticleHitDumper::FillReco2D(), lar_pandora::PFParticleHitDumper::FillReco3D(), lar_pandora::PFParticleCosmicAna::FillRecoTree(), trkf::Geometric3DVertexFitter::fitPFP(), lar_pandora::ConsolidatedPFParticleAnalysisTemplate::GetFinalStatePFParticleVectors(), lar_pandora::PFParticleValidation::GetMCPrimaryMatchingMap(), lar_pandora::LArPandoraHelper::GetParentNeutrino(), lar_pandora::LArPandoraHelper::IsNeutrino(), lar_pandora::LArPandoraHelper::IsShower(), lar_pandora::LArPandoraHelper::IsTrack(), recob::operator<<(), lar_pandora::LArPandoraEventDump::PrintParticle(), NuSliceHitsProducer::produce(), ShowerReco3D::produce(), and shower::EMShower::produce().
|
inline |
Returns the index of this particle.
Definition at line 88 of file PFParticle.h.
References fSelf.
Referenced by lar_pandora::PFParticleAnalysis::analyze(), lar_pandora::LArPandoraHelper::BuildPFParticleHitMaps(), lar_pandora::LArPandoraEventDump::BuildPFParticleMap(), lar_pandora::LArPandoraHelper::BuildPFParticleMap(), shower::LArPandoraShowerCheatingAlg::CheatDebugEVD(), CRHitRemoval::collectPFParticleHits(), shower::LArPandoraShowerAlg::DebugEVD(), evd::RecoBaseDrawer::DrawPFParticle3D(), evd::RecoBaseDrawer::DrawPFParticleOrtho(), lar_pandora::PFParticleHitDumper::FillAssociated2DHits(), lar_pandora::PFParticleHitDumper::FillReco2D(), lar_pandora::PFParticleHitDumper::FillReco3D(), lar_pandora::PFParticleHitDumper::FillRecoTracks(), lar_pandora::PFParticleCosmicAna::FillRecoTree(), lar_pandora::LArPandoraHelper::GetFinalStatePFParticle(), lar_pandora::LArPandoraHelper::GetGeneration(), lar_pandora::PFParticleValidation::GetMCPrimaryMatchingMap(), lar_pandora::LArPandoraHelper::GetParentPFParticle(), lar_pandora::ConsolidatedPFParticleAnalysisTemplate::GetPFParticleIdMap(), recob::operator<(), lar_pandora::ConsolidatedPFParticleAnalysisTemplate::PrintOutScores(), lar_pandora::LArPandoraEventDump::PrintParticle(), trkf::VertexFitter::produce(), trkf::PMAlgTrajFitter::produce(), CRHitRemovalByPCA::removeTaggedHits(), and lar_pandora::LArPandoraHelper::SelectFinalStatePFParticles().
|
friend |
Definition at line 45 of file PFParticle.cxx.
Referenced by Daughters().
|
friend |
Definition at line 33 of file PFParticle.cxx.
Referenced by Daughters().
|
private |
Vector of indices into PFParticle Collection for daughters.
Definition at line 53 of file PFParticle.h.
Referenced by Daughters().
|
private |
Index into PFParticle collection for parent.
Definition at line 52 of file PFParticle.h.
Referenced by Parent().
|
private |
A preliminary estimate of the PFParticle type using the PDG code.
Definition at line 50 of file PFParticle.h.
Referenced by PdgCode().
|
private |
|
static |
Define index to signify primary particle.
Definition at line 57 of file PFParticle.h.
Referenced by lar_pandora::LArPandoraOutput::BuildPFParticle(), IsPrimary(), trkf::PMAlgTrackMaker::produce(), and lar_cluster3d::Cluster3D::ProduceArtClusters().