60                "The \"TRIMCOIL\" statement defines a trim coil."),
 
   63                     (
"TYPE", 
"Specifies the type of trim coil.",
 
   64                      {
"PSI-BFIELD", 
"PSI-PHASE", 
"PSI-BFIELD-MIRRORED"});
 
   67                        (
"COEFNUM", 
"Radial profile: list of polynomial coefficients for the numerator (not for PSI-BFIELD-MIRRORED)");
 
   70                          (
"COEFDENOM", 
"Radial profile: list of polynomial coefficients for the denominator (not for PSI-BFIELD-MIRRORED)");
 
   73                           (
"COEFNUMPHI", 
"Angular profile: list of polynomial coefficients for the numerator (not for PSI-BFIELD-MIRRORED)");
 
   76                             (
"COEFDENOMPHI", 
"Angular profile: list of polynomial coefficients for the denominator (not for PSI-BFIELD-MIRRORED)");
 
   79                     (
"BMAX", 
"Maximum magnetic field [T]");
 
   82                       (
"PHIMIN", 
"Minimal azimuth [deg] (default 0)", 0.0);
 
   85                       (
"PHIMAX", 
"Maximal azimuth [deg] (default 360)", 360.0);
 
   88                     (
"RMIN", 
"Minimum radius [mm]");
 
   91                     (
"RMAX", 
"Maximum radius [mm]");
 
   94                      (
"SLPTC", 
"Slopes of the rising edge [1/mm] (for PSI-BFIELD-MIRRORED)");
 
  138     if (trimcoil == 
nullptr) {
 
  139         throw OpalException(
"OpalTrimCoil::find()", 
"OpalTrimCoil \"" + name + 
"\" not found.");
 
  152     static const std::map<std::string, TrimCoilType> stringTrimCoilType_s = {
 
  160                             "The attribute \"TYPE\" isn't set for the \"TRIMCOIL\" statement");
 
  184             trimcoil_m = std::unique_ptr<TrimCoilBFit>     (
new TrimCoilBFit    (bmax, rmin, rmax, coefnum, coefdenom, coefnumphi, coefdenomphi));
 
  186             trimcoil_m = std::unique_ptr<TrimCoilPhaseFit> (
new TrimCoilPhaseFit(bmax, rmin, rmax, coefnum, coefdenom, coefnumphi, coefdenomphi));
 
  200     os << 
"* ******************************** T R I M C O I L ********************************\n" 
  219     os << 
"* *********************************************************************************" << 
endl;
 
  224     std::stringstream ss;
 
  226     for (std::size_t i = 0; i < coef.size(); ++i) {
 
  227         ss << ((i > 0) ? 
"+ " : 
"") << coef[i]
 
  228            << ((i > 0) ? (
" * x^" + std::to_string(i)) : 
"") << 
' ';
 
  230     os << 
"* POLYNOM " << attr.
getName() << 
"   " << ss.str() << 
'\n';
 
std::unique_ptr< TrimCoil > trimcoil_m
Actual implementation. 
Attribute makeReal(const std::string &name, const std::string &help)
Make real attribute. 
static OpalData * getInstance()
bool builtin
Built-in flag. 
TrimCoilType getTrimCoilType() const 
void setOpalName(const std::string &name)
Set object name. 
The base class for all OPAL objects. 
virtual void execute()
Check the OpalTrimCoil data. 
std::string getString(const Attribute &attr)
Get string value. 
void define(Object *newObject)
Define a new object. 
void initOpalTrimCoil()
Initialise implementation. 
const std::string & getName() const 
Return the attribute name. 
std::vector< double > getRealArray(const Attribute &attr)
Get array value. 
Attribute makeRealArray(const std::string &name, const std::string &help)
Create real array attribute. 
Inform & endl(Inform &inf)
void registerOwnership(const AttributeHandler::OwnerType &itsClass) const 
The base class for all OPAL exceptions. 
Attribute makePredefinedString(const std::string &name, const std::string &help, const std::initializer_list< std::string > &predefinedStrings)
Make predefined string attribute. 
virtual void update()
Update the OpalTrimCoil data. 
void printPolynom(Inform &os, const Attribute &attr) const 
Helper method for printing. 
const std::string & getOpalName() const 
Return object name. 
std::vector< Attribute > itsAttr
The object attributes. 
OpalTrimCoil()
Exemplar constructor. 
virtual bool canReplaceBy(Object *object)
Test if replacement is allowed. 
double getReal(const Attribute &attr)
Return real value. 
The base class for all OPAL definitions. 
Inform & level3(Inform &inf)
Object * find(const std::string &name)
Find entry. 
static OpalTrimCoil * find(const std::string &name)
Find named trim coil. 
virtual OpalTrimCoil * clone(const std::string &name)
Make clone. 
Inform & print(Inform &os) const 
A representation of an Object attribute.