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");
Attribute makeReal(const std::string &name, const std::string &help)
Make real attribute.
virtual void setBendAngle(double angle)
void setFieldAmplitude(double k0, double k0s)
item[EANGLE] Entrance edge angle(radians).\item[ROTATION] Rotation of the magnet about its central axis(radians
std::string getString(const Attribute &attr)
Get string value.
CoordinateSystemTrafo getCSTrafoGlobal2Local() const
virtual void setParticleMatterInteraction(ParticleMatterInteractionHandler *spys)
void setCSTrafoGlobal2Local(const CoordinateSystemTrafo &ori)
virtual OpalRBend3D * clone(const std::string &name)
Make clone.
static ParticleMatterInteraction * find(const std::string &name)
Find named PARTICLEMATTERINTERACTION.
Vector_t getOrigin() const
OpalRBend3D()
Exemplar constructor.
virtual void print(std::ostream &) const
Print the object.
virtual const std::string & getName() const
Get element name.
Inform & endl(Inform &inf)
void setElement(ElementBase *)
Assign new CLASSIC element.
virtual void setWake(WakeFunction *wf)
attach a wake field to the element
The base class for all OPAL exceptions.
virtual void update()
Update the embedded CLASSIC bend.
void initParticleMatterInteractionHandler(ElementBase &element)
Attribute makeString(const std::string &name, const std::string &help)
Make string attribute.
ElementBase * getElement() const
Return the embedded CLASSIC element.
void initWakefunction(const ElementBase &element)
bool isPositioned() const
void setFieldMapFN(std::string fileName)
const std::string & getOpalName() const
Return object name.
virtual void setEntranceAngle(double entranceAngle)
std::vector< Attribute > itsAttr
The object attributes.
ParticleMatterInteraction * parmatint_m
double getReal(const Attribute &attr)
Return real value.
ParticleMatterInteractionHandler * handler_m
virtual void setDesignEnergy(const double &energy, bool changeable=true)
virtual ParticleMatterInteraction * clone(const std::string &name)
Make clone.
virtual void setElementLength(double length)
Set design length.
virtual void updateUnknown(ElementBase *)
Transmit the ``unknown'' (not known to OPAL) attributes to CLASSIC.
Quaternion getRotation() const
void setAperture(const ApertureType &type, const std::vector< double > &args)
Tps< T > sin(const Tps< T > &x)
Sine.
static OpalWake * find(const std::string &name)
Find named WAKE.
virtual void print(std::ostream &) const
Print the object.
virtual void update()
Update the embedded CLASSIC element.
void registerOwnership() const