35 "The \"MULTIPOLE\" element defines a thick multipole.\n"
36 "* If the length is non-zero, the strengths are per unit "
37 "length.\n* If the length is zero, the strengths are the "
38 "values integrated over the length.\n"
39 "* With zero length no synchrotron radiation can be calculated.") {
43 "DKN",
"Normalised multipole strengths errors(normal) in m^(-k)");
47 "DKS",
"Normalised multipole strength errors (skew) in m^(-k)");
85 unsigned int normSize = norm.size();
86 unsigned int skewSize = skew.size();
87 normErrors.resize(normSize, 0.0);
88 skewErrors.resize(skewSize, 0.0);
91 unsigned int top = (normSize > skewSize) ? normSize : skewSize;
94 for (
unsigned int comp = 0; comp < top; ++comp) {
95 factor /= double(comp + 1);
96 if (comp < normSize) {
100 if (comp < skewSize) {
The magnetic field of a multipole.
void setNormalComponent(int n, double Bn)
Set component.
void setSkewComponent(int n, double Bn)
Set component.
virtual void setElementLength(double length)
Set design length.
ElementBase * getElement() const
Return the embedded OPALX element.
void setElement(ElementBase *)
Assign new OPALX element.
virtual void setField(const BMultipoleField &field)
Set mulitpole field.
void setSkewComponent(int n, double)
void setNormalComponent(int n, double)
std::vector< Attribute > itsAttr
The object attributes.
double getP0() const
Return value of global reference momentum.
static OpalData * getInstance()
virtual double getLength() const
Return element length.
virtual void updateUnknown(ElementBase *)
Transmit the `‘unknown’' (not known to OPALX) attributes to OPALX.
virtual void print(std::ostream &) const
Print the object.
virtual void update()
Update the embedded OPALX element.
void registerOwnership() const
virtual OpalMultipole * clone(const std::string &name)
Make clone.
virtual void print(std::ostream &) const
Print the object.
virtual void update()
Update the embedded OPALX multipole.
OpalMultipole()
Exemplar constructor.
Attribute makeRealArray(const std::string &name, const std::string &help)
Create real array attribute.
std::vector< double > getRealArray(const Attribute &attr)
Get array value.
constexpr double c
The velocity of light in m/s.