27 "The \"PEPPERPOT\" element defines an pepperpot collimator."),
28 parmatint_m(nullptr) {
30 (
"XSIZE",
"Size in x of the pepperpot in m");
32 (
"YSIZE",
"Size in y of the pepperpot in m");
34 (
"NHOLX",
"Number of holes in x");
36 (
"NHOLY",
"Number of holes in y");
38 (
"R",
"Radios of a holes in m");
48 parmatint_m(nullptr) {
81 double shiftx = (xsize - diameter) / repX;
82 double shifty = (ysize - diameter) / repY;
84 std::stringstream description;
85 description <<
"repeat(repeat(translate(ellipse("
86 << diameter <<
"," << diameter <<
"),"
87 << -shiftx * 0.5 * repX <<
"," << -shifty * 0.5 * repY <<
"),"
88 << repX <<
"," << shiftx <<
",0.0),"
89 << repY <<
",0.0," << shifty <<
")";
91 std::cout <<
"OpalPepperPot.cpp: " << __LINE__ <<
"\t"
Inform & endl(Inform &inf)
double getReal(const Attribute &attr)
Return real value.
Attribute makeReal(const std::string &name, const std::string &help)
Make real attribute.
std::string getString(const Attribute &attr)
Get string value.
ElementBase * getElement() const
Return the embedded CLASSIC element.
void setElement(ElementBase *)
Assign new CLASSIC element.
const std::string & getOpalName() const
Return object name.
std::vector< Attribute > itsAttr
The object attributes.
virtual void setElementLength(double length)
Set design length.
void setOutputFN(std::string fn)
Set output filename.
virtual void setParticleMatterInteraction(ParticleMatterInteractionHandler *spys)
void setDescription(const std::string &desc)
@ PARTICLEMATTERINTERACTION
virtual void updateUnknown(ElementBase *)
Transmit the `‘unknown’' (not known to OPAL) attributes to CLASSIC.
virtual void update()
Update the embedded CLASSIC element.
void registerOwnership() const
ParticleMatterInteraction * parmatint_m
virtual void update()
Update the embedded CLASSIC collimator.
OpalPepperPot()
Exemplar constructor.
virtual OpalPepperPot * clone(const std::string &name)
Make clone.
virtual ParticleMatterInteraction * clone(const std::string &name)
Make clone.
static ParticleMatterInteraction * find(const std::string &name)
Find named PARTICLEMATTERINTERACTION.
ParticleMatterInteractionHandler * handler_m
void initParticleMatterInteractionHandler(ElementBase &element)