30template <
class T,
unsigned Dim>
60 Ring(
const std::string& ring);
84 virtual bool apply(
const size_t&
id,
const double& t,
Vector_t& E,
115 double& endField)
override;
131 virtual bool bends()
const override {
return true;}
142 virtual void getDimensions(
double& zBegin,
double& zEnd)
const override;
422 return Vector_t(vec_3d(0), vec_3d(1), vec_3d(2));
426 return Vector3D(vec_t[0], vec_t[1], vec_t[2]);
std::vector< RingSection * > RingSectionList
Tps< T > sqrt(const Tps< T > &x)
Square root.
Interface for a single beam element.
Ring describes a ring type geometry for tracking.
virtual const EMField & getField() const override
Not implemented, throws an exception.
double getBeamRInit() const
Get the initial beam radius.
Vector_t getNextPosition() const
Get the initial element's start position in cartesian coordinates.
std::vector< RingSection * > getSectionsAt(const Vector_t &pos)
Get the list of sections at position pos.
void setSymmetry(double symmetry)
Set the rotational symmetry of the ring (number of cells)
PartBunchBase< double, 3 > * getRefPartBunch() const
Get pointer to RefPartBunchBase<double, 3> from the bunch.
double getLatticePhiInit() const
Get the initial element's azimuthal angle.
double getRingMinR() const
Get the ring minimum.
Rotation3D getRotationStartToEnd(Euclid3D delta) const
size_t getNumberOfRingSections() const
Get number of RingSections.
virtual EMField & getField() override
Not implemented, throws an exception.
static bool sectionCompare(RingSection const *const sec1, RingSection const *const sec2)
void setBeamThetaInit(double thetaInit)
Set the initial beam rotation relative to the tangent vector.
Vector_t getNextNormal() const
Get the initial element's start normal in cartesian coordinates.
double getBeamPRInit() const
Get the initial beam radial momentum.
virtual void finalise() override
Clean up the Ring.
double getSymmetry() const
Get the rotational symmetry of the ring (number of cells)
virtual ~Ring()
Destructor - deletes lossDS_m if not nullptr.
virtual bool apply(const size_t &id, const double &t, Vector_t &E, Vector_t &B) override
Overwrite data in vector E and B with electric and magnetic field.
Ring & operator=(const Ring &ring)
Disabled.
RingSection * getLastSectionPlaced() const
Get the last section placed or nullptr if no sections were placed yet.
void setBeamRInit(double rInit)
Set the initial beam radius.
virtual const PlanarArcGeometry & getGeometry() const override
Not implemented.
void setIsClosed(bool isClosed)
Set flag for closure checking.
void setLatticeThetaInit(double thetaInit)
Set the first element's horizontal angle.
void setRefPartBunch(PartBunchBase< double, 3 > *bunch)
Set RefPartBunchBase<double, 3> to bunch.
virtual ElementBase * clone() const override
Inherited copy constructor.
void setHarmonicNumber(double cyclHarm)
Set the harmonic number for RF (number of bunches in the ring)
void setLatticePhiInit(double phiInit)
Set the initial element's azimuthal angle.
virtual bool bends() const override
Returns true - Ring is assumed to bend particles, being a ring.
virtual void initialise(PartBunchBase< double, 3 > *bunch, double &startField, double &endField) override
Initialise the Ring.
double getLatticeThetaInit() const
Get the first element's horizontal angle.
double latticeThetaInit_m
std::vector< RingSectionList > ringSections_m
virtual void accept(BeamlineVisitor &visitor) const override
Accept the BeamlineVisitor.
void setRingAperture(double minR, double maxR)
Set the ring aperture limits.
void setScale(double scale)
Set the scaling factor for the fields.
RingSectionList section_list_m
double getBeamPhiInit() const
Get the initial beam azimuthal angle.
void setBeamPRInit(double pRInit)
Set the initial beam radial momentum.
double getIsClosed() const
Get flag for closure checking.
double getRingMaxR() const
Get the ring maximum.
void checkMidplane(Euclid3D delta) const
void setLossDataSink(LossDataSink *sink)
Set LossDataSink to sink.
void setBeamPhiInit(double phiInit)
Set the initial beam azimuthal angle.
double getBeamThetaInit() const
Get the initial beam rotation relative to the tangent vector.
PlanarArcGeometry planarArcGeometry_m
double getHarmonicNumber()
Get the harmonic number for RF (number of bunches in the ring)
virtual void getDimensions(double &zBegin, double &zEnd) const override
Not implemented - always throws an exception.
void setRFFreq(double rfFreq)
Set the nominal RF frequency.
void lockRing()
Lock the ring.
PartBunchBase< double, 3 > * getLossDataSink() const
Get pointer to lossDataSink.
double getRFFreq() const
Get the nominal RF frequency.
void setLatticeRInit(double rInit)
Set the initial element's radius.
virtual PlanarArcGeometry & getGeometry() override
Not implemented.
void appendElement(const Component &element)
Add element to the ring.
Vector_t getStartNormal() const
void rotateToCyclCoordinates(Euclid3D &euclid3d) const
static Vector_t convert(const Vector3D &vec)
Convert from a Vector3D to a Vector_t.
double getLatticeRInit() const
Get the initial element's radius.
static const double lengthTolerance_m
RingSection * getSection(int i) const
Return ith section.
Vector_t getStartPosition() const
PartBunchBase< double, 3 > * refPartBunch_m
static const double angleTolerance_m
Displacement and rotation in space.
A simple arc in the XZ plane.
Rotation in 3-dimensional space.
Abstract base class for electromagnetic fields.
Component placement handler in ring geometry.
Vektor< double, 3 > Vector_t