Garfield++ 5.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
particle_def.cpp
Go to the documentation of this file.
4
5// 1998 - 2004, I. Smirnov
6
7namespace Heed {
8
9using CLHEP::electron_mass_c2;
10using CLHEP::proton_mass_c2;
11using CLHEP::neutron_mass_c2;
12using CLHEP::c_squared;
13using CLHEP::electron_charge;
14using CLHEP::eplus;
15using CLHEP::MeV;
16using CLHEP::GeV;
17
18particle_def electron_def("electron", "e-", electron_mass_c2 / c_squared,
19 electron_charge, 0.5);
20particle_def positron_def("positron", "e+", electron_def);
21
22particle_def muon_minus_def("muon_minus", "mu-", 105.658367 * MeV / c_squared,
23 electron_charge, 0.5);
24particle_def muon_plus_def("muon_plus", "mu+", muon_minus_def);
25
26particle_def proton_def("proton", "p+", proton_mass_c2 / c_squared, eplus, 0.5);
28
29// light unflavored mesons
30particle_def pi_plus_meson_def("pi_plus", "pi+",
31 139.56755 * MeV / c_squared, eplus, 0.0);
32particle_def pi_minus_meson_def("pi_minus", "pi-",
33 139.56755 * MeV / c_squared, -eplus, 0.0);
34particle_def K_plus_meson_def("K_plus", "K+",
35 493.677 * MeV / c_squared, 1, 0.0);
37
38particle_def deuteron_def("deuteron", "d", 1875.613 * MeV / c_squared, eplus,
39 0.0);
40particle_def alpha_particle_def("alpha_particle", "alpha",
41 3727.417 * MeV / c_squared, 2 * eplus, 0.);
42
43particle_def::particle_def(const std::string& fname,
44 const std::string& fnotation, double fmass,
45 double fcharge, float fspin) :
46 name(fname), notation(fnotation), mass(fmass),
47 charge(fcharge), spin(fspin) {
48}
49
50particle_def::particle_def(const std::string& fname,
51 const std::string& fnotation, particle_def& p) {
52 // creates anti-particle through the call of anti_particle(p)
53 *this = anti_particle(p);
54 if (!(fname == "" || fname == " ")) name = fname;
55 if (!(fnotation == "" || fnotation == " ")) notation = fnotation;
56}
57
59 std::string aname = "anti-" + p.name;
60 std::string anot = "anti-" + p.notation;
61 return particle_def(aname, anot, p.mass, -p.charge, -p.spin);
62}
63
64void particle_def::set_mass(const double m) { mass = m * MeV / c_squared; }
65
66void particle_def::set_charge(const double z) { charge = z * eplus; }
67
68void particle_def::print(std::ostream& file, int l) const {
69 if (l > 0) file << (*this);
70}
71
72std::ostream& operator<<(std::ostream& file, const particle_def& f) {
73 Ifile << "particle_def: name=" << f.name << " notation=" << f.notation
74 << '\n';
75 Ifile << "mass=" << f.mass
76 << " mass/(GeV/c_squared)=" << f.mass / (GeV / c_squared)
77 << " charge=" << f.charge << " charge/eplus=" << f.charge / eplus
78 << '\n';
79 Ifile << "spin=" << f.spin << '\n';
80 return file;
81}
82
83}
void print(std::ostream &file, int l) const
void set_mass(const double m)
particle_def()=default
Default constructor.
particle_def anti_particle(const particle_def &p)
Function for making an anti-particle.
void set_charge(const double z)
std::string notation
Short name to make data summary files short.
Definition BGMesh.cpp:6
particle_def K_plus_meson_def("K_plus", "K+", 493.677 *MeV/c_squared, 1, 0.0)
particle_def alpha_particle_def("alpha_particle", "alpha", 3727.417 *MeV/c_squared, 2 *eplus, 0.)
particle_def anti_proton_def("", "p-", proton_def)
std::ostream & operator<<(std::ostream &file, const BGMesh &bgm)
Definition BGMesh.cpp:37
particle_def deuteron_def("deuteron", "d", 1875.613 *MeV/c_squared, eplus, 0.0)
particle_def electron_def("electron", "e-", electron_mass_c2/c_squared, electron_charge, 0.5)
particle_def muon_minus_def("muon_minus", "mu-", 105.658367 *MeV/c_squared, electron_charge, 0.5)
particle_def pi_plus_meson_def("pi_plus", "pi+", 139.56755 *MeV/c_squared, eplus, 0.0)
particle_def muon_plus_def("muon_plus", "mu+", muon_minus_def)
particle_def positron_def("positron", "e+", electron_def)
particle_def K_minus_meson_def("K_minus", "K-", K_plus_meson_def)
particle_def pi_minus_meson_def("pi_minus", "pi-", 139.56755 *MeV/c_squared, -eplus, 0.0)
particle_def proton_def("proton", "p+", proton_mass_c2/c_squared, eplus, 0.5)
#define Ifile
Definition prstream.h:195