Commit 2bf2fb40 authored by snuverink_j's avatar snuverink_j
Browse files

some spelling and cleaning

parent 9aa76f0f
......@@ -227,7 +227,7 @@ Option::Option():
("BOUNDPDESTROYFQ", "The frequency to do boundp_destroy to delete lost particles. Default 10",10.0);
itsAttr[BEAMHALOBOUNDARY] = Attributes::makeReal
("BEAMHALOBOUNDARY", "Defines in therms of sigma where the halo starts. Default 0.0",0.0);
("BEAMHALOBOUNDARY", "Defines in terms of sigma where the halo starts. Default 0.0",0.0);
itsAttr[IDEALIZED] = Attributes::makeBool
("IDEALIZED", "Using the hard edge model for the calculation of path length. Default: false", false);
......
......@@ -108,7 +108,7 @@ bool CCollimator::checkCollimator(Vector_t r, Vector_t rmin, Vector_t rmax) {
}
// rectangle collimators in cyclotron cyclindral coordinates
// rectangle collimators in cyclotron cylindrical coordinates
// without particlematterinteraction, the particle hitting collimator is deleted directly
bool CCollimator::checkCollimator(PartBunchBase<double, 3> *bunch, const int turnnumber, const double t, const double tstep) {
......@@ -132,12 +132,12 @@ bool CCollimator::checkCollimator(PartBunchBase<double, 3> *bunch, const int tur
for (unsigned int i = 0; i < tempnum; ++i) {
if (bunch->PType[i] == ParticleType::REGULAR && bunch->R[i](2) < zend_m && bunch->R[i](2) > zstart_m ) {
pflag = checkPoint(bunch->R[i](0), bunch->R[i](1));
/// bunch->Bin[i] != -1 makes sure the partcile is not stored in more than one collimator
/// bunch->Bin[i] != -1 makes sure the particle is not stored in more than one collimator
if ((pflag != 0) && (bunch->Bin[i] != -1)) {
if (!parmatint_m)
lossDs_m->addParticle(bunch->R[i], bunch->P[i], bunch->ID[i]);
bunch->Bin[i] = -1;
flagNeedUpdate = true;
if (!parmatint_m)
lossDs_m->addParticle(bunch->R[i], bunch->P[i], bunch->ID[i]);
bunch->Bin[i] = -1;
flagNeedUpdate = true;
}
}
}
......
......@@ -92,8 +92,6 @@ namespace {
CollimatorPhysics::CollimatorPhysics(const std::string &name, ElementBase *element, std::string &material):
ParticleMatterInteractionHandler(name, element),
// :FIXME: unused
//allParticlesIn_m(false),
T_m(0.0),
dT_m(0.0),
material_m(material),
......@@ -197,6 +195,7 @@ void CollimatorPhysics::doPhysics(PartBunchBase<double, 3> *bunch) {
double Eng = (sqrt(1.0 + dot(P, P)) - 1) * m_p;
if (locParts_m[i].label != -1) {
if (tester->checkHit(R, P, dT_m)) {
bool pdead = EnergyLoss(Eng, dT_m);
if (!pdead) {
......@@ -210,7 +209,7 @@ void CollimatorPhysics::doPhysics(PartBunchBase<double, 3> *bunch) {
// INFOMSG("final energy: " << (sqrt(1.0 + dot(P, P)) - 1) * m_p /1000 << " MeV" <<endl);
CoulombScat(R, P, dT_m);
} else {
// The particle is stopped in the material, set lable_m to -1
// The particle is stopped in the material, set label to -1
locParts_m[i].label = -1.0;
stoppedPartStat_m++;
lossDs_m->addParticle(R, P, -locParts_m[i].IDincol);
......@@ -292,13 +291,13 @@ void CollimatorPhysics::apply(PartBunchBase<double, 3> *bunch,
Particles that have entered material are flagged as Bin[i] == -1.
Fixme: should use PType
Flagged particles are copied to a local structue within Collimator Physics locParts_m.
Flagged particles are copied to a local structure within Collimator Physics locParts_m.
Particles in that structure will be pushed in the material and either come
back to the bunch or will be fully stopped in the material. For the push in the
material we use sub-timesteps.
Newely entered particles will be copied to locParts_m at the end of apply.
Newly entered particles will be copied to locParts_m at the end of apply.
*/
Eavg_m = 0.0;
......@@ -316,7 +315,7 @@ void CollimatorPhysics::apply(PartBunchBase<double, 3> *bunch,
T_m = bunch->getT();
/*
Because this is not propper set in the Component class when calling in the Constructor
Because this is not properly set in the Component class when calling in the Constructor
*/
#ifdef OPAL_DKS
......@@ -387,7 +386,7 @@ void CollimatorPhysics::apply(PartBunchBase<double, 3> *bunch,
IpplTimings::stopTimer(DegraderLoopTimer_m);
if (onlyOneLoopOverParticles)
copyFromBunchDKS(bunch, boundingSphere);
copyFromBunchDKS(bunch, boundingSphere);
T_m += dT_m;
......@@ -470,7 +469,6 @@ void CollimatorPhysics::apply(PartBunchBase<double, 3> *bunch,
} else {
onlyOneLoopOverParticles = true;
}
} while (onlyOneLoopOverParticles == false);
#endif
......@@ -834,7 +832,7 @@ void CollimatorPhysics::addBackToBunch(PartBunchBase<double, 3> *bunch, unsigned
/*
This particle is back to the bunch, by set
ting the lable to -1.0
ting the label to -1.0
the particle will be deleted.
*/
locParts_m[i].label = -1.0;
......@@ -868,7 +866,7 @@ void CollimatorPhysics::copyFromBunch(PartBunchBase<double, 3> *bunch,
tester = new FlexCollimatorInsideTester(element_ref_m);
break;
default:
throw OpalException("CollimatorPhysics::doPhysics",
throw OpalException("CollimatorPhysics::copyFromBunch",
"Unsupported element type");
}
......@@ -890,7 +888,7 @@ void CollimatorPhysics::copyFromBunch(PartBunchBase<double, 3> *bunch,
x.Qincol = bunch->Q[i];
x.Bfincol = bunch->Bf[i];
x.Efincol = bunch->Ef[i];
x.label = 0; // allive in matter
x.label = 0; // alive in matter
locParts_m.push_back(x);
ne++;
......@@ -1055,7 +1053,7 @@ void CollimatorPhysics::addBackToBunchDKS(PartBunchBase<double, 3> *bunch, unsig
}
void CollimatorPhysics::copyFromBunchDKS(PartBunchBase<double, 3> *bunch,
const std::pair<Vector_t, double> &boundingSphere)
const std::pair<Vector_t, double> &boundingSphere)
{
const size_t nL = bunch->getLocalNum();
if (nL == 0) return;
......@@ -1080,7 +1078,7 @@ void CollimatorPhysics::copyFromBunchDKS(PartBunchBase<double, 3> *bunch,
tester = new FlexCollimatorInsideTester(element_ref_m);
break;
default:
throw OpalException("CollimatorPhysics::doPhysics",
throw OpalException("CollimatorPhysics::copyFromBunchDKS",
"Unsupported element type");
}
......@@ -1103,7 +1101,7 @@ void CollimatorPhysics::copyFromBunchDKS(PartBunchBase<double, 3> *bunch,
x.Qincol = bunch->Q[i];
x.Bfincol = bunch->Bf[i];
x.Efincol = bunch->Ef[i];
x.label = 0; // allive in matter
x.label = 0; // alive in matter
PART_DKS x_gpu;
x_gpu.label = x.label;
......@@ -1130,7 +1128,7 @@ void CollimatorPhysics::copyFromBunchDKS(PartBunchBase<double, 3> *bunch,
}
void CollimatorPhysics::setupCollimatorDKS(PartBunchBase<double, 3> *bunch,
size_t numParticlesInSimulation)
size_t numParticlesInSimulation)
{
if (curandInitSet == -1) {
......
......@@ -101,7 +101,7 @@ private:
bool EnergyLoss(double &Eng, const double &deltat);
void Rot(double &px, double &pz, double &x, double &z, double xplane, double Norm_P,
double thetacou, double deltas, int coord);
double thetacou, double deltas, int coord);
void copyFromBunch(PartBunchBase<double, 3> *bunch,
const std::pair<Vector_t, double> &boundingSphere);
......@@ -109,7 +109,7 @@ private:
#ifdef OPAL_DKS
void copyFromBunchDKS(PartBunchBase<double, 3> *bunch,
const std::pair<Vector_t, double> &boundingSphere);
const std::pair<Vector_t, double> &boundingSphere);
void addBackToBunchDKS(PartBunchBase<double, 3> *bunch, unsigned i);
void setupCollimatorDKS(PartBunchBase<double, 3> *bunch, size_t numParticlesInSimulation);
......@@ -126,9 +126,6 @@ private:
void calcStat(double Eng);
// :FIXME: remove unused declaration
//bool allParticlesIn_m;
double T_m; // own time, maybe larger than in the bunch object
double dT_m; // dt from bunch
......@@ -195,9 +192,9 @@ inline
void CollimatorPhysics::calcStat(double Eng) {
Eavg_m += Eng;
if (Emin_m > Eng)
Emin_m = Eng;
Emin_m = Eng;
if (Emax_m < Eng)
Emax_m = Eng;
Emax_m = Eng;
}
inline
......
......@@ -32,7 +32,7 @@ public:
protected:
ElementBase *element_ref_m;
bool allParticleInMat_m;
bool allParticleInMat_m; ///< if all particles are in matter stay inside the particle matter interaction
private:
const std::string name_m;
......
......@@ -96,7 +96,7 @@ void OpalECollimator::update() {
coll->setElementLength(length);
if (getOpalName() != "ECOLLIMATOR") {
double width = 2 * Attributes::getReal(itsAttr[XSIZE]);
double width = 2 * Attributes::getReal(itsAttr[XSIZE]);
double height = 2 * Attributes::getReal(itsAttr[YSIZE]);
std::stringstream description;
description << "ellipse(" << width << "," << height << ")";
......
......@@ -57,8 +57,7 @@ OpalRCollimator::OpalRCollimator(const std::string &name, OpalRCollimator *paren
OpalRCollimator::~OpalRCollimator() {
if(parmatint_m)
delete parmatint_m;
delete parmatint_m;
}
......@@ -97,7 +96,7 @@ void OpalRCollimator::update() {
coll->setElementLength(Attributes::getReal(itsAttr[LENGTH]));
if (getOpalName() != "RCOLLIMATOR") {
double width = 2 * Attributes::getReal(itsAttr[XSIZE]);
double width = 2 * Attributes::getReal(itsAttr[XSIZE]);
double height = 2 * Attributes::getReal(itsAttr[YSIZE]);
std::stringstream description;
description << "rectangle(" << width << "," << height << ")";
......
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