Mēnsūra
Public Types | Public Member Functions | List of all members
GenParticle Class Reference

Describes a generator-level particle. More...

#include <GenParticle.hpp>

Inheritance diagram for GenParticle:
Candidate

Public Types

typedef std::list< GenParticle const * > collection_t
 Type of the container to store mothers and daughters.
 

Public Member Functions

 GenParticle () noexcept
 Default constructor.
 
 GenParticle (TLorentzVector const &p4, int pdgId=0) noexcept
 Constructor with four-momentum and PDG ID code.
 
 GenParticle (GenParticle const &)=default
 Default copy constructor.
 
 GenParticle (GenParticle &&)=default
 Default move constructor.
 
void AddDaughter (GenParticle const *p)
 Adds a daughter particle.
 
void AddMother (GenParticle const *p)
 Adds a mother particle.
 
GenParticle const * FindFirstDaughter (std::initializer_list< int > const &pdgIds) const
 Returns the pointer to the first daughter that matches one of the given PDG ID codes. More...
 
GenParticle const * FindFirstDaughterRecursive (std::initializer_list< int > const &pdgIds) const
 Recursively looks for a daughter with one of the specified PDG ID codes and returns the pointer to it. More...
 
collection_t const & GetDaughters () const
 Returns the collection of daughter particles.
 
GenParticle const * GetFirstMother () const
 A short-cut to access the first mother.
 
int GetFirstMotherPdgId () const
 A short-cut to access PDG ID code of the first mother. More...
 
collection_t const & GetMothers () const
 Returns the collection of mother particles.
 
int GetPdgId () const
 Returns the PDG ID code.
 
void SetPdgId (int pdgId_)
 Sets the PDG ID code.
 
- Public Member Functions inherited from Candidate
 Candidate () noexcept
 Default constructor.
 
 Candidate (TLorentzVector const &p4_) noexcept
 Constructor from a 4-momentum.
 
void SetP4 (TLorentzVector const &p4_) noexcept
 Sets four-momentum.
 
void SetPtEtaPhiM (double pt, double eta, double phi, double mass) noexcept
 Sets four-momentum.
 
void SetPxPyPzE (double px, double py, double pz, double E) noexcept
 Sets four-momentum.
 
void SetUserFloat (std::string const &label, double value)
 Sets or changes value of a user-defined real-valued property.
 
void SetUserInt (std::string const &label, long value)
 Sets or changes value of a user-defined integer-valued property.
 
TLorentzVector const & P4 () const noexcept
 Four-momentum.
 
double Pt () const noexcept
 Transverse momentum, GeV/c.
 
double Eta () const noexcept
 Pseudorapidity.
 
double Phi () const noexcept
 Azimuthal angle.
 
double M () const noexcept
 Mass, GeV/c^2.
 
double E () const noexcept
 Energy, GeV.
 
double UserFloat (std::string const &label) const
 Returns value of the user-defined property with the given label. More...
 
long UserInt (std::string const &label) const
 Returns value of the user-defined property with the given label. More...
 
bool operator< (Candidate const &rhs) const noexcept
 Ordering operator.
 

Detailed Description

Describes a generator-level particle.

A particle is described by its four-momentum and PDG ID codes. It also stores collections of (non-owning) pointers to its mothers and daughters.

Member Function Documentation

GenParticle const * GenParticle::FindFirstDaughter ( std::initializer_list< int > const &  pdgIds) const

Returns the pointer to the first daughter that matches one of the given PDG ID codes.

The sign of the code is taken in to account. Returns null pointer of no match is found.

GenParticle const * GenParticle::FindFirstDaughterRecursive ( std::initializer_list< int > const &  pdgIds) const

Recursively looks for a daughter with one of the specified PDG ID codes and returns the pointer to it.

The sign of the code is taken into account. This method is called recursively for all daughters until the match is found. If no descendants have the given PDG ID code, a null pointer is returned.

int GenParticle::GetFirstMotherPdgId ( ) const

A short-cut to access PDG ID code of the first mother.

If the particle has no mothers, zero is returned.


The documentation for this class was generated from the following files: