Commit a9d242c2 authored by frey_m's avatar frey_m
Browse files

use Util:getBetaGamma function

parent 8b530aa8
...@@ -2374,9 +2374,7 @@ void Distribution::generateMatchedGauss(const SigmaGenerator::matrix_t& sigma, ...@@ -2374,9 +2374,7 @@ void Distribution::generateMatchedGauss(const SigmaGenerator::matrix_t& sigma,
"Negative value on the diagonal of the sigma matrix."); "Negative value on the diagonal of the sigma matrix.");
} }
double gamma = E_m / massIneV + 1.0; double bgam = Util::getBetaGamma(E_m, massIneV);
// beta * gamma
double bgam = std::sqrt(gamma * gamma - 1.0);
/* /*
* only used for printing * only used for printing
......
...@@ -98,8 +98,7 @@ SigmaGenerator::SigmaGenerator(double I, ...@@ -98,8 +98,7 @@ SigmaGenerator::SigmaGenerator(double I,
, prinit_m(0.0) , prinit_m(0.0)
{ {
// minimum beta*gamma // minimum beta*gamma
double minGamma = Emin_m / m_m + 1.0; double bgam = Util::getBetaGamma(Emin_m, m_m);
double bgam = std::sqrt(minGamma * minGamma - 1.0);
// set emittances (initialization like that due to old compiler version) // set emittances (initialization like that due to old compiler version)
// [ex] = [ey] = [ez] = pi*mm*mrad --> [emittance] = m rad // [ex] = [ey] = [ez] = pi*mm*mrad --> [emittance] = m rad
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment