22#ifndef OPAL_ThickTracker_HH
23#define OPAL_ThickTracker_HH
48template <
class T,
unsigned Dim>
92 typedef std::tuple<series_t, std::size_t, double>
tuple_t;
105 bool revBeam,
bool revTrack);
118 bool revBeam,
bool revTrack,
119 const std::vector<unsigned long long> &maxSTEPS,
121 const std::vector<double> &zstop,
122 const std::vector<double> &dt,
199 "Element '" + element +
"' not supported.");
250 const std::size_t& step);
397 gradB = std::round(gradB*1e6)*1e-6;
432 double gamma = ekin / m + 1.0;
433 double beta = std::sqrt(1.0 - 1.0 / ( gamma * gamma ) );
434 double p0 = gamma * beta * m;
437 double r = std::abs(p0 / ( q * B *
Physics::c ));
451 double arclength = 2.0 * r * std::asin( L / ( 2.0 * r ) );
457 if (std::abs(e1) > 1e-6){
470 if (std::abs(e2) > 1e-6){
constexpr double c
The velocity of light in m/s.
FTps< double, 6 > series_t
virtual void visitSolenoid(const Solenoid &)
Apply the algorithm to a solenoid.
OpalBeamline itsOpalBeamline_m
void advanceDispersion_m(fMatrix_t tempMatrix, FMatrix< double, 1, 4 > initialVal, double pos)
Writes Dispersion in X and Y plane.
int truncOrder_m
truncation order of map tracking
void throwElementError_m(std::string element)
std::list< tuple_t > beamline_t
virtual void visitFlexibleCollimator(const FlexibleCollimator &)
Apply the algorithm to a flexible collimator.
particle_t particleToVector_m(const Vector_t &R, const Vector_t &P) const
virtual void visitSBend(const SBend &)
Apply the algorithm to a sector bend.
virtual void visitRFCavity(const RFCavity &)
Apply the algorithm to a RF cavity.
void fillGaps_m()
Fills undefined beam path with a Drift Space.
virtual void visitTravelingWave(const TravelingWave &)
Apply the algorithm to a traveling wave.
void applyExitFringe(double edge, double curve, const BMultipoleField &field, double scale)
CoordinateSystemTrafo referenceToLabCSTrafo_m
void advanceParticles_m(const map_t &map)
double threshold_m
Threshold for element overlaps and gaps.
void applyEntranceFringe(double edge, double curve, const BMultipoleField &field, double scale)
beamline_t elements_m
elements in beam line
virtual void visitBeamline(const Beamline &)
Apply the algorithm to a beam line.
virtual void visitSeptum(const Septum &)
Apply the algorithm to a septum.
virtual void visitProbe(const Probe &)
Apply the algorithm to a probe.
void concatenateMaps_m(const map_t &x, map_t &y)
void operator=(const ThickTracker &)=delete
virtual void visitDrift(const Drift &)
Apply the algorithm to a drift space.
void updateParticle_m(particle_t &particle, const map_t &map)
void write_m(const map_t &map)
Hamiltonian hamiltonian_m
virtual void visitDegrader(const Degrader &)
Apply the algorithm to a degrader.
virtual void visitMonitor(const Monitor &)
Apply the algorithm to a beam position monitor.
void vectorToParticle_m(const particle_t &particle, Vector_t &R, Vector_t &P) const
IpplTimings::TimerRef mapTracking_m
track particles trough maps of elements_m
IpplTimings::TimerRef mapCombination_m
map accumulation along elements_m -> Transfermap
std::tuple< series_t, std::size_t, double > tuple_t
virtual void visitMarker(const Marker &)
Apply the algorithm to a marker.
virtual void visitCCollimator(const CCollimator &)
Apply the algorithm to a collimator.
virtual void visitMultipole(const Multipole &)
Apply the algorithm to a multipole.
virtual void execute()
Apply the algorithm to the top-level beamline.
virtual void visitCorrector(const Corrector &)
Apply the algorithm to a closed orbit corrector.
ThickTracker(const Beamline &bl, const PartData &data, bool revBeam, bool revTrack)
Constructor.
ThickTracker(const ThickTracker &)=delete
void update_m(const double &spos, const std::size_t &step)
virtual void visitRBend(const RBend &)
Apply the algorithm to a rectangular bend.
Hamiltonian::series_t series_t
void checkElementOrder_m()
virtual void visitVacuum(const Vacuum &)
Apply the algorithm to a vacuum space.
double zstart_m
Start of beam line.
FMatrix< double, 6, 6 > fMatrix_t
double zstop_m
End of beam line.
FVector< double, 6 > particle_t
IpplTimings::TimerRef mapCreation_m
creation of elements_m
virtual double getExitAngle() const override
std::size_t getNSlices() const
double getDesignEnergy() const
double getEntranceAngle() const
Vector truncated power series in n variables.
Interface for general corrector.
Interface for drift space.
std::size_t getNSlices() const
virtual double getElementLength() const
Get design length.
Interface for general multipole.
std::size_t getNSlices() const
virtual BMultipoleField & getField() override=0
Get multipole field.
virtual double getB() const =0
Get dipole field of SBend.
const PartData itsReference
The reference information.
Tracker(const Beamline &, const PartData &, bool backBeam, bool backTrack)
Constructor.
PartBunchBase< double, 3 > * itsBunch_m
The bunch of particles to be tracked.
An abstract sequence of beam line components.
The magnetic field of a multipole.
double getNormalComponent(int n) const
Get component.
A templated representation for matrices.
A templated representation for vectors.
Timing::TimerRef TimerRef
Vektor< double, 3 > Vector_t