19#ifndef ABSBEAMLINE_ScalingFFAMagnet_H
20#define ABSBEAMLINE_ScalingFFAMagnet_H
65 inline bool apply(
const size_t& i,
const double& t,
117 inline bool bends()
const override;
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(const PETE_Expr< T > &l)
constexpr double e
The value of.
ParticleAttrib< Vector_t > P
Interface for a single beam element.
PartBunchBase< double, 3 > * RefPartBunch_m
Sector bending magnet with an FFA-style field index and spiral end shape.
bool getFieldValue(const Vector_t &R, Vector_t &B) const
Calculate the field at some arbitrary position in cartesian coordinates.
double getVerticalExtent() const
Get the maximum vertical displacement from the midplane.
std::string endFieldName_m
void setupEndField()
setupEndField does some end field and geometry set-up
bool apply(const size_t &i, const double &t, Vector_t &E, Vector_t &B) override
Calculate the field at the position of the ith particle.
void accept(BeamlineVisitor &visitor) const override
Accept a beamline visitor.
void setAzimuthalExtent(double azimuthalExtent)
Set the maximum azimuthal displacement from \psi=0.
void setRMin(double rMin)
Set the maximum radius.
void finalise() override
Finalise the ScalingFFAMagnet - sets bunch to nullptr.
void setCentre(Vector_t centre)
Set the centre of the sector.
void setR0(double r0)
Set the radius constant R_0.
endfieldmodel::EndFieldModel * endField_m
double getDipoleConstant() const
Get the dipole constant B_0.
void setVerticalExtent(double verticalExtent)
Set the maximum vertical displacement from the midplane.
void initialise()
Initialise the ScalingFFAMagnet.
std::vector< std::vector< double > > getDfCoefficients()
Return the calculated df coefficients.
ScalingFFAMagnet * clone() const override
Inheritable copy constructor.
ScalingFFAMagnet(const std::string &name)
Construct a new ScalingFFAMagnet.
void setTanDelta(double tanDelta)
Set tan delta - delta is the spiral angle.
double getAzimuthalExtent() const
Get the maximum azimuthal displacement from \psi=0.
std::string getEndFieldName() const
Return the end field name.
void setDipoleConstant(double Bz)
Set the dipole constant B_0.
void getDimensions(double &, double &) const override
Not implemented.
bool getFieldValueCylindrical(const Vector_t &R, Vector_t &B) const
Calculate the field at some arbitrary position in cylindrical coordinates.
void calculateDfCoefficients()
Calculate the df coefficients, ready for field generation.
void setPhiStart(double phiStart)
Set the offset of the magnet centre from the start.
const double fp_tolerance
double getRMin() const
Get the maximum radius.
double getPhiEnd() const
Get the offset of the magnet end from the start.
EMField & getField() override
Return a dummy (0.) field value (what is this for?)
size_t getMaxOrder() const
Get the maximum power of y modelled in the off-midplane expansion;.
~ScalingFFAMagnet()
Destructor - deletes map.
Vector_t getCentre() const
Get the centre of the sector.
void setEndField(endfieldmodel::EndFieldModel *endField)
Set the fringe field.
void setMaxOrder(size_t maxOrder)
Set the maximum power of y modelled in the off-midplane expansion;.
double getFieldIndex() const
Get the field index k.
void setFieldIndex(double k)
Set the field index k.
void setRMax(double rMax)
Set the maximum radius.
void setEndFieldName(std::string name)
Set the end field name.
void setPhiEnd(double phiEnd)
Set the offset of the magnet end from the start.
endfieldmodel::EndFieldModel * getEndField() const
Get the fringe field.
double getR0() const
Get the radius constant R_0.
double getRMax() const
Get the maximum radius.
std::vector< std::vector< double > > dfCoefficients_m
double getTanDelta() const
Get tan delta - delta is the spiral angle.
double getPhiStart() const
Get the offset of the magnet centre from the start.
BGeometryBase & getGeometry() override
Return the cell geometry.
bool bends() const override
Return true - ScalingFFAMagnet always bends the reference particle.
ScalingFFAMagnet & operator=(const ScalingFFAMagnet &rhs)
PlanarArcGeometry planarArcGeometry_m
Abstract base class for accelerator geometry classes.
A simple arc in the XZ plane.
The magnetic field of a multipole.
Abstract base class for electromagnetic fields.