Commit 5e0677c0 authored by kraus's avatar kraus
Browse files

fixing bug that prevented most distributions from beeing mirrored

parent d2e81d3c
...@@ -1936,14 +1936,14 @@ void Distribution::CreateOpalCycl(PartBunch &beam, ...@@ -1936,14 +1936,14 @@ void Distribution::CreateOpalCycl(PartBunch &beam,
* *
* For now we just cut the number of generated particles in half. * For now we just cut the number of generated particles in half.
*/ */
if (Options::cZero && !distrTypeT_m == DistrTypeT::FROMFILE) if (Options::cZero && !(distrTypeT_m == DistrTypeT::FROMFILE))
numberOfPartToCreate /= 2; numberOfPartToCreate /= 2;
// Create distribution. // Create distribution.
Create(numberOfPartToCreate, beam.getM()); Create(numberOfPartToCreate, beam.getM());
// Now reflect particles if Options::cZero is true. // Now reflect particles if Options::cZero is true.
if (Options::cZero && !distrTypeT_m == DistrTypeT::FROMFILE) if (Options::cZero && !(distrTypeT_m == DistrTypeT::FROMFILE))
ReflectDistribution(numberOfPartToCreate); ReflectDistribution(numberOfPartToCreate);
// Setup energy bins. // Setup energy bins.
...@@ -2071,7 +2071,7 @@ void Distribution::CreateOpalT(PartBunch &beam, ...@@ -2071,7 +2071,7 @@ void Distribution::CreateOpalT(PartBunch &beam,
* *
* For now we just cut the number of generated particles in half. * For now we just cut the number of generated particles in half.
*/ */
if (Options::cZero && !distrTypeT_m == DistrTypeT::FROMFILE) if (Options::cZero && !(distrTypeT_m == DistrTypeT::FROMFILE))
numberOfParticles /= 2; numberOfParticles /= 2;
/* /*
...@@ -2107,7 +2107,7 @@ void Distribution::CreateOpalT(PartBunch &beam, ...@@ -2107,7 +2107,7 @@ void Distribution::CreateOpalT(PartBunch &beam,
AddDistributions(); AddDistributions();
// Now reflect particles if Options::cZero is true // Now reflect particles if Options::cZero is true
if (Options::cZero && !distrTypeT_m == DistrTypeT::FROMFILE) if (Options::cZero && !(distrTypeT_m == DistrTypeT::FROMFILE))
ReflectDistribution(numberOfParticles); ReflectDistribution(numberOfParticles);
// Check number of particles in distribution. // Check number of particles in distribution.
...@@ -3475,7 +3475,7 @@ void Distribution::PrintDist(Inform &os, size_t numberOfParticles) const { ...@@ -3475,7 +3475,7 @@ void Distribution::PrintDist(Inform &os, size_t numberOfParticles) const {
if (numberOfParticles > 0) { if (numberOfParticles > 0) {
os << "Number of particles: " os << "Number of particles: "
<< numberOfParticles * (Options::cZero && !distrTypeT_m == DistrTypeT::FROMFILE? 2: 1) << numberOfParticles * (Options::cZero && !(distrTypeT_m == DistrTypeT::FROMFILE? 2: 1))
<< endl << endl
<< endl; << endl;
} }
...@@ -5051,4 +5051,4 @@ void Distribution::WriteOutFileInjection() { ...@@ -5051,4 +5051,4 @@ void Distribution::WriteOutFileInjection() {
reduce(numberOfParticles, numberOfParticles, OpAddAssign()); reduce(numberOfParticles, numberOfParticles, OpAddAssign());
} }
} }
} }
\ No newline at end of file
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