OPAL (Object Oriented Parallel Accelerator Library)  2024.1
OPAL
ParallelCyclotronTracker.h
Go to the documentation of this file.
1 //
2 // Class ParallelCyclotronTracker
3 // Tracker for OPAL-Cycl
4 //
5 // Copyright (c) 2007 - 2014, Jianjun Yang, Andreas Adelmann and Matthias Toggweiler,
6 // Paul Scherrer Institut, Villigen PSI, Switzerland
7 // Copyright (c) 2014, Daniel Winklehner, MIT, Cambridge, MA, USA
8 // Copyright (c) 2012 - 2022, Paul Scherrer Institut, Villigen PSI, Switzerland
9 // All rights reserved
10 //
11 // Implemented as part of the PhD thesis
12 // "Beam dynamics in high intensity cyclotrons including neighboring bunch effects"
13 // and the paper
14 // "Beam dynamics in high intensity cyclotrons including neighboring bunch effects:
15 // Model, implementation, and application"
16 // (https://journals.aps.org/prab/pdf/10.1103/PhysRevSTAB.13.064201)
17 //
18 // This file is part of OPAL.
19 //
20 // OPAL is free software: you can redistribute it and/or modify
21 // it under the terms of the GNU General Public License as published by
22 // the Free Software Foundation, either version 3 of the License, or
23 // (at your option) any later version.
24 //
25 // You should have received a copy of the GNU General Public License
26 // along with OPAL. If not, see <https://www.gnu.org/licenses/>.
27 //
28 #ifndef OPAL_ParallelCyclotronTracker_HH
29 #define OPAL_ParallelCyclotronTracker_HH
30 
32 #include "Algorithms/BoostMatrix.h"
34 #include "Algorithms/Tracker.h"
35 #include "Steppers/Steppers.h"
36 
37 #include <memory>
38 #include <tuple>
39 #include <vector>
40 
41 class DataSink;
42 class PluginElement;
43 class LossDataSink;
44 
45 template <class T, unsigned Dim>
46 class PartBunchBase;
47 
50  double sinAzimuth;
51  double cosAzimuth;
53 };
54 
56 
57 public:
58  typedef std::vector<double> dvector_t;
59  typedef std::vector<int> ivector_t;
60  typedef std::pair<double[8], Component*> element_pair;
61  typedef std::pair<ElementType, element_pair> type_pair;
62  typedef std::list<type_pair*> beamline_list;
63 
65  // The beam line to be tracked is "bl".
66  // The particle reference data are taken from "data".
67  // The particle bunch tracked is taken from [b]bunch[/b].
68  // If [b]revBeam[/b] is true, the beam runs from s = C to s = 0.
69  // If [b]revTrack[/b] is true, we track against the beam.
71  const PartData& data, bool revBeam,
72  bool revTrack, int maxSTEPS,
73  Steppers::TimeIntegrator timeintegrator,
74  const int& numBunch,
75  const double& mbEta,
76  const double& mbPara,
77  const std::string& mbMode,
78  const std::string& mbBinning);
79 
80  virtual ~ParallelCyclotronTracker();
81 
83  // overwrite the execute-methode from DefaultVisitor
84  virtual void execute();
85 
87  // R - position
88  // P - momentum; note the field is returned in the lab frame
89  // t - time
90  // Efield - filled with values for the electric field
91  // Bfield - filled with values for the magnetic field
92  // Returns a boolean value, true if the particle was out of the nominal
93  // field map boundary, else false.
95  const Vector_t& P,
96  const double& t,
97  Vector_t& Efield,
98  Vector_t& Bfield);
99 
101  // overwrite the execute-methode from DefaultVisitor
102  virtual void visitBeamline(const Beamline&);
103 
105  virtual void visitCCollimator(const CCollimator&);
106 
108  virtual void visitCorrector(const Corrector&);
109 
111  virtual void visitCyclotron(const Cyclotron& cycl);
112 
114  virtual void visitDegrader(const Degrader&);
115 
117  virtual void visitDrift(const Drift&);
118 
120  virtual void visitFlexibleCollimator(const FlexibleCollimator&);
121 
123  virtual void visitMarker(const Marker&);
124 
126  virtual void visitMonitor(const Monitor&);
127 
129  virtual void visitMultipole(const Multipole&);
130 
132  virtual void visitMultipoleT(const MultipoleT&);
133 
135  virtual void visitMultipoleTStraight(const MultipoleTStraight&);
136 
139 
142 
144  virtual void visitOffset(const Offset&);
145 
147  virtual void visitOutputPlane(const OutputPlane&);
148 
150  virtual void visitProbe(const Probe&);
151 
153  virtual void visitRBend(const RBend&);
154 
156  virtual void visitRFCavity(const RFCavity&);
157 
159  virtual void visitRing(const Ring& ring);
160 
162  virtual void visitSBend(const SBend&);
163 
165  virtual void visitSBend3D(const SBend3D&);
166 
168  virtual void visitScalingFFAMagnet(const ScalingFFAMagnet& bend);
169 
171  virtual void visitSeptum(const Septum&);
172 
174  virtual void visitSolenoid(const Solenoid&);
175 
177  virtual void visitStripper(const Stripper&);
178 
180  virtual void visitVacuum(const Vacuum&);
181 
183  virtual void visitVariableRFCavity(const VariableRFCavity& cav);
184 
187 
189  virtual void visitVerticalFFAMagnet(const VerticalFFAMagnet& bend);
190 
192  inline void setLastDumpedStep(const int para) { lastDumpedStep_m = para; }
193 
195  inline void setPr(double x) {referencePr = x;}
196  inline void setPt(double x) {referencePt = x;}
197  inline void setPz(double x) {referencePz = x;}
198  inline void setR(double x) {referenceR = x;}
199  inline void setTheta(double x) {referenceTheta = x;}
200  inline void setZ(double x) {referenceZ = x;}
201  inline void setBeGa(double x) {bega = x;}
202  inline void setPhi(double x) {referencePhi = x;}
203  inline void setPsi(double x) {referencePsi = x;}
204  inline void setPreviousH5Local(bool x) {previousH5Local = x;}
208 
209  Ring* getRing() const {return opalRing_m;}
210 private:
211  enum class TrackingMode: unsigned short {
212  UNDEFINED,
213  SINGLE,
214  SEO,
215  BUNCH
216  };
217 
218  // Not implemented.
221  void operator=(const ParallelCyclotronTracker&);
222 
224  std::list<Component*> myElements;
226  std::vector<PluginElement*> pluginElements_m;
227  std::vector<CavityCrossData> cavCrossDatas_m;
228 
230 
232 
234 
237 
239  static Vector_t const xaxis;
240  static Vector_t const yaxis;
241  static Vector_t const zaxis;
242 
244  double bega;
245  double referenceR;
247  double beamInitialRotation = 0.0;
248  double referenceZ = 0.0;
249 
250  double referencePr;
251  double referencePt;
252  double referencePz = 0.0;
254 
255  double referencePsi;
256  double referencePhi;
257 
258  bool spiral_flag = false;
259 
261 
263 
266 
267  // only used for multi-bunch mode
268  std::unique_ptr<MultiBunchHandler> mbHandler_m;
269 
271 
272  // for each bunch we have a path length
273  double pathLength_m;
274  // Multi time step tracker
275  void MtsTracker();
276 
277  void GenericTracker();
278  bool getFieldsAtPoint(const double& t, const size_t& Pindex, Vector_t& Efield, Vector_t& Bfield);
279 
280  /*
281  Local Variables both used by the integration methods
282  */
283 
284  long long step_m;
285  long long restartStep0_m;
286 
288 
289  // only for dumping
290  double azimuth_m;
292 
293  /* only for dumping to stat-file --> make azimuth monotonically increasing
294  * @param theta computed azimuth [deg]
295  * @param prevAzimuth previous angle [deg]
296  * @param azimuth to be updated [deg]
297  * @param bunchNr in restart mode only --> to compute initial azimuth
298  */
299  void dumpAngle(const double& theta,
300  double& prevAzimuth,
301  double& azimuth,
302  const short& bunchNr = 0);
303 
304  double computeRadius(const Vector_t& meanR) const;
305 
306  void computePathLengthUpdate(std::vector<double>& dl, const double& dt);
307 
308  // external field arrays for dumping
310 
311  const int myNode_m;
312  const size_t initialLocalNum_m;
313  const size_t initialTotalNum_m;
314 
316  std::vector<std::unique_ptr<std::ofstream> > outfTheta_m;
318  std::vector<double> azimuth_angle_m;
320  void openFiles(size_t numFiles, std::string fn);
321  void closeFiles();
324  std::ofstream outfTrackOrbit_m;
325 
326  void buildupFieldList(double BcParameter[], ElementType elementType, Component* elptr);
327 
328  // angle range [0~2PI) degree
329  double calculateAngle(double x, double y);
330  // angle range [-PI~PI) degree
331  double calculateAngle2(double x, double y);
332 
333  bool checkGapCross(Vector_t Rold, Vector_t Rnew, RFCavity* rfcavity, double& DistOld);
334  bool RFkick(RFCavity* rfcavity, const double t, const double dt, const int Pindex);
335 
336  bool getTunes(dvector_t& t, dvector_t& r, dvector_t& z, int lastTurn, double& nur, double& nuz);
337 
344 
345  /*
346  * @param bunchNr if <= -1 --> take all particles in simulation, if bunchNr > -1,
347  * take only particles of *this* bunch
348  */
349  Vector_t calcMeanR(short bunchNr = -1) const;
350 
351  Vector_t calcMeanP() const;
352 
353  void repartition(); // Do repartition between nodes if step_m is multiple of Options::repartFreq
354 
355  // Transform the x- and y-parts of a particle attribute (position, momentum, fields) from the
356  // global reference frame to the local reference frame.
357 
358  // phi is the angle of the bunch measured counter-clockwise from the positive x-axis.
359  void globalToLocal(ParticleAttrib<Vector_t>& vectorArray,
360  double phi, Vector_t const translationToGlobal = 0);
361 
362  // Transform the x- and y-parts of a particle attribute (position, momentum, fields) from the
363  // local reference frame to the global reference frame.
364  void localToGlobal(ParticleAttrib<Vector_t>& vectorArray,
365  double phi, Vector_t const translationToGlobal = 0);
366 
367  // Overloaded version of globalToLocal using a quaternion for 3D rotation
368  inline void globalToLocal(ParticleAttrib<Vector_t>& vectorArray,
369  Quaternion_t const quaternion,
370  Vector_t const meanR = Vector_t(0.0));
371 
372  // Overloaded version of localToGlobal using a quaternion for 3D rotation
373  inline void localToGlobal(ParticleAttrib<Vector_t>& vectorArray,
374  Quaternion_t const quaternion,
375  Vector_t const meanR = Vector_t(0.0));
376 
377  // Overloaded version of globalToLocal using phi and theta for pseudo 3D rotation
378  inline void globalToLocal(ParticleAttrib<Vector_t>& particleVectors,
379  double const phi, double const psi,
380  Vector_t const meanR = Vector_t(0.0));
381 
382  // Overloaded version of localToGlobal using phi and theta for pseudo 3D rotation
383  inline void localToGlobal(ParticleAttrib<Vector_t>& particleVectors,
384  double const phi, double const psi,
385  Vector_t const meanR = Vector_t(0.0));
386 
387  // Overloaded version of globalToLocal using phi and theta for pseudo 3D rotation, single vector
388  inline void globalToLocal(Vector_t& myVector,
389  double const phi, double const psi,
390  Vector_t const meanR = Vector_t(0.0));
391 
392  // Overloaded version of localToGlobal using phi and theta for pseudo 3D rotation, single vector
393  inline void localToGlobal(Vector_t& myVector,
394  double const phi, double const psi,
395  Vector_t const meanR = Vector_t(0.0));
396 
397  // Rotate the particles by an angle and axis defined in the quaternion (4-vector w,x,y,z)
398  inline void rotateWithQuaternion(ParticleAttrib<Vector_t>& vectorArray, Quaternion_t const quaternion);
399 
400  // Returns the quaternion of the rotation from vector u to vector v
401  inline void getQuaternionTwoVectors(Vector_t u, Vector_t v, Quaternion_t& quaternion);
402 
403  // Normalization of a quaternion
404  inline void normalizeQuaternion(Quaternion_t& quaternion);
405 
406  // Normalization of a quaternion
407  inline void normalizeVector(Vector_t& vector);
408 
409  // Some rotations
410  inline void rotateAroundZ(ParticleAttrib<Vector_t>& particleVectors, double const phi);
411  inline void rotateAroundX(ParticleAttrib<Vector_t>& particleVectors, double const psi);
412  inline void rotateAroundZ(Vector_t& myVector, double const phi);
413  inline void rotateAroundX(Vector_t& myVector, double const psi);
414 
415  // Push particles for time h.
416  // Apply effects of RF Gap Crossings.
417  // Unit assumptions: [itsBunch_m->R] = m, [itsBunch_m->P] = 1, [h] = s, [c] = m/s, [itsBunch_m->getT()] = s
418  bool push(double h);
419  // Kick particles for time h
420  // The fields itsBunch_m->Bf, itsBunch_m->Ef are used to calculate the forces
421  bool kick(double h);
422 
423  // Apply the trilogy half push - kick - half push,
424  // considering only external fields
425  void borisExternalFields(double h);
426 
427  // apply the plugin elements: probe, collimator, stripper, septum
428  bool applyPluginElements(const double dt);
429 
430  // destroy particles if they are marked as Bin=-1 in the plugin elements or out of global aperture
431  bool deleteParticle(bool = false);
432 
433  void initTrackOrbitFile();
434 
435  void singleParticleDump();
436 
437  void bunchDumpStatData();
438 
440 
442 
443  void initDistInGlobalFrame();
444 
445  void setTimeStep();
446 
447  void checkFileMomentum();
448 
449  void checkNumPart(std::string s);
450 
451  // we store a pointer explicitly to the Ring
453 
454  // to save geometry losses
455  std::unique_ptr<LossDataSink> lossDs_m;
456 
457  // If Ring is defined take the harmonic number from Ring; else use
458  // cyclotron
459  double getHarmonicNumber() const;
460 
461  typedef std::function<bool(const double&,
462  const size_t&,
463  Vector_t&,
465 
466  std::unique_ptr< Stepper<function_t> > itsStepper_mp;
467 
468  struct settings {
471  double deltaTheta;
473  } setup_m;
474 
476 
478 
479  // for change of coordinates
481 
483  bool isTurnDone();
484 
486  void update_m(double& t, const double& dt, const bool& finishedTurn);
487 
491  std::tuple<double, double, double> initializeTracking_m();
492 
493  void finalizeTracking_m(dvector_t& Ttime,
494  dvector_t& Tdeltr,
495  dvector_t& Tdeltz,
496  ivector_t& TturnNumber);
497 
498  void setTrackingMode();
499 
500  void seoMode_m(double& t, const double dt, bool& finishedTurn,
501  dvector_t& Ttime, dvector_t& Tdeltr,
502  dvector_t& Tdeltz, ivector_t& TturnNumber);
503 
504  void singleMode_m(double& t, const double dt, bool& finishedTurn, double& oldReferenceTheta);
505 
506  void bunchMode_m(double& t, const double dt, bool& finishedTurn);
507 
508  void gapCrossKick_m(size_t i, double t, double dt,
509  const Vector_t& Rold, const Vector_t& Pold);
510 
511 
512  inline void dumpAzimuthAngles_m(const double& t,
513  const Vector_t& R,
514  const Vector_t& P,
515  const double& oldReferenceTheta,
516  const double& temp_meanTheta);
517 
518  inline void dumpThetaEachTurn_m(const double& t,
519  const Vector_t& R,
520  const Vector_t& P,
521  const double& temp_meanTheta,
522  bool& finishedTurn);
523 
525 
526  bool computeExternalFields_m(const size_t& i,
527  const double& t,
528  Vector_t& Efield,
529  Vector_t& Bfield);
530 
531  void injectBunch(bool& flagTransition);
532 
533  void saveInjectValues();
534 
535  bool isMultiBunch() const;
536 
537  bool hasMultiBunch() const;
538 
539  /*
540  * @param dt time step in s
541  */
542  void updatePathLength(const double& dt);
543 
544  /*
545  * @param dt time step in s
546  */
547  void updateTime(const double& dt);
548 
549  void updateAzimuthAndRadius();
550 
558  void initPathLength();
559 };
560 
567 inline
568 double ParallelCyclotronTracker::calculateAngle(double x, double y) {
569  double thetaXY = std::atan2(y, x);
570 
571  if (thetaXY < 0) return thetaXY + Physics::two_pi;
572  return thetaXY;
573 }
574 
581 inline
582 double ParallelCyclotronTracker::calculateAngle2(double x, double y) {
583  return std::atan2(y,x);
584 }
585 
586 
587 inline
589  return ( (mbHandler_m != nullptr) && itsBunch_m->weHaveBins() );
590 }
591 
592 
593 inline
595  return ( isMultiBunch() && mbHandler_m->getNumBunch() > 1 );
596 }
597 
598 #endif // OPAL_ParallelCyclotronTracker_HH
virtual void visitOffset(const Offset &)
Apply the algorithm to a offset (placement).
virtual void visitVacuum(const Vacuum &)
Apply the algorithm to a vacuum space.
std::vector< double > dvector_t
boost::numeric::ublas::matrix< double > matrix_t
Definition: BoostMatrix.h:23
bool computeExternalFields_m(const Vector_t &R, const Vector_t &P, const double &t, Vector_t &Efield, Vector_t &Bfield)
Calculate the field map at an arbitrary point.
void computePathLengthUpdate(std::vector< double > &dl, const double &dt)
virtual void visitScalingFFAMagnet(const ScalingFFAMagnet &bend)
Apply the algorithm to a scaling FFA magnet.
std::pair< double[8], Component * > element_pair
void dumpAzimuthAngles_m(const double &t, const Vector_t &R, const Vector_t &P, const double &oldReferenceTheta, const double &temp_meanTheta)
IpplTimings::TimerRef TransformTimer_m
virtual void visitMarker(const Marker &)
Apply the algorithm to a marker.
bool RFkick(RFCavity *rfcavity, const double t, const double dt, const int Pindex)
IpplTimings::TimerRef BinRepartTimer_m
std::vector< std::unique_ptr< std::ofstream > > outfTheta_m
output coordinates at different azimuthal angles and one after every turn
constexpr double two_pi
The value of .
Definition: Physics.h:33
std::unique_ptr< MultiBunchHandler > mbHandler_m
virtual void visitCorrector(const Corrector &)
Apply the algorithm to a closed orbit corrector.
Interface for a marker.
Definition: Marker.h:32
virtual void visitDegrader(const Degrader &)
Apply the algorithm to a degrader.
virtual void visitRFCavity(const RFCavity &)
Apply the algorithm to a RF cavity.
std::tuple< double, double, double > initializeTracking_m()
virtual void visitSBend3D(const SBend3D &)
Apply the algorithm to a sector bend with 3D field map.
virtual void visitMultipoleT(const MultipoleT &)
Apply the algorithm to an arbitrary multipole.
Vektor< double, 3 > Vector_t
Definition: Vektor.h:6
virtual void visitDrift(const Drift &)
Apply the algorithm to a drift space.
Definition: TSVMeta.h:24
void rotateAroundZ(ParticleAttrib< Vector_t > &particleVectors, double const phi)
virtual void visitVerticalFFAMagnet(const VerticalFFAMagnet &bend)
Apply the algorithm to a vertical FFA magnet.
void update_m(double &t, const double &dt, const bool &finishedTurn)
Update time and path length, write to output files.
Interface for solenoids.
Definition: Solenoid.h:36
virtual void visitBeamline(const Beamline &)
Apply the algorithm to a beam line.
Definition: Offset.h:53
TimeIntegrator
Definition: Steppers.h:25
std::vector< CavityCrossData > cavCrossDatas_m
bool applyPluginElements(const double dt)
virtual void visitMultipoleTCurvedVarRadius(const MultipoleTCurvedVarRadius &)
Apply the algorithm to an arbitrary curved multipole of variable radius.
void setPr(double x)
Method for restart.
double computeRadius(const Vector_t &meanR) const
An abstract sequence of beam line components.
Definition: Beamline.h:34
void bunchMode_m(double &t, const double dt, bool &finishedTurn)
Interface for general multipole.
Definition: Multipole.h:47
virtual void visitSBend(const SBend &)
Apply the algorithm to a sector bend.
virtual void visitVariableRFCavity(const VariableRFCavity &cav)
Apply the algorithm to a variabel RF cavity.
Interface for drift space.
Definition: Drift.h:33
Definition: SBend.h:68
Interface for general corrector.
Definition: Corrector.h:35
Definition: Vacuum.h:61
void rotateWithQuaternion(ParticleAttrib< Vector_t > &vectorArray, Quaternion_t const quaternion)
PETE_TBTree< FnArcTan2, PETE_Scalar< Vektor< T1, Dim > >, typename T2::PETE_Expr_t > atan2(const Vektor< T1, Dim > &l, const PETE_Expr< T2 > &r)
void operator=(const ParallelCyclotronTracker &)
Timing::TimerRef TimerRef
Definition: IpplTimings.h:176
bool checkGapCross(Vector_t Rold, Vector_t Rnew, RFCavity *rfcavity, double &DistOld)
void setLastDumpedStep(const int para)
set last dumped step
void normalizeQuaternion(Quaternion_t &quaternion)
void seoMode_m(double &t, const double dt, bool &finishedTurn, dvector_t &Ttime, dvector_t &Tdeltr, dvector_t &Tdeltz, ivector_t &TturnNumber)
void dumpThetaEachTurn_m(const double &t, const Vector_t &R, const Vector_t &P, const double &temp_meanTheta, bool &finishedTurn)
bool weHaveBins() const
virtual void visitRBend(const RBend &)
Apply the algorithm to a rectangular bend.
bool getFieldsAtPoint(const double &t, const size_t &Pindex, Vector_t &Efield, Vector_t &Bfield)
std::unique_ptr< Stepper< function_t > > itsStepper_mp
double calculateAngle2(double x, double y)
bool isTurnDone()
Check if turn done.
virtual void visitStripper(const Stripper &)
Apply the algorithm to a particle stripper.
virtual void visitProbe(const Probe &)
Apply the algorithm to a probe.
void buildupFieldList(double BcParameter[], ElementType elementType, Component *elptr)
virtual void visitRing(const Ring &ring)
Apply the algorithm to a ring.
void rotateAroundX(ParticleAttrib< Vector_t > &particleVectors, double const psi)
std::unique_ptr< LossDataSink > lossDs_m
void updatePathLength(const double &dt)
double calculateAngle(double x, double y)
bool getTunes(dvector_t &t, dvector_t &r, dvector_t &z, int lastTurn, double &nur, double &nuz)
ElementType
Definition: ElementBase.h:88
void injectBunch(bool &flagTransition)
virtual void visitMultipoleTCurvedConstRadius(const MultipoleTCurvedConstRadius &)
Apply the algorithm to an arbitrary curved multipole of constant radius.
virtual void visitMultipole(const Multipole &)
Apply the algorithm to a multipole.
double function(PyOpalObjectNS::PyOpalObject< C > pyobject, double t)
virtual void visitVariableRFCavityFringeField(const VariableRFCavityFringeField &cav)
Apply the algorithm to a variable RF cavity with Fringe Field.
void finalizeTracking_m(dvector_t &Ttime, dvector_t &Tdeltr, dvector_t &Tdeltz, ivector_t &TturnNumber)
void dumpAngle(const double &theta, double &prevAzimuth, double &azimuth, const short &bunchNr=0)
virtual void visitCyclotron(const Cyclotron &cycl)
Apply the algorithm to a cyclotron.
std::vector< double > azimuth_angle_m
the different azimuthal angles for the outfTheta_m output files
Definition: RBend.h:58
Steppers::TimeIntegrator stepper_m
IpplTimings::TimerRef PluginElemTimer_m
virtual void visitOutputPlane(const OutputPlane &)
Apply the algorithm to a outputplane.
static Vector_t const xaxis
The positive axes unit vectors.
virtual void visitCCollimator(const CCollimator &)
Apply the algorithm to a collimator.
std::vector< PluginElement * > pluginElements_m
void openFiles(size_t numFiles, std::string fn)
@ open / close output coordinate files
IpplTimings::TimerRef DumpTimer_m
std::function< bool(const double &, const size_t &, Vector_t &, Vector_t &)> function_t
struct ParallelCyclotronTracker::settings setup_m
IpplTimings::TimerRef IntegrationTimer_m
PartBunchBase< double, 3 > * itsBunch_m
The bunch of particles to be tracked.
Definition: Tracker.h:151
int maxSteps_m
The maximal number of steps the system is integrated.
std::pair< ElementType, element_pair > type_pair
Definition: Probe.h:28
void localToGlobal(ParticleAttrib< Vector_t > &vectorArray, double phi, Vector_t const translationToGlobal=0)
void globalToLocal(ParticleAttrib< Vector_t > &vectorArray, double phi, Vector_t const translationToGlobal=0)
void singleMode_m(double &t, const double dt, bool &finishedTurn, double &oldReferenceTheta)
virtual void visitSeptum(const Septum &)
Apply the algorithm to a septum.
void normalizeVector(Vector_t &vector)
Ring describes a ring type geometry for tracking.
Definition: Ring.h:53
void getQuaternionTwoVectors(Vector_t u, Vector_t v, Quaternion_t &quaternion)
Vector_t calcMeanR(short bunchNr=-1) const
virtual void visitSolenoid(const Solenoid &)
Apply the algorithm to a solenoid.
Definition: Septum.h:23
Interface for a single beam element.
Definition: Component.h:50
void gapCrossKick_m(size_t i, double t, double dt, const Vector_t &Rold, const Vector_t &Pold)
double bega
The reference variables.
virtual void visitMonitor(const Monitor &)
Apply the algorithm to a beam position monitor.
IpplTimings::TimerRef DelParticleTimer_m
std::list< type_pair * > beamline_list
virtual void execute()
Apply the algorithm to the top-level beamline.
virtual void visitFlexibleCollimator(const FlexibleCollimator &)
Apply the algorithm to a flexible collimator.
std::list< Component * > myElements
virtual void visitMultipoleTStraight(const MultipoleTStraight &)
Apply the algorithm to an arbitrary straight multipole.