22 #ifndef OPAL_ThickTracker_HH
23 #define OPAL_ThickTracker_HH
48 template <
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,
123 const int& truncOrder);
199 "Element '" + element +
"' not supported.");
250 const std::size_t& step);
397 gradB = std::round(gradB*1e6)*1
e-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;
439 double k0 = B * q * Physics::c / p0;
451 double arclength = 2.0 * r *
std::asin( L / ( 2.0 * r ) );
500 #endif // OPAL_ThickTracker_HH
Hamiltonian::series_t drift(const double &gamma0)
A templated representation for vectors.
double threshold_m
Threshold for element overlaps and gaps.
virtual void visitSBend(const SBend &)
Apply the algorithm to a sector bend.
virtual void visitBeamline(const Beamline &)
Apply the algorithm to a beam line.
Tps< T > sqrt(const Tps< T > &x)
Square root.
constexpr double c
The velocity of light in m/s.
particle_t particleToVector_m(const Vector_t &R, const Vector_t &P) const
std::size_t getNSlices() const
double getQ() const
The constant charge per particle.
Hamiltonian::series_t series_t
virtual void visitSolenoid(const Solenoid &)
Apply the algorithm to a solenoid.
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(const PETE_Expr< T > &l)
Hamiltonian::series_t fringeField(const double &phi, const double &k0)
virtual void visitCCollimator(const CCollimator &)
Apply the algorithm to a collimator.
double zstart_m
Start of beam line.
virtual void visitMultipole(const Multipole &)
Apply the algorithm to a multipole.
Hamiltonian::series_t quadrupole(const double &gamma0, const double &q, const double &k1)
void applyEntranceFringe(double edge, double curve, const BMultipoleField &field, double scale)
Hamiltonian hamiltonian_m
FVector< double, 6 > particle_t
Track using thick-lens algorithm.
IpplTimings::TimerRef mapCombination_m
map accumulation along elements_m -> Transfermap
An abstract sequence of beam line components.
Interface for general multipole.
double getNormalComponent(int n) const
Get component.
Hamiltonian::series_t sbend(const double &gamma0, const double &h, const double &k0)
virtual void visitFlexibleCollimator(const FlexibleCollimator &)
Apply the algorithm to a flexible collimator.
Interface for drift space.
virtual void visitProbe(const Probe &)
Apply the algorithm to a probe.
Interface for general corrector.
void fillGaps_m()
Fills undefined beam path with a Drift Space.
double getM() const
The constant mass per particle.
void vectorToParticle_m(const particle_t &particle, Vector_t &R, Vector_t &P) const
std::list< tuple_t > beamline_t
IpplTimings::TimerRef mapTracking_m
track particles trough maps of elements_m
void advanceParticles_m(const map_t &map)
Timing::TimerRef TimerRef
void advanceDispersion_m(fMatrix_t tempMatrix, FMatrix< double, 1, 4 > initialVal, double pos)
Writes Dispersion in X and Y plane.
virtual void visitSeptum(const Septum &)
Apply the algorithm to a septum.
virtual BMultipoleField & getField() override=0
Get multipole field.
double getEntranceAngle() const
clearpage the user may choose between constant or variable radius This model includes fringe fields L
virtual void execute()
Apply the algorithm to the top-level beamline.
beamline_t elements_m
elements in beam line
OpalBeamline itsOpalBeamline_m
void updateParticle_m(particle_t &particle, const map_t &map)
std::size_t getNSlices() const
virtual void visitRBend(const RBend &)
Apply the algorithm to a rectangular bend.
std::size_t getNSlices() const
void operator=(const ThickTracker &)=delete
CoordinateSystemTrafo referenceToLabCSTrafo_m
const PartData itsReference
The reference information.
void concatenateMaps_m(const map_t &x, map_t &y)
virtual double getElementLength() const
Get design length.
void applyExitFringe(double edge, double curve, const BMultipoleField &field, double scale)
IpplTimings::TimerRef mapCreation_m
creation of elements_m
Vector truncated power series in n variables.
std::tuple< series_t, std::size_t, double > tuple_t
void write_m(const map_t &map)
virtual void visitMonitor(const Monitor &)
Apply the algorithm to a beam position monitor.
virtual void visitMarker(const Marker &)
Apply the algorithm to a marker.
void checkElementOrder_m()
virtual void visitRFCavity(const RFCavity &)
Apply the algorithm to a RF cavity.
PartBunchBase< double, 3 > * itsBunch_m
The bunch of particles to be tracked.
virtual void visitVacuum(const Vacuum &)
Apply the algorithm to a vacuum space.
int truncOrder_m
truncation order of map tracking
void visit(const T &, BeamlineVisitor &, PartBunchBase< double, 3 > *)
virtual double getExitAngle() const override
virtual void visitDrift(const Drift &)
Apply the algorithm to a drift space.
double getDesignEnergy() const
constexpr double e
The value of .
virtual void visitCorrector(const Corrector &)
Apply the algorithm to a closed orbit corrector.
void update_m(const double &spos, const std::size_t &step)
void throwElementError_m(std::string element)
double getP() const
The constant reference momentum per particle.
PETE_TUTree< FnArcSin, typename T::PETE_Expr_t > asin(const PETE_Expr< T > &l)
virtual double getB() const =0
Get dipole field of SBend.
FMatrix< double, 6, 6 > fMatrix_t
virtual void visitDegrader(const Degrader &)
Apply the algorithm to a degrader.
virtual void visitTravelingWave(const TravelingWave &)
Apply the algorithm to a traveling wave.
The magnetic field of a multipole.
double zstop_m
End of beam line.
double getGamma() const
The relativistic gamma per particle.