62 (
"LINE",
"The beam line to be Micadoed");
64 (
"BEAM",
"The beam to be used",
"UNNAMED_BEAM");
66 (
"RANGE",
"The range in the lattice");
85 if(dynamic_cast<OpalKicker *>(elem)) {
89 }
else if(dynamic_cast<OpalHKicker *>(elem)) {
92 }
else if(dynamic_cast<OpalVKicker *>(elem)) {
97 "Orbit Corrector \"" + name +
"\" not found.");
108 std::cout <<
"\nTotal corrector settings for plane "
109 << (plane == 0 ?
'X' :
'Y') <<
'\n';
116 double setting = (plane == 0) ? - field.
getBy() : field.
getBx();
120 std::cout << std::setw(20) << corr->
getName()
121 << std::setw(12) << setting <<
'\n';
124 rms += setting * setting;
129 std::cout <<
"R.m.s. : " << std::setw(20) << rms <<
'\n'
130 <<
"Maximum: " << std::setw(20) << top <<
std::endl;
138 std::cout <<
"\nFinal monitor readings for plane "
139 << (plane == 0 ?
'X' :
'Y') <<
'\n';
143 double reading = (*iter)->orbit[q];
145 std::cout << std::setw(20) << (*iter)->getElement()->getName()
146 << std::setw(12) << reading <<
'\n';
149 rms += reading * reading;
154 std::cout <<
"R.m.s. : " << std::setw(20) << rms <<
'\n'
155 <<
"Maximum: " << std::setw(20) << top <<
std::endl;
164 iter !=
itsLine.end(); ++iter) {
166 iter->accept(mapper);
168 iter->isUsed[0] = iter->isUsed[1] =
false;
189 if(
Corrector *corr = dynamic_cast<Corrector *>(design)) {
190 switch(corr->getPlane()) {
207 }
else if(
Monitor *moni = dynamic_cast<Monitor *>(design)) {
208 switch(moni->getPlane()) {
void setReal(Attribute &attr, double val)
Set real value.
Abstract base class for all orbit correction commands.
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(const PETE_Expr< T > &l)
virtual BDipoleField & getField()=0
Return the corrector field.
Interface for basic beam line object.
The field of a magnetic dipole.
double getP0() const
Return value of global reference momentum.
Corrector acts on both planes.
The base class for all OPAL actions.
Build a map using the linear map around the design orbit for each element.
Interface for beam position monitors.
T::PETE_Expr_t::PETE_Return_t max(const PETE_Expr< T > &expr, NDIndex< D > &loc)
The base class for all OPAL exceptions.
virtual ElementBase * removeWrappers()
Return the design element.
Interface for general corrector.
void test(ElementBase *)
Routine to test for corrector or monitor.
Attribute makeRange(const std::string &name, const std::string &help)
Create a range attribute.
virtual double getBy() const
Get vertical component.
virtual const std::string & getName() const
Get element name.
Monitor acts on both planes.
std::vector< Attribute > itsAttr
The object attributes (see Attribute.hh).
LocalList monitorTable[2]
void listCorrectors(bool list, int plane)
List correctors before or after correction.
static OpalData * getInstance()
virtual double getElementLength() const
Get design length.
void listMonitors(bool list, int plane)
List monitors before or after correction.
TLine itsLine
The flat beam line on which the correction is done.
constexpr double c
The velocity of light in m/s.
Corrector acts on y-plane.
LocalList::iterator LocalIter
LocalList correctorTable[2]
Corrector acts on x-plane.
virtual double getBx() const
Get horizontal component.
virtual void getMatrix(FMatrix< double, 6, 6 > &) const
Return the linear part of the accumulated map.
bool isMoni[2]
Flag telling wether a monitor exists.
PartData reference
The particle reference data.
Tps< T > sqrt(const Tps< T > &x)
Square root.
virtual ~CorrectionBase()
virtual void update()
Update this object.
Object * find(const std::string &name)
Find entry.
The base class for all OPAL objects.
std::string::iterator iterator
double getReal(const Attribute &attr)
Return real value.
bool isCorr[2]
Flags telling wether a corrector exists.
Attribute makeString(const std::string &name, const std::string &help)
Make string attribute.
void setupTables()
Set up the corrector and monitor tables.
ElementBase * getElement() const
Get the element pointer.
void addKick(int plane, Row &, double kick)
Add to kicker strength.
Inform & endl(Inform &inf)
Structure for a row of the Twiss table.
A section of a beam line.