OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
TransportMapper.h
Go to the documentation of this file.
1 #ifndef OPAL_TransportMapper_HH
2 #define OPAL_TransportMapper_HH
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: TransportMapper.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.2 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: TransportMapper
13 //
14 // ------------------------------------------------------------------------
15 //
16 // $Date: 2000/03/29 10:41:03 $
17 // $Author: opal $
18 //
19 // ------------------------------------------------------------------------
20 
23 
24 
25 class BMultipoleField;
26 class Euclid3D;
27 class PlanarArcGeometry;
28 
29 template <class T, int N> class FTps;
30 template <class T, int N> class FVps;
31 
32 
33 // Class TransportMapper
34 // ------------------------------------------------------------------------
36 // Phase space coordinates numbering:
37 // [tab 3 b]
38 // [row]number [&]name [&]unit [/row]
39 // [row]0 [&]x [&]metres [/row]
40 // [row]1 [&]p_x/p_r [&]1 [/row]
41 // [row]2 [&]y [&]metres [/row]
42 // [row]3 [&]p_y/p_r [&]1 [/row]
43 // [row]4 [&]v*delta_t [&]metres [/row]
44 // [row]5 [&]delta_p/p_r [&]1 [/row]
45 // [/tab][p]
46 // Where $p_r$ is the constant reference momentum defining the reference
47 // frame velocity, $m$ is the rest mass of the particles, and $v$ is the
48 // instantaneous velocity of the particle.
49 // [p]
50 // Other units used:
51 // [tab 2 b]
52 // [row]quantity [&]unit [/row]
53 // [row]reference momentum [&]electron-volts [/row]
54 // [row]velocity [&]metres/second [/row]
55 // [row]accelerating voltage [&]volts [/row]
56 // [row]separator voltage [&]volts [/row]
57 // [row]frequencies [&]hertz [/row]
58 // [row]phase lags [&]$2*pi$ [/row]
59 // [/tab][p]
60 // Approximations used:
61 // [ul]
62 // [li] All elements are represented by maps for finite-length elements.
63 // [li] Terms beyond second-order in orbit coordinates are ignored.
64 // [li] Geometric transformations ignore rotations about transverse axes and
65 // translations along the design orbit and truncate after second order.
66 // [li] Beam-beam elements are two-dimensional, and the second moment <x,y>
67 // of the opposite bunches vanish.
68 // [/ul]
69 
71 
72 public:
73 
75  // The beam line to be tracked is [b]bl[/b].
76  // The particle reference data are taken from [b]data[/b].
77  // If [b]revBeam[/b] is true, the beam runs from s = C to s = 0.
78  // If [b]revTrack[/b] is true, we track against the beam.
79  TransportMapper(const Beamline &beamline, const PartData &,
80  bool revBeam, bool revTrack);
81 
82  virtual ~TransportMapper();
83 
85  virtual void getMap(LinearMap<double, 6> &) const;
86 
88  virtual void getMap(TransportMap<double, 6> &) const;
89 
91  virtual void getMap(FVps<double, 6> &) const;
92 
94  virtual void setMap(const LinearMap<double, 6> &);
95 
97  virtual void setMap(const TransportMap<double, 6> &);
98 
100  virtual void setMap(const FVps<double, 6> &);
101 
103  virtual void visitBeamBeam(const BeamBeam &);
104 
106  virtual void visitBeamStripping(const BeamStripping &);
107 
109  virtual void visitCCollimator(const CCollimator &);
110 
112  // This override calls the component to track the map.
113  virtual void visitComponent(const Component &);
114 
116  virtual void visitCorrector(const Corrector &);
117 
119  virtual void visitDegrader(const Degrader &);
120 
122  virtual void visitDiagnostic(const Diagnostic &);
123 
125  virtual void visitDrift(const Drift &);
126 
128  virtual void visitFlexibleCollimator(const FlexibleCollimator &);
129 
131  virtual void visitLambertson(const Lambertson &);
132 
134  virtual void visitMarker(const Marker &);
135 
137  virtual void visitMonitor(const Monitor &);
138 
140  virtual void visitMultipole(const Multipole &);
141 
143  virtual void visitPatch(const Patch &pat);
144 
146  virtual void visitProbe(const Probe &);
147 
149  virtual void visitRBend(const RBend &);
150 
152  virtual void visitRFCavity(const RFCavity &);
153 
155  virtual void visitRFQuadrupole(const RFQuadrupole &);
156 
158  virtual void visitSBend(const SBend &);
159 
161  virtual void visitSeparator(const Separator &);
162 
164  virtual void visitSeptum(const Septum &);
165 
167  virtual void visitSolenoid(const Solenoid &);
168 
170  virtual void visitParallelPlate(const ParallelPlate &);
171 
173  virtual void visitCyclotronValley(const CyclotronValley &);
174 
176  virtual void visitAlignWrapper(const AlignWrapper &);
177 
178 
180  virtual void visitMapIntegrator(const MapIntegrator &);
181 
182 private:
183 
184  // Not implemented.
185  TransportMapper();
187  void operator=(const TransportMapper &);
188 
189  // Apply drift length.
190  // Propagate current map through a drift.
191  void applyDrift(double length);
192 
193  // Transforms fringing fields.
194  void applyEntranceFringe(double edge,
195  const BMultipoleField &field, double scale);
196  void applyExitFringe(double edge,
197  const BMultipoleField &field, double scale);
198 
199  // Apply transport map, defined by the second-order expansions Fx and Fy.
200  void applyTransportMap(double length, double refLength, double h,
201  const FTps<double, 2> &Fx, const FTps<double, 2> &Fy);
202 
203  // Apply thin multipole kick (integrated over length) to all particles.
204  void applyMultipoleBody(double length, double refLength,
205  const BMultipoleField &field, double scale);
206 
207  // Apply thin multipole kick (integrated over length) to all particles.
208  void applySBendBody(double length, double refLength, double h,
209  const BMultipoleField &field, double scale);
210 
212  // Apply a thin multipole kick (integrated over length) to current map.
213  void applyThinMultipole(const BMultipoleField &field, double factor);
214 
216  // Special kick routine for thin SBend.
217  void applyThinSBend(const BMultipoleField &field, double scale, double h);
218 
220  // Propagate current map through a geometric transformation.
221  void applyTransform(const Euclid3D &, double refLength);
222 
225  buildSBendVectorPotential(const BMultipoleField &, double h);
226 
227  // The transport map being accumulated.
229 };
230 
231 #endif // OPAL_TransportMapper_HH
Build transfer map.
virtual void visitSeptum(const Septum &)
Apply the algorithm to a Septum.
void applyThinSBend(const BMultipoleField &field, double scale, double h)
Thin SBend kick.
virtual void visitDrift(const Drift &)
Apply the algorithm to a Drift.
virtual void visitSBend(const SBend &)
Apply the algorithm to a SBend.
virtual void visitMonitor(const Monitor &)
Apply the algorithm to a Monitor.
virtual void visitPatch(const Patch &pat)
Apply the algorithm to a patch.
virtual void visitSeparator(const Separator &)
Apply the algorithm to a Separator.
Interface for septum magnet.
Definition: Septum.h:11
virtual void visitRFCavity(const RFCavity &)
Apply the algorithm to a RFCavity.
Interface for electrostatic separator.
Definition: Separator.h:33
virtual ~TransportMapper()
virtual void visitBeamStripping(const BeamStripping &)
Apply the algorithm to a BeamStripping.
Interface for beam position monitors.
Definition: Monitor.h:41
Interface for RF Quadrupole.
Definition: RFQuadrupole.h:30
A simple arc in the XZ plane.
virtual void visitAlignWrapper(const AlignWrapper &)
Apply the algorithm to an offset beamline object wrapper.
virtual void visitBeamBeam(const BeamBeam &)
Apply the algorithm to a BeamBeam.
Define the position of a misaligned element.
Definition: AlignWrapper.h:39
Interface for RF cavity.
Definition: ParallelPlate.h:36
virtual void setMap(const LinearMap< double, 6 > &)
Reset the linear part of the accumulated map for restart.
Particle reference data.
Definition: PartData.h:38
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
Interface for drift space.
Definition: Drift.h:33
virtual void visitMarker(const Marker &)
Apply the algorithm to a Marker.
virtual void visitMapIntegrator(const MapIntegrator &)
Apply the algorithm to an integrator capable of mapping.
Interface for general multipole.
Definition: Multipole.h:46
void operator=(const TransportMapper &)
Interface for probe.
Definition: Probe.h:16
void applyDrift(double length)
virtual void visitRBend(const RBend &)
Apply the algorithm to a RBend.
virtual void getMap(LinearMap< double, 6 > &) const
Return the linear part of the accumulated map.
virtual void visitCorrector(const Corrector &)
Apply the algorithm to a Corrector.
virtual void visitCyclotronValley(const CyclotronValley &)
Apply the algorithm to a CyclotronValley.
virtual void visitCCollimator(const CCollimator &)
Apply the algorithm to a collimator.
Interface for cyclotron collimator.
Definition: CCollimator.h:13
virtual void visitFlexibleCollimator(const FlexibleCollimator &)
Apply the algorithm to a flexible collimator.
virtual void visitProbe(const Probe &)
Apply the algorithm to a probe.
Displacement and rotation in space.
Definition: Euclid3D.h:68
Abstract beam-beam interaction.
Definition: BeamBeam.h:37
Definition: SBend.h:68
void applyEntranceFringe(double edge, const BMultipoleField &field, double scale)
Interface for cyclotron valley.
Interface for solenoids.
Definition: Solenoid.h:36
An abstract sequence of beam line components.
Definition: Beamline.h:37
virtual void visitComponent(const Component &)
Apply the algorithm to an arbitrary component.
virtual void visitDiagnostic(const Diagnostic &)
Apply the algorithm to a Diagnostic.
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 applyTransform(const Euclid3D &, double refLength)
Apply transform.
void applyExitFringe(double edge, const BMultipoleField &field, double scale)
virtual void visitDegrader(const Degrader &)
Apply the algorithm to a Degrader.
Abstract collimator.
Definition: Degrader.h:37
virtual void visitMultipole(const Multipole &)
Apply the algorithm to a Multipole.
void applyTransportMap(double length, double refLength, double h, const FTps< double, 2 > &Fx, const FTps< double, 2 > &Fy)
void applySBendBody(double length, double refLength, double h, const BMultipoleField &field, double scale)
Truncated power series in N variables of type T.
TransportMap< double, 6 > itsMap
Interface for a geometric patch.
Definition: Patch.h:34
Interface for a single beam element.
Definition: Component.h:51
void applyThinMultipole(const BMultipoleField &field, double factor)
Thin multipole kick.
FTps< double, 2 > buildSBendVectorPotential(const BMultipoleField &, double h)
Construct the vector potential for a SBend.
Build a map using a transport map for each elements.
Vector truncated power series in n variables.
virtual void visitParallelPlate(const ParallelPlate &)
Apply the algorithm to a ParallelPlate.
virtual void visitRFQuadrupole(const RFQuadrupole &)
Apply the algorithm to a RFQuadrupole.
void applyMultipoleBody(double length, double refLength, const BMultipoleField &field, double scale)
Interface for a Lambertson septum.
Definition: Lambertson.h:33
Integrate a map.
Definition: MapIntegrator.h:41
virtual void visitSolenoid(const Solenoid &)
Apply the algorithm to a Solenoid.