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);
402 gradB = std::round(gradB*1e6)*1
e-6;
436 double gamma = ekin / m + 1.0;
437 double beta =
std::sqrt(1.0 - 1.0 / ( gamma * gamma ) );
438 double p0 = gamma * beta * m;
455 double arclength = 2.0 * r *
std::asin( L / ( 2.0 * r ) );
Tps< T > sqrt(const Tps< T > &x)
Square root.
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(const PETE_Expr< T > &l)
PETE_TUTree< FnArcSin, typename T::PETE_Expr_t > asin(const PETE_Expr< T > &l)
constexpr double e
The value of.
constexpr double c
The velocity of light in m/s.
Hamiltonian::series_t sbend(const double &gamma0, const double &h, const double &k0)
Hamiltonian::series_t drift(const double &gamma0)
Hamiltonian::series_t quadrupole(const double &gamma0, const double &q, const double &k1)
Hamiltonian::series_t fringeField(const double &phi, const double &k0)
Track using thick-lens algorithm.
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 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.
virtual BMultipoleField & getField() override=0
Get multipole field.
std::size_t getNSlices() const
virtual double getB() const =0
Get dipole field of SBend.
Interface for Traveling Wave.
const PartData itsReference
The reference information.
double getQ() const
The constant charge per particle.
double getGamma() const
The relativistic gamma per particle.
double getP() const
The constant reference momentum per particle.
double getM() const
The constant mass per particle.
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 vectors.
void visit(const T &, BeamlineVisitor &, PartBunchBase< double, 3 > *)
Timing::TimerRef TimerRef