39 bool backBeam,
bool backTrack):
125 Series pz =
sqrt(pt * pt - px * px - py * py);
130 itsMap[
T] += pt * (refTime / E - length / pz);
136 int order = field.
order();
145 Series kxt = x * kx - y * ky;
146 Series kyt = x * ky + y * kx;
147 kx = kxt + field.
normal(order);
148 ky = kyt - field.
skew(order);
151 itsMap[
PX] -= kx * scale;
152 itsMap[
PY] += ky * scale;
159 Series As = buildSBendVectorPotential(field, h) * scale;
175 Series pz =
sqrt(pt * pt - px * px - py * py);
177 itsMap[
PX] = euclid.
M(0, 0) * px + euclid.
M(1, 0) * py + euclid.
M(2, 0) * pz;
178 itsMap[
PY] = euclid.
M(0, 1) * px + euclid.
M(1, 1) * py + euclid.
M(2, 1) * pz;
179 pz = euclid.
M(0, 2) * px + euclid.
M(1, 2) * py + euclid.
M(2, 2) * pz;
184 euclid.
M(0, 0) * x + euclid.
M(1, 0) * y - euclid.
M(2, 0) * euclid.
getZ();
186 euclid.
M(0, 1) * x + euclid.
M(1, 1) * y - euclid.
M(2, 1) * euclid.
getZ();
188 euclid.
M(0, 2) * x + euclid.
M(1, 2) * y - euclid.
M(2, 2) * euclid.
getZ();
193 itsMap[
Y] = y2 - sByPz * itsMap[
PY];
194 itsMap[
T] += pt * (refTime / E + sByPz);
virtual ElementBase * getElement() const
Return the contained element.
Euclid3D & offset() const
Return the offset.
void applyThinSBend(const BMultipoleField &field, double scale, double h)
Thin SBend kick.
double getX() const
Get displacement.
double normal(int) const
Get component.
virtual void visitAlignWrapper(const AlignWrapper &)
Apply the algorithm to an align wrapper.
virtual void trackMap(FVps< double, 6 > &, const PartData &, bool revBeam, bool revTrack) const
Track a map.
virtual void trackMap(FVps< double, 6 > &map, const PartData &, bool revBeam, bool revTrack) const
Track a map.
Define the position of a misaligned element.
double getZ() const
Get displacement.
virtual Euclid3D getEntranceTransform() const
Get entrance patch.
double getBeta() const
The relativistic beta per particle.
double M(int row, int col) const
Get component.
Euclid3D Inverse(const Euclid3D &t)
Euclidean inverse.
virtual void visitComponent(const Component &)
Apply the algorithm to an arbitrary component.
virtual Euclid3D getExitTransform() const
Get exit patch.
double skew(int) const
Get component.
virtual void accept(BeamlineVisitor &visitor) const =0
Apply visitor.
Displacement and rotation in space.
bool isIdentity() const
Test for identity.
void applyThinMultipole(const BMultipoleField &field, double factor)
Thin multipole kick.
An abstract sequence of beam line components.
FTps substitute(const FMatrix< T, N, N > &M, int n) const
Substitute.
Tps< T > sqrt(const Tps< T > &x)
Square root.
virtual void getMap(LinearMap< double, 6 > &) const
Return the linear part of the accumulated map.
FTps derivative(int var) const
Partial derivative.
virtual void setMap(const LinearMap< double, 6 > &)
Reset the linear part of the accumulated map for restart.
double getP() const
The constant reference momentum per particle.
virtual void visitPatch(const Patch &pat)
Apply the algorithm to a patch.
void applyTransform(const Euclid3D &, double refLength=0.0)
Apply transform.
The magnetic field of a multipole.
double getM() const
The constant mass per particle.
Interface for a geometric patch.
virtual void visitMapIntegrator(const MapIntegrator &)
Apply the algorithm to an integrator capable of mapping.
Interface for a single beam element.
virtual const Euclid3D & getPatch() const =0
Get patch transform.
const PartData itsReference
The reference information.
double getY() const
Get displacement.
int order() const
Return order.
FVps< double, 6 > itsMap
The transfer map being built.
void applyDrift(double length)
Apply drift length.