29 OpalElement(
SIZE,
"RBEND3D",
"The \"RBEND3D\" element defines an RBEND with 3D field maps"),
31 parmatint_m(nullptr) {
33 (
"ANGLE",
"Upright dipole coefficient in m^(-1)");
35 (
"K0",
"Normal dipole coefficient in m^(-1)");
37 (
"K0S",
"Skew dipole coefficient in m^(-1)");
39 (
"E1",
"Entry pole face angle in rad", 0.0);
41 (
"FMAPFN",
"Filename for the fieldmap");
43 (
"GAP",
"Full gap height of the magnet (m)", 0.0);
45 (
"HAPERT",
"Bend plane magnet aperture (m)", 0.0);
47 (
"DESIGNENERGY",
"the mean energy of the particles in MeV");
84 length ? 2 *
sin(angle / 2) / length : angle;
107 }
else if (bend->
getName() !=
"RBEND3D") {
109 throw OpalException(
"OpalRBend3D::update", bend->
getName() +
": No filename for field map given");
117 }
else if (bend->
getName() !=
"RBEND3D") {
119 "RBend3D requires non-zero DESIGNENERGY");
Tps< T > sin(const Tps< T > &x)
Sine.
Inform & endl(Inform &inf)
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.
void setFieldMapFN(std::string fileName)
virtual void setDesignEnergy(const double &energy, bool changeable=true)
virtual void setEntranceAngle(double entranceAngle)
virtual void setBendAngle(double angle)
void setFieldAmplitude(double k0, double k0s)
virtual const std::string & getName() const
Get element name.
void setAperture(const ApertureType &type, const std::vector< double > &args)
bool isPositioned() const
virtual void setElementLength(double length)
Set design length.
CoordinateSystemTrafo getCSTrafoGlobal2Local() const
virtual void setParticleMatterInteraction(ParticleMatterInteractionHandler *spys)
void setCSTrafoGlobal2Local(const CoordinateSystemTrafo &ori)
virtual void setWake(WakeFunction *wf)
attach a wake field to the element
Vector_t getOrigin() const
Quaternion getRotation() const
@ PARTICLEMATTERINTERACTION
virtual void updateUnknown(ElementBase *)
Transmit the `‘unknown’' (not known to OPAL) attributes to CLASSIC.
virtual void print(std::ostream &) const
Print the object.
virtual void update()
Update the embedded CLASSIC element.
void registerOwnership() const
virtual void update()
Update the embedded CLASSIC bend.
virtual void print(std::ostream &) const
Print the object.
virtual OpalRBend3D * clone(const std::string &name)
Make clone.
OpalRBend3D()
Exemplar constructor.
ParticleMatterInteraction * parmatint_m
static OpalWake * find(const std::string &name)
Find named WAKE.
void initWakefunction(const ElementBase &element)
virtual ParticleMatterInteraction * clone(const std::string &name)
Make clone.
static ParticleMatterInteraction * find(const std::string &name)
Find named PARTICLEMATTERINTERACTION.
ParticleMatterInteractionHandler * handler_m
void initParticleMatterInteractionHandler(ElementBase &element)
The base class for all OPAL exceptions.