OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Ring Class Reference

Ring describes a ring type geometry for tracking. More...

#include <Ring.h>

Inheritance diagram for Ring:
Inheritance graph
[legend]
Collaboration diagram for Ring:
Collaboration graph
[legend]

Public Member Functions

 Ring (std::string ring)
 
 Ring (const Ring &ring)
 
virtual ~Ring ()
 
virtual bool apply (const size_t &id, const double &t, Vector_t &E, Vector_t &B) override
 
virtual bool apply (const Vector_t &R, const Vector_t &P, const double &t, Vector_t &E, Vector_t &B) override
 
virtual void initialise (PartBunchBase< double, 3 > *bunch, double &startField, double &endField) override
 
virtual void initialise (PartBunchBase< double, 3 > *bunch)
 
virtual void finalise () override
 
virtual bool bends () const override
 
virtual void accept (BeamlineVisitor &visitor) const override
 
virtual void getDimensions (double &zBegin, double &zEnd) const override
 
virtual ElementBaseclone () const override
 
void appendElement (const Component &element)
 
virtual EMFieldgetField () override
 
virtual const EMFieldgetField () const override
 
virtual PlanarArcGeometrygetGeometry () override
 
virtual const PlanarArcGeometrygetGeometry () const override
 
void setLossDataSink (LossDataSink *sink)
 
PartBunchBase< double, 3 > * getLossDataSink () const
 
void setRefPartBunch (PartBunchBase< double, 3 > *bunch)
 
PartBunchBase< double, 3 > * getRefPartBunch () const
 
void setHarmonicNumber (double cyclHarm)
 
double getHarmonicNumber ()
 
void setRFFreq (double rfFreq)
 
double getRFFreq () const
 
void setBeamRInit (double rInit)
 
double getBeamRInit () const
 
void setBeamPhiInit (double phiInit)
 
double getBeamPhiInit () const
 
void setBeamPRInit (double pRInit)
 
double getBeamPRInit () const
 
void setLatticeRInit (double rInit)
 
double getLatticeRInit () const
 
void setLatticePhiInit (double phiInit)
 
double getLatticePhiInit () const
 
Vector_t getNextPosition () const
 
Vector_t getNextNormal () const
 
void setLatticeThetaInit (double thetaInit)
 
double getLatticeThetaInit () const
 
void setSymmetry (double symmetry)
 
void setScale (double scale)
 
double getSymmetry () const
 
void setIsClosed (bool isClosed)
 
double getIsClosed () const
 
void setRingAperture (double minR, double maxR)
 
double getRingMinR () const
 
double getRingMaxR () const
 
void lockRing ()
 
RingSectiongetLastSectionPlaced () const
 
std::vector< RingSection * > getSectionsAt (const Vector_t &pos)
 
- Public Member Functions inherited from Component
 Component (const std::string &name)
 Constructor with given name. More...
 
 Component ()
 
 Component (const Component &right)
 
virtual ~Component ()
 
EVector Efield (const Point3D &P) const
 Return the field in a point. More...
 
BVector Bfield (const Point3D &P) const
 Return the field in a point. More...
 
EVector Efield (const Point3D &P, double t) const
 Return the field in a point. More...
 
BVector Bfield (const Point3D &P, double t) const
 Return the field in a point. More...
 
EBVectors EBfield (const Point3D &P) const
 Return the field in a point. More...
 
EBVectors EBfield (const Point3D &P, double t) const
 Return the field in a point. More...
 
virtual void addKR (int i, double t, Vector_t &K)
 
virtual void addKT (int i, double t, Vector_t &K)
 
virtual bool applyToReferenceParticle (const Vector_t &R, const Vector_t &P, const double &t, Vector_t &E, Vector_t &B)
 
virtual bool getPotential (const Vector_t &R, const double &t, Vector_t &A, double &phi)
 
virtual double getDesignEnergy () const
 
virtual void setDesignEnergy (const double &energy, bool changeable)
 
virtual void goOnline (const double &kineticEnergy)
 
virtual void goOffline ()
 
virtual bool Online ()
 
virtual ElementBase::ElementType getType () const
 Get element type std::string. More...
 
virtual void setComponentType (std::string)
 
virtual std::string getComponentType () const
 
virtual const ElementBasegetDesign () const
 Return design element. More...
 
virtual void trackBunch (PartBunchBase< double, 3 > *bunch, const PartData &, bool revBeam, bool revTrack) const
 Track particle bunch. More...
 
virtual void trackMap (FVps< double, 6 > &map, const PartData &, bool revBeam, bool revTrack) const
 Track a map. More...
 
void setExitFaceSlope (const double &)
 
- Public Member Functions inherited from ElementBase
 ElementBase (const std::string &name)
 Constructor with given name. More...
 
 ElementBase ()
 
 ElementBase (const ElementBase &)
 
virtual ~ElementBase ()
 
virtual const std::string & getName () const
 Get element name. More...
 
virtual void setName (const std::string &name)
 Set element name. More...
 
std::string getTypeString () const
 
virtual double getArcLength () const
 Get arc length. More...
 
virtual double getElementLength () const
 Get design length. More...
 
virtual void setElementLength (double length)
 Set design length. More...
 
virtual void getElementDimensions (double &begin, double &end) const
 
virtual double getOrigin () const
 Get origin position. More...
 
virtual double getEntrance () const
 Get entrance position. More...
 
virtual double getExit () const
 Get exit position. More...
 
virtual Euclid3D getTransform (double fromS, double toS) const
 Get transform. More...
 
virtual Euclid3D getTransform (double s) const
 Get transform. More...
 
virtual Euclid3D getTotalTransform () const
 Get transform. More...
 
virtual Euclid3D getEntranceFrame () const
 Get transform. More...
 
virtual Euclid3D getExitFrame () const
 Get transform. More...
 
virtual Euclid3D getEntrancePatch () const
 Get patch. More...
 
virtual Euclid3D getExitPatch () const
 Get patch. More...
 
virtual double getAttribute (const std::string &aKey) const
 Get attribute value. More...
 
virtual bool hasAttribute (const std::string &aKey) const
 Test for existence of an attribute. More...
 
virtual void removeAttribute (const std::string &aKey)
 Remove an existing attribute. More...
 
virtual void setAttribute (const std::string &aKey, double val)
 Set value of an attribute. More...
 
virtual ChannelgetChannel (const std::string &aKey, bool create=false)
 Construct a read/write channel. More...
 
virtual const ConstChannelgetConstChannel (const std::string &aKey) const
 Construct a read-only channel. More...
 
virtual ElementImagegetImage () const
 Construct an image. More...
 
virtual ElementBasecopyStructure ()
 Make a structural copy. More...
 
bool isSharable () const
 Test if the element can be shared. More...
 
virtual void makeSharable ()
 Set sharable flag. More...
 
virtual ElementBasemakeAlignWrapper ()
 Allow misalignment. More...
 
virtual ElementBasemakeFieldWrapper ()
 Allow field errors. More...
 
virtual ElementBasemakeWrappers ()
 Allow errors. More...
 
virtual ElementBaseremoveAlignWrapper ()
 Remove align wrapper. More...
 
virtual const ElementBaseremoveAlignWrapper () const
 Remove align wrapper. More...
 
virtual ElementBaseremoveFieldWrapper ()
 Remove field wrapper. More...
 
virtual const ElementBaseremoveFieldWrapper () const
 Remove field wrapper. More...
 
virtual ElementBaseremoveWrappers ()
 Return the design element. More...
 
virtual const ElementBaseremoveWrappers () const
 Return the design element. More...
 
bool update (const AttributeSet &)
 Update element. More...
 
virtual void setBoundaryGeometry (BoundaryGeometry *geo)
 
virtual BoundaryGeometrygetBoundaryGeometry () const
 return the attached boundary geometrt object if there is any More...
 
virtual bool hasBoundaryGeometry () const
 
virtual void setWake (WakeFunction *wf)
 attach a wake field to the element More...
 
virtual WakeFunctiongetWake () const
 return the attached wake object if there is any More...
 
virtual bool hasWake () const
 
virtual void setParticleMatterInteraction (ParticleMatterInteractionHandler *spys)
 
virtual
ParticleMatterInteractionHandler
getParticleMatterInteraction () const
 
virtual bool hasParticleMatterInteraction () const
 
ElemType getElType () const
 returns element type as enumeration needed in the envelope tracker More...
 
void setElType (ElemType elt)
 set the element type as enumeration needed in the envelope tracker More...
 
void setCSTrafoGlobal2Local (const CoordinateSystemTrafo &ori)
 
CoordinateSystemTrafo getCSTrafoGlobal2Local () const
 
void releasePosition ()
 
void fixPosition ()
 
bool isPositioned () const
 
virtual CoordinateSystemTrafo getEdgeToBegin () const
 
virtual CoordinateSystemTrafo getEdgeToEnd () const
 
void setAperture (const ApertureType &type, const std::vector< double > &args)
 
std::pair
< ElementBase::ApertureType,
std::vector< double > > 
getAperture () const
 
virtual bool isInside (const Vector_t &r) const
 
void setMisalignment (double x, double y, double s)
 
void setMisalignment (const CoordinateSystemTrafo &cst)
 
void getMisalignment (double &x, double &y, double &s) const
 
CoordinateSystemTrafo getMisalignment () const
 
void setActionRange (const std::queue< std::pair< double, double > > &range)
 
void setCurrentSCoordinate (double s)
 
void setRotationAboutZ (double rotation)
 Set rotation about z axis in bend frame. More...
 
double getRotationAboutZ () const
 
void setElementPosition (double elemedge)
 Access to ELEMEDGE attribute. More...
 
double getElementPosition () const
 
bool isElementPositionSet () const
 
- Public Member Functions inherited from RCObject
int addReference () const
 Increment reference count. More...
 
int removeReference () const
 Decrement the reference count. More...
 
bool isShared () const
 Test for sharing. More...
 

Static Public Member Functions

static Vector_t convert (const Vector3D &vec)
 
static Vector3D convert (const Vector_t &vec)
 
- Static Public Member Functions inherited from ElementBase
static std::string getTypeString (ElementType type)
 

Private Member Functions

void resetAzimuths ()
 
void checkAndClose ()
 
void buildRingSections ()
 
void rotateToCyclCoordinates (Euclid3D &euclid3d) const
 
 Ring ()
 
Ringoperator= (const Ring &ring)
 
void checkMidplane (Euclid3D delta) const
 
Rotation3D getRotationStartToEnd (Euclid3D delta) const
 

Static Private Member Functions

static bool sectionCompare (RingSection const *const sec1, RingSection const *const sec2)
 

Private Attributes

PlanarArcGeometry planarArcGeometry_m
 
PartBunchBase< double, 3 > * refPartBunch_m
 
LossDataSinklossDS_m
 
double beamRInit_m
 
double beamPRInit_m
 
double beamPhiInit_m
 
double latticeRInit_m
 
double latticePhiInit_m
 
double latticeThetaInit_m
 
bool willDoAperture_m = false
 
double minR2_m
 
double maxR2_m
 
bool isLocked_m
 
bool isClosed_m
 
int symmetry_m
 
double scale_m = 1.
 
double cyclHarm_m
 
double rfFreq_m
 
double phiStep_m
 
std::vector< RingSectionListringSections_m
 
RingSectionList section_list_m
 

Static Private Attributes

static const double lengthTolerance_m = 1e-2
 
static const double angleTolerance_m = 1e-2
 

Additional Inherited Members

- Public Types inherited from ElementBase
enum  ApertureType { RECTANGULAR, ELLIPTICAL, CONIC_RECTANGULAR, CONIC_ELLIPTICAL }
 
enum  ElementType {
  ALIGNWRAPPER, BEAMBEAM, BEAMBEAM3D, BEAMLINE,
  BEAMSTRIPPING, CCOLLIMATOR, CORRECTOR, CORRECTORWRAPPER,
  CYCLOTRON, CYCLOTRONWRAPPER, CYCLOTRONVALLEY, DEGRADER,
  DIAGNOSTIC, DRIFT, FLEXIBLECOLLIMATOR, INTEGRATOR,
  LAMBERTSON, MARKER, MONITOR, MPSPLITINTEGRATOR,
  MULTIPOLE, MULTIPOLET, MULTIPOLEWRAPPER, OFFSET,
  PARALLELPLATE, PATCH, PROBE, RBEND,
  RBEND3D, RBENDWRAPPER, RFCAVITY, RFQUADRUPOLE,
  RING, SBEND3D, SBEND, SBENDWRAPPER,
  SEPARATOR, SEPTUM, SOLENOID, SOURCE,
  STRIPPER, TRAVELINGWAVE, VARIABLERFCAVITY, ANY
}
 
- Protected Member Functions inherited from ElementBase
bool isInsideTransverse (const Vector_t &r, double f=1) const
 
- Protected Member Functions inherited from RCObject
 RCObject ()
 Default constructor. More...
 
 RCObject (const RCObject &)
 Copy constructor. More...
 
virtual ~RCObject ()=0
 
RCObjectoperator= (const RCObject &right)
 
- Protected Attributes inherited from Component
double exit_face_slope_m
 
PartBunchBase< double, 3 > * RefPartBunch_m
 
bool online_m
 
- Protected Attributes inherited from ElementBase
bool shareFlag
 
CoordinateSystemTrafo csTrafoGlobal2Local_m
 
CoordinateSystemTrafo misalignment_m
 
std::pair< ApertureType,
std::vector< double > > 
aperture_m
 
double elementEdge_m
 
double rotationZAxis_m
 
- Static Protected Attributes inherited from Component
static const std::vector< double > defaultAperture_m
 

Detailed Description

Ring describes a ring type geometry for tracking.

Ring describes a ring type geometry for tracking. Ring provides the necessary interfaces for e.g. OPAL-CYCL to track through the ring geometry, while enabling the user to add arbitrary field elements in a closed geometry.

Ring uses similar routines to OPAL-T OpalBeamline class to set up geometry; note that as OPAL-CYCL places the beam in an x-y geometry we place in an x-y geometry for Ring (i.e. the axis of the ring is by default the z-axis). So far only placement of elements in the midplane is supported. It is not possible to give vertical displacements or rotations, or add elements that might create vertical displacements and rotations.

Also aim to maintain backwards compatibility with Cyclotron (i.e. use ParallelCyclotronTracker)

Definition at line 64 of file Ring.h.

Constructor & Destructor Documentation

Ring::Ring ( std::string  ring)

Constructor

Parameters
ringName of the ring as defined in the input file

Definition at line 45 of file Ring.cpp.

References setRefPartBunch().

Here is the call graph for this function:

Ring::Ring ( const Ring ring)

Copy constructor

Can't copy LossDataSink so throw exception if this is set

Definition at line 63 of file Ring.cpp.

References buildRingSections(), lossDS_m, refPartBunch_m, section_list_m, and setRefPartBunch().

Here is the call graph for this function:

Ring::~Ring ( )
virtual

Destructor - deletes lossDS_m if not NULL

Definition at line 93 of file Ring.cpp.

References lossDS_m, and section_list_m.

Ring::Ring ( )
private

Disabled

Referenced by clone().

Member Function Documentation

void Ring::accept ( BeamlineVisitor visitor) const
overridevirtual

Accept the BeamlineVisitor

Just calls visitRing function on the visitor. I guess the point of this function is that it enables us to store a pointer to the visitor object or something

Implements ElementBase.

Definition at line 59 of file Ring.cpp.

References BeamlineVisitor::visitRing().

Here is the call graph for this function:

void Ring::appendElement ( const Component element)

Add element to the ring

Add element to the ring. Elements are assumed to occupy a region of space defined by a (flat) plane at the start and a plane at the end, both infinite in extent. The position and rotation of these planes are defined according to the Component geometry given by element.getGeometry().

Caller owns memory allocated to element - Ring makes a copy.

Throws an exception if the geometry would bend the element out of the midplane (elements out of midplane are not yet supported). Note that BeamlineGeometry considers midplane to be x-z, whereas Ring considers midplane to be x-y; we apply a rotation during set up.

The element is assumed to extend not beyond the element geometry; Ring applies a bounding box based on the element geometry, if there are field maps expanding outside this region they may get cut.

Definition at line 227 of file Ring.cpp.

References atan2(), checkMidplane(), ElementBase::clone(), cos(), endl(), Rotation3D::getAxis(), RingSection::getEndNormal(), RingSection::getEndPosition(), ElementBase::getGeometry(), ElementBase::getName(), getNextNormal(), getNextPosition(), Euclid3D::getRotation(), RingSection::getStartNormal(), RingSection::getStartPosition(), BGeometryBase::getTotalTransform(), Euclid3D::getVector(), isLocked_m, rotateToCyclCoordinates(), section_list_m, RingSection::setComponent(), RingSection::setComponentOrientation(), RingSection::setComponentPosition(), RingSection::setEndNormal(), RingSection::setEndPosition(), RingSection::setStartNormal(), RingSection::setStartPosition(), and sin().

Referenced by lockRing(), ParallelCyclotronTracker::visitMultipoleT(), ParallelCyclotronTracker::visitMultipoleTCurvedConstRadius(), ParallelCyclotronTracker::visitMultipoleTCurvedVarRadius(), ParallelCyclotronTracker::visitMultipoleTStraight(), ParallelCyclotronTracker::visitOffset(), ParallelCyclotronTracker::visitSBend3D(), ParallelCyclotronTracker::visitScalingFFAMagnet(), ParallelCyclotronTracker::visitVariableRFCavity(), and ParallelCyclotronTracker::visitVerticalFFAMagnet().

Here is the call graph for this function:

bool Ring::apply ( const size_t &  id,
const double &  t,
Vector_t E,
Vector_t B 
)
overridevirtual

Overwrite data in vector E and B with electric and magnetic field

Parameters
iindex of item in RefPartBunch_m - particle bunch
ttime
Earray where electric field vector is stored - any existing data is overwritten
Barray where magnetic field vector is stored - any existing data is overwritten
Returns
false if particle is outside of the field map apertures, else true. If particle is off the field maps, then set flag on the particle "Bin" data to -1 and store in LossDataSink

Reimplemented from Component.

Definition at line 99 of file Ring.cpp.

References LossDataSink::addParticle(), PartBunchBase< T, Dim >::Bin, endl(), ElementBase::getName(), INFORM_ALL_NODES, lossDS_m, PartBunchBase< T, Dim >::P, PartBunchBase< T, Dim >::R, refPartBunch_m, and LossDataSink::save().

Here is the call graph for this function:

bool Ring::apply ( const Vector_t R,
const Vector_t P,
const double &  t,
Vector_t E,
Vector_t B 
)
overridevirtual

Overwrite data in vector E and B with electromagnetic field at point R

Parameters
R3 vector position at which the field is found in Cartesian coordinates (i.e. x, y, z with z=vertical)
P3 vector momentum
centroidunknown, but not used - bunch mean maybe?
ttime
Evector where electric field vector will be stored - any existing data is overwritten
Bvector where magnetic field vector will be stored - any existing data is overwritten
Returns
false if particle is outside of the ring aperture, else true. If particle is off the field maps, then set flag on the particle "Bin" data to -1

Reimplemented from Component.

Definition at line 117 of file Ring.cpp.

References PartBunchBase< T, Dim >::get_centroid(), getSectionsAt(), maxR2_m, refPartBunch_m, scale_m, and willDoAperture_m.

Here is the call graph for this function:

virtual bool Ring::bends ( ) const
inlineoverridevirtual

Returns true - Ring is assumed to bend particles, being a ring

Implements Component.

Definition at line 141 of file Ring.h.

void Ring::buildRingSections ( )
private

Definition at line 348 of file Ring.cpp.

References phiStep_m, Physics::pi, ringSections_m, and section_list_m.

Referenced by lockRing(), and Ring().

void Ring::checkAndClose ( )
private

Definition at line 333 of file Ring.cpp.

References angleTolerance_m, fabs(), lengthTolerance_m, and section_list_m.

Referenced by lockRing().

Here is the call graph for this function:

void Ring::checkMidplane ( Euclid3D  delta) const
private

Definition at line 190 of file Ring.cpp.

References angleTolerance_m, fabs(), Rotation3D::getAxis(), Euclid3D::getRotation(), Euclid3D::getVector(), and lengthTolerance_m.

Referenced by appendElement().

Here is the call graph for this function:

virtual ElementBase* Ring::clone ( ) const
inlineoverridevirtual

Inherited copy constructor

Implements ElementBase.

Definition at line 155 of file Ring.h.

References Ring().

Referenced by ParallelCyclotronTracker::visitRing().

Here is the call graph for this function:

Vector_t Ring::convert ( const Vector3D vec)
inlinestatic

Convert from a Vector3D to a Vector_t

Definition at line 412 of file Ring.h.

Vector3D Ring::convert ( const Vector_t vec)
inlinestatic

Convert from a Vector_t to a Vector3D

Definition at line 416 of file Ring.h.

void Ring::finalise ( )
overridevirtual

Clean up the Ring

Ring relinquishes RefPartBunchBase<double, 3> pointer and deletes LossDataSink

Implements Component.

Definition at line 164 of file Ring.cpp.

References Component::online_m, setLossDataSink(), and setRefPartBunch().

Here is the call graph for this function:

double Ring::getBeamPhiInit ( ) const
inline

Get the initial beam azimuthal angle

Definition at line 241 of file Ring.h.

References beamPhiInit_m.

Referenced by ParallelCyclotronTracker::visitRing().

double Ring::getBeamPRInit ( ) const
inline

Get the initial beam radial momentum

Definition at line 247 of file Ring.h.

References beamPRInit_m.

Referenced by ParallelCyclotronTracker::visitRing().

double Ring::getBeamRInit ( ) const
inline

Get the initial beam radius

Definition at line 235 of file Ring.h.

References beamRInit_m.

Referenced by ParallelCyclotronTracker::visitRing().

void Ring::getDimensions ( double &  zBegin,
double &  zEnd 
) const
overridevirtual

Not implemented - always throws an exception

Implements Component.

Definition at line 148 of file Ring.cpp.

virtual EMField& Ring::getField ( )
inlineoverridevirtual

Not implemented, throws an exception

Implements Component.

Definition at line 179 of file Ring.h.

virtual const EMField& Ring::getField ( ) const
inlineoverridevirtual

Not implemented, throws an exception

Implements Component.

Definition at line 182 of file Ring.h.

virtual PlanarArcGeometry& Ring::getGeometry ( )
inlineoverridevirtual

Not implemented

Implements ElementBase.

Definition at line 185 of file Ring.h.

References planarArcGeometry_m.

virtual const PlanarArcGeometry& Ring::getGeometry ( ) const
inlineoverridevirtual

Not implemented

Implements ElementBase.

Definition at line 188 of file Ring.h.

References planarArcGeometry_m.

double Ring::getHarmonicNumber ( )
inline

Get the harmonic number for RF (number of bunches in the ring)

Definition at line 222 of file Ring.h.

References cyclHarm_m.

Referenced by ParallelCyclotronTracker::getHarmonicNumber(), and ParallelCyclotronTracker::visitRing().

double Ring::getIsClosed ( ) const
inline

Get flag for closure checking

Definition at line 292 of file Ring.h.

References isClosed_m.

RingSection * Ring::getLastSectionPlaced ( ) const

Get the last section placed or NULL if no sections were placed yet

Definition at line 362 of file Ring.cpp.

References section_list_m.

double Ring::getLatticePhiInit ( ) const
inline

Get the initial element's azimuthal angle

Definition at line 259 of file Ring.h.

References latticePhiInit_m.

double Ring::getLatticeRInit ( ) const
inline

Get the initial element's radius

Definition at line 253 of file Ring.h.

References latticeRInit_m.

double Ring::getLatticeThetaInit ( ) const
inline

Get the first element's horizontal angle

Get the angle in the ring plane with respect to the tangent vector

Definition at line 277 of file Ring.h.

References latticeThetaInit_m.

PartBunchBase<double, 3>* Ring::getLossDataSink ( ) const

Get pointer to lossDataSink.

Ring still owns the memory to which lossDataSink points.

Vector_t Ring::getNextNormal ( ) const

Get the initial element's start normal in cartesian coordinates

Definition at line 218 of file Ring.cpp.

References cos(), latticePhiInit_m, latticeThetaInit_m, section_list_m, and sin().

Referenced by appendElement(), and ParallelCyclotronTracker::visitOffset().

Here is the call graph for this function:

Vector_t Ring::getNextPosition ( ) const

Get the initial element's start position in cartesian coordinates

Definition at line 209 of file Ring.cpp.

References cos(), latticePhiInit_m, latticeRInit_m, section_list_m, and sin().

Referenced by appendElement(), and ParallelCyclotronTracker::visitOffset().

Here is the call graph for this function:

PartBunchBase<double, 3>* Ring::getRefPartBunch ( ) const

Get pointer to RefPartBunchBase<double, 3> from the bunch.

Ring does not own this memory (so neither does caller).

double Ring::getRFFreq ( ) const
inline

Get the nominal RF frequency

Definition at line 229 of file Ring.h.

References rfFreq_m.

double Ring::getRingMaxR ( ) const
inline

Get the ring maximum

Definition at line 304 of file Ring.h.

References maxR2_m, and sqrt().

Here is the call graph for this function:

double Ring::getRingMinR ( ) const
inline

Get the ring minimum

Definition at line 301 of file Ring.h.

References minR2_m, and sqrt().

Here is the call graph for this function:

Rotation3D Ring::getRotationStartToEnd ( Euclid3D  delta) const
private

Definition at line 179 of file Ring.cpp.

References atan2(), Euclid3D::getRotation(), and Rotation3D::ZRotation().

Here is the call graph for this function:

std::vector< RingSection * > Ring::getSectionsAt ( const Vector_t pos)

Get the list of sections at position pos

Definition at line 175 of file Ring.cpp.

References section_list_m.

Referenced by apply().

double Ring::getSymmetry ( ) const
inline

Get the rotational symmetry of the ring (number of cells)

Definition at line 286 of file Ring.h.

References symmetry_m.

Referenced by ParallelCyclotronTracker::visitRing().

void Ring::initialise ( PartBunchBase< double, 3 > *  bunch,
double &  startField,
double &  endField 
)
overridevirtual

Initialise the Ring

Parameters
bunchthe particle bunch. Ring borrows this pointer (caller owns memory)
startField- not used
endField- not used
scaleFactor- not used

Implements Component.

Definition at line 159 of file Ring.cpp.

Referenced by ParallelCyclotronTracker::visitRing().

void Ring::initialise ( PartBunchBase< double, 3 > *  bunch)
virtual

Initialise the Ring - set the bunch and allocate a new LossDataSink

Parameters
bunchthe particle bunch. Ring borrows this pointer (caller owns memory)

Definition at line 153 of file Ring.cpp.

References ElementBase::getName(), Component::online_m, setLossDataSink(), and setRefPartBunch().

Here is the call graph for this function:

void Ring::lockRing ( )

Lock the ring

Lock the ring; apply closure checks and symmetry properties as required. Impose rule that start must be before end and switch objects around if this is not the case. Sort by startPosition azimuthal angle.

Sets isLocked_m to true. New elements can no longer be added (as it may break the symmetry/bound checking)

Definition at line 287 of file Ring.cpp.

References appendElement(), buildRingSections(), checkAndClose(), endl(), isClosed_m, isLocked_m, section_list_m, and symmetry_m.

Referenced by ParallelCyclotronTracker::execute().

Here is the call graph for this function:

Ring& Ring::operator= ( const Ring ring)
private

Disabled

void Ring::resetAzimuths ( )
private

Definition at line 318 of file Ring.cpp.

References section_list_m.

void Ring::rotateToCyclCoordinates ( Euclid3D euclid3d) const
private

Definition at line 200 of file Ring.cpp.

References Rotation3D::getAxis(), Euclid3D::getRotation(), and Euclid3D::getVector().

Referenced by appendElement().

Here is the call graph for this function:

bool Ring::sectionCompare ( RingSection const *const  sec1,
RingSection const *const  sec2 
)
staticprivate

Definition at line 369 of file Ring.cpp.

void Ring::setBeamPhiInit ( double  phiInit)
inline

Set the initial beam azimuthal angle

Definition at line 238 of file Ring.h.

References beamPhiInit_m.

Referenced by OpalRingDefinition::update().

void Ring::setBeamPRInit ( double  pRInit)
inline

Set the initial beam radial momentum

Definition at line 244 of file Ring.h.

References beamPRInit_m.

Referenced by OpalRingDefinition::update().

void Ring::setBeamRInit ( double  rInit)
inline

Set the initial beam radius

Definition at line 232 of file Ring.h.

References beamRInit_m.

Referenced by OpalRingDefinition::update().

void Ring::setHarmonicNumber ( double  cyclHarm)
inline

Set the harmonic number for RF (number of bunches in the ring)

Definition at line 219 of file Ring.h.

References cyclHarm_m.

Referenced by OpalRingDefinition::update().

void Ring::setIsClosed ( bool  isClosed)
inline

Set flag for closure checking

Definition at line 289 of file Ring.h.

References isClosed_m.

Referenced by OpalRingDefinition::update().

void Ring::setLatticePhiInit ( double  phiInit)
inline

Set the initial element's azimuthal angle

Definition at line 256 of file Ring.h.

References latticePhiInit_m.

Referenced by OpalRingDefinition::update().

void Ring::setLatticeRInit ( double  rInit)
inline

Set the initial element's radius

Definition at line 250 of file Ring.h.

References latticeRInit_m.

Referenced by OpalRingDefinition::update().

void Ring::setLatticeThetaInit ( double  thetaInit)
inline

Set the first element's horizontal angle

Set the angle in the ring plane with respect to the tangent vector

Definition at line 271 of file Ring.h.

References latticeThetaInit_m.

Referenced by OpalRingDefinition::update().

void Ring::setLossDataSink ( LossDataSink sink)

Set LossDataSink to sink.

Parameters
sinkThe LossDataSink. Ring takes ownership of memory allocated to sink

Definition at line 143 of file Ring.cpp.

References lossDS_m.

Referenced by finalise(), and initialise().

void Ring::setRefPartBunch ( PartBunchBase< double, 3 > *  bunch)

Set RefPartBunchBase<double, 3> to bunch.

Parameters
sinkThe Bunch. Ring borrows memory allocated to bunch.

Note for compliance with style guide and compatibility with parent two pointer to RefPartBunchBase<double, 3> are stored; this keeps them aligned

Definition at line 170 of file Ring.cpp.

References Component::RefPartBunch_m, and refPartBunch_m.

Referenced by finalise(), initialise(), and Ring().

void Ring::setRFFreq ( double  rfFreq)
inline

Set the nominal RF frequency

Definition at line 226 of file Ring.h.

References rfFreq_m.

Referenced by OpalRingDefinition::update().

void Ring::setRingAperture ( double  minR,
double  maxR 
)

Set the ring aperture limits

  • minR; the minimum radius allowed during tracking. Throws if minR < 0
  • maxR; the maximum radius allowed during tracking. Throws if maxR < 0 Sets willDoRingAperture_m to true.

Definition at line 374 of file Ring.cpp.

References maxR2_m, minR2_m, and willDoAperture_m.

Referenced by OpalRingDefinition::update().

void Ring::setScale ( double  scale)
inline

Set the scaling factor for the fields

Definition at line 283 of file Ring.h.

References scale_m.

Referenced by OpalRingDefinition::update().

void Ring::setSymmetry ( double  symmetry)
inline

Set the rotational symmetry of the ring (number of cells)

Definition at line 280 of file Ring.h.

References symmetry_m.

Referenced by OpalRingDefinition::update().

Member Data Documentation

const double Ring::angleTolerance_m = 1e-2
staticprivate

Definition at line 409 of file Ring.h.

Referenced by checkAndClose(), and checkMidplane().

double Ring::beamPhiInit_m
private

Definition at line 371 of file Ring.h.

Referenced by getBeamPhiInit(), and setBeamPhiInit().

double Ring::beamPRInit_m
private

Definition at line 370 of file Ring.h.

Referenced by getBeamPRInit(), and setBeamPRInit().

double Ring::beamRInit_m
private

Definition at line 369 of file Ring.h.

Referenced by getBeamRInit(), and setBeamRInit().

double Ring::cyclHarm_m
private

Definition at line 397 of file Ring.h.

Referenced by getHarmonicNumber(), and setHarmonicNumber().

bool Ring::isClosed_m
private

Definition at line 389 of file Ring.h.

Referenced by getIsClosed(), lockRing(), and setIsClosed().

bool Ring::isLocked_m
private

Definition at line 385 of file Ring.h.

Referenced by appendElement(), and lockRing().

double Ring::latticePhiInit_m
private

Definition at line 375 of file Ring.h.

Referenced by getLatticePhiInit(), getNextNormal(), getNextPosition(), and setLatticePhiInit().

double Ring::latticeRInit_m
private

Definition at line 374 of file Ring.h.

Referenced by getLatticeRInit(), getNextPosition(), and setLatticeRInit().

double Ring::latticeThetaInit_m
private

Definition at line 376 of file Ring.h.

Referenced by getLatticeThetaInit(), getNextNormal(), and setLatticeThetaInit().

const double Ring::lengthTolerance_m = 1e-2
staticprivate

Definition at line 408 of file Ring.h.

Referenced by checkAndClose(), and checkMidplane().

LossDataSink* Ring::lossDS_m
private

Definition at line 366 of file Ring.h.

Referenced by apply(), Ring(), setLossDataSink(), and ~Ring().

double Ring::maxR2_m
private

Definition at line 382 of file Ring.h.

Referenced by apply(), getRingMaxR(), and setRingAperture().

double Ring::minR2_m
private

Definition at line 381 of file Ring.h.

Referenced by getRingMinR(), and setRingAperture().

double Ring::phiStep_m
private

Definition at line 403 of file Ring.h.

Referenced by buildRingSections().

PlanarArcGeometry Ring::planarArcGeometry_m
private

Definition at line 355 of file Ring.h.

Referenced by getGeometry().

PartBunchBase<double, 3>* Ring::refPartBunch_m
private

Definition at line 361 of file Ring.h.

Referenced by apply(), Ring(), and setRefPartBunch().

double Ring::rfFreq_m
private

Definition at line 400 of file Ring.h.

Referenced by getRFFreq(), and setRFFreq().

std::vector<RingSectionList> Ring::ringSections_m
private

Definition at line 404 of file Ring.h.

Referenced by buildRingSections().

double Ring::scale_m = 1.
private

Definition at line 394 of file Ring.h.

Referenced by apply(), and setScale().

RingSectionList Ring::section_list_m
private
int Ring::symmetry_m
private

Definition at line 392 of file Ring.h.

Referenced by getSymmetry(), lockRing(), and setSymmetry().

bool Ring::willDoAperture_m = false
private

Definition at line 380 of file Ring.h.

Referenced by apply(), and setRingAperture().


The documentation for this class was generated from the following files: