Resolve "Variables of incident particles in OPAL-t elements"
Closes #683 (closed)
Merge request reports
Activity
changed milestone to %2022.1
added Enhancement OPAL-T labels
requested review from @kraus and @snuverink_j
- Resolved by kraus
@ext-calvo_p sorry, I think you misunderstood me. The degrader should still have an instance of
LossDataSink
but only record particles whos energy gets below a threashold and consequently are stopped and deleted.
102 102 bool FlexibleCollimator::apply(const size_t &i, const double &t, Vector_t &/*E*/, Vector_t &/*B*/) { 103 103 const Vector_t &R = RefPartBunch_m->R[i]; 104 104 const Vector_t &P = RefPartBunch_m->P[i]; 105 105 const double &dt = RefPartBunch_m->dt[i]; 106 const double recpgamma = Physics::c * dt / std::sqrt(1.0 + dot(P, P)); 106 const Vector_t singleStep = Physics::c * dt * Util::getBeta(P); 107 107 bool pdead = isStopped(R); 108 108 109 109 if (pdead) { 110 110 if (lossDs_m) { 111 double frac = -R(2) / P(2) * recpgamma; 111 double frac = -R(2) / singleStep(2); 112 112 lossDs_m->addParticle(OpalParticle(RefPartBunch_m->ID[i], 113 R, P, 113 R + frac * singleStep, P, 114 114 t + frac * dt, frac
is the fraction of a step the particle is away from the edge. It is introduced to establish the storing of particles in the physical boundary of the element. Currently, the particles are being stored in the position corresponding to the subsequent step once the edge has been crossed.Particles that enter a collimator transversely doesn't make much sense, does it? I know, I've introduced the option to avoid deletion of particles entering elements transversely and adapted also the
FlexibleCollimator
class but I think I should revert it (only changes inFlexibleCollimator
).Edited by krausIt depends, there are some collimators that have a cone-like shape to distribute the losses more evenly along the collimator. I don't know if such collimators are supported in OPAL. Also if the beam is diverging in this area, transverse particles could happen occasionally.
But if you both think it is fine, I don't mind and I am fine with the changes.
- Resolved by snuverink_j
added Cleanup label
mentioned in commit 140193bd