18#ifndef CLASSIC_ABSBEAMLINE_Offset_HH
19#define CLASSIC_ABSBEAMLINE_Offset_HH
145 bool bends()
const override;
148 double& startField,
double& endField)
override;
bool operator!=(const Offset &off1, const Offset &off2)
Return not of operator ==.
std::ostream & operator<<(std::ostream &out, const Offset &off1)
Print Offset off1 to the ostream.
bool operator==(const Offset &off1, const Offset &off2)
Return true if off1 is equal to off2 within static floating point tolerance.
Interface for a single beam element.
static Vector_t rotate(Vector_t vec, double theta)
Rotate vec anticlockwise by angle theta about z axis; return the rotated vector.
static Offset globalCylindricalOffset(const std::string &name, double radius_out, double phi_out, double theta_out)
Factory method to make an offset in global cylindrical polar coordinates.
static double getTheta(Vector_t vec1, Vector_t vec2)
Calculate the angle between vectors on the midplane.
Euclid3DGeometry & getGeometry() override
Get geometry.
Offset & operator=(const Offset &)
Assignment operator deep copies geometry and wrappedGeometry; all other stuff is copied as well.
bool isGeometryAllocated() const
~Offset()
deletes geometry and wrappedGeometry
void getDimensions(double &, double &) const override
void setEndPosition(Vector_t position)
Vector_t getEndPosition() const
EMField & getField() override
Not implemented - throws GeneralClassicException.
Offset()
Default constructor sets everything to 0., makes a default geometry with everything set to 0.
void setEndDirection(Vector_t direction)
static double float_tolerance
ElementBase * clone() const override
Just calls the copy constructor on *this.
void accept(BeamlineVisitor &) const override
Apply visitor to Offset.
Euclid3DGeometry * geometry_m
static Offset localCartesianOffset(const std::string &name, Vector_t end_position, Vector_t end_direction)
Factory method to make an offset in cartesian coordinates local to the end of the previous element.
static Offset globalCartesianOffset(const std::string &name, Vector_t end_position, Vector_t end_direction)
Factory method to make an offset in global cartesian coordinates.
bool getIsLocal() const
Returns true if stored coordinates are in the local coordinate system of the last placed object.
void setIsLocal(bool isLocal)
Set to true if stored coordinates are in the local coordinate system of the last placed object.
bool bends() const override
Returns true if either input angle or output angle are greater than float_tolerance.
void initialise(PartBunchBase< double, 3 > *bunch, double &startField, double &endField) override
Vector_t getEndDirection() const
static Offset localCylindricalOffset(const std::string &name, double theta_in, double theta_out, double displacement)
Factory method to make an offset in Cylindrical coordinates local to the end of the previous element.
Abstract base class for electromagnetic fields.