Commit 2c83690a authored by kraus's avatar kraus Committed by kraus
Browse files

Resolve "Orbit threader throws an exception when TRACKBACK = TRUE and...

Resolve "Orbit threader throws an exception when TRACKBACK = TRUE and traveling wave structure present"
parent ebb89c52
......@@ -61,9 +61,9 @@ RFCavity::RFCavity(const RFCavity &right):
autophaseVeto_m(right.autophaseVeto_m),
designEnergy_m(right.designEnergy_m),
fieldmap_m(right.fieldmap_m),
length_m(right.length_m),
startField_m(right.startField_m),
endField_m(right.endField_m),
length_m(right.length_m),
type_m(right.type_m),
rmin_m(right.rmin_m),
rmax_m(right.rmax_m),
......@@ -97,9 +97,9 @@ RFCavity::RFCavity(const std::string &name):
autophaseVeto_m(false),
designEnergy_m(-1.0),
fieldmap_m(nullptr),
length_m(0.0),
startField_m(0.0),
endField_m(0.0),
length_m(0.0),
type_m(SW),
rmin_m(0.0),
rmax_m(0.0),
......@@ -112,9 +112,6 @@ RFCavity::RFCavity(const std::string &name):
RNormal_m(nullptr),
VrNormal_m(nullptr),
DvDr_m(nullptr),
// RNormal_m(std::nullptr_t(NULL)),
// VrNormal_m(std::nullptr_t(NULL)),
// DvDr_m(std::nullptr_t(NULL)),
num_points_m(0)
{
setElType(isRF);
......@@ -122,13 +119,6 @@ RFCavity::RFCavity(const std::string &name):
RFCavity::~RFCavity() {
// FIXME: in deleteFielmak, a map find makes problems
// Fieldmap::deleteFieldmap(filename_m);
//~ if(RNormal_m) {
//~ delete[] RNormal_m;
//~ delete[] VrNormal_m;
//~ delete[] DvDr_m;
//~ }
}
void RFCavity::accept(BeamlineVisitor &visitor) const {
......@@ -252,6 +242,7 @@ bool RFCavity::applyToReferenceParticle(const Vector_t &R,
void RFCavity::initialise(PartBunchBase<double, 3> *bunch, double &startField, double &endField) {
using Physics::two_pi;
startField_m = endField_m = 0.0;
if (bunch == NULL) {
startField = startField_m;
endField = endField_m;
......@@ -265,29 +256,30 @@ void RFCavity::initialise(PartBunchBase<double, 3> *bunch, double &startField, d
RefPartBunch_m = bunch;
fieldmap_m = Fieldmap::getFieldmap(filename_m, fast_m);
fieldmap_m->getFieldDimensions(startField_m, endField_m, rBegin, rEnd);
if(endField_m > startField_m) {
msg << level2 << getName() << " using file ";
fieldmap_m->getInfo(&msg);
if(std::abs((frequency_m - fieldmap_m->getFrequency()) / frequency_m) > 0.01) {
errormsg << "FREQUENCY IN INPUT FILE DIFFERENT THAN IN FIELD MAP '" << filename_m << "';\n"
<< frequency_m / two_pi * 1e-6 << " MHz <> "
<< fieldmap_m->getFrequency() / two_pi * 1e-6 << " MHz; TAKE ON THE LATTER";
std::string errormsg_str = Fieldmap::typeset_msg(errormsg.str(), "warning");
ERRORMSG(errormsg_str << "\n" << endl);
if(Ippl::myNode() == 0) {
std::ofstream omsg("errormsg.txt", std::ios_base::app);
omsg << errormsg_str << std::endl;
omsg.close();
}
frequency_m = fieldmap_m->getFrequency();
if (endField_m <= startField_m) {
throw GeneralClassicException("RFCavity::initialise",
"The length of the field map '" + filename_m + "' is zero or negativ");
}
msg << level2 << getName() << " using file ";
fieldmap_m->getInfo(&msg);
if(std::abs((frequency_m - fieldmap_m->getFrequency()) / frequency_m) > 0.01) {
errormsg << "FREQUENCY IN INPUT FILE DIFFERENT THAN IN FIELD MAP '" << filename_m << "';\n"
<< frequency_m / two_pi * 1e-6 << " MHz <> "
<< fieldmap_m->getFrequency() / two_pi * 1e-6 << " MHz; TAKE ON THE LATTER";
std::string errormsg_str = Fieldmap::typeset_msg(errormsg.str(), "warning");
ERRORMSG(errormsg_str << "\n" << endl);
if(Ippl::myNode() == 0) {
std::ofstream omsg("errormsg.txt", std::ios_base::app);
omsg << errormsg_str << std::endl;
omsg.close();
}
length_m = endField_m - startField_m;
endField = startField + length_m;
} else {
endField = startField - 1e-3;
frequency_m = fieldmap_m->getFrequency();
}
length_m = endField_m - startField_m;
endField = startField + length_m;
}
// In current version ,this function reads in the cavity voltage profile data from file.
......@@ -783,9 +775,9 @@ pair<double, double> RFCavity::trackOnAxisParticle(const double &p0,
integrator.push(z, p, dt);
z *= cdt;
Ef = 0.0;
Bf = 0.0;
if(z(2) >= zbegin && z(2) <= zend) {
Ef = 0.0;
Bf = 0.0;
applyToReferenceParticle(z, p, t + 0.5 * dt, Ef, Bf);
}
integrator.kick(z, p, Ef, Bf, dt);
......
......@@ -228,11 +228,13 @@ protected:
bool autophaseVeto_m;
double designEnergy_m;
private:
Fieldmap* fieldmap_m;
double length_m;
double startField_m; /**< starting point of field(m)*/
private:
double endField_m;
double length_m;
CavityType type_m;
......
......@@ -40,52 +40,39 @@ TravelingWave::TravelingWave():
TravelingWave::TravelingWave(const TravelingWave &right):
RFCavity(right),
CoreFieldmap_m(NULL),
scaleCore_m(right.scaleCore_m),
scaleCoreError_m(right.scaleCoreError_m),
phaseCore1_m(right.phaseCore1_m),
phaseCore2_m(right.phaseCore2_m),
phaseExit_m(right.phaseExit_m),
length_m(right.length_m),
startCoreField_m(right.startCoreField_m),
startExitField_m(right.startExitField_m),
mappedStartExitField_m(right.mappedStartExitField_m),
PeriodLength_m(right.PeriodLength_m),
NumCells_m(right.NumCells_m),
CellLength_m(right.CellLength_m),
Mode_m(right.Mode_m),
fast_m(right.fast_m),
autophaseVeto_m(right.autophaseVeto_m),
designEnergy_m(right.designEnergy_m)
Mode_m(right.Mode_m)
{}
TravelingWave::TravelingWave(const std::string &name):
RFCavity(name),
CoreFieldmap_m(NULL),
scaleCore_m(1.0),
scaleCoreError_m(0.0),
phaseCore1_m(0.0),
phaseCore2_m(0.0),
phaseExit_m(0.0),
length_m(0.0),
startCoreField_m(0.0),
startExitField_m(0.0),
mappedStartExitField_m(0.0),
PeriodLength_m(0.0),
NumCells_m(1),
CellLength_m(0.0),
Mode_m(1),
fast_m(true),
autophaseVeto_m(false),
designEnergy_m(-1.0)
Mode_m(1)
{}
TravelingWave::~TravelingWave() {
// Fieldmap::deleteFieldmap(filename_m);
// Fieldmap::deleteFieldmap(EntryFilename_m);
// Fieldmap::deleteFieldmap(ExitFilename_m);
}
......@@ -114,9 +101,9 @@ void TravelingWave::addKR(int i, double t, Vector_t &K) {
if(tmpA0(2) < startCoreField_m) {
wtf = frequency_m * t + phase_m;
CoreFieldmap_m->getFieldstrength(tmpA0, tmpE, tmpB);
CoreFieldmap_m->getFieldDerivative(tmpA0, tmpE_diff, tmpB_diff, zdir);
k = scale_m * (tmpE_diff(2) * cos(wtf) - b * frequency_m * tmpE(2) * sin(wtf) / Physics::c);
fieldmap_m->getFieldstrength(tmpA0, tmpE, tmpB);
fieldmap_m->getFieldDerivative(tmpA0, tmpE_diff, tmpB_diff, zdir);
k = scale_m * (tmpE_diff(2) * std::cos(wtf) - b * frequency_m * tmpE(2) * std::sin(wtf) / Physics::c);
} else if(tmpA0(2) < startExitField_m) {
......@@ -130,9 +117,9 @@ void TravelingWave::addKR(int i, double t, Vector_t &K) {
tmpE_diff = 0.0;
tmpB_diff = 0.0;
CoreFieldmap_m->getFieldstrength(tmpA0, tmpE, tmpB);
CoreFieldmap_m->getFieldDerivative(tmpA0, tmpE_diff, tmpB_diff, zdir);
k = scaleCore_m * (tmpE_diff(2) * cos(wtf) - b * frequency_m * tmpE(2) * sin(wtf) / Physics::c);
fieldmap_m->getFieldstrength(tmpA0, tmpE, tmpB);
fieldmap_m->getFieldDerivative(tmpA0, tmpE_diff, tmpB_diff, zdir);
k = scaleCore_m * (tmpE_diff(2) * std::cos(wtf) - b * frequency_m * tmpE(2) * std::sin(wtf) / Physics::c);
wtf = frequency_m * t + phaseCore2_m;
tmpA0(2) = z + CellLength_m;
......@@ -143,9 +130,9 @@ void TravelingWave::addKR(int i, double t, Vector_t &K) {
tmpE_diff = 0.0;
tmpB_diff = 0.0;
CoreFieldmap_m->getFieldstrength(tmpA0, tmpE, tmpB);
CoreFieldmap_m->getFieldDerivative(tmpA0, tmpE_diff, tmpB_diff, zdir);
k += scaleCore_m * (tmpE_diff(2) * cos(wtf) - b * frequency_m * tmpE(2) * sin(wtf) / Physics::c);
fieldmap_m->getFieldstrength(tmpA0, tmpE, tmpB);
fieldmap_m->getFieldDerivative(tmpA0, tmpE_diff, tmpB_diff, zdir);
k += scaleCore_m * (tmpE_diff(2) * std::cos(wtf) - b * frequency_m * tmpE(2) * std::sin(wtf) / Physics::c);
} else {
......@@ -156,9 +143,9 @@ void TravelingWave::addKR(int i, double t, Vector_t &K) {
tmpE_diff = 0.0;
tmpB_diff = 0.0;
CoreFieldmap_m->getFieldstrength(tmpA0, tmpE, tmpB);
CoreFieldmap_m->getFieldDerivative(tmpA0, tmpE_diff, tmpB_diff, zdir);
k = scale_m * (tmpE_diff(2) * cos(wtf) - b * frequency_m * tmpE(2) * sin(wtf) / Physics::c);
fieldmap_m->getFieldstrength(tmpA0, tmpE, tmpB);
fieldmap_m->getFieldDerivative(tmpA0, tmpE_diff, tmpB_diff, zdir);
k = scale_m * (tmpE_diff(2) * std::cos(wtf) - b * frequency_m * tmpE(2) * std::sin(wtf) / Physics::c);
}
......@@ -227,7 +214,7 @@ bool TravelingWave::apply(const Vector_t &R, const Vector_t &P, const double &t,
Vector_t tmpE(0.0, 0.0, 0.0), tmpB(0.0, 0.0, 0.0);
if (tmpR(2) < startCoreField_m) {
if (!CoreFieldmap_m->isInside(tmpR)) return true;
if (!fieldmap_m->isInside(tmpR)) return true;
tmpcos = (scale_m + scaleError_m) * cos(frequency_m * t + phase_m + phaseError_m);
tmpsin = -(scale_m + scaleError_m) * sin(frequency_m * t + phase_m + phaseError_m);
......@@ -238,11 +225,11 @@ bool TravelingWave::apply(const Vector_t &R, const Vector_t &P, const double &t,
const double z = tmpR(2);
tmpR(2) = tmpR(2) - PeriodLength_m * floor(tmpR(2) / PeriodLength_m);
tmpR(2) += startCoreField_m;
if (!CoreFieldmap_m->isInside(tmpR)) return true;
if (!fieldmap_m->isInside(tmpR)) return true;
tmpcos = (scaleCore_m + scaleCoreError_m) * cos(frequency_m * t + phaseCore1_m + phaseError_m);
tmpsin = -(scaleCore_m + scaleCoreError_m) * sin(frequency_m * t + phaseCore1_m + phaseError_m);
CoreFieldmap_m->getFieldstrength(tmpR, tmpE, tmpB);
tmpcos = (scaleCore_m + scaleCoreError_m) * std::cos(frequency_m * t + phaseCore1_m + phaseError_m);
tmpsin = -(scaleCore_m + scaleCoreError_m) * std::sin(frequency_m * t + phaseCore1_m + phaseError_m);
fieldmap_m->getFieldstrength(tmpR, tmpE, tmpB);
E += tmpcos * tmpE;
B += tmpsin * tmpB;
......@@ -258,12 +245,12 @@ bool TravelingWave::apply(const Vector_t &R, const Vector_t &P, const double &t,
} else {
tmpR(2) -= mappedStartExitField_m;
if (!CoreFieldmap_m->isInside(tmpR)) return true;
tmpcos = (scale_m + scaleError_m) * cos(frequency_m * t + phaseExit_m + phaseError_m);
tmpsin = -(scale_m + scaleError_m) * sin(frequency_m * t + phaseExit_m + phaseError_m);
if (!fieldmap_m->isInside(tmpR)) return true;
tmpcos = (scale_m + scaleError_m) * std::cos(frequency_m * t + phaseExit_m + phaseError_m);
tmpsin = -(scale_m + scaleError_m) * std::sin(frequency_m * t + phaseExit_m + phaseError_m);
}
CoreFieldmap_m->getFieldstrength(tmpR, tmpE, tmpB);
fieldmap_m->getFieldstrength(tmpR, tmpE, tmpB);
E += tmpcos * tmpE;
B += tmpsin * tmpB;
......@@ -280,9 +267,9 @@ bool TravelingWave::applyToReferenceParticle(const Vector_t &R, const Vector_t &
Vector_t tmpE(0.0, 0.0, 0.0), tmpB(0.0, 0.0, 0.0);
if (tmpR(2) < startCoreField_m) {
if (!CoreFieldmap_m->isInside(tmpR)) return true;
tmpcos = scale_m * cos(frequency_m * t + phase_m);
tmpsin = -scale_m * sin(frequency_m * t + phase_m);
if (!fieldmap_m->isInside(tmpR)) return true;
tmpcos = scale_m * std::cos(frequency_m * t + phase_m);
tmpsin = -scale_m * std::sin(frequency_m * t + phase_m);
} else if (tmpR(2) < startExitField_m) {
Vector_t tmpE2(0.0, 0.0, 0.0), tmpB2(0.0, 0.0, 0.0);
......@@ -290,11 +277,11 @@ bool TravelingWave::applyToReferenceParticle(const Vector_t &R, const Vector_t &
const double z = tmpR(2);
tmpR(2) = tmpR(2) - PeriodLength_m * floor(tmpR(2) / PeriodLength_m);
tmpR(2) += startCoreField_m;
if (!CoreFieldmap_m->isInside(tmpR)) return true;
if (!fieldmap_m->isInside(tmpR)) return true;
tmpcos = scaleCore_m * cos(frequency_m * t + phaseCore1_m);
tmpsin = -scaleCore_m * sin(frequency_m * t + phaseCore1_m);
CoreFieldmap_m->getFieldstrength(tmpR, tmpE, tmpB);
tmpcos = scaleCore_m * std::cos(frequency_m * t + phaseCore1_m);
tmpsin = -scaleCore_m * std::sin(frequency_m * t + phaseCore1_m);
fieldmap_m->getFieldstrength(tmpR, tmpE, tmpB);
E += tmpcos * tmpE;
B += tmpsin * tmpB;
......@@ -310,14 +297,13 @@ bool TravelingWave::applyToReferenceParticle(const Vector_t &R, const Vector_t &
} else {
tmpR(2) -= mappedStartExitField_m;
if (!CoreFieldmap_m->isInside(tmpR)) return true;
if (!fieldmap_m->isInside(tmpR)) return true;
tmpcos = scale_m * cos(frequency_m * t + phaseExit_m);
tmpsin = -scale_m * sin(frequency_m * t + phaseExit_m);
}
CoreFieldmap_m->getFieldstrength(tmpR, tmpE, tmpB);
fieldmap_m->getFieldstrength(tmpR, tmpE, tmpB);
E += tmpcos * tmpE;
B += tmpsin * tmpB;
......@@ -338,53 +324,26 @@ void TravelingWave::initialise(PartBunchBase<double, 3> *bunch, double &startFie
std::stringstream errormsg;
RefPartBunch_m = bunch;
CoreFieldmap_m = Fieldmap::getFieldmap(filename_m, fast_m);
if(CoreFieldmap_m != NULL) {
double zBegin = 0.0, zEnd = 0.0, rBegin = 0.0, rEnd = 0.0;
CoreFieldmap_m->getFieldDimensions(zBegin, zEnd, rBegin, rEnd);
if(zEnd > zBegin) {
msg << level2 << getName() << " using file ";
CoreFieldmap_m->getInfo(&msg);
if(std::abs((frequency_m - CoreFieldmap_m->getFrequency()) / frequency_m) > 0.01) {
errormsg << "FREQUENCY IN INPUT FILE DIFFERENT THAN IN FIELD MAP '" << filename_m + "';\n"
<< frequency_m / two_pi * 1e-6 << " MHz <> "
<< CoreFieldmap_m->getFrequency() / two_pi * 1e-6 << " MHz; TAKE ON THE LATTER\n";
std::string errormsg_str = Fieldmap::typeset_msg(errormsg.str(), "warning");
*gmsg << errormsg_str << endl;
ERRORMSG(errormsg_str << "\n" << endl);
if(Ippl::myNode() == 0) {
std::ofstream omsg("errormsg.txt", std::ios_base::app);
omsg << errormsg_str << std::endl;
omsg.close();
}
frequency_m = CoreFieldmap_m->getFrequency();
}
PeriodLength_m = (zEnd - zBegin) / 2.0;
CellLength_m = PeriodLength_m * Mode_m;
startCoreField_m = PeriodLength_m / 2.0;
startExitField_m = startCoreField_m + (NumCells_m - 1) * CellLength_m;
mappedStartExitField_m = startExitField_m - 3.0 * PeriodLength_m / 2.0;
startField = -PeriodLength_m / 2.0;
endField = startField + startExitField_m + PeriodLength_m / 2.0;
length_m = endField - startField;
scaleCore_m = scale_m / sin(2.0 * pi * Mode_m);
scaleCoreError_m = scaleError_m / sin(2.0 * pi * Mode_m);
phaseCore1_m = phase_m + pi * Mode_m / 2.0;
phaseCore2_m = phase_m + pi * Mode_m * 1.5;
phaseExit_m = phase_m - 2.0 * pi * ((NumCells_m - 1) * Mode_m - floor((NumCells_m - 1) * Mode_m));
} else {
endField = startField - 1e-3;
}
} else {
endField = startField - 1e-3;
}
double zBegin = 0.0, zEnd = 0.0;
RFCavity::initialise(bunch, zBegin, zEnd);
PeriodLength_m = (zEnd - zBegin) / 2.0;
CellLength_m = PeriodLength_m * Mode_m;
startField_m = -0.5 * PeriodLength_m;
startCoreField_m = PeriodLength_m / 2.0;
startExitField_m = startCoreField_m + (NumCells_m - 1) * CellLength_m;
mappedStartExitField_m = startExitField_m - 3.0 * PeriodLength_m / 2.0;
startField = -PeriodLength_m / 2.0;
endField = startField + startExitField_m + PeriodLength_m / 2.0;
length_m = endField - startField;
scaleCore_m = scale_m / std::sin(2.0 * pi * Mode_m);
scaleCoreError_m = scaleError_m / std::sin(2.0 * pi * Mode_m);
phaseCore1_m = phase_m + pi * Mode_m / 2.0;
phaseCore2_m = phase_m + pi * Mode_m * 1.5;
phaseExit_m = phase_m - 2.0 * pi * ((NumCells_m - 1) * Mode_m - std::floor((NumCells_m - 1) * Mode_m));
}
void TravelingWave::finalise()
......@@ -435,7 +394,7 @@ double TravelingWave::getAutoPhaseEstimate(const double &E0, const double &t0, c
double phaseC2 = phaseCore2_m - phase_m;
double phaseE = phaseExit_m - phase_m;
CoreFieldmap_m->getOnaxisEz(F);
fieldmap_m->getOnaxisEz(F);
if(F.size() == 0) return 0.0;
N1 = static_cast<int>(floor(F.size() / 4.)) + 1;
......@@ -560,103 +519,6 @@ double TravelingWave::getAutoPhaseEstimate(const double &E0, const double &t0, c
return phi;
}
std::pair<double, double> TravelingWave::trackOnAxisParticle(const double &p0,
const double &t0,
const double &dt,
const double &q,
const double &mass,
std::ofstream *out) {
double phase = frequency_m * t0 + phase_m;
double p = p0;
double t = t0;
double cdt = Physics::c * dt;
double dphi = frequency_m * dt;
std::vector<std::pair<double, double> > F;
CoreFieldmap_m->getOnaxisEz(F);
double *zvals = new double[F.size()];
double *onAxisField = new double[F.size()];
double Ezmax = 0.0;
for(unsigned int i = 0; i < F.size(); ++i) {
zvals[i] = F[i].first;
onAxisField[i] = F[i].second;
if(std::abs(onAxisField[i]) > Ezmax) Ezmax = std::abs(onAxisField[i]);
}
// Ezmax /= 1e6;
double z = zvals[0];
double zbegin = z;
gsl_spline *onAxisInterpolants = gsl_spline_alloc(gsl_interp_cspline, F.size());
gsl_interp_accel *onAxisAccel = gsl_interp_accel_alloc();
gsl_spline_init(onAxisInterpolants, zvals, onAxisField, F.size());
delete[] zvals;
delete[] onAxisField;
if (out) *out << std::setw(18) << z
<< std::setw(18) << Util::getEnergy(p, mass)
<< std::endl;
double dz = 0.5 * p / sqrt(1.0 + p * p) * cdt;
while(z + dz < startCoreField_m + zbegin) {
z += dz;
double ez = scale_m / Ezmax * cos(phase) * gsl_spline_eval(onAxisInterpolants, z, onAxisAccel);
p += ez * q * cdt / mass;
dz = 0.5 * p / sqrt(1.0 + p * p) * cdt;
z += 0.5 * p / sqrt(1.0 + p * p) * cdt;
phase += dphi;
t += dt;
}
double phase2 = phase - phase_m + phaseCore2_m;
phase = phase - phase_m + phaseCore1_m;
while(z + dz < startExitField_m + zbegin) {
z += dz;
double tmpz = z - (startCoreField_m + zbegin);
tmpz -= PeriodLength_m * floor(tmpz / PeriodLength_m);
tmpz += startCoreField_m + zbegin;
double ez = scaleCore_m / Ezmax * cos(phase) * gsl_spline_eval(onAxisInterpolants, tmpz, onAxisAccel);
tmpz = z - (startCoreField_m + zbegin) + CellLength_m;
tmpz -= PeriodLength_m * floor(tmpz / PeriodLength_m);
tmpz += startCoreField_m + zbegin;
ez += scaleCore_m / Ezmax * cos(phase2) * gsl_spline_eval(onAxisInterpolants, tmpz, onAxisAccel);
p += ez * q * cdt / mass;
dz = 0.5 * p / sqrt(1.0 + p * p) * cdt;
z += dz;
phase += dphi;
phase2 += dphi;
t += dt;
if (out) *out << std::setw(18) << z
<< std::setw(18) << Util::getEnergy(p, mass)
<< std::endl;
}
phase = phase - phaseCore1_m + phaseExit_m;
while(z + dz < startExitField_m + 0.5 * PeriodLength_m + zbegin) {
z += dz;
double tmpz = z - (startExitField_m + zbegin);
tmpz -= PeriodLength_m * floor(tmpz / PeriodLength_m);
tmpz += 3.0 * PeriodLength_m / 2.0;
double ez = scale_m / Ezmax * cos(phase) * gsl_spline_eval(onAxisInterpolants, tmpz, onAxisAccel);
p += ez * q * cdt / mass;
dz = 0.5 * p / sqrt(1.0 + p * p) * cdt;
z += dz;
phase += dphi;
t += dt;
}
gsl_spline_free(onAxisInterpolants);
gsl_interp_accel_free(onAxisAccel);
const double beta = sqrt(1. - 1 / (p * p + 1.));
const double tErr = (z - (startExitField_m + 0.5 * PeriodLength_m + zbegin)) / (Physics::c * beta);
return std::pair<double, double>(p, t - tErr);
}
bool TravelingWave::isInside(const Vector_t &r) const {
return (isInsideTransverse(r) && r(2) >= -0.5 * PeriodLength_m && r(2) < startExitField_m);
}
\ No newline at end of file
}
......@@ -66,13 +66,6 @@ public:
virtual double getAutoPhaseEstimate(const double & E0, const double & t0, const double & q, const double & m) override;
virtual std::pair<double, double> trackOnAxisParticle(const double & p0,
const double & t0,
const double & dt,
const double & q,
const double & mass,
std::ofstream *out = NULL) override;
virtual void addKR(int i, double t, Vector_t &K) override;
virtual void addKT(int i, double t, Vector_t &K) override;
......@@ -107,10 +100,6 @@ public:
virtual CoordinateSystemTrafo getEdgeToEnd() const override;
private:
Fieldmap *CoreFieldmap_m;
/* Fieldmap *EntryFringeField_m; */
/* Fieldmap *ExitFringeField_m; */
double scaleCore_m;
double scaleCoreError_m;
......@@ -118,7 +107,6 @@ private:
double phaseCore2_m;
double phaseExit_m;
double length_m;
double startCoreField_m; /**< starting point of field(m)*/
double startExitField_m;
double mappedStartExitField_m;
......@@ -128,11 +116,6 @@ private:
double CellLength_m;
double Mode_m;
bool fast_m;
bool autophaseVeto_m;
double designEnergy_m;
inline double getdE(const int & i,
const int & I,
const std::vector<double> & t,
......@@ -258,4 +241,4 @@ CoordinateSystemTrafo TravelingWave::getEdgeToEnd() const
return ret;
}
#endif // CLASSIC_TravelingWave_HH
#endif // CLASSIC_TravelingWave_HH
\ No newline at end of file
......@@ -33,11 +33,11 @@ Astra1DDynamic::Astra1DDynamic(std::string aFilename):
if (file.good()) {
bool parsing_passed = true;
try {
parsing_passed = interpreteLine<std::string, int>(file,
parsing_passed = interpretLine<std::string, int>(file,
tmpString,
accuracy_m);
} catch (GeneralClassicException &e) {
parsing_passed = interpreteLine<std::string, int, std::string>(file,
parsing_passed = interpretLine<std::string, int, std::string>(file,
tmpString,
accuracy_m,
tmpString);
......@@ -53,13 +53,13 @@ Astra1DDynamic::Astra1DDynamic(std::string aFilename):
}
parsing_passed = parsing_passed &&
interpreteLine<double>(file, frequency_m);
interpretLine<double>(file, frequency_m);
parsing_passed = parsing_passed &&
interpreteLine<double, double>(file, zbegin_m, tmpDouble);
interpretLine<double, double>(file, zbegin_m, tmpDouble);