Commit 754e1858 authored by frey_m's avatar frey_m
Browse files

Gauss-Matched: Throw exception if 'FMLOWE' or 'FMHIGHE' attributes in...

Gauss-Matched: Throw exception if 'FMLOWE' or 'FMHIGHE' attributes in 'CYCLOTRON' definition are missing.
parent a7080a2f
...@@ -1300,15 +1300,12 @@ void Distribution::createMatchedGaussDistribution(size_t numberOfParticles, doub ...@@ -1300,15 +1300,12 @@ void Distribution::createMatchedGaussDistribution(size_t numberOfParticles, doub
const double fmLowE = CyclotronElement->getFMLowE(); const double fmLowE = CyclotronElement->getFMLowE();
const double fmHighE = CyclotronElement->getFMHighE(); const double fmHighE = CyclotronElement->getFMHighE();
double lE,hE; if ( fmLowE < 0 || fmHighE < 0 ) {
lE = fmLowE; throw OpalException("Distribution::CreateMatchedGaussDistribution()",
hE = fmHighE; "Missing attributes 'FMLOWE' and/or 'FMHIHGE' in "
"'CYCLOTRON' definition.");
if ((lE<0) || (hE<0)) {
lE = E_m*1E-6;
hE = E_m*1E-6;
} }
int Nint = 1000; int Nint = 1000;
double scaleFactor = 1.0; double scaleFactor = 1.0;
bool writeMap = true; bool writeMap = true;
...@@ -1322,8 +1319,8 @@ void Distribution::createMatchedGaussDistribution(size_t numberOfParticles, doub ...@@ -1322,8 +1319,8 @@ void Distribution::createMatchedGaussDistribution(size_t numberOfParticles, doub
E_m*1E-6, E_m*1E-6,
CyclotronElement->getCyclHarm(), CyclotronElement->getCyclHarm(),
massIneV*1E-6, massIneV*1E-6,
lE, fmLowE,
hE, fmHighE,
(int)Attributes::getReal(itsAttr[Attrib::Distribution::MAGSYM]), (int)Attributes::getReal(itsAttr[Attrib::Distribution::MAGSYM]),
Nint, Nint,
Attributes::getString(itsAttr[Attrib::Distribution::FMAPFN]), Attributes::getString(itsAttr[Attrib::Distribution::FMAPFN]),
......
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