24 #include <boost/regex.hpp>
32 "The \"SLIT\" element defines a slit."),
35 (
"XSIZE",
"Horizontal half-aperture in m");
37 (
"YSIZE",
"Vertical half-aperture in m");
39 (
"OUTFN",
"Monitor output filename");
76 std::string Double(
"(-?[0-9]+\\.?[0-9]*([Ee][+-]?[0-9]+)?)");
79 boost::regex parser(
"rectangle\\(" + Double +
"," + Double +
"\\)");
81 if (!boost::regex_match(desc, what, parser))
return;
83 double width = atof(std::string(what[1]).c_str());
84 double height = atof(std::string(what[3]).c_str());
102 std::stringstream description;
103 description <<
"rectangle(" << width <<
"," << height <<
")";
ParticleMatterInteraction * parmatint_m
std::string getDescription() const
Representation for a collimator.
static AttCell * registerStringAttribute(const std::string &name)
Register a ``string'' element attribute.
Interface for basic beam line object.
virtual void fillRegisteredAttributes(const ElementBase &, ValueFlag)
Fill in all registered attributes.
ValueFlag
Switch for value desired on ATTLIST command.
virtual ElementBase * removeWrappers()
Return the design element.
OpalSlit()
Exemplar constructor.
virtual void setElementLength(double length)
Set design length.
std::vector< Attribute > itsAttr
The object attributes (see Attribute.hh).
virtual void update()
Update the embedded CLASSIC collimator.
static ParticleMatterInteraction * find(const std::string &name)
Find named PARTICLEMATTERINTERACTION.
ParticleMatterInteractionHandler * handler_m
static std::map< std::string, OwnPtr< AttCell > > attributeRegistry
The registry for named attributes.
const std::string & getOpalName() const
Return object name.
void setDescription(const std::string &desc)
void initParticleMatterInteractionHandler(ElementBase &element)
void setOutputFN(const std::string &fn)
Base class for all beam line elements.
void setElement(ElementBase *)
Assign new CLASSIC element.
virtual void fillRegisteredAttributes(const ElementBase &, ValueFlag)
Fill in all registered attributes.
void registerOwnership() const
virtual void update()
Update the embedded CLASSIC element.
virtual void updateUnknown(ElementBase *)
Transmit the ``unknown'' (not known to OPAL) attributes to CLASSIC.
virtual void setParticleMatterInteraction(ParticleMatterInteractionHandler *spys)
ElementBase * getElement() const
Return the embedded CLASSIC element.
void setAperture(const ApertureType &type, const std::vector< double > &args)
virtual OpalSlit * clone(const std::string &name)
Make clone.
double getReal(const Attribute &attr)
Return real value.
Attribute makeString(const std::string &name, const std::string &help)
Make string attribute.
Attribute makeReal(const std::string &name, const std::string &help)
Make real attribute.
static AttCell * registerRealAttribute(const std::string &name)
Register a ``real'' element attribute.
std::string getString(const Attribute &attr)
Get string value.