Commit 0b17cb5d authored by kraus's avatar kraus

adding fine-grained output control

parent bacac526
......@@ -356,20 +356,25 @@ void Collimator::goOnline(const double &) {
return;
}
if (Options::info) {
if(isAPepperPot_m)
*gmsg << "* Pepperpot x= " << a_m << " y= " << b_m << " r= " << rHole_m << " nx= " << nHolesX_m << " ny= " << nHolesY_m << " pitch= " << pitch_m << endl;
else if(isASlit_m)
*gmsg << "* Slit x= " << getXsize() << " Slit y= " << getYsize() << " start= " << position_m << " fn= " << filename_m << endl;
else if(isARColl_m)
*gmsg << "* RCollimator a= " << getXsize() << " b= " << b_m << " start= " << position_m << " fn= " << filename_m << " ny= " << nHolesY_m << " pitch= " << pitch_m << endl;
else if(isACColl_m)
*gmsg << "* CCollimator angle start " << xstart_m << " (Deg) angle end " << ystart_m << " (Deg) R start " << xend_m << " (mm) R rend " << yend_m << " (mm)" << endl;
else if(isAWire_m)
*gmsg << level3;
if(isAPepperPot_m)
*gmsg << "* Pepperpot x= " << a_m << " y= " << b_m << " r= " << rHole_m
<< " nx= " << nHolesX_m << " ny= " << nHolesY_m << " pitch= " << pitch_m << endl;
else if(isASlit_m)
*gmsg << "* Slit x= " << getXsize() << " Slit y= " << getYsize()
<< " start= " << position_m << " fn= " << filename_m << endl;
else if(isARColl_m)
*gmsg << "* RCollimator a= " << getXsize() << " b= " << b_m << " start= " << position_m
<< " fn= " << filename_m << " ny= " << nHolesY_m << " pitch= " << pitch_m << endl;
else if(isACColl_m)
*gmsg << "* CCollimator angle start " << xstart_m << " (Deg) angle end " << ystart_m << " (Deg) "
<< "R start " << xend_m << " (mm) R rend " << yend_m << " (mm)" << endl;
else if(isAWire_m)
*gmsg << "* Wire x= " << x0_m << " y= " << y0_m << endl;
else
*gmsg << "* ECollimator a= " << getXsize() << " b= " << b_m << " start= " << position_m << " fn= " << filename_m << " ny= " << nHolesY_m << " pitch= " << pitch_m << endl;
}
else
*gmsg << "* ECollimator a= " << getXsize() << " b= " << b_m << " start= " << position_m
<< " fn= " << filename_m << " ny= " << nHolesY_m << " pitch= " << pitch_m << endl;
PosX_m.reserve((int)(1.1 * RefPartBunch_m->getLocalNum()));
PosY_m.reserve((int)(1.1 * RefPartBunch_m->getLocalNum()));
......@@ -636,4 +641,4 @@ int Collimator::checkPoint(const double &x, const double &y) {
}
}
return (cn & 1); // 0 if even (out), and 1 if odd (in)
}
}
\ No newline at end of file
......@@ -26,6 +26,8 @@
#include <iostream>
#include <fstream>
extern Inform *gmsg;
// Class RBend
// ------------------------------------------------------------------------
......@@ -418,7 +420,7 @@ ElementBase::ElementType RBend::getType() const {
void RBend::initialise(PartBunch *bunch, double &startField, double &endField, const double &scaleFactor) {
Inform msg("RBend ");
Inform msg("RBend ", *gmsg);
if(InitializeFieldMap(msg)) {
......@@ -436,9 +438,9 @@ void RBend::initialise(PartBunch *bunch, double &startField, double &endField, c
endField = endField_m;
} else {
msg << " There is something wrong with your field map \""
<< fileName_m
<< "\"";
ERRORMSG("There is something wrong with your field map \""
<< fileName_m
<< "\"");
endField = startField - 1.0e-3;
}
}
......@@ -986,9 +988,9 @@ bool RBend::FindBendLength(Inform &msg,
if(bendLength <= 0.0) {
msg << "Magnet length inferred from field map is less than or equal"
" to zero. Check your bend magnet input."
<< endl;
ERRORMSG("Magnet length inferred from field map is less than or equal"
" to zero. Check your bend magnet input."
<< endl);
return false;
} else
return true;
......@@ -1255,104 +1257,102 @@ bool RBend::IsPositionInExitField(Vector_t R, Vector_t &RExit) {
}
void RBend::Print(Inform &msg, double bendAngleX, double bendAngleY) {
if (Options::info) {
msg << endl
msg << level2 << "\n"
<< "Start of field map: "
<< startField_m
<< " m (in s coordinates)"
<< endl;
<< "\n";
msg << "End of field map: "
<< endField_m
<< " m (in s coordinates)"
<< endl;
<< "\n";
msg << "Entrance edge of magnet: "
<< elementEdge_m
<< " m (in s coordinates)"
<< endl;
msg << endl
<< "\n";
msg << "\n"
<< "Reference Trajectory Properties"
<< endl
<< "\n"
<< "==============================="
<< endl << endl;
<< "\n\n";
msg << "Bend angle magnitude: "
<< angle_m
<< " rad ("
<< angle_m * 180.0 / Physics::pi
<< " degrees)"
<< endl;
<< "\n";
msg << "Entrance edge angle: "
<< entranceAngle_m
<< " rad ("
<< entranceAngle_m * 180.0 / Physics::pi
<< " degrees)"
<< endl;
<< "\n";
msg << "Exit edge angle: "
<< exitAngle_m
<< " rad ("
<< exitAngle_m * 180.0 / Physics::pi
<< " degrees)"
<< endl;
<< "\n";
msg << "Bend design radius: "
<< designRadius_m
<< " m"
<< endl;
<< "\n";
msg << "Bend design energy: "
<< designEnergy_m
<< " eV"
<< endl;
msg << endl
<< "\n";
msg << "\n"
<< "Bend Field and Rotation Properties"
<< endl
<< "\n"
<< "=================================="
<< endl << endl;
<< "\n\n";
msg << "Field amplitude: "
<< fieldAmplitude_m
<< " T"
<< endl;
<< "\n";
msg << "Field index: "
<< fieldIndex_m
<< endl;
<< "\n";
msg << "Rotation about x axis: "
<< Orientation_m(1)
<< " rad ("
<< Orientation_m(1) * 180.0 / Physics::pi
<< " degrees)"
<< endl;
<< "\n";
msg << "Rotation about y axis: "
<< Orientation_m(0)
<< " rad ("
<< Orientation_m(0) * 180.0 / Physics::pi
<< " degrees)"
<< endl;
<< "\n";
msg << "Rotation about z axis: "
<< Orientation_m(2)
<< " rad ("
<< Orientation_m(2) * 180.0 / Physics::pi
<< " degrees)"
<< endl;
msg << endl
<< "\n";
msg << "\n"
<< "Reference Trajectory Properties Through Bend Magnet with Fringe Fields"
<< endl
<< "\n"
<< "======================================================================"
<< endl << endl;
<< "\n\n";
msg << "Reference particle is bent: "
<< bendAngleX
<< " rad ("
<< bendAngleX * 180.0 / Physics::pi
<< " degrees) in x plane"
<< endl;
<< "\n";
msg << "Reference particle is bent: "
<< bendAngleY
<< " rad ("
<< bendAngleY * 180.0 / Physics::pi
<< " degrees) in y plane"
<< endl << endl;
}
<< "\n" << endl;
}
void RBend::ReadFieldMap(Inform &msg) {
*Ippl::Info << getName() << " using file ";
fieldmap_m->getInfo(Ippl::Info);
msg << level2 << getName() << " using file ";
fieldmap_m->getInfo(&msg);
Fieldmap::readMap(fileName_m);
fieldmap_m->Get1DProfile1EntranceParam(entranceParameter1_m,
......@@ -1377,7 +1377,7 @@ bool RBend::Reinitialize() {
double bendAngleY = 0.0;
CalculateRefTrajectory(bendAngleX, bendAngleY);
INFOMSG("Bend design energy changed to: "
INFOMSG(level2 << "Bend design energy changed to: "
<< designEnergy_m * 1.0e-6
<< " MeV"
<< endl);
......@@ -1611,13 +1611,14 @@ bool RBend::SetupBendGeometry(Inform &msg, double &startField, double &endField)
bool RBend::SetupDefaultFieldMap(Inform &msg) {
if(gap_m <= 0.0 || length_m <= 0.0) {
msg << "If using \"1DPROFILE1-DEFAULT\" field map you must set the "
"bend attributes GAP and L in the OPAL input file."
<< endl;
ERRORMSG("If using \"1DPROFILE1-DEFAULT\" field map you must set the "
"bend attributes GAP and L in the OPAL input file."
<< endl);
return false;
} else {
fieldmap_m->SetFieldGap(gap_m);
if(Options::info) fieldmap_m->getInfo(&msg);
msg << level2;
fieldmap_m->getInfo(&msg);
return true;
}
......@@ -1641,16 +1642,16 @@ void RBend::SetupPusher(PartBunch *bunch) {
bool RBend::TreatAsDrift(Inform &msg) {
if(designEnergy_m <= 0.0) {
msg << "Warning: bend design energy is zero. Treating as drift."
<< endl;
WARNMSG("Warning: bend design energy is zero. Treating as drift."
<< endl);
designRadius_m = 0.0;
return true;
} else if(angle_m == 0.0 &&
pow(bX_m, 2.0) + pow(bY_m, 2.0) == 0.0) {
msg << "Warning bend angle/strength is zero. Treating as drift."
<< endl;
WARNMSG("Warning bend angle/strength is zero. Treating as drift."
<< endl);
designRadius_m = 0.0;
return true;
......
......@@ -407,7 +407,7 @@ bool RFCavity::apply(const Vector_t &R, const Vector_t &centroid, const double &
void RFCavity::initialise(PartBunch *bunch, double &startField, double &endField, const double &scaleFactor) {
using Physics::two_pi;
double zBegin = 0.0, zEnd = 0.0, rBegin = 0.0, rEnd = 0.0;
Inform msg("RFCavity ");
Inform msg("RFCavity ", *gmsg);
std::stringstream errormsg;
RefPartBunch_m = bunch;
......@@ -461,15 +461,14 @@ void RFCavity::initialise(PartBunch *bunch, double &startField, double &endField
fmap->getFieldDimensions(zBegin, zEnd, rBegin, rEnd);
if(zEnd > zBegin) {
*Ippl::Info << getName() << " using file ";
fmap->getInfo(Ippl::Info);
msg << level2 << getName() << " using file ";
fmap->getInfo(&msg);
if(fabs((frequency - fmap->getFrequency()) / frequency) > 0.01) {
errormsg << "FREQUENCY IN INPUT FILE DIFFERENT THAN IN FIELD MAP '" << filename << "';\n"
<< frequency / two_pi * 1e-6 << " MHz <> "
<< fmap->getFrequency() / two_pi * 1e-6 << " MHz; TAKE ON THE LATTER";
std::string errormsg_str = Fieldmap::typeset_msg(errormsg.str(), "warning");
msg << errormsg_str << "\n"
<< endl;
ERRORMSG(errormsg_str << "\n" << endl);
if(Ippl::myNode() == 0) {
std::ofstream omsg("errormsg.txt", std::ios_base::app);
omsg << errormsg_str << std::endl;
......@@ -519,9 +518,7 @@ void RFCavity::initialise(PartBunch *bunch, double &startField, double &endField
void RFCavity::initialise(PartBunch *bunch, const double &scaleFactor) {
using Physics::pi;
// Inform msg("visitRFCavity read voltage");
RefPartBunch_m = bunch;
// INFOMSG("q= " << RefPartBunch_m->getQ() << " m= " << RefPartBunch_m->getM() / 1.0E9 << endl);
ifstream in(filename_m.c_str());
if(!in.good()) {
......@@ -529,14 +526,9 @@ void RFCavity::initialise(PartBunch *bunch, const double &scaleFactor) {
"failed to open file '" + filename_m + "', please check if it exists");
}
*gmsg << "* Read cavity voltage profile data" << endl;
// << " (data format: s/L, v, dV/dr)" << endl;
in >> num_points_m;
//~ if(RNormal_m != NULL) delete[] RNormal_m;
//~ if(VrNormal_m != NULL)delete[] VrNormal_m;
//~ if(DvDr_m != NULL) delete[] DvDr_m;
RNormal_m = std::unique_ptr<double[]>(new double[num_points_m]);
VrNormal_m = std::unique_ptr<double[]>(new double[num_points_m]);
DvDr_m = std::unique_ptr<double[]>(new double[num_points_m]);
......@@ -644,13 +636,11 @@ void RFCavity::setComponentType(std::string name) {
type_m = SGSW;
} else {
if(name != "") {
Inform msg("RFCavity ");
std::stringstream errormsg;
errormsg << "CAVITY TYPE " << name << " DOES NOT EXIST; \n"
<< "CHANGING TO REGULAR STANDING WAVE";
std::string errormsg_str = Fieldmap::typeset_msg(errormsg.str(), "warning");
msg << errormsg_str << "\n"
<< endl;
ERRORMSG(errormsg_str << "\n" << endl);
if(Ippl::myNode() == 0) {
ofstream omsg("errormsg.txt", ios_base::app);
omsg << errormsg_str << endl;
......@@ -761,10 +751,6 @@ double RFCavity::spline(double z, double *za) {
}
}
// Inform msg("visitRFCavity read voltage");
//*gmsg <<"num_points_m = "<<num_points_m<<", ih = "<<ih<<", il = "<<il<<endl;
double x1 = RNormal_m[il];
double x2 = RNormal_m[ih];
double y1 = VrNormal_m[il];
......@@ -1047,4 +1033,4 @@ pair<double, double> RFCavity::trackOnAxisParticle(const double &p0,
const double tErr = (z - zend) / (Physics::c * beta);
return pair<double, double>(p, t - tErr);
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -27,6 +27,7 @@
#include <iostream>
#include <fstream>
extern Inform *gmsg;
// Class Solenoid
// ------------------------------------------------------------------------
......@@ -199,18 +200,18 @@ bool Solenoid::apply(const Vector_t &R, const Vector_t &centroid, const double
}
void Solenoid::initialise(PartBunch *bunch, double &startField, double &endField, const double &scaleFactor) {
Inform msg("Solenoid ");
Inform msg("Solenoid ", *gmsg);
double zBegin = 0.0, zEnd = 0.0, rBegin = 0.0, rEnd = 0.0;
RefPartBunch_m = bunch;
*Ippl::Info << getName() << " using file ";
myFieldmap_m = Fieldmap::getFieldmap(filename_m, fast_m);
if(myFieldmap_m != NULL) {
myFieldmap_m->getInfo(Ippl::Info);
if(fabs(dx_m) > EPS_MISALIGNMENT || fabs(dy_m) > EPS_MISALIGNMENT || fabs(ds_m) > EPS_MISALIGNMENT) {
msg << "misaligned by dx = " << dx_m << ", dy = " << dy_m << ", dz = " << ds_m << endl;
msg << level2 << getName() << " using file ";
myFieldmap_m->getInfo(&msg);
if(std::abs(dx_m) > EPS_MISALIGNMENT || std::abs(dy_m) > EPS_MISALIGNMENT || std::abs(ds_m) > EPS_MISALIGNMENT) {
msg << level2 << "misaligned by dx = " << dx_m << ", dy = " << dy_m << ", dz = " << ds_m << endl;
}
myFieldmap_m->getFieldDimensions(zBegin, zEnd, rBegin, rEnd);
......@@ -253,5 +254,4 @@ void Solenoid::getDimensions(double &zBegin, double &zEnd) const {
ElementBase::ElementType Solenoid::getType() const {
return SOLENOID;
}
}
\ No newline at end of file
......@@ -387,7 +387,7 @@ void TravelingWave::initialise(PartBunch *bunch, double &startField, double &end
using Physics::pi;
using Physics::two_pi;
Inform msg("TravelingWave ");
Inform msg("TravelingWave ", *gmsg);
std::stringstream errormsg;
RefPartBunch_m = bunch;
......@@ -398,15 +398,14 @@ void TravelingWave::initialise(PartBunch *bunch, double &startField, double &end
CoreFieldmap_m->getFieldDimensions(zBegin, zEnd, rBegin, rEnd);
if(zEnd > zBegin) {
*Ippl::Info << getName() << " using file ";
CoreFieldmap_m->getInfo(Ippl::Info);
if(fabs((frequency_m - CoreFieldmap_m->getFrequency()) / frequency_m) > 0.01) {
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 '" << CoreFilename_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");
msg << errormsg_str << "\n"
<< endl;
ERRORMSG(errormsg_str << "\n" << endl);
if(Ippl::myNode() == 0) {
ofstream omsg("errormsg.txt", ios_base::app);
omsg << errormsg_str << endl;
......@@ -427,7 +426,7 @@ void TravelingWave::initialise(PartBunch *bunch, double &startField, double &end
*/
if(dx_m > 1e-10 || dy_m > 1e-10)
msg << "misaligned by dx = " << dx_m << ", dy = " << dy_m << endl;
msg << level2 << "misaligned by dx = " << dx_m << ", dy = " << dy_m << endl;
if(hasAttribute("MODE")) {
Mode_m = getAttribute("MODE");
......@@ -436,8 +435,8 @@ void TravelingWave::initialise(PartBunch *bunch, double &startField, double &end
errormsg.str("");
errormsg << "NO MODE GIVEN; 2\\pi/3 MODE ASSUMED.";
std::string errormsg_str = Fieldmap::typeset_msg(errormsg.str(), "warning");
msg << errormsg_str << "\n"
<< endl;
ERRORMSG(errormsg_str << "\n" << endl);
if(Ippl::myNode() == 0) {
ofstream omsg("errormsg.txt", ios_base::app);
omsg << errormsg_str << endl;
......@@ -560,7 +559,7 @@ double TravelingWave::getAutoPhaseEstimate(const double &E0, const double &t0, c
B += scale_m * (1. + frequency_m * (t2[i] - t[i]) / dphi) * getdB(i, I, t, phaseE, F);
}
if(fabs(B) > 0.0000001) {
if(std::abs(B) > 0.0000001) {
tmp_phi = atan(A / B);
} else {
tmp_phi = Physics::pi / 2;
......@@ -569,7 +568,7 @@ double TravelingWave::getAutoPhaseEstimate(const double &E0, const double &t0, c
tmp_phi += Physics::pi;
}
if(fabs(phi - tmp_phi) < frequency_m * (t[N3 - 1] - t[0]) / N3) {
if(std::abs(phi - tmp_phi) < frequency_m * (t[N3 - 1] - t[0]) / N3) {
for(int i = 1; i < N1; ++ i) {
E[i] = E[i - 1] + q * scale_m * getdE(i, i, t, phi, F);
}
......@@ -686,7 +685,7 @@ pair<double, double> TravelingWave::trackOnAxisParticle(const double &p0,
for(unsigned int i = 0; i < F.size(); ++i) {
zvals[i] = F[i].first;
onAxisField[i] = F[i].second;
if(fabs(onAxisField[i]) > Ezmax) Ezmax = fabs(onAxisField[i]);
if(std::abs(onAxisField[i]) > Ezmax) Ezmax = std::abs(onAxisField[i]);
}
// Ezmax /= 1e6;
double z = zvals[0];
......@@ -754,4 +753,4 @@ pair<double, double> TravelingWave::trackOnAxisParticle(const double &p0,
const double tErr = (z - (startExitField_m + 0.5 * PeriodLength_m + zbegin)) / (Physics::c * beta);
return pair<double, double>(p, t - tErr);
}
}
\ No newline at end of file
......@@ -622,10 +622,10 @@ void PartBunch::calcGammas() {
reduce(pInBin, pInBin, OpAddAssign());
if(pInBin != 0) {
bingamma_m[i] /= pInBin;
INFOMSG("Bin " << i << " gamma = " << setw(8) << scientific << setprecision(5) << bingamma_m[i] << "; NpInBin= " << setw(8) << setfill(' ') << pInBin << endl);
INFOMSG(level2 << "Bin " << i << " gamma = " << setw(8) << scientific << setprecision(5) << bingamma_m[i] << "; NpInBin= " << setw(8) << setfill(' ') << pInBin << endl);
} else {
bingamma_m[i] = 1.0;
INFOMSG("Bin " << i << " has no particles " << endl);
INFOMSG(level2 << "Bin " << i << " has no particles " << endl);
}
s += pInBin;
}
......@@ -638,7 +638,8 @@ void PartBunch::calcGammas() {
if(emittedBins >= 2) {
for(int i = 1; i < emittedBins; i++) {
if(binemitted_m[i - 1] != 0 && binemitted_m[i] != 0)
INFOMSG("d(gamma)= " << 100.0 * std::abs(bingamma_m[i - 1] - bingamma_m[i]) / bingamma_m[i] << " [%] between bin " << i - 1 << " and " << i << endl);
INFOMSG(level2 << "d(gamma)= " << 100.0 * std::abs(bingamma_m[i - 1] - bingamma_m[i]) / bingamma_m[i] << " [%] "
<< "between bin " << i - 1 << " and " << i << endl);
}
}
}
......@@ -909,7 +910,7 @@ void PartBunch::resizeMesh() {
R[n](1) < ymin || R[n](1) > ymax) {
// delete the particle
INFOMSG("destroyed particle with id=" << n << endl;);
INFOMSG(level2 << "destroyed particle with id=" << n << endl;);
destroy(1, n);
}
......@@ -952,7 +953,7 @@ void PartBunch::computeSelfFields() {
if(fs_m->getFieldSolverType() == "SAAMG")
resizeMesh();
INFOMSG("mesh size" << hr_m << endl);
INFOMSG(level3 << "mesh size" << hr_m << endl);
//scatter charges onto grid
this->Q *= this->dt;
this->Q.scatter(this->rho_m, this->R, IntrplCIC_t());
......@@ -1675,7 +1676,7 @@ void PartBunch::setBCAllOpen() {
getBConds()[i] = ParticleNoBCond;
}
dcBeam_m=false;
INFOMSG("BC set for normal Beam" << endl);
INFOMSG(level3 << "BC set for normal Beam" << endl);
}
void PartBunch::setBCForDCBeam() {
......@@ -1691,7 +1692,7 @@ void PartBunch::setBCForDCBeam() {
bc_m[5] = new ParallelPeriodicFace<double,3,Mesh_t,Center_t>(5);
this->getBConds()[5] = ParticlePeriodicBCond;
dcBeam_m=true;
INFOMSG("BC set for DC-Beam" << endl);
INFOMSG(level3 << "BC set for DC-Beam" << endl);
}
void PartBunch::boundp() {
......@@ -2317,26 +2318,26 @@ Inform &PartBunch::print(Inform &os) {
if(this->getTotalNum() != 0) { // to suppress Nan's
Inform::FmtFlags_t ff = os.flags();
os << scientific;
os << endl;
os << "* ************** B U N C H ********************************************************* " << endl;
os << level1 << "\n";
os << "* ************** B U N C H ********************************************************* \n";
os << "* NP = " << this->getTotalNum() << "\n";
os << "* Qtot = " << setw(12) << setprecision(5) << abs(sum(Q)) * 1.0e9 << " [nC] "
<< "Qi = " << setw(12) << std::abs(qi_m) * 1e9 << " [nC]" << "\n";
os << "* Ekin = " << setw(12) << setprecision(5) << eKin_m << " [MeV] "
<< "dEkin = " << setw(12) << dE_m << " [MeV]" << endl;
os << "* rmax = " << setw(12) << setprecision(5) << rmax_m << " [m]" << endl;
os << "* rmin = " << setw(12) << setprecision(5) << rmin_m << " [m]" << endl;
os << "* rms beam size = " << setw(12) << setprecision(5) << rrms_m << " [m]" << endl;
os << "* rms momenta = " << setw(12) << setprecision(5) << prms_m << " [beta gamma]" << endl;
os << "* mean position = " << setw(12) << setprecision(5) << rmean_m << " [m]" << endl;
os << "* mean momenta = " << setw(12) << setprecision(5) << pmean_m << " [beta gamma]" << endl;
os << "* rms emittance = " << setw(12) << setprecision(5) << eps_m << " (not normalized)" << endl;
os << "* rms correlation = " << setw(12) << setprecision(5) << rprms_m << endl;
os << "* hr = " << setw(12) << setprecision(5) << hr_m << " [m]" << endl;
os << "* dh = " << setw(12) << setprecision(5) << dh_m << " [m]" << endl;
<< "dEkin = " << setw(12) << dE_m << " [MeV]\n";
os << "* rmax = " << setw(12) << setprecision(5) << rmax_m << " [m]\n";
os << "* rmin = " << setw(12) << setprecision(5) << rmin_m << " [m]\n";
os << "* rms beam size = " << setw(12) << setprecision(5) << rrms_m << " [m]\n";
os << "* rms momenta = " << setw(12) << setprecision(5) << prms_m << " [beta gamma]\n";
os << "* mean position = " << setw(12) << setprecision(5) << rmean_m << " [m]\n";
os << "* mean momenta = " << setw(12) << setprecision(5) << pmean_m << " [beta gamma]\n";
os << "* rms emittance = " << setw(12) << setprecision(5) << eps_m << " (not normalized)\n";
os << "* rms correlation = " << setw(12) << setprecision(5) << rprms_m << "\n";
os << "* hr = " << setw(12) << setprecision(5) << hr_m << " [m]\n";
os << "* dh = " << setw(12) << setprecision(5) << dh_m << " [m]\n";
os << "* t = " << setw(12) << setprecision(5) << getT() << " [s] "
<< "dT = " << setw(12) << getdT() << " [s]" << endl;
os << "* spos = " << setw(12) << setprecision(5) << get_sPos() << " [m]" << endl;
<< "dT = " << setw(12) << getdT() << " [s]\n";
os << "* spos = " << setw(12) << setprecision(5) << get_sPos() << " [m]\n";
os << "* ********************************************************************************** " << endl;
os.flags(ff);
}
......
......@@ -16,7 +16,7 @@ using Physics::two_pi;
Astra1DDynamic::Astra1DDynamic(std::string aFilename):
Fieldmap(aFilename),
FourCoefs_m(NULL) {
Inform msg("*1DD ");
ifstream file;
int skippedValues = 0;
std::string tmpString;
......@@ -71,7 +71,6 @@ Astra1DDynamic::~Astra1DDynamic() {
void Astra1DDynamic::readMap() {
if(FourCoefs_m == NULL) {
// declare variables and allocate memory
Inform msg("*1DD ");
ifstream in;
bool parsing_passed = true;
......@@ -148,7 +147,7 @@ void Astra1DDynamic::readMap() {
delete[] zvals;
delete[] RealValues;
INFOMSG(typeset_msg("read in fieldmap '" + Filename_m + "'", "info") << endl);
INFOMSG(level3 << typeset_msg("read in fieldmap '" + Filename_m + "'", "info") << endl);
}
}
......@@ -157,7 +156,7 @@ void Astra1DDynamic::freeMap() {
delete[] FourCoefs_m;
FourCoefs_m = NULL;
INFOMSG(typeset_msg("freed fieldmap '" + Filename_m + "'", "info") << endl);
INFOMSG(level3 << typeset_msg("freed fieldmap '" + Filename_m + "'", "info") << endl);
}
}
......@@ -262,4 +261,4 @@ void Astra1DDynamic::getOnaxisEz(vector<pair<double, double> > & F) {
for(int i = 0; i < num_gridpz_m; ++ i) {
F[i].second /= Ez_max;
}
}
\ No newline at end of file
}
......@@ -71,7 +71,7 @@ void Astra1DDynamic_fast::readMap() {
onAxisInterpolants_m[0],
onAxisAccel_m[0]);
INFOMSG(typeset_msg("read in fieldmap '" + Filename_m + "'", "info") << endl);
INFOMSG(level3 << typeset_msg("read in fieldmap '" + Filename_m + "'", "info") << endl);
}
}
......@@ -182,4 +182,4 @@ int Astra1DDynamic_fast::stripFileHeader(std::ifstream &file) {
interpreteLine<double>(file, tmpDouble);
return accuracy;
}
\ No newline at end of file
}
......@@ -141,7 +141,7 @@ void Astra1DElectroStatic::readMap() {
delete[] zvals;
delete[] RealValues;
INFOMSG(typeset_msg("read in fieldmap '" + Filename_m + "'", "info") << endl);
INFOMSG(level3 << typeset_msg("read in fieldmap '" + Filename_m + "'", "info") << endl);