63 bool backBeam,
bool backTrack):
64 Mapper(beamline, ref, backBeam, backTrack)
177 if(length) scale *= length;
178 int order = field.
order();
187 Series kxt = x * kx - y * ky;
188 Series kyt = x * ky + y * kx;
189 kx = kxt + field.
normal(order);
190 ky = kyt - field.
skew(order);
195 itsMap[
T] -= angle * x;
214 Series speed = (
c * pt) /
sqrt(pt * pt + kin * kin);
242 if(length) scale *= length;
243 int order = field.
order();
252 Series kxt = x * kx - y * ky;
253 Series kyt = x * ky + y * kx;
254 kx = kxt + field.
normal(order);
255 ky = kyt - field.
skew(order);
260 itsMap[
T] -= angle * x;
276 double Ex = scale * sep.
getEx();
277 double Ey = scale * sep.
getEy();
304 Series pz =
sqrt(pt * pt - px * px - py * py);
309 Series xt = C * itsMap[
X] + S * itsMap[
Y];
310 Series yt = C * itsMap[
Y] - S * itsMap[
X];
314 itsMap[
X] = C * xt + (S / k) * pxt;
315 itsMap[
Y] = C * yt + (S / k) * pyt;
316 itsMap[
PX] = C * pxt - (S * k) * xt;
317 itsMap[
PY] = C * pyt - (S * k) * yt;
320 double ref = kin * kin;
321 itsMap[
T] += length * (pt * ref - (px * px + py * py + 3.0 * pt * pt *
ref) / 2.0);
339 double ref = kin * kin;
343 Series lByPz = length / (1.0 + pt);
346 itsMap[
T] += length * (pt * ref - (px * px + py * py + 3.0 * pt * pt *
ref) / 2.0);
virtual BMultipoleField & getField() override=0
Get multipole expansion of field.
virtual BDipoleField & getField()=0
Return the corrector field.
virtual double getAmplitude() const =0
Get RF amplitude.
double normal(int) const
Get component.
The field of a magnetic dipole.
virtual BMultipoleField & getField() override=0
Get multipole expansion of field.
Interface for septum magnet.
virtual BMultipoleField & getField() override=0
Get multipole field.
Interface for electrostatic separator.
virtual double getPhase() const =0
Get RF phase.
Interface for beam position monitors.
virtual void visitMarker(const Marker &)
Apply the algorithm to a marker.
Interface for RF Quadrupole.
A simple arc in the XZ plane.
Tps< T > sin(const Tps< T > &x)
Sine.
virtual void visitParallelPlate(const ParallelPlate &)
Apply the algorithm to a ParallelPlate.
virtual double getBz() const =0
Get solenoid field Bz in Teslas.
virtual double getElementLength() const override
Get design length.
virtual void visitMonitor(const Monitor &)
Apply the algorithm to a monitor.
virtual double getEx() const =0
Get horizontal component Ex of field in V/m.
Interface for general corrector.
virtual void visitCorrector(const Corrector &)
Apply the algorithm to a corrector.
virtual double getEy() const =0
Get vertical component Ey of field in V/m.
Interface for beam diagnostics.
virtual double getBy() const
Get vertical component.
virtual PlanarArcGeometry & getGeometry() override=0
Get SBend geometry.
Interface for drift space.
Interface for general multipole.
virtual void visitSeptum(const Septum &)
Apply the algorithm to a septum.
T deg(T x)
Convert radians to degrees.
virtual void visitCyclotronValley(const CyclotronValley &)
Apply the algorithm to a CyclotronValley.
virtual double getElementLength() const override
Get design length.
double getBendAngle() const
Get angle.
virtual void visitRBend(const RBend &)
Apply the algorithm to a rectangular bend.
double skew(int) const
Get component.
double getQ() const
The constant charge per particle.
virtual double getElementLength() const
Get design length.
virtual void visitProbe(const Probe &)
Apply the algorithm to a probe.
virtual double getFrequency() const =0
Get RF frequencey.
constexpr double c
The velocity of light in m/s.
Interface for cyclotron collimator.
Abstract beam-beam interaction.
Interface for cyclotron valley.
virtual void visitRFQuadrupole(const RFQuadrupole &)
Apply the algorithm to a RF quadrupole.
void applyThinMultipole(const BMultipoleField &field, double factor)
Thin multipole kick.
virtual double getBx() const
Get horizontal component.
virtual void visitSolenoid(const Solenoid &)
Apply the algorithm to a solenoid.
virtual double getElementLength() const
Get element length.
An abstract sequence of beam line components.
virtual double getElementLength() const
Get element length.
virtual void visitBeamBeam(const BeamBeam &)
Apply the algorithm to a beam-beam.
Tps< T > sqrt(const Tps< T > &x)
Square root.
The geometry for a RBend element.
double getP() const
The constant reference momentum per particle.
virtual void visitBeamStripping(const BeamStripping &)
Apply the algorithm to a beam stripping.
virtual void visitRFCavity(const RFCavity &)
Apply the algorithm to a RF cavity.
virtual void visitSeparator(const Separator &)
Apply the algorithm to a separator.
virtual void visitFlexibleCollimator(const FlexibleCollimator &)
Apply the algorithm to a flexible collimator.
The magnetic field of a multipole.
double getM() const
The constant mass per particle.
Tps< T > cos(const Tps< T > &x)
Cosine.
virtual void visitSBend(const SBend &)
Apply the algorithm to a sector bend.
virtual void visitCCollimator(const CCollimator &)
Apply the algorithm to a collimator.
virtual void visitDiagnostic(const Diagnostic &)
Apply the algorithm to a diagnostic.
virtual void visitLambertson(const Lambertson &)
Apply the algorithm to a Lambertson.
void applyDrift(double length)
virtual void visitDrift(const Drift &)
Apply the algorithm to a drift.
virtual void visitDegrader(const Degrader &)
Apply the algorithm to a drift.
virtual RBendGeometry & getGeometry() override=0
Get RBend geometry.
virtual double getBendAngle() const
Get angle.
const PartData itsReference
The reference information.
int order() const
Return order.
FVps< double, 6 > itsMap
The transfer map being built.
Interface for a Lambertson septum.
virtual void visitMultipole(const Multipole &)
Apply the algorithm to a multipole.