67 bool backBeam,
bool backTrack,
int order):
69 itsOrder(std::
min(order, 6))
134 f_1[1] = - scale * field.
getBy();
135 f_1[2] = - f_1[1] * (length / 2.0);
136 f_1[3] = scale * field.
getBx();
137 f_1[4] = - f_1[3] * (length / 2.0);
144 theMap.
getMatrix()(4, 5) = length * kin * kin;
204 Series pz =
sqrt(pt1 * pt1 - px * px - py * py);
206 Series H = length * (As + E - pz);
264 Series pz =
sqrt(pt1 * pt1 - px * px - py * py);
266 Series H = length * (As + E - pz);
364 Series pz =
sqrt(pt1 * pt1 - px * px - py * py);
366 Series H = length * (As + E - (1.0 + h * x) * pz);
400 f_1[1] = scale * sep.
getEx();
401 f_1[2] = - f_1[1] * (length / 2.0);
402 f_1[3] = scale * sep.
getEy();
403 f_1[4] = - f_1[3] * (length / 2.0);
410 theMap.
getMatrix()(4, 5) = length * kin * kin;
433 Series pz =
sqrt(pt1 * pt1 - px * px - py * py);
434 Series H = length * (
sqrt(pt1 * pt1 + kin * kin) - pz);
455 Series pz =
sqrt(pt1 * pt1 - px * px - py * py);
456 Series H = length * (
sqrt(pt1 * pt1 + kin * kin) - pz);
487 double s2 = (euclid.
M(0, 2) * euclid.
getX() +
488 euclid.
M(1, 2) * euclid.
getY() +
489 euclid.
M(2, 2) * euclid.
getZ()) / euclid.
M(2, 2);
494 f_1[1] = euclid.
M(0, 2) / euclid.
M(2, 2);
495 f_1[2] = - euclid.
getX() + f_1[1] * s2;
496 f_1[3] = euclid.
M(1, 2) / euclid.
M(2, 2);
497 f_1[4] = - euclid.
getY() + f_1[3] * s2;
499 f_1[6] = euclid.
getZ();
503 F(1, 1) = euclid.
M(0, 0);
504 F(1, 3) = euclid.
M(1, 0);
505 F(1, 5) = euclid.
M(2, 0);
506 F(3, 1) = euclid.
M(0, 1);
507 F(3, 3) = euclid.
M(1, 1);
508 F(3, 5) = euclid.
M(2, 1);
511 F(0, 0) = euclid.
M(1, 1) / euclid.
M(2, 2);
512 F(0, 2) = F(0, 0) * s2;
513 F(0, 2) = - euclid.
M(0, 1) / euclid.
M(2, 2);
514 F(0, 3) = F(0, 2) * s2;
515 F(2, 0) = - euclid.
M(1, 0) / euclid.
M(2, 2);
516 F(2, 1) = F(2, 0) * s2;
517 F(2, 2) = euclid.
M(0, 0) / euclid.
M(2, 2);
518 F(2, 3) = F(2, 2) * s2;
519 F(4, 0) = euclid.
M(0, 2) / euclid.
M(2, 2);
520 F(4, 1) = F(4, 0) * s2;
521 F(4, 2) = euclid.
M(1, 2) / euclid.
M(2, 2);
522 F(4, 3) = F(4, 2) * s2;
524 F(4, 5) = - s2 * kin * kin;
virtual void visitSeptum(const Septum &)
Apply the algorithm to a Septum.
virtual double getExitFaceRotation() const =0
Get exit pole face rotation.
virtual BMultipoleField & getField() override=0
Get multipole expansion of field.
double getX() const
Get displacement.
virtual void visitFlexibleCollimator(const FlexibleCollimator &)
Apply the algorithm to a flexible collimator.
virtual BDipoleField & getField()=0
Return the corrector field.
virtual double getAmplitude() const =0
Get RF amplitude.
The field of a magnetic dipole.
virtual BMultipoleField & getField() override=0
Get multipole expansion of field.
Interface for septum magnet.
void applyEntranceFringe(double edge, double curve, const BMultipoleField &field, double scale)
virtual BMultipoleField & getField() override=0
Get multipole field.
Interface for electrostatic separator.
Euclid3D getExitPatch() const
Get patch.
virtual double getPhase() const =0
Get RF phase.
Interface for beam position monitors.
Interface for RF Quadrupole.
A simple arc in the XZ plane.
virtual void visitParallelPlate(const ParallelPlate &)
Apply the algorithm to a ParallelPlate.
virtual double getBz() const =0
Get solenoid field Bz in Teslas.
virtual void setMap(const LinearMap< double, 6 > &)
Reset the linear part of the accumulated map for restart.
double getZ() const
Get displacement.
virtual double getElementLength() const override
Get design length.
static DragtFinnMap factorSimple(const FTps< double, 2 *N > &H)
virtual double getEx() const =0
Get horizontal component Ex of field in V/m.
Interface for general corrector.
virtual void visitCCollimator(const CCollimator &)
Apply the algorithm to a Collimator.
virtual double getEy() const =0
Get vertical component Ey of field in V/m.
Interface for beam diagnostics.
Euclid3D getEntrancePatch() const
Get patch.
virtual double getBy() const
Get vertical component.
virtual PlanarArcGeometry & getGeometry() override=0
Get SBend geometry.
const FMatrix< double, 2 *N, 2 *N > & getMatrix() const
Return the matrix representing the linear transform.
virtual void visitLambertson(const Lambertson &)
Apply the algorithm to a Lambertson.
virtual double getEntryFaceRotation() const =0
Get pole entry face rotation.
Interface for drift space.
virtual void visitBeamStripping(const BeamStripping &)
Apply the algorithm to a BeamStripping.
virtual void visitComponent(const Component &)
Apply the algorithm to a Component.
double getBeta() const
The relativistic beta per particle.
virtual void visitRFCavity(const RFCavity &)
Apply the algorithm to a RFCavity.
double M(int row, int col) const
Get component.
DragtFinnMap catenate(const DragtFinnMap &) const
Substitute (concatenate) with another map in beam order.
Interface for general multipole.
static Euclid3D YRotation(double angle)
Make rotation.
T deg(T x)
Convert radians to degrees.
void applyDrift(double length)
Euclid3D Inverse(const Euclid3D &t)
Euclidean inverse.
virtual double getElementLength() const override
Get design length.
virtual void visitCorrector(const Corrector &)
Apply the algorithm to a Corrector.
virtual double getExitFaceRotation() const =0
Get exit pole face rotation.
double getBendAngle() const
Get angle.
virtual void visitDiagnostic(const Diagnostic &)
Apply the algorithm to a Diagnostic.
virtual void visitMultipole(const Multipole &)
Apply the algorithm to a Multipole.
void assign(const FMatrix< double, 2 *N, 2 *N > &)
Assign the matrix representing the linear transform.
virtual void visitRBend(const RBend &)
Apply the algorithm to a RBend.
double getQ() const
The constant charge per particle.
virtual double getElementLength() const
Get design length.
void applyExitFringe(double edge, double curve, const BMultipoleField &field, double scale)
virtual double getFrequency() const =0
Get RF frequencey.
constexpr double c
The velocity of light in m/s.
Interface for cyclotron collimator.
Displacement and rotation in space.
Abstract beam-beam interaction.
virtual void visitProbe(const Probe &)
Apply the algorithm to a Probe.
FTps< double, 6 > buildSBendVectorPotential(const BMultipoleField &, double h)
Construct the vector potential for an SBend.
bool isIdentity() const
Test for identity.
Interface for cyclotron valley.
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 getEntryFaceCurvature() const =0
Get entry pole face curvature.
virtual double getElementLength() const
Get element length.
Tps< T > sqrt(const Tps< T > &x)
Square root.
virtual double getEntryFaceRotation() const =0
Get pole entry face rotation.
A representation for a homogeneous polynomial, used as a Lie generator.
The geometry for a RBend element.
double getP() const
The constant reference momentum per particle.
FTps filter(int minOrder, int maxOrder, int trcOrder=EXACT) const
Extract given range of orders, with truncation.
The magnetic field of a multipole.
virtual void visitRFQuadrupole(const RFQuadrupole &)
Apply the algorithm to a RFQuadrupole.
virtual void visitCyclotronValley(const CyclotronValley &)
Apply the algorithm to a CyclotronValley.
FTps< double, 6 > buildMultipoleVectorPotential(const BMultipoleField &)
Construct the vector potential for a Multipole.
double getM() const
The constant mass per particle.
Tps< T > cos(const Tps< T > &x)
Cosine.
virtual double getExitFaceCurvature() const =0
Get exit pole face curvature.
virtual void applyTransform(const Euclid3D &, double refLength=0.0)
Apply transform.
virtual void visitBeamBeam(const BeamBeam &)
Apply the algorithm to a BeamBeam.
double getCurvature() const
Get curvature.
virtual RBendGeometry & getGeometry() override=0
Get RBend geometry.
virtual double getBendAngle() const
Get angle.
Interface for a geometric patch.
virtual void visitSeparator(const Separator &)
Apply the algorithm to a Separator.
virtual void visitMarker(const Marker &)
Apply the algorithm to a Marker.
Interface for a single beam element.
virtual const Euclid3D & getPatch() const =0
Get patch transform.
virtual void visitDrift(const Drift &)
Apply the algorithm to a Drift.
const PartData itsReference
The reference information.
double getY() const
Get displacement.
virtual void visitPatch(const Patch &)
Apply the algorithm to a Patch.
T::PETE_Expr_t::PETE_Return_t min(const PETE_Expr< T > &expr, NDIndex< D > &loc)
virtual void visitSBend(const SBend &)
Apply the algorithm to a SBend.
virtual void visitMonitor(const Monitor &)
Apply the algorithm to a Monitor.
static FTps makeVariable(int var)
Make variable.
virtual void getMap(LinearMap< double, 6 > &) const
Return the linear part of the accumulated map.
virtual void visitDegrader(const Degrader &)
Apply the algorithm to a Degrader.
Interface for a Lambertson septum.