Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit bb4872eb authored by kraus's avatar kraus
Browse files

Resolve "Transversely shifted distribution in temporal monitors"

parent 076d15a8
No related branches found
No related tags found
No related merge requests found
...@@ -103,7 +103,7 @@ bool Monitor::applyToReferenceParticle(const Vector_t &R, ...@@ -103,7 +103,7 @@ bool Monitor::applyToReferenceParticle(const Vector_t &R,
dt * (R(2) + P(2) * recpgamma) > dt * middle) { dt * (R(2) + P(2) * recpgamma) > dt * middle) {
double frac = (middle - R(2)) / (P(2) * recpgamma); double frac = (middle - R(2)) / (P(2) * recpgamma);
double time = t + frac * dt; double time = t + frac * dt;
Vector_t dR = (0.5 + frac) * P * recpgamma; Vector_t dR = frac * P * recpgamma;
double ds = euclidean_norm(dR); double ds = euclidean_norm(dR);
lossDs_m->addReferenceParticle(csTrafoGlobal2Local_m.transformFrom(R + dR), lossDs_m->addReferenceParticle(csTrafoGlobal2Local_m.transformFrom(R + dR),
csTrafoGlobal2Local_m.rotateFrom(P), csTrafoGlobal2Local_m.rotateFrom(P),
...@@ -116,9 +116,12 @@ bool Monitor::applyToReferenceParticle(const Vector_t &R, ...@@ -116,9 +116,12 @@ bool Monitor::applyToReferenceParticle(const Vector_t &R,
for (unsigned int i = 0; i < localNum; ++ i) { for (unsigned int i = 0; i < localNum; ++ i) {
const double recpgamma = Physics::c * dt / Util::getGamma(RefPartBunch_m->P[i]); const double recpgamma = Physics::c * dt / Util::getGamma(RefPartBunch_m->P[i]);
lossDs_m->addParticle(RefPartBunch_m->R[i] + frac * RefPartBunch_m->P[i] * recpgamma - halfLength_s, Vector_t shift = frac * recpgamma * RefPartBunch_m->P[i] - Vector_t(0, 0, middle);
RefPartBunch_m->P[i], RefPartBunch_m->ID[i], lossDs_m->addParticle(RefPartBunch_m->R[i] + shift,
time, 0); RefPartBunch_m->P[i],
RefPartBunch_m->ID[i],
time,
0);
} }
OpalData::OPENMODE openMode; OpalData::OPENMODE openMode;
if (numPassages_m > 0) { if (numPassages_m > 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment