OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
OrbitTracker.h
Go to the documentation of this file.
1 #ifndef CLASSIC_OrbitTracker_HH
2 #define CLASSIC_OrbitTracker_HH
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: OrbitTracker.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.1.1 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: OrbitTracker
13 //
14 // ------------------------------------------------------------------------
15 // Class category: Algorithms
16 // ------------------------------------------------------------------------
17 //
18 // $Date: 2000/03/27 09:32:33 $
19 // $Author: fci $
20 //
21 // ------------------------------------------------------------------------
22 
24 #include "FixedAlgebra/FVector.h"
25 
26 class BMultipoleField;
27 class Euclid3D;
28 
29 template <class T, int N> class FTps;
30 
31 
32 // Class OrbitTracker
33 // ------------------------------------------------------------------------
35 // Uses a thick lens method to find the orbit for each element.
36 
38 
39 public:
40 
41  // Particle coordinate numbers.
42  enum { X, PX, Y, PY, T, PT };
43 
45  // The beam line to be tracked is [b]bl[/b].
46  // The particle reference data are taken from [b]data[/b].
47  // If [b]revBeam[/b] is true, the beam runs from s = C to s = 0.
48  // If [b]revTrack[/b] is true, we track against the beam.
49  OrbitTracker(const Beamline &, const PartData &,
50  bool backBeam, bool backTrack);
51 
52  virtual ~OrbitTracker();
53 
54 
56  const FVector<double, 6> &getOrbit() const;
57 
59  void setOrbit(const FVector<double, 6> orbit);
60 
62  virtual void visitBeamBeam(const BeamBeam &);
63 
65  virtual void visitBeamStripping(const BeamStripping &);
66 
68  virtual void visitCCollimator(const CCollimator &);
69 
71  virtual void visitComponent(const Component &);
72 
74  virtual void visitCorrector(const Corrector &);
75 
77  virtual void visitDegrader(const Degrader &);
78 
80  virtual void visitDiagnostic(const Diagnostic &);
81 
83  virtual void visitDrift(const Drift &);
84 
86  virtual void visitFlexibleCollimator(const FlexibleCollimator &);
87 
89  virtual void visitLambertson(const Lambertson &);
90 
92  virtual void visitMarker(const Marker &);
93 
95  virtual void visitMonitor(const Monitor &);
96 
98  virtual void visitMultipole(const Multipole &);
99 
101  virtual void visitPatch(const Patch &pat);
102 
104  virtual void visitProbe(const Probe &prob);
105 
107  virtual void visitRBend(const RBend &);
108 
110  virtual void visitRFCavity(const RFCavity &);
111 
113  virtual void visitRFQuadrupole(const RFQuadrupole &);
114 
116  virtual void visitSBend(const SBend &);
117 
119  virtual void visitSeparator(const Separator &);
120 
122  virtual void visitSeptum(const Septum &);
123 
125  virtual void visitSolenoid(const Solenoid &);
126 
128  virtual void visitParallelPlate(const ParallelPlate &);
129 
131  virtual void visitCyclotronValley(const CyclotronValley &);
132 
134  virtual void visitAlignWrapper(const AlignWrapper &);
135 
136 private:
137 
138  // Not implemented.
139  OrbitTracker();
140  OrbitTracker(const OrbitTracker &);
141  void operator=(const OrbitTracker &);
142 
144  // Propagate current map through a drift.
145  void applyDrift(double length);
146 
148  void applyEntranceFringe(double edge,
149  const BMultipoleField &field, double scale);
150  void applyExitFringe(double edge,
151  const BMultipoleField &field, double scale);
152 
154  void applyLinearMap(double length, double refLength, double h,
155  const FTps<double, 2> &Fx, const FTps<double, 2> &Fy);
156 
158  void applyMultipoleBody(double length, double refLength,
159  const BMultipoleField &field, double scale);
160 
162  void applySBendBody(double length, double refLength, double h,
163  const BMultipoleField &field, double scale);
164 
166  // Apply a thin multipole kick (integrated over length) to current map.
167  void applyThinMultipole(const BMultipoleField &field, double factor);
168 
170  // Propagate current map through a geometric transformation.
171  void applyTransform(const Euclid3D &, double refLength);
172 
175  buildSBendVectorPotential(const BMultipoleField &, double h);
176 
178  static void makeFocus
179  (double k, double L, double &c, double &s, double &d, double &f);
180 
181 
182  // The current orbit.
184 };
185 
186 #endif // CLASSIC_OrbitTracker_HH
virtual void visitSolenoid(const Solenoid &)
Apply the algorithm to a solenoid.
virtual void visitCCollimator(const CCollimator &)
Apply the algorithm to a collimator.
virtual void visitRBend(const RBend &)
Apply the algorithm to a rectangular bend.
virtual void visitCorrector(const Corrector &)
Apply the algorithm to a corrector.
virtual void visitDegrader(const Degrader &)
Apply the algorithm to a drift.
virtual void visitBeamBeam(const BeamBeam &)
Apply the algorithm to a beam-beam.
virtual void visitSBend(const SBend &)
Apply the algorithm to a sector bend.
Track particles or bunches.
Interface for septum magnet.
Definition: Septum.h:11
Interface for electrostatic separator.
Definition: Separator.h:33
void applySBendBody(double length, double refLength, double h, const BMultipoleField &field, double scale)
Apply thin multipole kick (integrated over length) to all particles.
Interface for beam position monitors.
Definition: Monitor.h:41
Interface for RF Quadrupole.
Definition: RFQuadrupole.h:30
FVector< double, 6 > itsOrbit
Definition: OrbitTracker.h:183
Define the position of a misaligned element.
Definition: AlignWrapper.h:39
Interface for RF cavity.
Definition: ParallelPlate.h:36
virtual void visitParallelPlate(const ParallelPlate &)
Apply the algorithm to a ParallelPlate.
virtual void visitRFQuadrupole(const RFQuadrupole &)
Apply the algorithm to a RF quadrupole.
Particle reference data.
Definition: PartData.h:38
virtual void visitMonitor(const Monitor &)
Apply the algorithm to a monitor.
Interface for general corrector.
Definition: Corrector.h:35
Abstract collimator.
Definition: RBend.h:73
Interface for beam diagnostics.
Definition: Diagnostic.h:32
Interface for a marker.
Definition: Marker.h:32
void applyTransform(const Euclid3D &, double refLength)
Apply transform.
virtual void visitMarker(const Marker &)
Apply the algorithm to a marker.
virtual ~OrbitTracker()
Interface for drift space.
Definition: Drift.h:33
virtual void visitAlignWrapper(const AlignWrapper &)
Apply the algorithm to an align wrapper..
Interface for general multipole.
Definition: Multipole.h:46
virtual void visitSeparator(const Separator &)
Apply the algorithm to a separator.
void setOrbit(const FVector< double, 6 > orbit)
Reset the current orbit.
void applyLinearMap(double length, double refLength, double h, const FTps< double, 2 > &Fx, const FTps< double, 2 > &Fy)
Apply linear map, defined by the linear expansions Fx and Fy.
Interface for probe.
Definition: Probe.h:16
virtual void visitProbe(const Probe &prob)
Apply the algorithm to a probe.
virtual void visitComponent(const Component &)
Apply the algorithm to an arbitrary component.
void applyThinMultipole(const BMultipoleField &field, double factor)
Thin multipole kick.
constexpr double c
The velocity of light in m/s.
Definition: Physics.h:52
Interface for cyclotron collimator.
Definition: CCollimator.h:13
Displacement and rotation in space.
Definition: Euclid3D.h:68
Abstract beam-beam interaction.
Definition: BeamBeam.h:37
void applyDrift(double length)
Apply drift length.
void applyExitFringe(double edge, const BMultipoleField &field, double scale)
Definition: SBend.h:68
Track closed orbit.
Definition: OrbitTracker.h:37
Interface for cyclotron valley.
virtual void visitDiagnostic(const Diagnostic &)
Apply the algorithm to a diagnostic.
Interface for solenoids.
Definition: Solenoid.h:36
An abstract sequence of beam line components.
Definition: Beamline.h:37
virtual void visitRFCavity(const RFCavity &)
Apply the algorithm to a RF cavity.
virtual void visitSeptum(const Septum &)
Apply the algorithm to a septum.
FTps< double, 2 > buildSBendVectorPotential(const BMultipoleField &, double h)
Construct the vector potential for a SBend.
virtual void visitPatch(const Patch &pat)
Apply the algorithm to a patch.
virtual void visitFlexibleCollimator(const FlexibleCollimator &)
Apply the algorithm to a flexible collimator.
The magnetic field of a multipole.
virtual void visitLambertson(const Lambertson &)
Apply the algorithm to a Lambertson.
Interface for RF cavity.
Definition: RFCavity.h:37
void applyMultipoleBody(double length, double refLength, const BMultipoleField &field, double scale)
Apply body of SBend.
void operator=(const OrbitTracker &)
Abstract collimator.
Definition: Degrader.h:37
virtual void visitMultipole(const Multipole &)
Apply the algorithm to a multipole.
virtual void visitBeamStripping(const BeamStripping &)
Apply the algorithm to a beam stripping.
const FVector< double, 6 > & getOrbit() const
Return the current orbit.
void applyEntranceFringe(double edge, const BMultipoleField &field, double scale)
Transforms fringing fields.
virtual void visitCyclotronValley(const CyclotronValley &)
Apply the algorithm to a CyclotronValley.
static void makeFocus(double k, double L, double &c, double &s, double &d, double &f)
Helper function for finding first-order coefficients.
Truncated power series in N variables of type T.
Interface for a geometric patch.
Definition: Patch.h:34
Interface for a single beam element.
Definition: Component.h:51
virtual void visitDrift(const Drift &)
Apply the algorithm to a drift.
Interface for a Lambertson septum.
Definition: Lambertson.h:33