OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
Replacer Class Reference

Replace all references to named element by a new version. More...

#include <Replacer.h>

Inheritance diagram for Replacer:
Collaboration diagram for Replacer:

Public Member Functions

 Replacer (const Beamline &, const std::string &name, ElementBase *elm)
 Constructor.
virtual ~Replacer ()
virtual void visitFlaggedElmPtr (const FlaggedElmPtr &)
 Apply the visitor to an FlaggedElmPtr.
virtual void execute ()
 Apply the algorithm to the top-level beamline.
virtual void visitBeamline (const Beamline &)
 Apply the algorithm to a beam line.
virtual void visitCCollimator (const CCollimator &)
 Apply the algorithm to a collimator.
virtual void visitComponent (const Component &)
 Apply the algorithm to an arbitrary component.
virtual void visitCorrector (const Corrector &)
 Apply the algorithm to a closed orbit corrector.
virtual void visitCyclotron (const Cyclotron &)
 Apply the algorithm to an cyclotron.
virtual void visitDegrader (const Degrader &)
 Apply the algorithm to a degrader.
virtual void visitDrift (const Drift &)
 Apply the algorithm to a drift space.
virtual void visitFlexibleCollimator (const FlexibleCollimator &)
 Apply the algorithm to a flexible collimator.
virtual void visitMarker (const Marker &)
 Apply the algorithm to a marker.
virtual void visitMonitor (const Monitor &)
 Apply the algorithm to a beam position monitor.
virtual void visitMultipole (const Multipole &)
 Apply the algorithm to a multipole.
virtual void visitMultipoleT (const MultipoleT &)
 Apply the algorithm to to an arbitrary multipole.
virtual void visitOffset (const Offset &)
 Apply the algorithm to an offset (placement).
virtual void visitOutputPlane (const OutputPlane &)
 Apply the algorithm to an output plane.
virtual void visitProbe (const Probe &prob)
 Apply the algorithm to a probe.
virtual void visitRBend (const RBend &)
 Apply the algorithm to a rectangular bend.
virtual void visitRBend3D (const RBend3D &)
 Apply the algorithm to a rectangular bend.
virtual void visitRFCavity (const RFCavity &)
 Apply the algorithm to a RF cavity.
virtual void visitRing (const Ring &)
 Apply the algorithm to a ring.
virtual void visitSBend (const SBend &)
 Apply the algorithm to a sector bend.
virtual void visitSBend3D (const SBend3D &)
 Apply the algorithm to a sector bend with 3D field map.
virtual void visitScalingFFAMagnet (const ScalingFFAMagnet &)
 Apply the algorithm to a scaling FFA magnet.
virtual void visitSeptum (const Septum &)
 Apply the algorithm to a septum.
virtual void visitSolenoid (const Solenoid &)
 Apply the algorithm to a solenoid.
virtual void visitSource (const Source &)
 Apply the algorithm to a source.
virtual void visitStripper (const Stripper &)
 Apply the algorithm to a particle stripper.
virtual void visitTravelingWave (const TravelingWave &)
 Apply the algorithm to a traveling wave.
virtual void visitVacuum (const Vacuum &)
 Apply the algorithm to a vacuum space.
virtual void visitVariableRFCavity (const VariableRFCavity &vcav)
 Apply the algorithm to a a variable RF cavity.
virtual void visitVariableRFCavityFringeField (const VariableRFCavityFringeField &vcav)
 Apply the algorithm to a a variable RF cavity with Fringe Field.
virtual void visitVerticalFFAMagnet (const VerticalFFAMagnet &)
 Apply the algorithm to a vertical FFA magnet.

Protected Attributes

const BeamlineitsLine
bool back_beam
bool back_track
bool back_path
double flip_B
double flip_s

Private Member Functions

 Replacer ()
 Replacer (const Replacer &)
void operator= (const Replacer &)
virtual void applyDefault (const ElementBase &)

Private Attributes

const std::string itsName
ElementBasenewBase
bool local_flip

Detailed Description

Replace all references to named element by a new version.

Definition at line 32 of file Replacer.h.

Constructor & Destructor Documentation

◆ Replacer() [1/3]

Replacer::Replacer ( const Beamline & beamline,
const std::string & name,
ElementBase * elm )

Constructor.

Definition at line 32 of file Replacer.cpp.

References DefaultVisitor::DefaultVisitor(), itsName, name, and newBase.

Referenced by operator=(), and Replacer().

Here is the call graph for this function:

◆ ~Replacer()

Replacer::~Replacer ( )
virtual

Definition at line 41 of file Replacer.cpp.

◆ Replacer() [2/3]

Replacer::Replacer ( )
private

◆ Replacer() [3/3]

Replacer::Replacer ( const Replacer & )
private

References Replacer().

Here is the call graph for this function:

Member Function Documentation

◆ applyDefault()

◆ execute()

void DefaultVisitor::execute ( )
virtualinherited

Apply the algorithm to the top-level beamline.

Implements BeamlineVisitor.

Reimplemented in ParallelCyclotronTracker, ParallelTTracker, RangeSelector, Selector, and ThickTracker.

Definition at line 79 of file DefaultVisitor.cpp.

References back_beam, back_track, itsLine, and local_flip.

Referenced by RangeSelector::execute(), Line::replace(), Sequence::replace(), and Select::select().

◆ operator=()

void Replacer::operator= ( const Replacer & )
private

References Replacer().

Here is the call graph for this function:

◆ visitBeamline()

void DefaultVisitor::visitBeamline ( const Beamline & bl)
virtualinherited

Apply the algorithm to a beam line.

Implements BeamlineVisitor.

Reimplemented in ParallelCyclotronTracker, ParallelTTracker, and ThickTracker.

Definition at line 213 of file DefaultVisitor.cpp.

References Beamline::iterate(), and local_flip.

Here is the call graph for this function:

◆ visitCCollimator()

void DefaultVisitor::visitCCollimator ( const CCollimator & coll)
virtualinherited

Apply the algorithm to a collimator.

Implements BeamlineVisitor.

Reimplemented in ParallelCyclotronTracker, ParallelTTracker, and ThickTracker.

Definition at line 85 of file DefaultVisitor.cpp.

References applyDefault().

Here is the call graph for this function:

◆ visitComponent()

void DefaultVisitor::visitComponent ( const Component & comp)
virtualinherited

Apply the algorithm to an arbitrary component.

Implements BeamlineVisitor.

Reimplemented in Tracker.

Definition at line 89 of file DefaultVisitor.cpp.

References applyDefault().

Here is the call graph for this function:

◆ visitCorrector()

void DefaultVisitor::visitCorrector ( const Corrector & corr)
virtualinherited

Apply the algorithm to a closed orbit corrector.

Implements BeamlineVisitor.

Reimplemented in ParallelCyclotronTracker, ParallelTTracker, and ThickTracker.

Definition at line 93 of file DefaultVisitor.cpp.

References applyDefault().

Here is the call graph for this function:

◆ visitCyclotron()

void DefaultVisitor::visitCyclotron ( const Cyclotron & cyc)
virtualinherited

Apply the algorithm to an cyclotron.

Implements BeamlineVisitor.

Reimplemented in ParallelCyclotronTracker.

Definition at line 97 of file DefaultVisitor.cpp.

References applyDefault().

Here is the call graph for this function:

◆ visitDegrader()

void DefaultVisitor::visitDegrader ( const Degrader & deg)
virtualinherited

Apply the algorithm to a degrader.

Implements BeamlineVisitor.

Reimplemented in ParallelCyclotronTracker, ParallelTTracker, and ThickTracker.

Definition at line 101 of file DefaultVisitor.cpp.

References applyDefault().

Here is the call graph for this function:

◆ visitDrift()

void DefaultVisitor::visitDrift ( const Drift & drf)
virtualinherited

Apply the algorithm to a drift space.

Implements BeamlineVisitor.

Reimplemented in ParallelCyclotronTracker, ParallelTTracker, and ThickTracker.

Definition at line 105 of file DefaultVisitor.cpp.

References applyDefault().

Here is the call graph for this function:

◆ visitFlaggedElmPtr()

void Replacer::visitFlaggedElmPtr ( const FlaggedElmPtr & fep)
virtual

Apply the visitor to an FlaggedElmPtr.

Reimplemented from DefaultVisitor.

Definition at line 45 of file Replacer.cpp.

References ElmPtr::getElement(), ElementBase::getName(), itsName, name, newBase, and DefaultVisitor::visitFlaggedElmPtr().

Here is the call graph for this function:

◆ visitFlexibleCollimator()

void DefaultVisitor::visitFlexibleCollimator ( const FlexibleCollimator & coll)
virtualinherited

Apply the algorithm to a flexible collimator.

Implements BeamlineVisitor.

Reimplemented in ParallelCyclotronTracker, ParallelTTracker, and ThickTracker.

Definition at line 109 of file DefaultVisitor.cpp.

References applyDefault().

Here is the call graph for this function:

◆ visitMarker()

void DefaultVisitor::visitMarker ( const Marker & mark)
virtualinherited

Apply the algorithm to a marker.

Implements BeamlineVisitor.

Reimplemented in ParallelCyclotronTracker, ParallelTTracker, and ThickTracker.

Definition at line 113 of file DefaultVisitor.cpp.

References applyDefault().

Here is the call graph for this function:

◆ visitMonitor()

void DefaultVisitor::visitMonitor ( const Monitor & mon)
virtualinherited

Apply the algorithm to a beam position monitor.

Implements BeamlineVisitor.

Reimplemented in ParallelCyclotronTracker, ParallelTTracker, and ThickTracker.

Definition at line 117 of file DefaultVisitor.cpp.

References applyDefault().

Here is the call graph for this function:

◆ visitMultipole()

void DefaultVisitor::visitMultipole ( const Multipole & mult)
virtualinherited

Apply the algorithm to a multipole.

Implements BeamlineVisitor.

Reimplemented in ParallelCyclotronTracker, ParallelTTracker, and ThickTracker.

Definition at line 121 of file DefaultVisitor.cpp.

References applyDefault().

Here is the call graph for this function:

◆ visitMultipoleT()

void DefaultVisitor::visitMultipoleT ( const MultipoleT & multT)
virtualinherited

Apply the algorithm to to an arbitrary multipole.

Implements BeamlineVisitor.

Reimplemented in ParallelCyclotronTracker, and ParallelTTracker.

Definition at line 125 of file DefaultVisitor.cpp.

References applyDefault().

Here is the call graph for this function:

◆ visitOffset()

void DefaultVisitor::visitOffset ( const Offset & off)
virtualinherited

Apply the algorithm to an offset (placement).

Implements BeamlineVisitor.

Reimplemented in ParallelCyclotronTracker.

Definition at line 129 of file DefaultVisitor.cpp.

References applyDefault().

Here is the call graph for this function:

◆ visitOutputPlane()

void DefaultVisitor::visitOutputPlane ( const OutputPlane & out)
virtualinherited

Apply the algorithm to an output plane.

Implements BeamlineVisitor.

Reimplemented in ParallelCyclotronTracker.

Definition at line 133 of file DefaultVisitor.cpp.

References applyDefault().

Here is the call graph for this function:

◆ visitProbe()

void DefaultVisitor::visitProbe ( const Probe & prob)
virtualinherited

Apply the algorithm to a probe.

Implements BeamlineVisitor.

Reimplemented in ParallelCyclotronTracker, ParallelTTracker, and ThickTracker.

Definition at line 137 of file DefaultVisitor.cpp.

References applyDefault().

Here is the call graph for this function:

◆ visitRBend()

void DefaultVisitor::visitRBend ( const RBend & bend)
virtualinherited

Apply the algorithm to a rectangular bend.

Implements BeamlineVisitor.

Reimplemented in ParallelCyclotronTracker, ParallelTTracker, and ThickTracker.

Definition at line 141 of file DefaultVisitor.cpp.

References applyDefault().

Here is the call graph for this function:

◆ visitRBend3D()

void DefaultVisitor::visitRBend3D ( const RBend3D & bend)
virtualinherited

Apply the algorithm to a rectangular bend.

Reimplemented from BeamlineVisitor.

Reimplemented in ParallelTTracker.

Definition at line 145 of file DefaultVisitor.cpp.

References applyDefault().

Here is the call graph for this function:

◆ visitRFCavity()

void DefaultVisitor::visitRFCavity ( const RFCavity & cav)
virtualinherited

Apply the algorithm to a RF cavity.

Implements BeamlineVisitor.

Reimplemented in ParallelCyclotronTracker, ParallelTTracker, and ThickTracker.

Definition at line 149 of file DefaultVisitor.cpp.

References applyDefault().

Here is the call graph for this function:

◆ visitRing()

void DefaultVisitor::visitRing ( const Ring & ring)
virtualinherited

Apply the algorithm to a ring.

Implements BeamlineVisitor.

Reimplemented in ParallelCyclotronTracker.

Definition at line 153 of file DefaultVisitor.cpp.

References applyDefault().

Here is the call graph for this function:

◆ visitSBend()

void DefaultVisitor::visitSBend ( const SBend & bend)
virtualinherited

Apply the algorithm to a sector bend.

Implements BeamlineVisitor.

Reimplemented in ParallelCyclotronTracker, ParallelTTracker, and ThickTracker.

Definition at line 157 of file DefaultVisitor.cpp.

References applyDefault().

Here is the call graph for this function:

◆ visitSBend3D()

void DefaultVisitor::visitSBend3D ( const SBend3D & bend)
virtualinherited

Apply the algorithm to a sector bend with 3D field map.

Implements BeamlineVisitor.

Reimplemented in ParallelCyclotronTracker.

Definition at line 161 of file DefaultVisitor.cpp.

References applyDefault().

Here is the call graph for this function:

◆ visitScalingFFAMagnet()

void DefaultVisitor::visitScalingFFAMagnet ( const ScalingFFAMagnet & spiral)
virtualinherited

Apply the algorithm to a scaling FFA magnet.

Implements BeamlineVisitor.

Reimplemented in ParallelCyclotronTracker.

Definition at line 165 of file DefaultVisitor.cpp.

References applyDefault().

Here is the call graph for this function:

◆ visitSeptum()

void DefaultVisitor::visitSeptum ( const Septum & sept)
virtualinherited

Apply the algorithm to a septum.

Implements BeamlineVisitor.

Reimplemented in ParallelCyclotronTracker, ParallelTTracker, and ThickTracker.

Definition at line 169 of file DefaultVisitor.cpp.

References applyDefault().

Here is the call graph for this function:

◆ visitSolenoid()

void DefaultVisitor::visitSolenoid ( const Solenoid & sol)
virtualinherited

Apply the algorithm to a solenoid.

Implements BeamlineVisitor.

Reimplemented in ParallelCyclotronTracker, ParallelTTracker, and ThickTracker.

Definition at line 173 of file DefaultVisitor.cpp.

References applyDefault().

Here is the call graph for this function:

◆ visitSource()

void DefaultVisitor::visitSource ( const Source & sou)
virtualinherited

Apply the algorithm to a source.

Implements BeamlineVisitor.

Reimplemented in ParallelTTracker.

Definition at line 177 of file DefaultVisitor.cpp.

References applyDefault().

Here is the call graph for this function:

◆ visitStripper()

void DefaultVisitor::visitStripper ( const Stripper & stripper)
virtualinherited

Apply the algorithm to a particle stripper.

Implements BeamlineVisitor.

Reimplemented in ParallelCyclotronTracker.

Definition at line 181 of file DefaultVisitor.cpp.

References applyDefault().

Here is the call graph for this function:

◆ visitTravelingWave()

void DefaultVisitor::visitTravelingWave ( const TravelingWave & trw)
virtualinherited

Apply the algorithm to a traveling wave.

Implements BeamlineVisitor.

Reimplemented in ParallelTTracker, and ThickTracker.

Definition at line 185 of file DefaultVisitor.cpp.

References applyDefault().

Here is the call graph for this function:

◆ visitVacuum()

void DefaultVisitor::visitVacuum ( const Vacuum & vac)
virtualinherited

Apply the algorithm to a vacuum space.

Implements BeamlineVisitor.

Reimplemented in ParallelCyclotronTracker, ParallelTTracker, and ThickTracker.

Definition at line 195 of file DefaultVisitor.cpp.

References applyDefault().

Here is the call graph for this function:

◆ visitVariableRFCavity()

void DefaultVisitor::visitVariableRFCavity ( const VariableRFCavity & vcav)
virtualinherited

Apply the algorithm to a a variable RF cavity.

Implements BeamlineVisitor.

Reimplemented in ParallelCyclotronTracker.

Definition at line 199 of file DefaultVisitor.cpp.

References applyDefault().

Here is the call graph for this function:

◆ visitVariableRFCavityFringeField()

void DefaultVisitor::visitVariableRFCavityFringeField ( const VariableRFCavityFringeField & vcav)
virtualinherited

Apply the algorithm to a a variable RF cavity with Fringe Field.

Implements BeamlineVisitor.

Reimplemented in ParallelCyclotronTracker.

Definition at line 203 of file DefaultVisitor.cpp.

References applyDefault().

Here is the call graph for this function:

◆ visitVerticalFFAMagnet()

void DefaultVisitor::visitVerticalFFAMagnet ( const VerticalFFAMagnet & mag)
virtualinherited

Apply the algorithm to a vertical FFA magnet.

Implements BeamlineVisitor.

Reimplemented in ParallelCyclotronTracker.

Definition at line 208 of file DefaultVisitor.cpp.

References applyDefault().

Here is the call graph for this function:

Member Data Documentation

◆ back_beam

bool DefaultVisitor::back_beam
protectedinherited

Definition at line 155 of file DefaultVisitor.h.

Referenced by DefaultVisitor(), execute(), and Tracker::visitComponent().

◆ back_path

bool DefaultVisitor::back_path
protectedinherited

Definition at line 157 of file DefaultVisitor.h.

Referenced by DefaultVisitor().

◆ back_track

◆ flip_B

double DefaultVisitor::flip_B
protectedinherited

Definition at line 160 of file DefaultVisitor.h.

Referenced by DefaultVisitor().

◆ flip_s

double DefaultVisitor::flip_s
protectedinherited

Definition at line 161 of file DefaultVisitor.h.

Referenced by DefaultVisitor().

◆ itsLine

const Beamline& DefaultVisitor::itsLine
protectedinherited

Definition at line 152 of file DefaultVisitor.h.

Referenced by DefaultVisitor(), and execute().

◆ itsName

const std::string Replacer::itsName
private

Definition at line 53 of file Replacer.h.

Referenced by Replacer(), and visitFlaggedElmPtr().

◆ local_flip

bool DefaultVisitor::local_flip
privateinherited

Definition at line 176 of file DefaultVisitor.h.

Referenced by DefaultVisitor(), execute(), visitBeamline(), and visitFlaggedElmPtr().

◆ newBase

ElementBase* Replacer::newBase
private

Definition at line 56 of file Replacer.h.

Referenced by Replacer(), and visitFlaggedElmPtr().


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