46 Setter(
const Beamline &,
const std::string &
type,
int slices);
53 void getCounts(
int &add,
int &rem,
int &rep)
const;
57 const std::string itsType;
63 int added, removed, replaced;
67 Setter::Setter(
const Beamline &beamline,
const std::string &
type,
int slices):
69 itsType(type), itsSlices(slices), added(0), removed(0), replaced(0)
86 if(dynamic_cast<Beamline *>(base)) {
91 if(
Integrator *i = dynamic_cast<Integrator *>(base)) {
93 if(
Multipole *mult = dynamic_cast<Multipole *>(i->getElement())) {
96 if(itsType ==
"NONE") {
111 }
else if(
Multipole *mult = dynamic_cast<Multipole *>(base)) {
127 void Setter::getCounts(
int &add,
int &rem,
int &rep)
const {
146 "The \"SETINT\" statement attaches special integrators to selected "
149 (
"LINE",
"Name of the lattice to be changed");
151 (
"TYPE",
"Type of integrator to be attached: default = THIN",
"THIN");
153 (
"SLICES",
"Number of slices to be used for \"TYPE=THIN\"", 1.0);
184 int add = 0, rem = 0, rep = 0;
185 splitter.getCounts(add, rem, rep);
189 cerr <<
"No integrator removed.\n";
190 }
else if(rem == 1) {
191 cerr <<
"1 integrator removed.\n";
193 cerr << rem <<
" integrators removed.\n";
197 cerr <<
"No integrator replaced.\n";
198 }
else if(rep == 1) {
199 cerr <<
"1 integrator replaced.\n";
201 cerr << rep <<
" integrators replaced.\n";
205 cerr <<
"No integrator installed.\n";
206 }
else if(add == 1) {
207 cerr <<
"1 integrator installed.\n";
209 cerr << add <<
" integrators installed.\n";
virtual ElementBase * removeAlignWrapper()
Remove align wrapper.
Interface for basic beam line object.
The base class for all OPAL actions.
Define the position of a misaligned element.
virtual void visitFlaggedElmPtr(const FlaggedElmPtr &)
Apply the algorithm to a FlaggedElmPtr.
std::vector< Attribute > itsAttr
The object attributes (see Attribute.hh).
Interface for general multipole.
void setElement(ElementBase *)
Replace the contained element.
static BeamSequence * find(const std::string &name)
Find a BeamSequence by name.
SetIntegrator()
Exemplar constructor.
void registerOwnership(const AttributeHandler::OwnerType &itsClass) const
virtual Beamline * fetchLine() const =0
Return the embedded CLASSIC beam line.
bool getSelectionFlag() const
Get selection flag.
An abstract sequence of beam line components.
The base class for all OPAL beam lines and sequences.
Integrator replacing each multipole by a set of thin lenses.
Base class for special integrators.
double getReal(const Attribute &attr)
Return real value.
virtual void execute()
Execute the command.
Attribute makeString(const std::string &name, const std::string &help)
Make string attribute.
ElementBase * getElement() const
Get the element pointer.
virtual SetIntegrator * clone(const std::string &name)
Make clone.
Attribute makeReal(const std::string &name, const std::string &help)
Make real attribute.
Inform & endl(Inform &inf)
A section of a beam line.
std::string getString(const Attribute &attr)
Get string value.