Bayeux  3.4.1
Core Foundation library for SuperNEMO
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
genbb::primary_particle Class Reference

A primary particle generated by a Monte Carlo generator process. More...

#include <bayeux/genbb_help/primary_particle.h>

Inheritance diagram for genbb::primary_particle:
datatools::i_serializable datatools::i_tree_dumpable

Public Types

enum  particle_type {
  PARTICLE_UNDEFINED = -1, PARTICLE_UNKNOWN = 0, GAMMA = 1, POSITRON = 2,
  ELECTRON = 3, NEUTRINO = 4, MUON_PLUS = 5, MUON_MINUS = 6,
  PION_0 = 7, PION_PLUS = 8, PION_MINUS = 9, KAON_0_LONG = 10,
  KAON_PLUS = 11, KAON_MINUS = 12, NEUTRON = 13, PROTON = 14,
  ANTI_PROTON = 15, KAON_0_SHORT = 16, ETA = 17, LAMBDA = 18,
  SIGMA_PLUS = 19, SIGMA_0 = 20, SIGMA_MINUS = 21, XI_0 = 22,
  XI_MINUS = 23, OMEGA_MINUS = 24, ANTI_NEUTRON = 25, ANTI_LAMBDA = 26,
  ANTI_SIGMA_MINUS = 27, ANTI_SIGMA_0 = 28, ANTI_SIGMA_PLUS = 29, ANTI_XI_0 = 30,
  ANTI_XI_PLUS = 31, ANTI_OMEGA_PLUS = 32, DEUTERON = 45, TRITIUM = 46,
  TRITON = 46, ALPHA = 47, GEANTINO = 48, HE3 = 49,
  CERENKOV = 50, NUCLEUS = 1000000000, ION = 1100000000
}
 Extended Geant3 particle These are historical codes used in GEANT3 and original GENBB/DECAY0 library. Modern particle code scheme is proposed by the PDG. Some utilities are now provided to translate such a code into the corresponding PDG code, if possible. GEANT3 definition: http://www.star.bnl.gov/public/comp/simu/gstar/Manual/particle_id.html. More...
 
- Public Types inherited from datatools::i_tree_dumpable
enum  ostream_type { OSTREAM_COUT = 1, OSTREAM_CERR = 2, OSTREAM_CLOG = 3 }
 Enumeration for standard output streams. More...
 

Public Member Functions

void reset ()
 Reset the full data structure of the particle. More...
 
bool has_generation_id () const
 Check if the particle has an unique generation Id. More...
 
void set_generation_id (int)
 Set the unique generation Id. More...
 
void reset_generation_id ()
 Reset the unique generation Id. More...
 
int get_generation_id () const
 Return the unique generation Id. More...
 
bool has_type () const
 Check if the extended Geant3 type of the particle is defined. More...
 
int get_type () const
 Return the extended Geant3 type of the particle. More...
 
void set_type (int type_)
 Set the extended Geant3 type of the particle and set the corresponding particle label if it is empty. More...
 
void set_nucleus (int z_, int a_, double excitation_energy_=0.0, bool pdg_=false)
 Define a nucleus, possibly in some excited state. More...
 
void set_ion (int z_, int a_, double excitation_energy_=0.0, int charge_=0, bool pdg_=false)
 Define an ion (or neutral atom) More...
 
void set_neutrino (const std::string &label_)
 Define a neutrino. More...
 
void set_neutrino (const std::string &flavour_, bool antineutrino_)
 Define a neutrino. More...
 
bool has_pdg_code () const
 Check if the PDG code of the particle is defined. More...
 
int get_pdg_code () const
 Return the PDG code of the particle. More...
 
void set_pdg_code (int)
 Set the PDG code of the particle. More...
 
int fetch_pdg_code () const
 Fetch the PDG code from the particle type/label... More...
 
bool has_time () const
 Check if time is defined. More...
 
double get_time () const
 Return the creation time of the particle (in unit of time) More...
 
double & grab_time ()
 Return mutable reference on the creation time of the particle (in unit of time) More...
 
bool needs_particle_label () const
 Check is the particle should have a specific identifier label because it lacks a type or code. More...
 
bool has_particle_label () const
 Check is the particle has a specific identifier label. More...
 
const std::string & get_particle_label () const
 Return the identifier label of the particle. More...
 
void set_particle_label (const std::string &)
 Set the identifier label of the particle (for type == PARTICLE_UNKNOWN, NUCLEUS, ION) More...
 
void set_time (double time_)
 Set the creation time of the particle (in unit of time) More...
 
void shift_time (double delta_time_)
 Shift the creation time of the particle (in unit of time) More...
 
bool is_valid () const
 Check if the description of the particle is valid. More...
 
bool is_unknown () const
 Check if the particle is of unknown type (but possibly valid for a client application) More...
 
bool is_gamma () const
 Check if the particle is a gamma. More...
 
bool is_positron () const
 Check if the particle is a positron. More...
 
bool is_electron () const
 Check if the particle is an electron. More...
 
bool is_neutrino () const
 Check if the particle is a neutrino. More...
 
bool is_alpha () const
 Check if the particle is an alpha. More...
 
bool is_deuteron () const
 Check if the particle is a deuteron. More...
 
bool is_tritium () const
 Check if the particle is a tritium. More...
 
bool is_proton () const
 Check if the particle is a proton. More...
 
bool is_neutron () const
 Check if the particle is a neutron. More...
 
bool is_muon_plus () const
 Check if the particle is muon+. More...
 
bool is_muon_minus () const
 Check if the particle is minus-. More...
 
bool is_pion_plus () const
 Check if the particle is pion+. More...
 
bool is_pion_minus () const
 Check if the particle is pion-. More...
 
bool is_pion_zero () const
 Check if the particle is pion0. More...
 
bool is_nucleus () const
 Check if the particle is an nucleus (not the light ones: p, D, T, He3, He4) More...
 
bool is_ion () const
 Check if the particle is an ion (not the light ones: p, D, T, He3, He4) More...
 
void set_momentum (const geomtools::vector_3d &m_)
 Set the momentum of the particle (in unit of energy, i.e. p x c) More...
 
const geomtools::vector_3dget_momentum () const
 Return the const momentum of the particle (in unit of energy, i.e. p x c) More...
 
geomtools::vector_3dgrab_momentum ()
 Return the mutable momentum of the particle (in unit of energy, i.e. p x c) More...
 
void compute_four_momentum (CLHEP::HepLorentzVector &) const
 Compute the associated 4-vector (in unit of energy, i.e. p x c) More...
 
void set_vertex (const geomtools::vector_3d &v_)
 Set the vertex of the particle (in unit of length) More...
 
const geomtools::vector_3dget_vertex () const
 Return the const vertex of the particle (in unit of length) More...
 
geomtools::vector_3dgrab_vertex ()
 Return the mutable vertex of the particle (in unit of length) More...
 
bool has_vertex () const
 Check if the particle has its own vertex. More...
 
void invalidate_vertex ()
 Invalidate the vertex of the particle. More...
 
bool charge_is_known () const
 Check if the charge of the particle is known. More...
 
double get_charge () const
 Return the charge of the particle (in unit of +e, as a real number) More...
 
void set_mass (double)
 Set the mass of the particle (in unit of energy, i.e. m x c2) More...
 
void reset_mass ()
 Reset the mass of the particle. More...
 
double get_mass () const
 Return the mass of the particle (in unit of energy, i.e. m x c2) More...
 
bool mass_is_known () const
 Check if the mass of the particle is known. More...
 
double get_total_energy () const
 Return the total energy (in unit of energy) More...
 
double get_kinetic_energy () const
 Return the kinetic energy (in unit of energy) More...
 
double get_beta () const
 Return the relativistic beta coefficient. More...
 
const datatools::propertiesget_auxiliaries () const
 
datatools::propertiesgrab_auxiliaries ()
 Return a mutable reference to the auxiliary properties. More...
 
 primary_particle ()
 Default constructor. More...
 
 primary_particle (int32_t a_type, double a_time, const geomtools::vector_3d &)
 Constructor. More...
 
virtual ~primary_particle ()
 Destructor. More...
 
virtual void tree_dump (std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
 Smart print. More...
 
void dump (std::ostream &out_=std::clog, const std::string &a_indent="") const
 Basic print. More...
 
- Public Member Functions inherited from datatools::i_serializable
 i_serializable ()
 Default constructor. More...
 
virtual ~i_serializable ()
 Destructor. More...
 
virtual const std::string & get_serial_tag () const =0
 Return the serialization string identifier of the class. More...
 
- Public Member Functions inherited from datatools::i_tree_dumpable
 i_tree_dumpable ()
 Constructor. More...
 
virtual ~i_tree_dumpable ()
 Destructor. More...
 
virtual void print_tree (std::ostream &out_=std::clog, const boost::property_tree::ptree &options_=empty_options()) const
 Main new interface method for printing. More...
 
void print_tree_json (std::ostream &out_=std::clog, const std::string &json_options_="") const
 Printing with jsonized options. More...
 
void print_tree_json (std::ostream &out_=std::clog, const char *json_options_=nullptr) const
 Printing with jsonized options. More...
 
void tree_dump_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="", const bool inherit_=false) const
 
void tree_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="") const
 
void smart_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="") const
 

Static Public Member Functions

static std::string nucleus_to_label (int z_, int a_, double excitation_energy_=0.0)
 Build the label describing a nucleus ion from Z, A, and excitation energy. More...
 
static std::string ion_to_label (int z_, int a_, double excitation_energy_=0.0, int charge_=0)
 Build the label describing an charged ion from Z, A, excitation energy and charge. More...
 
static bool label_to_ion (const std::string label_, int &z_, int &a_, double &excitation_energy_, int &charge_)
 Build the ion's characteristics from a label. More...
 
static bool label_to_nucleus (const std::string label_, int &z_, int &a_, double &excitation_energy_)
 Build the nucleus'characteristics from a label. More...
 
static std::string particle_label_from_type (int a_type)
 Return the label associated to a particle code. More...
 
static int particle_type_from_label (const std::string &a_label)
 Return the particle code associated to a label. More...
 
- Static Public Member Functions inherited from datatools::i_tree_dumpable
static const boost::property_tree::ptree & empty_options ()
 
static boost::property_tree::ptree make_base_print_options (const std::string &title_, const std::string &indent_="", const bool inherit_=false)
 
static std::ostream & last_skip_tag (std::ostream &out_)
 
static std::ostream & skip_tag (std::ostream &out_)
 
static std::ostream & last_tag (std::ostream &out_)
 
static std::ostream & tag (std::ostream &out_)
 

Static Public Attributes

static const int INVALID_GENERATION_ID = -1
 Invalid generation Id. More...
 
static const int32_t PDG_CODE_UNDEFINED = 0
 

Protected Member Functions

void _set_defaults ()
 Set the default values for attributes. More...
 

Detailed Description

A primary particle generated by a Monte Carlo generator process.

Member Enumeration Documentation

◆ particle_type

Extended Geant3 particle These are historical codes used in GEANT3 and original GENBB/DECAY0 library. Modern particle code scheme is proposed by the PDG. Some utilities are now provided to translate such a code into the corresponding PDG code, if possible. GEANT3 definition: http://www.star.bnl.gov/public/comp/simu/gstar/Manual/particle_id.html.

Enumerator
PARTICLE_UNDEFINED 

Undefined particle type.

PARTICLE_UNKNOWN 

A valid particle but unknown from the genbb library.

GAMMA 
POSITRON 
ELECTRON 
NEUTRINO 
MUON_PLUS 
MUON_MINUS 
PION_0 
PION_PLUS 
PION_MINUS 
KAON_0_LONG 
KAON_PLUS 
KAON_MINUS 
NEUTRON 
PROTON 
ANTI_PROTON 
KAON_0_SHORT 
ETA 
LAMBDA 
SIGMA_PLUS 
SIGMA_0 
SIGMA_MINUS 
XI_0 
XI_MINUS 
OMEGA_MINUS 
ANTI_NEUTRON 
ANTI_LAMBDA 
ANTI_SIGMA_MINUS 
ANTI_SIGMA_0 
ANTI_SIGMA_PLUS 
ANTI_XI_0 
ANTI_XI_PLUS 
ANTI_OMEGA_PLUS 
DEUTERON 
TRITIUM 
TRITON 
ALPHA 
GEANTINO 
HE3 
CERENKOV 
NUCLEUS 

Fully ionized ion (naked nucleus)

ION 

An ion/atom with arbitrary ionization state.

Constructor & Destructor Documentation

◆ primary_particle() [1/2]

genbb::primary_particle::primary_particle ( )

Default constructor.

◆ primary_particle() [2/2]

genbb::primary_particle::primary_particle ( int32_t  a_type,
double  a_time,
const geomtools::vector_3d  
)

Constructor.

◆ ~primary_particle()

virtual genbb::primary_particle::~primary_particle ( )
virtual

Destructor.

Member Function Documentation

◆ _set_defaults()

void genbb::primary_particle::_set_defaults ( )
protected

Set the default values for attributes.

◆ charge_is_known()

bool genbb::primary_particle::charge_is_known ( ) const

Check if the charge of the particle is known.

◆ compute_four_momentum()

void genbb::primary_particle::compute_four_momentum ( CLHEP::HepLorentzVector &  ) const

Compute the associated 4-vector (in unit of energy, i.e. p x c)

◆ dump()

void genbb::primary_particle::dump ( std::ostream &  out_ = std::clog,
const std::string &  a_indent = "" 
) const

Basic print.

◆ fetch_pdg_code()

int genbb::primary_particle::fetch_pdg_code ( ) const

Fetch the PDG code from the particle type/label...

◆ get_auxiliaries()

const datatools::properties& genbb::primary_particle::get_auxiliaries ( ) const

Return a const reference to the auxiliary properties

Examples of supported properties:

For nucleus/ion:

  • "ion.Z" (integer) : value >= 1
  • "ion.A" (integer) : value >= Z
  • "ion.I" (integer) : value >= 1
  • "ion.excitation_energy" (real) : value > 0.0 keV (explicit energy unit)
  • "ion.Q" (integer) (only for ion) : Q>0, Q==0 (neutral atom), Q<0 (in unit: +e)

For neutrinos:

  • "neutrino.type" (string) : "neutrino", "antineutrino"
  • "neutrino.flavor" (string) : "electron", "muon", "tau"

◆ get_beta()

double genbb::primary_particle::get_beta ( ) const

Return the relativistic beta coefficient.

◆ get_charge()

double genbb::primary_particle::get_charge ( ) const

Return the charge of the particle (in unit of +e, as a real number)

◆ get_generation_id()

int genbb::primary_particle::get_generation_id ( ) const

Return the unique generation Id.

◆ get_kinetic_energy()

double genbb::primary_particle::get_kinetic_energy ( ) const

Return the kinetic energy (in unit of energy)

◆ get_mass()

double genbb::primary_particle::get_mass ( ) const

Return the mass of the particle (in unit of energy, i.e. m x c2)

◆ get_momentum()

const geomtools::vector_3d& genbb::primary_particle::get_momentum ( ) const

Return the const momentum of the particle (in unit of energy, i.e. p x c)

◆ get_particle_label()

const std::string& genbb::primary_particle::get_particle_label ( ) const

Return the identifier label of the particle.

◆ get_pdg_code()

int genbb::primary_particle::get_pdg_code ( ) const

Return the PDG code of the particle.

◆ get_time()

double genbb::primary_particle::get_time ( ) const

Return the creation time of the particle (in unit of time)

◆ get_total_energy()

double genbb::primary_particle::get_total_energy ( ) const

Return the total energy (in unit of energy)

◆ get_type()

int genbb::primary_particle::get_type ( ) const

Return the extended Geant3 type of the particle.

◆ get_vertex()

const geomtools::vector_3d& genbb::primary_particle::get_vertex ( ) const

Return the const vertex of the particle (in unit of length)

◆ grab_auxiliaries()

datatools::properties& genbb::primary_particle::grab_auxiliaries ( )

Return a mutable reference to the auxiliary properties.

◆ grab_momentum()

geomtools::vector_3d& genbb::primary_particle::grab_momentum ( )

Return the mutable momentum of the particle (in unit of energy, i.e. p x c)

◆ grab_time()

double& genbb::primary_particle::grab_time ( )

Return mutable reference on the creation time of the particle (in unit of time)

◆ grab_vertex()

geomtools::vector_3d& genbb::primary_particle::grab_vertex ( )

Return the mutable vertex of the particle (in unit of length)

◆ has_generation_id()

bool genbb::primary_particle::has_generation_id ( ) const

Check if the particle has an unique generation Id.

◆ has_particle_label()

bool genbb::primary_particle::has_particle_label ( ) const

Check is the particle has a specific identifier label.

◆ has_pdg_code()

bool genbb::primary_particle::has_pdg_code ( ) const

Check if the PDG code of the particle is defined.

◆ has_time()

bool genbb::primary_particle::has_time ( ) const

Check if time is defined.

◆ has_type()

bool genbb::primary_particle::has_type ( ) const

Check if the extended Geant3 type of the particle is defined.

◆ has_vertex()

bool genbb::primary_particle::has_vertex ( ) const

Check if the particle has its own vertex.

◆ invalidate_vertex()

void genbb::primary_particle::invalidate_vertex ( )

Invalidate the vertex of the particle.

◆ ion_to_label()

static std::string genbb::primary_particle::ion_to_label ( int  z_,
int  a_,
double  excitation_energy_ = 0.0,
int  charge_ = 0 
)
static

Build the label describing an charged ion from Z, A, excitation energy and charge.

◆ is_alpha()

bool genbb::primary_particle::is_alpha ( ) const

Check if the particle is an alpha.

◆ is_deuteron()

bool genbb::primary_particle::is_deuteron ( ) const

Check if the particle is a deuteron.

◆ is_electron()

bool genbb::primary_particle::is_electron ( ) const

Check if the particle is an electron.

◆ is_gamma()

bool genbb::primary_particle::is_gamma ( ) const

Check if the particle is a gamma.

◆ is_ion()

bool genbb::primary_particle::is_ion ( ) const

Check if the particle is an ion (not the light ones: p, D, T, He3, He4)

◆ is_muon_minus()

bool genbb::primary_particle::is_muon_minus ( ) const

Check if the particle is minus-.

◆ is_muon_plus()

bool genbb::primary_particle::is_muon_plus ( ) const

Check if the particle is muon+.

◆ is_neutrino()

bool genbb::primary_particle::is_neutrino ( ) const

Check if the particle is a neutrino.

◆ is_neutron()

bool genbb::primary_particle::is_neutron ( ) const

Check if the particle is a neutron.

◆ is_nucleus()

bool genbb::primary_particle::is_nucleus ( ) const

Check if the particle is an nucleus (not the light ones: p, D, T, He3, He4)

◆ is_pion_minus()

bool genbb::primary_particle::is_pion_minus ( ) const

Check if the particle is pion-.

◆ is_pion_plus()

bool genbb::primary_particle::is_pion_plus ( ) const

Check if the particle is pion+.

◆ is_pion_zero()

bool genbb::primary_particle::is_pion_zero ( ) const

Check if the particle is pion0.

◆ is_positron()

bool genbb::primary_particle::is_positron ( ) const

Check if the particle is a positron.

◆ is_proton()

bool genbb::primary_particle::is_proton ( ) const

Check if the particle is a proton.

◆ is_tritium()

bool genbb::primary_particle::is_tritium ( ) const

Check if the particle is a tritium.

◆ is_unknown()

bool genbb::primary_particle::is_unknown ( ) const

Check if the particle is of unknown type (but possibly valid for a client application)

◆ is_valid()

bool genbb::primary_particle::is_valid ( ) const

Check if the description of the particle is valid.

Here we test a minimal set of attributes to consider that the particle can be used by a client application:

  • identifier: extended Geant3 'type' or 'PDG code' or 'particle label'
  • time
  • momentum Other attributes (mass, vertex...) are not mandatory.

◆ label_to_ion()

static bool genbb::primary_particle::label_to_ion ( const std::string  label_,
int &  z_,
int &  a_,
double &  excitation_energy_,
int &  charge_ 
)
static

Build the ion's characteristics from a label.

◆ label_to_nucleus()

static bool genbb::primary_particle::label_to_nucleus ( const std::string  label_,
int &  z_,
int &  a_,
double &  excitation_energy_ 
)
static

Build the nucleus'characteristics from a label.

◆ mass_is_known()

bool genbb::primary_particle::mass_is_known ( ) const

Check if the mass of the particle is known.

◆ needs_particle_label()

bool genbb::primary_particle::needs_particle_label ( ) const

Check is the particle should have a specific identifier label because it lacks a type or code.

◆ nucleus_to_label()

static std::string genbb::primary_particle::nucleus_to_label ( int  z_,
int  a_,
double  excitation_energy_ = 0.0 
)
static

Build the label describing a nucleus ion from Z, A, and excitation energy.

◆ particle_label_from_type()

static std::string genbb::primary_particle::particle_label_from_type ( int  a_type)
static

Return the label associated to a particle code.

◆ particle_type_from_label()

static int genbb::primary_particle::particle_type_from_label ( const std::string &  a_label)
static

Return the particle code associated to a label.

◆ reset()

void genbb::primary_particle::reset ( )

Reset the full data structure of the particle.

◆ reset_generation_id()

void genbb::primary_particle::reset_generation_id ( )

Reset the unique generation Id.

◆ reset_mass()

void genbb::primary_particle::reset_mass ( )

Reset the mass of the particle.

◆ set_generation_id()

void genbb::primary_particle::set_generation_id ( int  )

Set the unique generation Id.

◆ set_ion()

void genbb::primary_particle::set_ion ( int  z_,
int  a_,
double  excitation_energy_ = 0.0,
int  charge_ = 0,
bool  pdg_ = false 
)

Define an ion (or neutral atom)

◆ set_mass()

void genbb::primary_particle::set_mass ( double  )

Set the mass of the particle (in unit of energy, i.e. m x c2)

◆ set_momentum()

void genbb::primary_particle::set_momentum ( const geomtools::vector_3d m_)

Set the momentum of the particle (in unit of energy, i.e. p x c)

◆ set_neutrino() [1/2]

void genbb::primary_particle::set_neutrino ( const std::string &  label_)

Define a neutrino.

◆ set_neutrino() [2/2]

void genbb::primary_particle::set_neutrino ( const std::string &  flavour_,
bool  antineutrino_ 
)

Define a neutrino.

◆ set_nucleus()

void genbb::primary_particle::set_nucleus ( int  z_,
int  a_,
double  excitation_energy_ = 0.0,
bool  pdg_ = false 
)

Define a nucleus, possibly in some excited state.

◆ set_particle_label()

void genbb::primary_particle::set_particle_label ( const std::string &  )

Set the identifier label of the particle (for type == PARTICLE_UNKNOWN, NUCLEUS, ION)

◆ set_pdg_code()

void genbb::primary_particle::set_pdg_code ( int  )

Set the PDG code of the particle.

◆ set_time()

void genbb::primary_particle::set_time ( double  time_)

Set the creation time of the particle (in unit of time)

◆ set_type()

void genbb::primary_particle::set_type ( int  type_)

Set the extended Geant3 type of the particle and set the corresponding particle label if it is empty.

◆ set_vertex()

void genbb::primary_particle::set_vertex ( const geomtools::vector_3d v_)

Set the vertex of the particle (in unit of length)

◆ shift_time()

void genbb::primary_particle::shift_time ( double  delta_time_)

Shift the creation time of the particle (in unit of time)

◆ tree_dump()

virtual void genbb::primary_particle::tree_dump ( std::ostream &  out_ = std::clog,
const std::string &  title_ = "",
const std::string &  indent_ = "",
bool  inherit_ = false 
) const
virtual

Smart print.

Reimplemented from datatools::i_tree_dumpable.

Member Data Documentation

◆ INVALID_GENERATION_ID

const int genbb::primary_particle::INVALID_GENERATION_ID = -1
static

Invalid generation Id.

◆ PDG_CODE_UNDEFINED

const int32_t genbb::primary_particle::PDG_CODE_UNDEFINED = 0
static

Invalid PDG particle code This constant should be moved in some "PDG tools" class in the future


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