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") {
97 std::cerr <<
className <<
"::SetParticle:\n";
98 std::cerr <<
" Particle " << part <<
" is not defined.\n";
105 std::cerr <<
className <<
"::SetEnergy:\n";
106 std::cerr <<
" Particle energy must be greater than the mass.\n";
112 beta2 = 1. - 1. / (gamma * gamma);
119 std::cerr <<
className <<
"::SetBetaGamma:\n";
120 std::cerr <<
" Particle speed must be greater than zero.\n";
124 const double bg2 = bg * bg;
126 beta2 = bg2 / (1. + bg2);
132 if (beta <= 0. && beta >= 1.) {
133 std::cerr <<
className <<
"::SetBeta:\n";
134 std::cerr <<
" Particle speed must be between zero"
135 <<
" and speed of light.\n";
147 std::cerr <<
className <<
"::SetGamma:\n";
148 std::cerr <<
" Particle speed must be greater than zero.\n";
153 beta2 = 1. - 1. / (gamma * gamma);
160 std::cerr <<
className <<
"::SetMomentum:\n";
161 std::cerr <<
" Particle momentum must be greater than zero.\n";
166 const double bg = p /
mass;
167 beta2 = bg * bg / (1. + bg * bg);
174 std::cerr <<
className <<
"::SetKineticEnergy:\n";
175 std::cerr <<
" Kinetic energy must be greater than zero.\n";
180 const double gamma = 1. + ekin /
mass;
181 beta2 = 1. - 1. / (gamma * gamma);
188 std::cerr <<
className <<
"::SetSensor:\n";
189 std::cerr <<
" Sensor pointer is null.\n";
199 std::cerr <<
className <<
"::EnablePlotting:\n";
200 std::cerr <<
" Pointer is null.\n";
224 std::cerr <<
className <<
"::PlotCluster:\n";
225 std::cerr <<
" No track set. Program bug!\n";
DoubleAc sqrt(const DoubleAc &f)
void EnablePlotting(ViewDrift *viewer)
void SetBetaGamma(const double bg)
void SetSensor(Sensor *s)
void SetKineticEnergy(const double ekin)
void SetMomentum(const double p)
virtual void SetParticle(std::string part)
void PlotCluster(const double x0, const double y0, const double z0)
void SetEnergy(const double e)
void SetGamma(const double gamma)
void SetBeta(const double beta)
void PlotNewTrack(const double x0, const double y0, const double z0)
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)