OPAL (Object Oriented Parallel Accelerator Library)
2.2.0
OPAL
|
#include <OrbitTracker.h>
Public Types | |
enum | { X, PX, Y, PY, T, PT } |
![]() | |
enum | { X, PX, Y, PY, T, PT } |
Public Member Functions | |
OrbitTracker (const Beamline &, const PartData &, bool backBeam, bool backTrack) | |
Constructor. More... | |
virtual | ~OrbitTracker () |
const FVector< double, 6 > & | getOrbit () const |
Return the current orbit. More... | |
void | setOrbit (const FVector< double, 6 > orbit) |
Reset the current orbit. More... | |
virtual void | visitBeamBeam (const BeamBeam &) |
Apply the algorithm to a beam-beam. More... | |
virtual void | visitBeamStripping (const BeamStripping &) |
Apply the algorithm to a beam stripping. More... | |
virtual void | visitCCollimator (const CCollimator &) |
Apply the algorithm to a collimator. More... | |
virtual void | visitComponent (const Component &) |
Apply the algorithm to an arbitrary component. More... | |
virtual void | visitCorrector (const Corrector &) |
Apply the algorithm to a corrector. More... | |
virtual void | visitDegrader (const Degrader &) |
Apply the algorithm to a drift. More... | |
virtual void | visitDiagnostic (const Diagnostic &) |
Apply the algorithm to a diagnostic. More... | |
virtual void | visitDrift (const Drift &) |
Apply the algorithm to a drift. More... | |
virtual void | visitFlexibleCollimator (const FlexibleCollimator &) |
Apply the algorithm to a flexible collimator. More... | |
virtual void | visitLambertson (const Lambertson &) |
Apply the algorithm to a Lambertson. More... | |
virtual void | visitMarker (const Marker &) |
Apply the algorithm to a marker. More... | |
virtual void | visitMonitor (const Monitor &) |
Apply the algorithm to a monitor. More... | |
virtual void | visitMultipole (const Multipole &) |
Apply the algorithm to a multipole. More... | |
virtual void | visitPatch (const Patch &pat) |
Apply the algorithm to a patch. More... | |
virtual void | visitProbe (const Probe &prob) |
Apply the algorithm to a probe. More... | |
virtual void | visitRBend (const RBend &) |
Apply the algorithm to a rectangular bend. More... | |
virtual void | visitRFCavity (const RFCavity &) |
Apply the algorithm to a RF cavity. More... | |
virtual void | visitRFQuadrupole (const RFQuadrupole &) |
Apply the algorithm to a RF quadrupole. More... | |
virtual void | visitSBend (const SBend &) |
Apply the algorithm to a sector bend. More... | |
virtual void | visitSeparator (const Separator &) |
Apply the algorithm to a separator. More... | |
virtual void | visitSeptum (const Septum &) |
Apply the algorithm to a septum. More... | |
virtual void | visitSolenoid (const Solenoid &) |
Apply the algorithm to a solenoid. More... | |
virtual void | visitParallelPlate (const ParallelPlate &) |
Apply the algorithm to a ParallelPlate. More... | |
virtual void | visitCyclotronValley (const CyclotronValley &) |
Apply the algorithm to a CyclotronValley. More... | |
virtual void | visitAlignWrapper (const AlignWrapper &) |
Apply the algorithm to an align wrapper.. More... | |
![]() | |
AbstractTracker (const Beamline &, const PartData &, bool backBeam, bool backTrack) | |
Constructor. More... | |
virtual | ~AbstractTracker () |
![]() | |
DefaultVisitor (const Beamline &beamline, bool backBeam, bool backTrack) | |
Constructor. More... | |
virtual | ~DefaultVisitor ()=0 |
virtual void | execute () |
Apply the algorithm to the top-level beamline. More... | |
virtual void | visitCyclotron (const Cyclotron &) |
Apply the algorithm to an cyclotron. More... | |
virtual void | visitRing (const Ring &) |
Apply the algorithm to an opal ring.. More... | |
virtual void | visitMultipoleT (const MultipoleT &) |
Apply the algorithm to a multipoleT. More... | |
virtual void | visitMultipoleTStraight (const MultipoleTStraight &) |
Apply the algorithm to a multipoleTStraight. More... | |
virtual void | visitMultipoleTCurvedConstRadius (const MultipoleTCurvedConstRadius &) |
Apply the algorithm to a multipoleTCurvedConstRadius. More... | |
virtual void | visitMultipoleTCurvedVarRadius (const MultipoleTCurvedVarRadius &) |
Apply the algorithm to a multipoleTCurvedVarRadius. More... | |
virtual void | visitOffset (const Offset &) |
Apply the algorithm to an Offset. More... | |
virtual void | visitRBend3D (const RBend3D &) |
Apply the algorithm to a rectangular bend. More... | |
virtual void | visitVariableRFCavity (const VariableRFCavity &vcav) |
Apply the algorithm to a RF cavity. More... | |
virtual void | visitVariableRFCavityFringeField (const VariableRFCavityFringeField &vcav) |
Apply the algorithm to a RF cavity. More... | |
virtual void | visitTravelingWave (const TravelingWave &) |
Apply the algorithm to a RF cavity. More... | |
virtual void | visitSBend3D (const SBend3D &) |
Apply the algorithm to a sector bend. More... | |
virtual void | visitScalingFFAMagnet (const ScalingFFAMagnet &) |
Apply the algorithm to a scaling FFA magnet. More... | |
virtual void | visitVerticalFFAMagnet (const VerticalFFAMagnet &) |
Apply the algorithm to a RF cavity. More... | |
virtual void | visitSource (const Source &) |
Apply the algorithm to a source. More... | |
virtual void | visitStripper (const Stripper &) |
Apply the algorithm to a charge stripper. More... | |
virtual void | visitBeamline (const Beamline &) |
Apply the algorithm to a beam line. More... | |
virtual void | visitFlaggedElmPtr (const FlaggedElmPtr &) |
Apply the algorithm to a FlaggedElmPtr. More... | |
virtual void | visitCorrectorWrapper (const CorrectorWrapper &) |
Apply the algorithm to an corrector wrapper.. More... | |
virtual void | visitCyclotronWrapper (const CyclotronWrapper &) |
Apply the algorithm to an cyclotron wrapper.. More... | |
virtual void | visitMultipoleWrapper (const MultipoleWrapper &) |
Apply the algorithm to an multipole wrapper.. More... | |
virtual void | visitRBendWrapper (const RBendWrapper &) |
Apply the algorithm to an RBend wrapper.. More... | |
virtual void | visitSBendWrapper (const SBendWrapper &) |
Apply the algorithm to an SBend wrapper.. More... | |
virtual void | visitIntegrator (const Integrator &) |
Apply the algorithm to a generic integrator. More... | |
virtual void | visitMapIntegrator (const MapIntegrator &) |
Apply the algorithm to an integrator capable of mapping. More... | |
virtual void | visitTrackIntegrator (const TrackIntegrator &) |
Apply the algorithm to an integrator capable of tracking. More... | |
![]() | |
BeamlineVisitor () | |
virtual | ~BeamlineVisitor () |
Private Member Functions | |
OrbitTracker () | |
OrbitTracker (const OrbitTracker &) | |
void | operator= (const OrbitTracker &) |
void | applyDrift (double length) |
Apply drift length. More... | |
void | applyEntranceFringe (double edge, const BMultipoleField &field, double scale) |
Transforms fringing fields. More... | |
void | applyExitFringe (double edge, const BMultipoleField &field, double scale) |
void | applyLinearMap (double length, double refLength, double h, const FTps< double, 2 > &Fx, const FTps< double, 2 > &Fy) |
Apply linear map, defined by the linear expansions Fx and Fy. More... | |
void | applyMultipoleBody (double length, double refLength, const BMultipoleField &field, double scale) |
Apply body of SBend. More... | |
void | applySBendBody (double length, double refLength, double h, const BMultipoleField &field, double scale) |
Apply thin multipole kick (integrated over length) to all particles. More... | |
void | applyThinMultipole (const BMultipoleField &field, double factor) |
Thin multipole kick. More... | |
void | applyTransform (const Euclid3D &, double refLength) |
Apply transform. More... | |
FTps< double, 2 > | buildSBendVectorPotential (const BMultipoleField &, double h) |
Construct the vector potential for a SBend. More... | |
Static Private Member Functions | |
static void | makeFocus (double k, double L, double &c, double &s, double &d, double &f) |
Helper function for finding first-order coefficients. More... | |
Private Attributes | |
FVector< double, 6 > | itsOrbit |
Additional Inherited Members | |
![]() | |
const PartData | itsReference |
The reference information. More... | |
![]() | |
const Beamline & | itsLine |
bool | back_beam |
bool | back_track |
bool | back_path |
double | flip_B |
double | flip_s |
Track closed orbit.
Definition at line 37 of file OrbitTracker.h.
anonymous enum |
Enumerator | |
---|---|
X | |
PX | |
Y | |
PY | |
T | |
PT |
Definition at line 42 of file OrbitTracker.h.
OrbitTracker::OrbitTracker | ( | const Beamline & | beamline, |
const PartData & | reference, | ||
bool | backBeam, | ||
bool | backTrack | ||
) |
Constructor.
Definition at line 69 of file OrbitTracker.cpp.
|
virtual |
Definition at line 76 of file OrbitTracker.cpp.
|
private |
|
private |
|
private |
Apply drift length.
Definition at line 403 of file OrbitTracker.cpp.
References PartData::getM(), PartData::getP(), itsOrbit, AbstractTracker::itsReference, PT, PX, PY, T, X, and Y.
Referenced by applyMultipoleBody(), visitCCollimator(), visitCorrector(), visitDegrader(), visitDiagnostic(), visitDrift(), visitFlexibleCollimator(), visitLambertson(), visitMonitor(), visitRFCavity(), visitRFQuadrupole(), visitSeparator(), visitSeptum(), and visitSolenoid().
|
private |
Transforms fringing fields.
Definition at line 412 of file OrbitTracker.cpp.
References BMultipoleField::normal(), PX, PY, tan(), X, and Y.
Referenced by visitRBend(), and visitSBend().
|
private |
Definition at line 422 of file OrbitTracker.cpp.
References BMultipoleField::normal(), PX, PY, tan(), X, and Y.
Referenced by visitRBend(), and visitSBend().
|
private |
Apply linear map, defined by the linear expansions Fx and Fy.
Definition at line 432 of file OrbitTracker.cpp.
References Hypervolume::hv(), PT, PX, PY, sqrt(), T, X, and Y.
Referenced by applyMultipoleBody(), and applySBendBody().
|
private |
Apply body of SBend.
Definition at line 509 of file OrbitTracker.cpp.
References applyDrift(), applyLinearMap(), FTps< T, N >::getMaxOrder(), itsOrbit, FTps< T, N >::makeVariable(), BMultipoleField::normal(), BMultipoleField::order(), FTps< T, N >::setTruncOrder(), BMultipoleField::skew(), FTps< T, N >::substitute(), X, and Y.
Referenced by visitMultipole(), and visitRBend().
|
private |
Apply thin multipole kick (integrated over length) to all particles.
Definition at line 547 of file OrbitTracker.cpp.
References applyLinearMap(), buildSBendVectorPotential(), and FTps< T, N >::derivative().
Referenced by visitSBend().
|
private |
Thin multipole kick.
Definition at line 562 of file OrbitTracker.cpp.
References BMultipoleField::normal(), BMultipoleField::order(), PX, PY, BMultipoleField::skew(), X, and Y.
Referenced by visitMultipole(), visitRBend(), and visitSBend().
|
private |
Apply transform.
Definition at line 584 of file OrbitTracker.cpp.
References PartData::getBeta(), PartData::getM(), PartData::getP(), Euclid3D::getX(), Euclid3D::getY(), Euclid3D::getZ(), Euclid3D::isIdentity(), itsOrbit, AbstractTracker::itsReference, Euclid3D::M(), PT, PX, PY, sqrt(), T, X, and Y.
Referenced by visitAlignWrapper(), visitPatch(), visitRBend(), and visitSBend().
|
private |
Construct the vector potential for a SBend.
Definition at line 616 of file OrbitTracker.cpp.
References FTps< T, N >::derivative(), endl(), FTps< T, N >::getMaxOrder(), itsOrbit, FTps< T, N >::makeVariable(), BMultipoleField::normal(), BMultipoleField::order(), FTps< T, N >::setTruncOrder(), BMultipoleField::skew(), FTps< T, N >::substitute(), X, and Y.
Referenced by applySBendBody().
const FVector< double, 6 > & OrbitTracker::getOrbit | ( | ) | const |
Return the current orbit.
Definition at line 80 of file OrbitTracker.cpp.
References itsOrbit.
Referenced by ThreadBpm::execute(), and ThreadAll::execute().
|
staticprivate |
Helper function for finding first-order coefficients.
Definition at line 688 of file OrbitTracker.cpp.
References abs(), Physics::c, cos(), cosh(), Physics::e, sin(), sinh(), and sqrt().
|
private |
void OrbitTracker::setOrbit | ( | const FVector< double, 6 > | orbit | ) |
Reset the current orbit.
Definition at line 85 of file OrbitTracker.cpp.
References itsOrbit.
Referenced by ThreadBpm::correct(), ThreadAll::correct(), ThreadBpm::execute(), and ThreadAll::execute().
|
virtual |
Apply the algorithm to an align wrapper..
Reimplemented from DefaultVisitor.
Definition at line 381 of file OrbitTracker.cpp.
References ElementBase::accept(), applyTransform(), DefaultVisitor::back_path, AlignWrapper::getElement(), AlignWrapper::getEntranceTransform(), AlignWrapper::getExitTransform(), Inverse(), Euclid3D::isIdentity(), and AlignWrapper::offset().
|
virtual |
Apply the algorithm to a beam-beam.
Reimplemented from DefaultVisitor.
Definition at line 90 of file OrbitTracker.cpp.
|
virtual |
Apply the algorithm to a beam stripping.
Reimplemented from DefaultVisitor.
Definition at line 95 of file OrbitTracker.cpp.
|
virtual |
Apply the algorithm to a collimator.
Reimplemented from DefaultVisitor.
Definition at line 100 of file OrbitTracker.cpp.
References applyDrift(), DefaultVisitor::flip_s, and ElementBase::getElementLength().
|
virtual |
Apply the algorithm to an arbitrary component.
Reimplemented from DefaultVisitor.
Definition at line 117 of file OrbitTracker.cpp.
References DefaultVisitor::back_beam, DefaultVisitor::back_track, itsOrbit, AbstractTracker::itsReference, PT, OpalParticle::pt(), PX, OpalParticle::px(), PY, OpalParticle::py(), T, OpalParticle::t(), Component::trackBunch(), X, OpalParticle::x(), Y, and OpalParticle::y().
|
virtual |
Apply the algorithm to a corrector.
Reimplemented from DefaultVisitor.
Definition at line 133 of file OrbitTracker.cpp.
References applyDrift(), Physics::c, DefaultVisitor::flip_B, DefaultVisitor::flip_s, BDipoleField::getBx(), BDipoleField::getBy(), ElementBase::getElementLength(), Corrector::getField(), PartData::getP(), PartData::getQ(), itsOrbit, AbstractTracker::itsReference, PX, and PY.
|
virtual |
Apply the algorithm to a CyclotronValley.
Reimplemented from DefaultVisitor.
Definition at line 113 of file OrbitTracker.cpp.
|
virtual |
Apply the algorithm to a drift.
Reimplemented from DefaultVisitor.
Definition at line 104 of file OrbitTracker.cpp.
References applyDrift(), DefaultVisitor::flip_s, and ElementBase::getElementLength().
|
virtual |
Apply the algorithm to a diagnostic.
Reimplemented from DefaultVisitor.
Definition at line 149 of file OrbitTracker.cpp.
References applyDrift(), DefaultVisitor::flip_s, and ElementBase::getElementLength().
|
virtual |
Apply the algorithm to a drift.
Reimplemented from DefaultVisitor.
Definition at line 154 of file OrbitTracker.cpp.
References applyDrift(), DefaultVisitor::flip_s, and ElementBase::getElementLength().
|
virtual |
Apply the algorithm to a flexible collimator.
Reimplemented from DefaultVisitor.
Definition at line 158 of file OrbitTracker.cpp.
References applyDrift(), DefaultVisitor::flip_s, and ElementBase::getElementLength().
|
virtual |
Apply the algorithm to a Lambertson.
Reimplemented from DefaultVisitor.
Definition at line 162 of file OrbitTracker.cpp.
References applyDrift(), DefaultVisitor::flip_s, and ElementBase::getElementLength().
|
virtual |
Apply the algorithm to a marker.
Reimplemented from DefaultVisitor.
Definition at line 168 of file OrbitTracker.cpp.
|
virtual |
Apply the algorithm to a monitor.
Reimplemented from DefaultVisitor.
Definition at line 173 of file OrbitTracker.cpp.
References applyDrift(), DefaultVisitor::flip_s, and ElementBase::getElementLength().
|
virtual |
Apply the algorithm to a multipole.
Reimplemented from DefaultVisitor.
Definition at line 178 of file OrbitTracker.cpp.
References applyMultipoleBody(), applyThinMultipole(), Physics::c, DefaultVisitor::flip_B, DefaultVisitor::flip_s, ElementBase::getElementLength(), Multipole::getField(), PartData::getP(), PartData::getQ(), and AbstractTracker::itsReference.
|
virtual |
Apply the algorithm to a ParallelPlate.
Reimplemented from DefaultVisitor.
Definition at line 108 of file OrbitTracker.cpp.
|
virtual |
Apply the algorithm to a patch.
Reimplemented from DefaultVisitor.
Definition at line 194 of file OrbitTracker.cpp.
References applyTransform(), DefaultVisitor::back_path, Patch::getPatch(), and Inverse().
|
virtual |
Apply the algorithm to a probe.
Reimplemented from DefaultVisitor.
Definition at line 200 of file OrbitTracker.cpp.
|
virtual |
Apply the algorithm to a rectangular bend.
Reimplemented from DefaultVisitor.
Definition at line 204 of file OrbitTracker.cpp.
References applyEntranceFringe(), applyExitFringe(), applyMultipoleBody(), applyThinMultipole(), applyTransform(), DefaultVisitor::back_path, Physics::c, DefaultVisitor::flip_B, DefaultVisitor::flip_s, RBendGeometry::getArcLength(), RBendGeometry::getBendAngle(), RBendGeometry::getElementLength(), RBendGeometry::getEntrancePatch(), RBend::getEntryFaceRotation(), RBend::getExitFaceRotation(), RBendGeometry::getExitPatch(), RBend::getField(), RBend::getGeometry(), PartData::getP(), PartData::getQ(), Inverse(), AbstractTracker::itsReference, and Euclid3D::YRotation().
|
virtual |
Apply the algorithm to a RF cavity.
Reimplemented from DefaultVisitor.
Definition at line 260 of file OrbitTracker.cpp.
References applyDrift(), Physics::c, DefaultVisitor::flip_s, RFCavity::getAmplitude(), PartData::getBeta(), RFCavity::getElementLength(), RFCavity::getFrequency(), PartData::getP(), RFCavity::getPhase(), itsOrbit, AbstractTracker::itsReference, PT, sin(), and T.
|
virtual |
Apply the algorithm to a RF quadrupole.
Reimplemented from DefaultVisitor.
Definition at line 276 of file OrbitTracker.cpp.
References applyDrift(), DefaultVisitor::flip_s, and ElementBase::getElementLength().
|
virtual |
Apply the algorithm to a sector bend.
Reimplemented from DefaultVisitor.
Definition at line 282 of file OrbitTracker.cpp.
References applyEntranceFringe(), applyExitFringe(), applySBendBody(), applyThinMultipole(), applyTransform(), DefaultVisitor::back_path, Physics::c, DefaultVisitor::flip_B, DefaultVisitor::flip_s, PlanarArcGeometry::getArcLength(), PlanarArcGeometry::getBendAngle(), PlanarArcGeometry::getCurvature(), PlanarArcGeometry::getElementLength(), SBend::getEntryFaceRotation(), SBend::getExitFaceRotation(), SBend::getField(), SBend::getGeometry(), PartData::getP(), PartData::getQ(), AbstractTracker::itsReference, and Euclid3D::YRotation().
|
virtual |
Apply the algorithm to a separator.
Reimplemented from DefaultVisitor.
Definition at line 328 of file OrbitTracker.cpp.
References applyDrift(), DefaultVisitor::flip_s, ElementBase::getElementLength(), Separator::getEx(), Separator::getEy(), PartData::getP(), PartData::getQ(), itsOrbit, AbstractTracker::itsReference, PT, PX, and PY.
|
virtual |
Apply the algorithm to a septum.
Reimplemented from DefaultVisitor.
Definition at line 345 of file OrbitTracker.cpp.
References applyDrift(), DefaultVisitor::flip_s, and ElementBase::getElementLength().
|
virtual |
Apply the algorithm to a solenoid.
Reimplemented from DefaultVisitor.
Definition at line 351 of file OrbitTracker.cpp.
References applyDrift(), Physics::c, cos(), DefaultVisitor::flip_B, DefaultVisitor::flip_s, Solenoid::getBz(), Solenoid::getElementLength(), PartData::getM(), PartData::getP(), PartData::getQ(), itsOrbit, AbstractTracker::itsReference, PT, PX, PY, sin(), T, X, and Y.
|
private |
Definition at line 183 of file OrbitTracker.h.
Referenced by applyDrift(), applyMultipoleBody(), applyTransform(), buildSBendVectorPotential(), getOrbit(), setOrbit(), visitComponent(), visitCorrector(), visitRFCavity(), visitSeparator(), and visitSolenoid().