Bayeux
3.4.1
Core Foundation library for SuperNEMO
|
A primary particle generated by a Monte Carlo generator process. More...
#include <bayeux/genbb_help/primary_particle.h>
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_3d & | get_momentum () const |
Return the const momentum of the particle (in unit of energy, i.e. p x c) More... | |
geomtools::vector_3d & | grab_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_3d & | get_vertex () const |
Return the const vertex of the particle (in unit of length) More... | |
geomtools::vector_3d & | grab_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::properties & | get_auxiliaries () const |
datatools::properties & | grab_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... | |
A primary particle generated by a Monte Carlo generator process.
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.
genbb::primary_particle::primary_particle | ( | ) |
Default constructor.
genbb::primary_particle::primary_particle | ( | int32_t | a_type, |
double | a_time, | ||
const geomtools::vector_3d & | |||
) |
Constructor.
|
virtual |
Destructor.
|
protected |
Set the default values for attributes.
bool genbb::primary_particle::charge_is_known | ( | ) | const |
Check if the charge of the particle is known.
void genbb::primary_particle::compute_four_momentum | ( | CLHEP::HepLorentzVector & | ) | const |
Compute the associated 4-vector (in unit of energy, i.e. p x c)
void genbb::primary_particle::dump | ( | std::ostream & | out_ = std::clog , |
const std::string & | a_indent = "" |
||
) | const |
Basic print.
int genbb::primary_particle::fetch_pdg_code | ( | ) | const |
Fetch the PDG code from the particle type/label...
const datatools::properties& genbb::primary_particle::get_auxiliaries | ( | ) | const |
Return a const reference to the auxiliary properties
Examples of supported properties:
For nucleus/ion:
For neutrinos:
double genbb::primary_particle::get_beta | ( | ) | const |
Return the relativistic beta coefficient.
double genbb::primary_particle::get_charge | ( | ) | const |
Return the charge of the particle (in unit of +e, as a real number)
int genbb::primary_particle::get_generation_id | ( | ) | const |
Return the unique generation Id.
double genbb::primary_particle::get_kinetic_energy | ( | ) | const |
Return the kinetic energy (in unit of energy)
double genbb::primary_particle::get_mass | ( | ) | const |
Return the mass of the particle (in unit of energy, i.e. m x c2)
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)
const std::string& genbb::primary_particle::get_particle_label | ( | ) | const |
Return the identifier label of the particle.
int genbb::primary_particle::get_pdg_code | ( | ) | const |
Return the PDG code of the particle.
double genbb::primary_particle::get_time | ( | ) | const |
Return the creation time of the particle (in unit of time)
double genbb::primary_particle::get_total_energy | ( | ) | const |
Return the total energy (in unit of energy)
int genbb::primary_particle::get_type | ( | ) | const |
Return the extended Geant3 type of the particle.
const geomtools::vector_3d& genbb::primary_particle::get_vertex | ( | ) | const |
Return the const vertex of the particle (in unit of length)
datatools::properties& genbb::primary_particle::grab_auxiliaries | ( | ) |
Return a mutable reference to the auxiliary properties.
geomtools::vector_3d& genbb::primary_particle::grab_momentum | ( | ) |
Return the mutable momentum of the particle (in unit of energy, i.e. p x c)
double& genbb::primary_particle::grab_time | ( | ) |
Return mutable reference on the creation time of the particle (in unit of time)
geomtools::vector_3d& genbb::primary_particle::grab_vertex | ( | ) |
Return the mutable vertex of the particle (in unit of length)
bool genbb::primary_particle::has_generation_id | ( | ) | const |
Check if the particle has an unique generation Id.
bool genbb::primary_particle::has_particle_label | ( | ) | const |
Check is the particle has a specific identifier label.
bool genbb::primary_particle::has_pdg_code | ( | ) | const |
Check if the PDG code of the particle is defined.
bool genbb::primary_particle::has_time | ( | ) | const |
Check if time is defined.
bool genbb::primary_particle::has_type | ( | ) | const |
Check if the extended Geant3 type of the particle is defined.
bool genbb::primary_particle::has_vertex | ( | ) | const |
Check if the particle has its own vertex.
void genbb::primary_particle::invalidate_vertex | ( | ) |
Invalidate the vertex of the particle.
|
static |
Build the label describing an charged ion from Z, A, excitation energy and charge.
bool genbb::primary_particle::is_alpha | ( | ) | const |
Check if the particle is an alpha.
bool genbb::primary_particle::is_deuteron | ( | ) | const |
Check if the particle is a deuteron.
bool genbb::primary_particle::is_electron | ( | ) | const |
Check if the particle is an electron.
bool genbb::primary_particle::is_gamma | ( | ) | const |
Check if the particle is a gamma.
bool genbb::primary_particle::is_ion | ( | ) | const |
Check if the particle is an ion (not the light ones: p, D, T, He3, He4)
bool genbb::primary_particle::is_muon_minus | ( | ) | const |
Check if the particle is minus-.
bool genbb::primary_particle::is_muon_plus | ( | ) | const |
Check if the particle is muon+.
bool genbb::primary_particle::is_neutrino | ( | ) | const |
Check if the particle is a neutrino.
bool genbb::primary_particle::is_neutron | ( | ) | const |
Check if the particle is a neutron.
bool genbb::primary_particle::is_nucleus | ( | ) | const |
Check if the particle is an nucleus (not the light ones: p, D, T, He3, He4)
bool genbb::primary_particle::is_pion_minus | ( | ) | const |
Check if the particle is pion-.
bool genbb::primary_particle::is_pion_plus | ( | ) | const |
Check if the particle is pion+.
bool genbb::primary_particle::is_pion_zero | ( | ) | const |
Check if the particle is pion0.
bool genbb::primary_particle::is_positron | ( | ) | const |
Check if the particle is a positron.
bool genbb::primary_particle::is_proton | ( | ) | const |
Check if the particle is a proton.
bool genbb::primary_particle::is_tritium | ( | ) | const |
Check if the particle is a tritium.
bool genbb::primary_particle::is_unknown | ( | ) | const |
Check if the particle is of unknown type (but possibly valid for a client application)
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:
|
static |
Build the ion's characteristics from a label.
|
static |
Build the nucleus'characteristics from a label.
bool genbb::primary_particle::mass_is_known | ( | ) | const |
Check if the mass of the particle is known.
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.
|
static |
Build the label describing a nucleus ion from Z, A, and excitation energy.
|
static |
Return the label associated to a particle code.
|
static |
Return the particle code associated to a label.
void genbb::primary_particle::reset | ( | ) |
Reset the full data structure of the particle.
void genbb::primary_particle::reset_generation_id | ( | ) |
Reset the unique generation Id.
void genbb::primary_particle::reset_mass | ( | ) |
Reset the mass of the particle.
void genbb::primary_particle::set_generation_id | ( | int | ) |
Set the unique generation Id.
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)
void genbb::primary_particle::set_mass | ( | double | ) |
Set the mass of the particle (in unit of energy, i.e. m x c2)
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)
void genbb::primary_particle::set_neutrino | ( | const std::string & | label_ | ) |
Define a neutrino.
void genbb::primary_particle::set_neutrino | ( | const std::string & | flavour_, |
bool | antineutrino_ | ||
) |
Define a neutrino.
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.
void genbb::primary_particle::set_particle_label | ( | const std::string & | ) |
Set the identifier label of the particle (for type == PARTICLE_UNKNOWN, NUCLEUS, ION)
void genbb::primary_particle::set_pdg_code | ( | int | ) |
Set the PDG code of the particle.
void genbb::primary_particle::set_time | ( | double | time_ | ) |
Set the creation time of the particle (in unit of time)
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.
void genbb::primary_particle::set_vertex | ( | const geomtools::vector_3d & | v_ | ) |
Set the vertex of the particle (in unit of length)
void genbb::primary_particle::shift_time | ( | double | delta_time_ | ) |
Shift the creation time of the particle (in unit of time)
|
virtual |
Smart print.
Reimplemented from datatools::i_tree_dumpable.
|
static |
Invalid generation Id.
|
static |
Invalid PDG particle code This constant should be moved in some "PDG tools" class in the future