Commit 0530b5ea authored by ext-calvo_p's avatar ext-calvo_p

Resolve "cleanup src: remove using namespace std"

parent e7812d0b
......@@ -45,7 +45,7 @@
// /DTA
#define MAX_NUM_INSTANCES 10
using namespace std;
// Class OpalData::ClearReference
// ------------------------------------------------------------------------
......@@ -524,8 +524,8 @@ void OpalData::define(Object *newObject) {
if(table->isDependent(name)) {
if(Options::info) {
cerr << endl << "Erasing dependent table \"" << tableName
<< "\"." << endl << endl;
std::cerr << std::endl << "Erasing dependent table \""
<< tableName << "\"." << std::endl;
}
// Remove table from directory.
......@@ -599,8 +599,8 @@ void OpalData::makeDirty(Object *obj) {
void OpalData::printNames(std::ostream &os, const std::string &pattern) {
int column = 0;
RegularExpression regex(pattern);
os << endl << "Object names matching the pattern \""
<< pattern << "\":" << endl;
os << std::endl << "Object names matching the pattern \""
<< pattern << "\":" << std::endl;
for(ObjectDir::const_iterator index = p->mainDirectory.begin();
index != p->mainDirectory.end(); ++index) {
......@@ -617,14 +617,14 @@ void OpalData::printNames(std::ostream &os, const std::string &pattern) {
column++;
} while((column % 20) != 0);
} else {
os << endl;
os << std::endl;
column = 0;
}
}
}
if(column) os << endl;
os << endl;
if(column) os << std::endl;
os << std::endl;
}
......
......@@ -19,7 +19,6 @@
#include "AbstractObjects/RangeRep.h"
#include "AbstractObjects/Element.h"
#include <iostream>
using namespace std;
// Class RangeRep
......
......@@ -54,7 +54,6 @@
class Beamline;
class PartData;
using Physics::c;
typedef FTps<double, 6> Series;
......@@ -183,7 +182,7 @@ void LieMapper::visitMonitor(const Monitor &corr) {
void LieMapper::visitMultipole(const Multipole &mult) {
double length = mult.getElementLength() * flip_s;
const BMultipoleField &field = mult.getField();
double scale = (flip_B * itsReference.getQ() * c) / itsReference.getP();
double scale = (flip_B * itsReference.getQ() * Physics::c) / itsReference.getP();
if(length) {
// Normal case: Finite-length multipole, field coefficients are B.
......@@ -231,7 +230,7 @@ void LieMapper::visitRBend(const RBend &bend) {
// Geometry.
const RBendGeometry &geometry = bend.getGeometry();
double length = flip_s * geometry.getElementLength();
double scale = (flip_B * itsReference.getQ() * c) / itsReference.getP();
double scale = (flip_B * itsReference.getQ() * Physics::c) / itsReference.getP();
const BMultipoleField &field = bend.getField();
if(length) {
......@@ -313,7 +312,7 @@ void LieMapper::visitRFCavity(const RFCavity &as) {
// Compute Hamiltonian.
static const Series t = Series::makeVariable(AbstractMapper::T);
Series H = peak * cos(as.getPhase() + (freq / c) * t);
Series H = peak * cos(as.getPhase() + (freq / Physics::c) * t);
// Build map.
DragtFinnMap<3> theMap = DragtFinnMap<3>::factorSimple(H);
......@@ -333,7 +332,7 @@ void LieMapper::visitRFQuadrupole(const RFQuadrupole &rfq) {
void LieMapper::visitSBend(const SBend &bend) {
const PlanarArcGeometry &geometry = bend.getGeometry();
double length = flip_s * geometry.getElementLength();
double scale = (flip_B * itsReference.getQ() * c) / itsReference.getP();
double scale = (flip_B * itsReference.getQ() * Physics::c) / itsReference.getP();
const BMultipoleField &field = bend.getField();
if(length) {
......@@ -417,7 +416,7 @@ void LieMapper::visitSolenoid(const Solenoid &solenoid) {
double length = flip_s * solenoid.getElementLength();
if(length) {
double ks = (flip_B * itsReference.getQ() * solenoid.getBz() * c) /
double ks = (flip_B * itsReference.getQ() * solenoid.getBz() * Physics::c) /
(2.0 * itsReference.getP());
if(ks) {
......
......@@ -29,8 +29,6 @@
#include "FixedAlgebra/FVps.h"
#include "Physics/Physics.h"
using Physics::c;
// Class MPSplitIntegrator
// ------------------------------------------------------------------------
......@@ -82,7 +80,7 @@ void MPSplitIntegrator::trackMap(FVps<double, 6> &map,
double length = itsMultipole->getElementLength();
if(revTrack) length = - length;
BMultipoleField field = itsMultipole->getField();
double scale = (ref.getQ() * c) / (ref.getP());
double scale = (ref.getQ() * Physics::c) / (ref.getP());
if(revBeam) scale = - scale;
if(length) {
......@@ -112,7 +110,7 @@ void MPSplitIntegrator::trackParticle(OpalParticle &part, const PartData &ref,
double length = itsMultipole->getElementLength();
if(revTrack) length = - length;
BMultipoleField field = itsMultipole->getField();
double scale = (ref.getQ() * c) / (ref.getP());
double scale = (ref.getQ() * Physics::c) / (ref.getP());
if(revBeam) scale = - scale;
if(length) {
......@@ -143,7 +141,7 @@ void MPSplitIntegrator::trackBunch(PartBunchBase<double, 3> *bunch,
double length = itsMultipole->getElementLength();
if(revTrack) length = - length;
BMultipoleField field = itsMultipole->getField();
double scale = (ref.getQ() * c) / (ref.getP());
double scale = (ref.getQ() * Physics::c) / (ref.getP());
if(revBeam) scale = - scale;
if(length) {
......
......@@ -306,7 +306,7 @@ void MapAnalyser::normalizeEigen_m(cfMatrix_t& eigenVecM, cfMatrix_t& invEigenVe
for (int j = 0; j < 6; j += 2){
temp += 2 * (eigenVecM[j][i] * std::conj(eigenVecM[j+1][i])).imag();
}
temp = std::fabs(temp);
temp = std::abs(temp);
if (temp > 1e-10){
for (int j = 0; j < 6; j++){
......
This diff is collapsed.
......@@ -55,7 +55,6 @@
class Beamline;
class PartData;
using Physics::c;
#define PSdim 6
typedef FVector<double, PSdim> Vector;
......@@ -106,7 +105,7 @@ void ThickMapper::visitCorrector(const Corrector &corr) {
// Apply kick.
double scale =
(flip_s * flip_B * itsReference.getQ() * c) / itsReference.getP();
(flip_s * flip_B * itsReference.getQ() * Physics::c) / itsReference.getP();
const BDipoleField &field = corr.getField();
itsMap[PX] -= field.getBy() * scale;
itsMap[PY] += field.getBx() * scale;
......@@ -153,7 +152,7 @@ void ThickMapper::visitMultipole(const Multipole &mult) {
//std::cerr << "==> In ThickMapper::visitMultipole(const Multipole &mult)" << std::endl;
// Geometry and Field
double length = flip_s * mult.getElementLength();
double scale = (flip_B * itsReference.getQ() * c) / itsReference.getP();
double scale = (flip_B * itsReference.getQ() * Physics::c) / itsReference.getP();
const BMultipoleField &field = mult.getField();
int order = field.order();
......@@ -220,7 +219,7 @@ void ThickMapper::visitRBend(const RBend &bend) {
// Geometry and Field.
const RBendGeometry &geometry = bend.getGeometry();
double length = flip_s * geometry.getElementLength();
double scale = (flip_B * itsReference.getQ() * c) / itsReference.getP();
double scale = (flip_B * itsReference.getQ() * Physics::c) / itsReference.getP();
const BMultipoleField &field = bend.getField();
int order = field.order();
double beta_inv = 1.0 / itsReference.getBeta();
......@@ -336,7 +335,7 @@ void ThickMapper::visitRFCavity(const RFCavity &as) {
double peak = flip_s * as.getAmplitude() / itsReference.getP();
Series pt = itsMap[PT] + 1.0;
Series speed = (c * pt) / sqrt(pt * pt + kin * kin);
Series speed = (Physics::c * pt) / sqrt(pt * pt + kin * kin);
Series phase = as.getPhase() + freq * itsMap[T] / speed;
itsMap[PT] += peak * sin(phase) / pt;
......@@ -356,7 +355,7 @@ void ThickMapper::visitSBend(const SBend &bend) {
// Geometry and Field.
const PlanarArcGeometry &geometry = bend.getGeometry();
double length = flip_s * geometry.getElementLength();
double scale = (flip_B * itsReference.getQ() * c) / itsReference.getP();
double scale = (flip_B * itsReference.getQ() * Physics::c) / itsReference.getP();
const BMultipoleField &field = bend.getField();
int order = field.order();
double beta_inv = 1.0 / itsReference.getBeta();
......@@ -480,7 +479,7 @@ void ThickMapper::visitSolenoid(const Solenoid &solenoid) {
double length = flip_s * solenoid.getElementLength();
if(length != 0.0) {
double ks = (flip_B * itsReference.getQ() * solenoid.getBz() * c) /
double ks = (flip_B * itsReference.getQ() * solenoid.getBz() * Physics::c) /
(2.0 * itsReference.getP());
if(ks) {
......
......@@ -51,9 +51,8 @@
#include "FixedAlgebra/TransportFun.h"
#include "FixedAlgebra/TransportMath.h"
#include "Physics/Physics.h"
#include <cmath>
using Physics::c;
#include <cmath>
typedef FTps<double, 2> Series2;
typedef TransportFun<double, 6> TptFun;
......@@ -141,7 +140,7 @@ void TransportMapper::visitCorrector(const Corrector &corr) {
if(length) applyDrift(length / 2.0);
// Apply kick.
double scale = (flip_B * itsReference.getQ() * c) / itsReference.getP();
double scale = (flip_B * itsReference.getQ() * Physics::c) / itsReference.getP();
const BDipoleField &field = corr.getField();
itsMap[PX] -= field.getBy() * scale;
itsMap[PY] += field.getBx() * scale;
......@@ -185,7 +184,7 @@ void TransportMapper::visitMonitor(const Monitor &corr) {
void TransportMapper::visitMultipole(const Multipole &multipole) {
double length = flip_s * multipole.getElementLength();
double scale = (flip_B * itsReference.getQ() * c) / itsReference.getP();
double scale = (flip_B * itsReference.getQ() * Physics::c) / itsReference.getP();
const BMultipoleField &field = multipole.getField();
if(length) {
......@@ -212,7 +211,7 @@ void TransportMapper::visitProbe(const Probe &/*prob*/) {
void TransportMapper::visitRBend(const RBend &bend) {
const RBendGeometry &geometry = bend.getGeometry();
double length = flip_s * geometry.getElementLength();
double scale = (flip_B * itsReference.getQ() * c) / itsReference.getP();
double scale = (flip_B * itsReference.getQ() * Physics::c) / itsReference.getP();
const BMultipoleField &field = bend.getField();
if(length == 0.0) {
......@@ -271,7 +270,7 @@ void TransportMapper::visitRFCavity(const RFCavity &as) {
if(length) applyDrift(length / 2.0);
// Apply accelerating voltage.
TptFun time = itsMap[T] / (c * itsReference.getBeta());
TptFun time = itsMap[T] / (Physics::c * itsReference.getBeta());
double peak = flip_s * as.getAmplitude() / itsReference.getP();
TptFun phase = as.getPhase() + as.getFrequency() * time;
itsMap[PT] += peak * sin(phase);
......@@ -290,7 +289,7 @@ void TransportMapper::visitRFQuadrupole(const RFQuadrupole &rfq) {
void TransportMapper::visitSBend(const SBend &bend) {
const PlanarArcGeometry &geometry = bend.getGeometry();
double length = flip_s * geometry.getElementLength();
double scale = (flip_B * itsReference.getQ() * c) / itsReference.getP();
double scale = (flip_B * itsReference.getQ() * Physics::c) / itsReference.getP();
const BMultipoleField &field = bend.getField();
if(length == 0.0) {
......@@ -360,7 +359,7 @@ void TransportMapper::visitSolenoid(const Solenoid &solenoid) {
double length = flip_s * solenoid.getElementLength();
if(length) {
double ks = (flip_B * itsReference.getQ() * solenoid.getBz() * c) /
double ks = (flip_B * itsReference.getQ() * solenoid.getBz() * Physics::c) /
(2.0 * itsReference.getP());
if(ks) {
......
This diff is collapsed.
This diff is collapsed.
......@@ -27,7 +27,7 @@
#include <fstream>
#include <cmath>
#include "Fields/Interpolation/NDGrid.h" // classic
#include "AbsBeamline/Component.h" // classic
#include "Utilities/OpalException.h"
......@@ -114,7 +114,7 @@ void DumpEMFields::parseCoordinateSystem() {
}
std::string coordStr = Attributes::getString(itsAttr[13]);
for (size_t i = 0; i < coordStr.size(); ++i) {
coordStr[i] = tolower(coordStr[i]);
coordStr[i] = std::tolower(coordStr[i]);
}
if (coordStr == "cylindrical") {
coordinates_m = CYLINDRICAL;
......@@ -197,12 +197,12 @@ void DumpEMFields::writeFields(Component* field) {
void DumpEMFields::checkInt(double real, std::string name, double tolerance) {
real += tolerance; // prevent rounding error
if (fabs(floor(real) - real) > 2*tolerance) {
if (std::abs(std::floor(real) - real) > 2*tolerance) {
throw OpalException("DumpEMFields::checkInt",
"Value for "+name+
" should be an integer but a real value was found");
}
if (floor(real) < 0.5) {
if (std::floor(real) < 0.5) {
throw OpalException("DumpEMFields::checkInt",
"Value for "+name+" should be 1 or more");
}
......@@ -247,8 +247,8 @@ void DumpEMFields::writeFieldLine(Component* field,
Vector_t point = pointIn;
if (coordinates_m == CYLINDRICAL) {
// pointIn is r, phi, z
point[0] = cos(pointIn[1])*pointIn[0];
point[1] = sin(pointIn[1])*pointIn[0];
point[0] = std::cos(pointIn[1])*pointIn[0];
point[1] = std::sin(pointIn[1])*pointIn[0];
}
field->apply(point, centroid, time, E, B);
......@@ -256,10 +256,10 @@ void DumpEMFields::writeFieldLine(Component* field,
Vector_t Eout = E;
if (coordinates_m == CYLINDRICAL) {
// pointIn is r, phi, z
Bout[0] = B[0]*cos(pointIn[1])+B[1]*sin(pointIn[1]);
Bout[1] = -B[0]*sin(pointIn[1])+B[1]*cos(pointIn[1]);
Eout[0] = E[0]*cos(pointIn[1])+E[1]*sin(pointIn[1]);
Eout[1] = -E[0]*sin(pointIn[1])+E[1]*cos(pointIn[1]);
Bout[0] = B[0]*std::cos(pointIn[1])+B[1]*std::sin(pointIn[1]);
Bout[1] = -B[0]*std::sin(pointIn[1])+B[1]*std::cos(pointIn[1]);
Eout[0] = E[0]*std::cos(pointIn[1])+E[1]*std::sin(pointIn[1]);
Eout[1] = -E[0]*std::sin(pointIn[1])+E[1]*std::cos(pointIn[1]);
fout << pointIn[0] << " " << pointIn[1]*DEGREE << " " << pointIn[2] << " " << time << " ";
} else {
fout << pointIn[0] << " " << pointIn[1] << " " << pointIn[2] << " " << time << " ";
......@@ -309,5 +309,4 @@ void DumpEMFields::writeFieldThis(Component* field) {
"Something went wrong during writing "+filename_m);
}
fout.close();
}
}
\ No newline at end of file
......@@ -131,12 +131,12 @@ void DumpFields::writeFields(Component* field) {
}
void DumpFields::checkInt(double real, std::string name, double tolerance) {
if (fabs(floor(real) - real) > tolerance) {
if (std::abs(std::floor(real) - real) > tolerance) {
throw OpalException("DumpFields::checkInt",
"Value for "+name+
" should be an integer but a real value was found");
}
if (floor(real) < 0.5) {
if (std::floor(real) < 0.5) {
throw OpalException("DumpFields::checkInt",
"Value for "+name+" should be 1 or more");
}
......@@ -183,4 +183,4 @@ void DumpFields::writeFieldThis(Component* field) {
"Something went wrong during writing "+filename_m);
}
fout.close();
}
}
\ No newline at end of file
......@@ -286,12 +286,12 @@ double BeamStripping::checkPressure(const double &x, const double &y) {
double tet = tempv;
if((x < 0) && (y >= 0)) tet = Physics::pi + tempv;
else if((x < 0) && (y <= 0)) tet = Physics::pi + tempv;
else if((x > 0) && (y <= 0)) tet = 2.0 * Physics::pi + tempv;
else if((x > 0) && (y <= 0)) tet = Physics::two_pi + tempv;
else if((x == 0) && (y > 0)) tet = Physics::pi / 2.0;
else if((x == 0) && (y < 0)) tet = 1.5 * Physics::pi;
// the actual angle of particle
tet = tet / Physics::pi * 180.0;
tet = tet * Physics::rad2deg;
// the corresponding angle on the field map
// Note: this does not work if the start point of field map does not equal zero.
......
This diff is collapsed.
......@@ -166,5 +166,4 @@ void CCollimator::doSetGeom() {
// *gmsg << "point " << i << " ( " << geom_m[i].x << ", " << geom_m[i].y << ")" << endl;
// }
// *gmsg << "rmin " << rmin_m << " rmax " << rmax_m << endl;
}
}
\ No newline at end of file
......@@ -25,7 +25,6 @@
#include "Utilities/GeneralClassicException.h"
#include "Utilities/Util.h"
extern Inform *gmsg;
// Class Corrector
// ------------------------------------------------------------------------
......@@ -116,7 +115,7 @@ void Corrector::goOnline(const double &) {
}
if (!kickFieldSet_m) {
const double momentum = sqrt(std::pow(designEnergy_m, 2.0) + 2.0 * designEnergy_m * RefPartBunch_m->getM());
const double momentum = std::sqrt(std::pow(designEnergy_m, 2.0) + 2.0 * designEnergy_m * RefPartBunch_m->getM());
const double magnitude = momentum / (Physics::c * pathLength);
kickField_m = magnitude * RefPartBunch_m->getQ() * Vector_t(kickY_m, -kickX_m, 0.0);
}
......@@ -132,7 +131,7 @@ void Corrector::setDesignEnergy(const double& ekin, bool changeable) {
if (RefPartBunch_m) {
if (!kickFieldSet_m) {
const double pathLength = getGeometry().getElementLength();
const double momentum = sqrt(std::pow(designEnergy_m, 2.0) + 2.0 * designEnergy_m * RefPartBunch_m->getM());
const double momentum = std::sqrt(std::pow(designEnergy_m, 2.0) + 2.0 * designEnergy_m * RefPartBunch_m->getM());
const double magnitude = momentum / (Physics::c * pathLength);
kickField_m = magnitude * RefPartBunch_m->getQ() * Vector_t(kickY_m, -kickX_m, 0.0);
}
......
......@@ -28,7 +28,6 @@ throw GeneralClassicException("Cyclotron::getFieldFromFile",\
extern Inform *gmsg;
using Physics::pi;
// Class Cyclotron
// ------------------------------------------------------------------------
......@@ -407,16 +406,16 @@ bool Cyclotron::apply(const Vector_t &R, const Vector_t &/*P*/,
/* if((R[0] > 0) && (R[1] >= 0)) tet = tempv;
else*/
if ((R[0] < 0) && (R[1] >= 0)) tet = pi + tempv;
else if((R[0] < 0) && (R[1] <= 0)) tet = pi + tempv;
else if((R[0] > 0) && (R[1] <= 0)) tet = 2.0 * pi + tempv;
else if((R[0] == 0) && (R[1] > 0)) tet = pi / 2.0;
else if((R[0] == 0) && (R[1] < 0)) tet = 1.5 * pi;
if ((R[0] < 0) && (R[1] >= 0)) tet = Physics::pi + tempv;
else if((R[0] < 0) && (R[1] <= 0)) tet = Physics::pi + tempv;
else if((R[0] > 0) && (R[1] <= 0)) tet = Physics::two_pi + tempv;
else if((R[0] == 0) && (R[1] > 0)) tet = Physics::pi / 2.0;
else if((R[0] == 0) && (R[1] < 0)) tet = 1.5 * Physics::pi;
double tet_rad = tet;
// the actual angle of particle in degree
tet = tet / pi * 180.0;
tet *= Physics::rad2deg;
// Necessary for gap phase output -DW
if (0 <= tet && tet <= 45) waiting_for_gap = 1;
......@@ -438,8 +437,8 @@ bool Cyclotron::apply(const Vector_t &R, const Vector_t &/*P*/,
this->applyTrimCoil(rad, R[2], tet_rad, br, bz);
/* Br Btheta -> Bx By */
B[0] = br * cos(tet_rad) - bt * sin(tet_rad);
B[1] = br * sin(tet_rad) + bt * cos(tet_rad);
B[0] = br * std::cos(tet_rad) - bt * std::sin(tet_rad);
B[1] = br * std::sin(tet_rad) + bt * std::cos(tet_rad);
B[2] = bz;
} else {
return true;
......@@ -495,18 +494,18 @@ bool Cyclotron::apply(const Vector_t &R, const Vector_t &/*P*/,
}
}
double phase = 2.0 * pi * 1.0E-3 * frequency * t + (*rfphii); // f in [MHz], t in [ns]
double phase = Physics::two_pi * 1.0E-3 * frequency * t + (*rfphii); // f in [MHz], t in [ns]
E += ebscale * cos(phase) * tmpE;
B -= ebscale * sin(phase) * tmpB;
E += ebscale * std::cos(phase) * tmpE;
B -= ebscale * std::sin(phase) * tmpB;
if(myBFieldType_m != SYNCHRO)
continue;
// Some phase output -DW
double phase_print = phase * Physics::rad2deg;
if (tet >= 90.0 && waiting_for_gap == 1) {
double phase_print = 180.0 * phase / pi;
phase_print = fmod(phase_print, 360) - 360.0;
phase_print = std::fmod(phase_print, 360) - 360.0;
*gmsg << endl << "Gap 1 phase = " << phase_print << " Deg" << endl;
*gmsg << "Gap 1 E-Field = (" << E[0] << "/" << E[1] << "/" << E[2] << ")" << endl;
......@@ -516,9 +515,7 @@ bool Cyclotron::apply(const Vector_t &R, const Vector_t &/*P*/,
waiting_for_gap = 2;
}
else if (tet >= 270.0 && waiting_for_gap == 2) {
double phase_print = 180.0 * phase / pi;
phase_print = fmod(phase_print, 360) - 360.0;
phase_print = std::fmod(phase_print, 360) - 360.0;
*gmsg << endl << "Gap 2 phase = " << phase_print << " Deg" << endl;
*gmsg << "Gap 2 E-Field = (" << E[0] << "/" << E[1] << "/" << E[2] << ")" << endl;
......@@ -684,7 +681,7 @@ bool Cyclotron::interpolate(const double& rad,
// the corresponding angle on the field map
// Note: this does not work if the start point of field map does not equal zero.
double tet_map = fmod(tet_rad / Physics::pi * 180.0, 360.0 / symmetry_m);
double tet_map = std::fmod(tet_rad * Physics::rad2deg, 360.0 / symmetry_m);
double xit = tet_map / BP.dtet;
......@@ -821,7 +818,7 @@ void Cyclotron::getdiffs() {
for(int k = 0; k < Bfield.ntet; k++) {
double dtheta = pi / 180.0 * BP.dtet;
double dtheta = Physics::deg2rad * BP.dtet;
int kEdge;
......@@ -907,8 +904,8 @@ void Cyclotron::getdiffs() {
for(int i = 0; i< Bfield.nrad; i++){
for(int j = 0; j< Bfield.ntetS; j++){
int index = idx(i,j);
double x = (BP.rmin+i*BP.delr) * sin(j*BP.dtet*pi/180.0);
double y = (BP.rmin+i*BP.delr) * cos(j*BP.dtet*pi/180.0);
double x = (BP.rmin+i*BP.delr) * std::sin(j*BP.dtet*pi/180.0);
double y = (BP.rmin+i*BP.delr) * std::cos(j*BP.dtet*pi/180.0);
*gmsg<<"x= "<<x<<" y= "<<y<<" B= "<<Bfield.bfld[index]<<endl;
}
}
......
......@@ -31,8 +31,6 @@
extern Inform *gmsg;
using namespace std;
// Class Degrader
// ------------------------------------------------------------------------
......@@ -91,7 +89,7 @@ bool Degrader::apply(const size_t &i, const double &t, Vector_t &/*E*/, Vector_t
const Vector_t &R = RefPartBunch_m->R[i];
const Vector_t &P = RefPartBunch_m->P[i];
const double recpgamma = Physics::c * RefPartBunch_m->dt[i] / sqrt(1.0 + dot(P, P));
const double recpgamma = Physics::c * RefPartBunch_m->dt[i] / std::sqrt(1.0 + dot(P, P));
if(isInMaterial(R(2))) {
//if particle was allready marked as -1 (it means it should have gone into degrader but didn't)
......@@ -183,7 +181,7 @@ void Degrader::setOutputFN(std::string fn) {
filename_m = fn;
}
string Degrader::getOutputFN() {
std::string Degrader::getOutputFN() {
if (filename_m == std::string(""))
return getName();
else
......@@ -200,8 +198,7 @@ ElementBase::ElementType Degrader::getType() const {
return DEGRADER;
}
string Degrader::getDegraderShape() {
std::string Degrader::getDegraderShape() {
return "DEGRADER";
}
}
\ No newline at end of file
......@@ -31,7 +31,6 @@
#include "Solvers/WakeFunction.hh"
#include "Solvers/ParticleMatterInteractionHandler.hh"
using namespace std;
// Class ElementBase
// ------------------------------------------------------------------------
......@@ -139,7 +138,7 @@ void ElementBase::setAttribute(const std::string &aKey, double val) {
*aChannel = val;
delete aChannel;
} else
cout << "Channel NULL or not Settable" << endl;
std::cout << "Channel NULL or not Settable" << std::endl;
}
......
......@@ -90,7 +90,7 @@ bool FlexibleCollimator::apply(const size_t &i, const double &t, Vector_t &/*E*/
const Vector_t &R = RefPartBunch_m->R[i];
const Vector_t &P = RefPartBunch_m->P[i];
const double &dt = RefPartBunch_m->dt[i];
const double recpgamma = Physics::c * dt / sqrt(1.0 + dot(P, P));
const double recpgamma = Physics::c * dt / std::sqrt(1.0 + dot(P, P));
bool pdead = isStopped(R, P, recpgamma);
if (pdead) {
......@@ -269,6 +269,4 @@ void FlexibleCollimator::writeHolesAndQuadtree(const std::string &baseFilename)
out.close();
}
}
}
\ No newline at end of file
......@@ -32,7 +32,6 @@
#include <fstream>
#include <memory>
using namespace std;
// Class Monitor
// ------------------------------------------------------------------------
......@@ -225,5 +224,4 @@ void Monitor::writeStatistics() {
}
statFileEntries_sm.clear();
}
}
\ No newline at end of file
......@@ -26,10 +26,10 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "MultipoleTBase.h"
#include <gsl/gsl_sf_gamma.h>