34 "The \"MULTIPOLE\" element defines a thick multipole.\n"
35 "* If the length is non-zero, the strengths are per unit "
36 "length.\n* If the length is zero, the strengths are the "
37 "values integrated over the length.\n"
38 "* With zero length no synchrotron radiation can be calculated.") {
40 (
"KN",
"Normalised multipole strengths (normal) in m^(-k)");
42 (
"DKN",
"Normalised multipole strengths errors(normal) in m^(-k)");
44 (
"KS",
"Normalised multipole strengths (skew) in m^(-k)");
46 (
"DKS",
"Normalised multipole strength errors (skew) in m^(-k)");
90 int normSize = norm.size();
91 int skewSize = skew.size();
92 normErrors.resize(normSize, 0.0);
93 skewErrors.resize(skewSize, 0.0);
95 int top = (normSize > skewSize) ? normSize : skewSize;
97 for(
int comp = 1; comp <= top; comp++) {
98 factor /= double(comp);
99 if(comp <= normSize) {
103 if(comp <= skewSize) {
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.
ElementBase * getElement() const
Return the embedded CLASSIC element.
void setElement(ElementBase *)
Assign new CLASSIC element.
std::vector< Attribute > itsAttr
The object attributes.
double getP0() const
Return value of global reference momentum.
static OpalData * getInstance()
virtual void setElementLength(double length)
Set design length.
void setNormalComponent(int, double)
Set normal component.
void setSkewComponent(int, double)
Set skew component.
virtual void setField(const BMultipoleField &field)
Set mulitpole field.
The magnetic field of a multipole.
void setNormalComponent(int n, double Bn)
Set component.
void setSkewComponent(int n, double Bn)
Set component.
virtual double getLength() const
Return element length.
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 OpalMultipole * clone(const std::string &name)
Make clone.
virtual void print(std::ostream &) const
Print the object.
virtual void update()
Update the embedded CLASSIC multipole.
OpalMultipole()
Exemplar constructor.