1 #ifndef OPAL_ThickTracker_HH
2 #define OPAL_ThickTracker_HH
61 template <
class T,
unsigned Dim>
112 typedef std::tuple<series_t, std::size_t, double>
tuple_t;
124 bool revBeam,
bool revTrack);
137 bool revBeam,
bool revTrack,
138 const std::vector<unsigned long long> &maxSTEPS,
140 const std::vector<double> &zstop,
141 const std::vector<double> &dt,
142 const int& truncOrder);
243 "Element '" + element +
"' not supported.");
296 const std::size_t& step);
473 gradB = std::round(gradB*1e6)*1
e-6;
517 double gamma = ekin / m + 1.0;
518 double beta =
std::sqrt(1.0 - 1.0 / ( gamma * gamma ) );
519 double p0 = gamma * beta * m;
524 double k0 = B * q * Physics::c / p0;
536 double arclength = 2.0 * r *
std::asin( L / ( 2.0 * r ) );
591 #endif // OPAL_ThickTracker_HH
void checkElementOrder_m()
virtual void visitSeparator(const Separator &)
Apply the algorithm to a Separator.
virtual double getB() const =0
Get dipole field of SBend.
virtual void visitDegrader(const Degrader &)
Apply the algorithm to a Degrader.
void write_m(const map_t &map)
CoordinateSystemTrafo referenceToLabCSTrafo_m
void advanceParticles_m(const map_t &map)
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(const PETE_Expr< T > &l)
constexpr double e
The value of .
IpplTimings::TimerRef mapCreation_m
creation of elements_m
Interface for septum magnet.
std::tuple< series_t, std::size_t, double > tuple_t
OpalBeamline itsOpalBeamline_m
virtual BMultipoleField & getField() override=0
Get multipole field.
virtual void visitRBend(const RBend &)
Apply the algorithm to a RBend.
Interface for electrostatic separator.
Interface for beam position monitors.
Interface for RF Quadrupole.
IpplTimings::TimerRef mapTracking_m
track particles trough maps of elements_m
Define the position of a misaligned element.
void advanceDispersion_m(fMatrix_t tempMatrix, FMatrix< double, 1, 4 > initialVal, double pos)
Writes Dispersion in X and Y plane.
virtual void visitProbe(const Probe &)
Apply the algorithm to a Probe.
Interface for general corrector.
Interface for beam diagnostics.
Hamiltonian::series_t fringeField(const double &phi, const double &k0)
void updateParticle_m(particle_t &particle, const map_t &map)
virtual void visitMonitor(const Monitor &)
Apply the algorithm to a Monitor.
Interface for drift space.
MapAnalyser::fMatrix_t fMatrix_t
virtual void visitParallelPlate(const ParallelPlate &)
Apply the algorithm to a ParallelPlate.
double getDesignEnergy() const
virtual void visitTravelingWave(const TravelingWave &)
Apply the algorithm to a RFCavity.
Interface for general multipole.
Hamiltonian::series_t drift(const double &gamma0)
virtual void visitBeamStripping(const BeamStripping &)
Apply the algorithm to a BeamStripping.
virtual void visitRFQuadrupole(const RFQuadrupole &)
Apply the algorithm to a RFQuadrupole.
T deg(T x)
Convert radians to degrees.
virtual void visitCorrector(const Corrector &)
Apply the algorithm to a Corrector.
std::size_t getNSlices() const
double zstart_m
Start of beam line.
virtual void visitSBend(const SBend &)
Apply the algorithm to a SBend.
FVector< double, 6 > particle_t
beamline_t elements_m
elements in beam line
virtual void visitSeptum(const Septum &)
Apply the algorithm to a Septum.
IpplTimings::TimerRef mapCombination_m
map accumulation along elements_m -> Transfermap
void fillGaps_m()
Fills undefined beam path with a Drift Space.
double getQ() const
The constant charge per particle.
virtual void visitRFCavity(const RFCavity &)
Apply the algorithm to a RFCavity.
virtual double getElementLength() const
Get design length.
virtual void visitMarker(const Marker &)
Apply the algorithm to a Marker.
double getNormalComponent(int n) const
Get component.
constexpr double c
The velocity of light in m/s.
void applyExitFringe(double edge, double curve, const BMultipoleField &field, double scale)
Interface for cyclotron collimator.
Hamiltonian hamiltonian_m
particle_t particleToVector_m(const Vector_t &R, const Vector_t &P) const
virtual void visitBeamline(const Beamline &)
Apply the algorithm to a beam line.
void vectorToParticle_m(const particle_t &particle, Vector_t &R, Vector_t &P) const
Abstract beam-beam interaction.
void visit(const T &, BeamlineVisitor &, PartBunchBase< double, 3 > *)
std::size_t getNSlices() const
void applyEntranceFringe(double edge, double curve, const BMultipoleField &field, double scale)
Interface for cyclotron valley.
virtual void visitCyclotronValley(const CyclotronValley &)
Apply the algorithm to a CyclotronValley.
std::size_t getNSlices() const
double zstop_m
End of beam line.
An abstract sequence of beam line components.
const PartData itsReference
The reference information.
virtual double getExitAngle() const
virtual void visitLambertson(const Lambertson &)
Apply the algorithm to a Lambertson.
virtual void visitBeamBeam(const BeamBeam &)
Apply the algorithm to a BeamBeam.
Tps< T > sqrt(const Tps< T > &x)
Square root.
Hamiltonian::series_t sbend(const double &gamma0, const double &h, const double &k0)
double getP() const
The constant reference momentum per particle.
double getGamma() const
The relativistic gamma per particle.
void throwElementError_m(std::string element)
Track using thick-lens algorithm.
The magnetic field of a multipole.
virtual void visitDiagnostic(const Diagnostic &)
Apply the algorithm to a Diagnostic.
MapAnalyser mapAnalyser_m
double getM() const
The constant mass per particle.
virtual void visitDrift(const Drift &)
Apply the algorithm to a Drift.
virtual void visitMultipole(const Multipole &)
Apply the algorithm to a Multipole.
virtual void visitCCollimator(const CCollimator &)
Apply the algorithm to a collimator.
double threshold_m
Threshold for element overlaps and gaps.
void update_m(const double &spos, const std::size_t &step)
MapAnalyser::cfMatrix_t cfMatrix_t
virtual void visitFlexibleCollimator(const FlexibleCollimator &)
Apply the algorithm to a flexible collimator.
PETE_TUTree< FnArcSin, typename T::PETE_Expr_t > asin(const PETE_Expr< T > &l)
Hamiltonian::series_t series_t
Timing::TimerRef TimerRef
void concatenateMaps_m(const map_t &x, map_t &y)
double getEntranceAngle() const
virtual void execute()
Apply the algorithm to the top-level beamline.
virtual void visitSolenoid(const Solenoid &)
Apply the algorithm to a Solenoid.
std::list< tuple_t > beamline_t
PartBunchBase< double, 3 > * itsBunch_m
The bunch of particles to be tracked.
void operator=(const ThickTracker &)=delete
virtual void visitAlignWrapper(const AlignWrapper &)
Apply the algorithm to an align wrapper.
Interface for a Lambertson septum.
Hamiltonian::series_t quadrupole(const double &gamma0, const double &q, const double &k1)
int truncOrder_m
truncation order of map tracking
Track particles or bunches.