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 ring, giving dipole field along a line of "
48 "constant radius. If blank, uses the default '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");
182 if (Attributes::getReal(
itsAttr[MAGNET_END]) < 0.0) {
184 "MAGNET_END must be > 0.0");
196 if (Attributes::getReal(
itsAttr[MAGNET_START]) < 0.0) {
198 "MAGNET_START must be > 0.0");
207 if (Attributes::getReal(
itsAttr[AZIMUTHAL_EXTENT]) < 0.0) {
209 "AZIMUTHAL_EXTENT must be > 0.0");
Attribute makeReal(const std::string &name, const std::string &help)
Make real attribute.
void setupNamedEndField()
void initialise(PartBunchBase< double, 3 > *bunch, double &startField, double &endField) override
std::string getString(const Attribute &attr)
Get string value.
void setPhiStart(double phiStart)
void setTanDelta(double tanDelta)
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(const PETE_Expr< T > &l)
void setEndFieldName(std::string name)
void setDipoleConstant(double Bz)
virtual ~OpalScalingFFAMagnet()
virtual OpalScalingFFAMagnet * clone(const std::string &name)
void setLambda(double lambda)
void setRMax(double rMax)
void setEndField(endfieldmodel::EndFieldModel *endField)
void setElement(ElementBase *)
Assign new CLASSIC element.
void setupDefaultEndField()
The base class for all OPAL exceptions.
void setMaxOrder(size_t maxOrder)
Attribute makeString(const std::string &name, const std::string &help)
Make string attribute.
ElementBase * getElement() const
Return the embedded CLASSIC element.
virtual void rescale(double scaleFactor)=0
endfieldmodel::EndFieldModel * getEndField() const
const std::string & getOpalName() const
Return object name.
void setRMin(double rMin)
std::vector< Attribute > itsAttr
The object attributes.
void setFieldIndex(double k)
void setCentre(Vector_t centre)
double getReal(const Attribute &attr)
Return real value.
void setVerticalExtent(double verticalExtent)
static void setEndFieldModel(std::string name, std::shared_ptr< EndFieldModel > efm)
PETE_TUTree< FnFloor, typename T::PETE_Expr_t > floor(const PETE_Expr< T > &l)
void setAzimuthalExtent(double azimuthalExtent)
void setPhiEnd(double phiEnd)
void registerOwnership() const
item[EANGLE] Entrance edge counterclockwise This enables to obtain skew at each point along the magnet