29 #ifndef GENBB_HELP_PRIMARY_PARTICLE_H 30 #define GENBB_HELP_PRIMARY_PARTICLE_H 1 44 #include <boost/cstdint.hpp> 46 #include <CLHEP/Vector/LorentzVector.h> 128 static std::string
nucleus_to_label(
int z_,
int a_,
double excitation_energy_ = 0.0);
131 static std::string
ion_to_label(
int z_,
int a_,
double excitation_energy_ = 0.0,
int charge_ = 0);
134 static bool label_to_ion(
const std::string label_,
int & z_,
int & a_,
double & excitation_energy_,
int & charge_);
137 static bool label_to_nucleus(
const std::string label_,
int & z_,
int & a_,
double & excitation_energy_);
164 void set_nucleus(
int z_,
int a_,
double excitation_energy_ = 0.0,
bool pdg_ =
false);
167 void set_ion(
int z_,
int a_,
double excitation_energy_ = 0.0,
int charge_ = 0,
bool pdg_ =
false);
173 void set_neutrino(
const std::string & flavour_,
bool antineutrino_);
365 tree_dump(std::ostream & out_ = std::clog,
366 const std::string & title_ =
"",
367 const std::string & indent_ =
"",
368 bool inherit_ =
false)
const;
371 void dump(std::ostream & out_ = std::clog,
372 const std::string & a_indent =
"")
const;
390 std::string _particle_label_;
410 #include <boost/serialization/export.hpp> 419 #include <boost/serialization/version.hpp> 422 #endif // GENBB_HELP_PRIMARY_PARTICLE_H #define DR_CLASS_INIT(Introspectable)
Inform Camp that class Introspectable exists and trigger the automatic registration of dedicated refl...
Definition: reflection_interface.h:149
bool is_neutrino() const
Check if the particle is a neutrino.
static bool label_to_nucleus(const std::string label_, int &z_, int &a_, double &excitation_energy_)
Build the nucleus'characteristics from a label.
Definition: primary_particle.h:102
Definition: primary_particle.h:95
Definition: primary_particle.h:97
Definition: primary_particle.h:81
static std::string particle_label_from_type(int a_type)
Return the label associated to a particle code.
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.
static const int INVALID_GENERATION_ID
Invalid generation Id.
Definition: primary_particle.h:68
Definition: primary_particle.h:105
bool is_electron() const
Check if the particle is an electron.
Definition: primary_particle.h:98
bool is_nucleus() const
Check if the particle is an nucleus (not the light ones: p, D, T, He3, He4)
Definition: primary_particle.h:107
void reset_generation_id()
Reset the unique generation Id.
bool is_alpha() const
Check if the particle is an alpha.
Definition: primary_particle.h:82
Definition: primary_particle.h:115
Definition: primary_particle.h:85
bool is_unknown() const
Check if the particle is of unknown type (but possibly valid for a client application)
void dump(std::ostream &out_=std::clog, const std::string &a_indent="") const
Basic print.
void set_vertex(const geomtools::vector_3d &v_)
Set the vertex of the particle (in unit of length)
const geomtools::vector_3d & get_momentum() const
Return the const momentum of the particle (in unit of energy, i.e. p x c)
Definition: primary_particle.h:117
Definition: primary_particle.h:93
#define DATATOOLS_SERIALIZATION_DECLARATION_ADVANCED(ClassName)
Definition: i_serializable.h:371
bool is_pion_minus() const
Check if the particle is pion-.
Definition: primary_particle.h:94
void set_ion(int z_, int a_, double excitation_energy_=0.0, int charge_=0, bool pdg_=false)
Define an ion (or neutral atom)
bool is_gamma() const
Check if the particle is a gamma.
particle_type
Extended Geant3 particle These are historical codes used in GEANT3 and original GENBB/DECAY0 library....
Definition: primary_particle.h:75
bool has_pdg_code() const
Check if the PDG code of the particle is defined.
bool is_tritium() const
Check if the particle is a tritium.
bool has_type() const
Check if the extended Geant3 type of the particle is defined.
void set_particle_label(const std::string &)
Set the identifier label of the particle (for type == PARTICLE_UNKNOWN, NUCLEUS, ION)
Definition: primary_particle.h:108
Definition: primary_particle.h:110
Definition: primary_particle.h:101
int get_type() const
Return the extended Geant3 type of the particle.
double get_total_energy() const
Return the total energy (in unit of energy)
bool is_deuteron() const
Check if the particle is a deuteron.
double get_kinetic_energy() const
Return the kinetic energy (in unit of energy)
double get_time() const
Return the creation time of the particle (in unit of time)
void set_generation_id(int)
Set the unique generation Id.
Definition: primary_particle.h:112
Definition: primary_particle.h:111
primary_particle()
Default constructor.
Definition: primary_particle.h:84
bool is_muon_plus() const
Check if the particle is muon+.
double get_charge() const
Return the charge of the particle (in unit of +e, as a real number)
bool has_vertex() const
Check if the particle has its own vertex.
void _set_defaults()
Set the default values for attributes.
geomtools::vector_3d & grab_momentum()
Return the mutable momentum of the particle (in unit of energy, i.e. p x c)
Definition: primary_particle.h:99
Definition: primary_particle.h:91
bool is_pion_zero() const
Check if the particle is pion0.
int get_generation_id() const
Return the unique generation Id.
static int particle_type_from_label(const std::string &a_label)
Return the particle code associated to a label.
Fully ionized ion (naked nucleus)
Definition: primary_particle.h:119
bool has_time() const
Check if time is defined.
double get_beta() const
Return the relativistic beta coefficient.
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
virtual ~primary_particle()
Destructor.
void set_neutrino(const std::string &label_)
Define a neutrino.
#define DATATOOLS_SERIALIZATION_EXT_BACKWARD_SERIAL_TAG_DECLARATION(ClassName)
Definition: i_serializable.h:180
Definition: primary_particle.h:79
Definition: primary_particle.h:104
bool is_neutron() const
Check if the particle is a neutron.
void reset()
Reset the full data structure of the particle.
Definition: primary_particle.h:83
void set_mass(double)
Set the mass of the particle (in unit of energy, i.e. m x c2)
Definition: primary_particle.h:90
void shift_time(double delta_time_)
Shift the creation time of the particle (in unit of time)
bool is_pion_plus() const
Check if the particle is pion+.
double get_mass() const
Return the mass of the particle (in unit of energy, i.e. m x c2)
geomtools::vector_3d & grab_vertex()
Return the mutable vertex of the particle (in unit of length)
Definition: primary_particle.h:87
void set_nucleus(int z_, int a_, double excitation_energy_=0.0, bool pdg_=false)
Define a nucleus, possibly in some excited state.
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.
bool is_proton() const
Check if the particle is a proton.
Definition: primary_particle.h:113
bool charge_is_known() const
Check if the charge of the particle is known.
Definition: primary_particle.h:92
#define DATATOOLS_SERIALIZATION_BACKWARD_SERIAL_TAG_SUPPORT()
Definition: i_serializable.h:174
void reset_mass()
Reset the mass of the particle.
Top-level namespace of the Bayeux/genbb_help module library.
Definition: alpha_decay.h:51
Definition: primary_particle.h:106
int get_pdg_code() const
Return the PDG code of the particle.
void set_time(double time_)
Set the creation time of the particle (in unit of time)
bool is_muon_minus() const
Check if the particle is minus-.
void set_type(int type_)
Set the extended Geant3 type of the particle and set the corresponding particle label if it is empty.
bool is_valid() const
Check if the description of the particle is valid.
Definition: primary_particle.h:86
Definition: primary_particle.h:96
void set_momentum(const geomtools::vector_3d &m_)
Set the momentum of the particle (in unit of energy, i.e. p x c)
const std::string & get_particle_label() const
Return the identifier label of the particle.
Definition: primary_particle.h:103
Definition: primary_particle.h:114
bool is_positron() const
Check if the particle is a positron.
datatools::properties & grab_auxiliaries()
Return a mutable reference to the auxiliary properties.
Undefined particle type.
Definition: primary_particle.h:77
bool is_ion() const
Check if the particle is an ion (not the light ones: p, D, T, He3, He4)
An ion/atom with arbitrary ionization state.
Definition: primary_particle.h:120
Definition: primary_particle.h:109
Definition: primary_particle.h:100
Definition: primary_particle.h:80
const datatools::properties & get_auxiliaries() const
bool has_particle_label() const
Check is the particle has a specific identifier label.
Definition: primary_particle.h:89
Definition: primary_particle.h:116
#define DR_CLASS_RTTI()
Declare Camp RTTI within class declaration.
Definition: reflection_interface.h:46
A valid particle but unknown from the genbb library.
Definition: primary_particle.h:78
bool needs_particle_label() const
Check is the particle should have a specific identifier label because it lacks a type or code.
Definition: primary_particle.h:88
double & grab_time()
Return mutable reference on the creation time of the particle (in unit of time)
A primary particle generated by a Monte Carlo generator process.
Definition: primary_particle.h:61
void invalidate_vertex()
Invalidate the vertex of the particle.
const geomtools::vector_3d & get_vertex() const
Return the const vertex of the particle (in unit of length)
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.
int fetch_pdg_code() const
Fetch the PDG code from the particle type/label...
void set_pdg_code(int)
Set the PDG code of the particle.
static const int32_t PDG_CODE_UNDEFINED
Definition: primary_particle.h:125
void compute_four_momentum(CLHEP::HepLorentzVector &) const
Compute the associated 4-vector (in unit of energy, i.e. p x c)
bool has_generation_id() const
Check if the particle has an unique generation Id.
bool mass_is_known() const
Check if the mass of the particle is known.