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");
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
static void setEndFieldModel(std::string name, std::shared_ptr< EndFieldModel > efm)
void setLambda(double lambda)
void setAzimuthalExtent(double azimuthalExtent)
void setRMin(double rMin)
void setCentre(Vector_t centre)
void setVerticalExtent(double verticalExtent)
void setTanDelta(double tanDelta)
void setDipoleConstant(double Bz)
void setPhiStart(double phiStart)
void setEndField(endfieldmodel::EndFieldModel *endField)
void setMaxOrder(size_t maxOrder)
void setFieldIndex(double k)
void setRMax(double rMax)
void setEndFieldName(std::string name)
void setPhiEnd(double phiEnd)
endfieldmodel::EndFieldModel * getEndField() const
void initialise(PartBunchBase< double, 3 > *bunch, double &startField, double &endField) override
OpalElement(int size, const char *name, const char *help)
Exemplar constructor.
void registerOwnership() const
virtual ~OpalScalingFFAMagnet()
void setupNamedEndField()
void setupDefaultEndField()
virtual OpalScalingFFAMagnet * clone(const std::string &name)
The base class for all OPAL exceptions.
Vektor< double, 3 > Vector_t