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 21 of file PFParticle.cxx.
recob::PFParticle::PFParticle | ( | int | pdgCode, |
size_t | self, | ||
size_t | parent, | ||
std::vector< size_t > && | daughters | ||
) |
Definition at line 28 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 111 of file PFParticle.h.
|
inline |
Returns the collection of daughter particles.
Definition at line 114 of file PFParticle.h.
|
inline |
Returns whether the particle is the root of the flow.
Definition at line 86 of file PFParticle.h.
|
inline |
Returns the number of daughter particles flowing from this one.
Definition at line 89 of file PFParticle.h.
|
default |
Copy assignment operator (using defaults)
|
default |
|
inline |
Returns the index of the parent particle (PFParticle::kPFParticlePrimary
if primary).
Definition at line 96 of file PFParticle.h.
|
inline |
Return the type of particle as a PDG ID.
Definition at line 83 of file PFParticle.h.
|
inline |
|
friend |
Definition at line 50 of file PFParticle.cxx.
|
friend |
Definition at line 38 of file PFParticle.cxx.
|
private |
Vector of indices into PFParticle Collection for daughters.
Definition at line 55 of file PFParticle.h.
|
private |
Index into PFParticle collection for parent.
Definition at line 54 of file PFParticle.h.
|
private |
A preliminary estimate of the PFParticle type using the PDG code.
Definition at line 52 of file PFParticle.h.
|
private |
Self reference.
Definition at line 53 of file PFParticle.h.
|
static |
Define index to signify primary particle.
Definition at line 61 of file PFParticle.h.