12 : m_className(
"Track"),
18 m_particleName(
"mu-"),
32 if (part ==
"electron" || part ==
"Electron" || part ==
"e-") {
38 }
else if (part ==
"positron" || part ==
"Positron" || part ==
"e+") {
43 }
else if (part ==
"muon" || part ==
"Muon" || part ==
"mu" ||
49 }
else if (part ==
"mu+") {
54 }
else if (part ==
"pion" || part ==
"Pion" || part ==
"pi" ||
60 }
else if (part ==
"pi+") {
65 }
else if (part ==
"kaon" || part ==
"Kaon" || part ==
"K" || part ==
"K-") {
70 }
else if (part ==
"K+") {
75 }
else if (part ==
"proton" || part ==
"Proton" || part ==
"p") {
80 }
else if (part ==
"anti-proton" || part ==
"Anti-Proton" ||
81 part ==
"antiproton" || part ==
"Antiproton" || part ==
"p-bar") {
86 }
else if (part ==
"deuteron" || part ==
"Deuteron" || part ==
"d") {
91 }
else if (part ==
"alpha" || part ==
"Alpha") {
98 <<
" Particle " << part <<
" is not defined.\n";
106 <<
" Particle energy must be greater than the mass.\n";
112 m_beta2 = 1. - 1. / (gamma * gamma);
120 <<
" Particle speed must be greater than zero.\n";
124 const double bg2 = bg * bg;
132 if (beta <= 0. && beta >= 1.) {
134 std::cerr <<
" Particle speed must be between zero"
135 <<
" and speed of light.\n";
148 std::cerr <<
" Particle speed must be greater than zero.\n";
153 m_beta2 = 1. - 1. / (gamma * gamma);
161 std::cerr <<
" Particle momentum must be greater than zero.\n";
166 const double bg = p /
m_mass;
167 m_beta2 = bg * bg / (1. + bg * bg);
174 std::cerr <<
m_className <<
"::SetKineticEnergy:\n";
175 std::cerr <<
" Kinetic energy must be greater than zero.\n";
180 const double gamma = 1. + ekin /
m_mass;
181 m_beta2 = 1. - 1. / (gamma * gamma);
189 std::cerr <<
" Sensor pointer is null.\n";
200 std::cerr <<
" Pointer is null.\n";
225 std::cerr <<
" No track set. Program bug!\n";
void EnablePlotting(ViewDrift *viewer)
void SetBetaGamma(const double bg)
Set the relative momentum of the particle.
void SetSensor(Sensor *s)
void SetKineticEnergy(const double ekin)
Set the kinetic energy of the particle.
void SetMomentum(const double p)
Set the particle momentum.
virtual void SetParticle(const std::string &part)
Set the type of particle.
std::string m_particleName
void PlotCluster(const double x0, const double y0, const double z0)
void SetEnergy(const double e)
Set the particle energy.
void SetGamma(const double gamma)
Set the Lorentz factor of the particle.
void SetBeta(const double beta)
Set the speed ( ) of the particle.
void PlotNewTrack(const double x0, const double y0, const double z0)
Visualize drift lines and tracks.
void AddTrackPoint(const unsigned int iL, const double x, const double y, const double z)
void NewChargedParticleTrack(const unsigned int np, int &id, const double x0, const double y0, const double z0)