63 #ifndef CLASSIC_ElementBase_HH
64 #define CLASSIC_ElementBase_HH
74 #include <boost/optional.hpp>
97 virtual const std::string &
getName()
const;
187 virtual double getExit()
const;
236 virtual double getAttribute(
const std::string &aKey)
const;
240 virtual bool hasAttribute(
const std::string &aKey)
const;
246 virtual void setAttribute(
const std::string &aKey,
double val);
325 std::pair<ElementBase::ApertureType, std::vector<double> >
getAperture()
const;
334 void setActionRange(
const std::queue<std::pair<double, double> > &range);
348 for (
unsigned int d = 0; d < 3; ++ d) {
356 void print(std::ostream &)
const;
489 {
return wake_m != NULL; }
611 std::string(
"ELEMEDGE for \"") +
getName() +
"\" not set");
PartBunchBase< T, Dim >::ConstIterator end(PartBunchBase< T, Dim > const &bunch)
PartBunchBase< T, Dim >::ConstIterator begin(PartBunchBase< T, Dim > const &bunch)
T::PETE_Expr_t::PETE_Return_t max(const PETE_Expr< T > &expr, NDIndex< D > &loc)
T::PETE_Expr_t::PETE_Return_t min(const PETE_Expr< T > &expr, NDIndex< D > &loc)
boost::function< boost::tuple< double, bool >arguments_t)> type
Map of std::string versus double value.
virtual void setBoundaryGeometry(BoundaryGeometry *geo)
void setElementPosition(double elemedge)
Access to ELEMEDGE attribute.
virtual Channel * getChannel(const std::string &aKey, bool create=false)
Construct a read/write channel.
virtual void setName(const std::string &name)
Set element name.
virtual const std::string & getName() const
Get element name.
virtual void removeAttribute(const std::string &aKey)
Remove an existing attribute.
virtual double getArcLength() const
Get arc length.
virtual const BGeometryBase & getGeometry() const =0
Get geometry.
virtual double getExit() const
Get exit position.
void setAperture(const ApertureType &type, const std::vector< double > &args)
virtual ParticleMatterInteractionHandler * getParticleMatterInteraction() const
virtual double getElementLength() const
Get design length.
bool update(const AttributeSet &)
Update element.
virtual Euclid3D getExitPatch() const
Get patch.
bool isPositioned() const
virtual void setElementLength(double length)
Set design length.
ParticleMatterInteractionHandler * parmatint_m
virtual Euclid3D getExitFrame() const
Get transform.
CoordinateSystemTrafo misalignment_m
void setMisalignment(const CoordinateSystemTrafo &cst)
CoordinateSystemTrafo getMisalignment() const
void getMisalignment(double &x, double &y, double &s) const
virtual const ConstChannel * getConstChannel(const std::string &aKey) const
Construct a read-only channel.
void operator=(const ElementBase &)
virtual void accept(BeamlineVisitor &visitor) const =0
Apply visitor.
CoordinateSystemTrafo getCSTrafoGlobal2Local() const
virtual void setAttribute(const std::string &aKey, double val)
Set value of an attribute.
virtual double getOrigin() const
Get origin position.
virtual BoundingBox getBoundingBoxInLabCoords() const
bool isInsideTransverse(const Vector_t &r) const
virtual Euclid3D getEntranceFrame() const
Get transform.
std::string getOutputFN() const
Get output filename.
virtual ElementType getType() const =0
Get element type std::string.
void setOutputFN(std::string fn)
Set output filename.
virtual bool isInside(const Vector_t &r) const
std::pair< ApertureType, std::vector< double > > aperture_m
virtual bool hasBoundaryGeometry() const
double elementPosition_m
ELEMEDGE attribute.
virtual void setParticleMatterInteraction(ParticleMatterInteractionHandler *spys)
virtual Euclid3D getTransform(double fromS, double toS) const
Get transform.
virtual void makeSharable()
Set sharable flag.
virtual bool hasAttribute(const std::string &aKey) const
Test for existence of an attribute.
bool isElementPositionSet() const
void setRotationAboutZ(double rotation)
Set rotation about z axis in bend frame.
std::queue< std::pair< double, double > > actionRange_m
void setCSTrafoGlobal2Local(const CoordinateSystemTrafo &ori)
virtual BoundaryGeometry * getBoundaryGeometry() const
return the attached boundary geometrt object if there is any
virtual double getEntrance() const
Get entrance position.
virtual CoordinateSystemTrafo getEdgeToBegin() const
std::string getTypeString() const
double getElementPosition() const
virtual ElementBase * clone() const =0
Return clone.
virtual ElementBase * copyStructure()
Make a structural copy.
double getRotationAboutZ() const
BoundaryGeometry * bgeometry_m
virtual Euclid3D getTotalTransform() const
Get transform.
std::pair< ElementBase::ApertureType, std::vector< double > > getAperture() const
bool isSharable() const
Test if the element can be shared.
void setActionRange(const std::queue< std::pair< double, double > > &range)
virtual BGeometryBase & getGeometry()=0
Get geometry.
virtual int getRequiredNumberOfTimeSteps() const
virtual Euclid3D getEntrancePatch() const
Get patch.
virtual WakeFunction * getWake() const
return the attached wake object if there is any
void setCurrentSCoordinate(double s)
virtual double getAttribute(const std::string &aKey) const
Get attribute value.
virtual bool hasParticleMatterInteraction() const
virtual CoordinateSystemTrafo getEdgeToEnd() const
virtual bool hasWake() const
virtual void getElementDimensions(double &begin, double &end) const
virtual void setWake(WakeFunction *wf)
attach a wake field to the element
CoordinateSystemTrafo csTrafoGlobal2Local_m
bool isInside(const Vector_t &) const
Vector_t upperRightCorner
static BoundingBox getBoundingBox(const std::vector< Vector_t > &points)
void getCombinedBoundingBox(const BoundingBox &other)
void print(std::ostream &) const
boost::optional< Vector_t > getPointOfIntersection(const Vector_t &position, const Vector_t &direction) const
Displacement and rotation in space.
Abstract base class for accelerator geometry classes.
virtual Euclid3D getTransform(double fromS, double toS) const =0
Get transform.
virtual Euclid3D getExitFrame() const
Get transform.
virtual Euclid3D getExitPatch() const
Get patch.
virtual void setElementLength(double length)
Set geometry length.
virtual double getEntrance() const
Get entrance position.
virtual double getExit() const
Get exit position.
virtual Euclid3D getTotalTransform() const
Get transform.
virtual double getElementLength() const =0
Get geometry length.
virtual double getOrigin() const
Get origin position.
virtual Euclid3D getEntranceFrame() const
Get transform.
virtual Euclid3D getEntrancePatch() const
Get patch.
virtual double getArcLength() const =0
Get arc length.
Abstract interface for read/write access to variable.
Abstract interface for read-only access to variable.
Abstract base class for reference counted objects.
Vektor< double, 3 > Vector_t