28 "The \"ScalingFFAMagnet\" element defines a FFA scaling magnet with zero or non-zero spiral angle.") {
31 (
"B0",
"The nominal dipole field of the magnet [T].");
34 (
"R0",
"Radial scale [m].");
37 (
"FIELD_INDEX",
"The scaling magnet field index.");
40 (
"TAN_DELTA",
"Tangent of the spiral angle; set to 0 to make a radial sector magnet.");
43 (
"MAX_Y_POWER",
"The maximum power in y that will be considered in the field expansion.");
47 "Names the end field model of the magnet, giving the field magnitude along a line of "
48 "constant radius. If blank, uses the 'END_LENGTH' and 'CENTRE_LENGTH' "
49 "parameters and a tanh model. If 'END_FIELD_MODEL' is not blank, Opal will seek "
50 "an END_FIELD_MODEL corresponding to the name defined in this string.");
53 (
"END_LENGTH",
"The end length of the spiral FFA [m].");
57 "Full height of the magnet. Particles moving more than height/2. "
58 "off the midplane (either above or below) are out of the aperture [m].");
61 (
"CENTRE_LENGTH",
"The centre length of the spiral FFA [m].");
65 "Particles are considered outside the tracking region if "
66 "radius is greater than R0-RADIAL_NEG_EXTENT [m].", 1);
70 "Particles are considered outside the tracking region if "
71 "radius is greater than R0+RADIAL_POS_EXTENT [m].", 1);
75 "Determines the position of the central portion of the magnet field "
76 "relative to the element start (default is 2*end_length) [m].");
80 "Offset to the end of the magnet, i.e. placement of the next element."
81 "Default is centre_length + 4*end_length.");
85 "The field will be assumed zero if particles are more than AZIMUTHAL_EXTENT "
86 "from the magnet centre (psi=0). Default is CENTRE_LENGTH/2.+5.*END_LENGTH [m].");
118 endField->
setX0(centre_length);
119 std::shared_ptr<endfieldmodel::EndFieldModel> efm(endField);
120 std::string endName =
"__opal_internal__" +
getOpalName();
141 magnet->
setR0(r0Signed);
162 "RADIAL_NEG_EXTENT needs to be defined");
168 "RADIAL_POS_EXTENT needs to be defined");
184 "MAGNET_END must be > 0.0");
198 "MAGNET_START must be > 0.0");
209 "AZIMUTHAL_EXTENT must be > 0.0");
PETE_TUTree< FnFloor, typename T::PETE_Expr_t > floor(const PETE_Expr< T > &l)
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(const PETE_Expr< T > &l)
double getReal(const Attribute &attr)
Return real value.
Attribute makeReal(const std::string &name, const std::string &help)
Make real attribute.
std::string getString(const Attribute &attr)
Get string value.
Attribute makeString(const std::string &name, const std::string &help)
Make string attribute.
ElementBase * getElement() const
Return the embedded CLASSIC element.
void setElement(ElementBase *)
Assign new CLASSIC element.
const std::string & getOpalName() const
Return object name.
std::vector< Attribute > itsAttr
The object attributes.
virtual void rescale(double scaleFactor)=0
Rescale the end field lengths and offsets by a factor x0.
static void setEndFieldModel(std::string name, std::shared_ptr< EndFieldModel > efm)
Add a value to the lookup table.
Calculate the Tanh function (e.g.
void setX0(double x0)
Set x0 (flat top length)
void setLambda(double lambda)
Set lambda (end length)
Sector bending magnet with an FFA-style field index and spiral end shape.
void setAzimuthalExtent(double azimuthalExtent)
Set the maximum azimuthal displacement from \psi=0.
void setRMin(double rMin)
Set the maximum radius.
void setCentre(Vector_t centre)
Set the centre of the sector.
void setR0(double r0)
Set the radius constant R_0.
void setVerticalExtent(double verticalExtent)
Set the maximum vertical displacement from the midplane.
void setTanDelta(double tanDelta)
Set tan delta - delta is the spiral angle.
void setDipoleConstant(double Bz)
Set the dipole constant B_0.
void setPhiStart(double phiStart)
Set the offset of the magnet centre from the start.
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;.
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.
void initialise(PartBunchBase< double, 3 > *bunch, double &startField, double &endField) override
Initialise the ScalingFFAMagnet.
void registerOwnership() const
OpalScalingFFAMagnet provides user interface information for the SCALINGFFA object.
OpalScalingFFAMagnet()
Default constructor initialises UI parameters.
virtual ~OpalScalingFFAMagnet()
Destructor does nothing.
void setupNamedEndField()
void setupDefaultEndField()
virtual void update()
Update the ScalingFFA with new parameters from UI parser.
virtual OpalScalingFFAMagnet * clone(const std::string &name)
Inherited copy constructor.
The base class for all OPAL exceptions.