OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
ThickMapper.h
Go to the documentation of this file.
1 #ifndef OPAL_ThickMapper_HH
2 #define OPAL_ThickMapper_HH
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: ThickMapper.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.1.1.4.2 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: ThickMapper
13 //
14 // ------------------------------------------------------------------------
15 //
16 // $Date: 2004/11/12 20:10:11 $
17 // $Author: adelmann $
18 //
19 // ------------------------------------------------------------------------
20 
21 #include "Algorithms/Mapper.h"
22 
23 class BMultipoleField;
24 class PlanarArcGeometry;
25 
26 
27 // Class ThickMapper
28 // ------------------------------------------------------------------------
30 // Multipole-like elements are done by expanding the Lie series.
31 // [p]
32 // Phase space coordinates numbering:
33 // [tab 3 b]
34 // [row]number [&]name [&]unit [/row]
35 // [row]0 [&]$x$ [&]metres [/row]
36 // [row]1 [&]$p_x/p_r$ [&]1 [/row]
37 // [row]2 [&]$y$ [&]metres [/row]
38 // [row]3 [&]$p_y/p_r$ [&]1 [/row]
39 // [row]4 [&]$v*delta_t$ [&]metres [/row]
40 // [row]5 [&]$delta_p/p_r$ [&]1 [/row]
41 // [/tab][p]
42 // Where $p_r$ is the constant reference momentum defining the reference
43 // frame velocity, $m$ is the rest mass of the particles, and $v$ is the
44 // instantaneous velocity of the particle.
45 // [p]
46 // Other units used:
47 // [tab 2 b]
48 // [row]quantity [&]unit [/row]
49 // [row]reference momentum [&]electron-volts [/row]
50 // [row]velocity [&]metres/second [/row]
51 // [row]accelerating voltage [&]volts [/row]
52 // [row]separator voltage [&]volts [/row]
53 // [row]frequencies [&]hertz [/row]
54 // [row]phase lags [&]$2*pi$ [/row]
55 // [/tab][p]
56 // Approximations used:
57 // [ul]
58 // [li] All elements are represented by maps for finite-length elements.
59 // For multipole-like elements the Lie series is used.
60 // [li] Geometric transformations ignore rotations about transverse axes and
61 // translations along the design orbit and truncate after second order.
62 // [li] Beam-beam elements are two-dimensional, and the second moment <x,y>
63 // of the opposite bunches vanish.
64 // [/ul]
65 //
66 // On going through an element, we increment the map using the following steps:
67 // Remove the closed orbit from the map.
68 // Construct the Hamiltonian H about that closed orbit.
69 // To do this properly, we must expand the square-root AFTER we translate
70 // its argument. In addition, note that the vector potential will be
71 // computed to an order determined by the number of field coefficients
72 // handed to it, and this may or may not agree with the order of the map.
73 // So as to avoid artificially truncating our map, we make the vector
74 // potential exact. Then when we add it to the Hamiltonian, after
75 // translating it according to the closed orbit, the Hamiltonian's
76 // truncation order will remain unchanged.
77 // Compute the map exp(-l:H:)z for the present element.
78 // Propagate the map by sustituting it into the map for the present element.
79 // exp(:f:) exp(:g:)z = G(F(z))
80 // ||| |||
81 // curr.map element
82 // To complete the map, we propagate the closed orbit and add that to the map.
83 
84 class ThickMapper: public Mapper {
85 
86 public:
87 
89  // The beam line to be tracked is "bl".
90  // The particle reference data are taken from "data".
91  // If [b]revBeam[/b] is true, the beam runs from s = C to s = 0.
92  // If [b]revTrack[/b] is true, we track against the beam.
93  explicit ThickMapper(const Beamline &bl, const PartData &data,
94  bool backBeam, bool backTrack);
95 
96  virtual ~ThickMapper();
97 
99  virtual void visitBeamBeam(const BeamBeam &);
100 
102  virtual void visitBeamStripping(const BeamStripping &);
103 
105  virtual void visitCCollimator(const CCollimator &);
106 
108  virtual void visitCorrector(const Corrector &);
109 
111  virtual void visitDegrader(const Degrader &);
112 
114  virtual void visitDiagnostic(const Diagnostic &);
115 
117  virtual void visitDrift(const Drift &);
118 
120  virtual void visitFlexibleCollimator(const FlexibleCollimator &);
121 
123  virtual void visitLambertson(const Lambertson &);
124 
126  virtual void visitMarker(const Marker &);
127 
129  virtual void visitMonitor(const Monitor &);
130 
132  virtual void visitMultipole(const Multipole &);
133 
135  virtual void visitProbe(const Probe &);
136 
138  virtual void visitRBend(const RBend &);
139 
141  virtual void visitRFCavity(const RFCavity &);
142 
144  virtual void visitRFQuadrupole(const RFQuadrupole &);
145 
147  virtual void visitSBend(const SBend &);
148 
150  virtual void visitSeparator(const Separator &);
151 
153  virtual void visitSeptum(const Septum &);
154 
156  virtual void visitSolenoid(const Solenoid &);
157 
159  virtual void visitParallelPlate(const ParallelPlate &);
160 
162  virtual void visitCyclotronValley(const CyclotronValley &);
163 
164 private:
165 
166  // Not implemented.
167  ThickMapper();
168  ThickMapper(const ThickMapper &);
169  void operator=(const ThickMapper &);
170 
171  // Apply drift length.
172  void applyDrift(double length);
173 
174  // Fringe fields for entrance and exit of a magnetic element.
175  void applyEntranceFringe(double edge, double curve,
176  const BMultipoleField &field, double scale);
177  void applyExitFringe(double edge, double curve,
178  const BMultipoleField &field, double scale);
179 
180 };
181 
182 #endif // OPAL_ThickMapper_HH
virtual void visitDrift(const Drift &)
Apply the algorithm to a Drift.
virtual void visitBeamBeam(const BeamBeam &)
Apply the algorithm to a BeamBeam.
Definition: ThickMapper.cpp:91
virtual void visitLambertson(const Lambertson &)
Apply the algorithm to a Lambertson.
virtual void visitMarker(const Marker &)
Apply the algorithm to a Marker.
virtual void visitRBend(const RBend &)
Apply the algorithm to a RBend.
Interface for septum magnet.
Definition: Septum.h:11
virtual void visitSeparator(const Separator &)
Apply the algorithm to a Separator.
Interface for electrostatic separator.
Definition: Separator.h:33
Interface for beam position monitors.
Definition: Monitor.h:41
Interface for RF Quadrupole.
Definition: RFQuadrupole.h:30
A simple arc in the XZ plane.
Interface for RF cavity.
Definition: ParallelPlate.h:36
virtual void visitSBend(const SBend &)
Apply the algorithm to a SBend.
Particle reference data.
Definition: PartData.h:38
Interface for general corrector.
Definition: Corrector.h:35
Abstract collimator.
Definition: RBend.h:73
virtual void visitParallelPlate(const ParallelPlate &)
Apply the algorithm to a ParallelPlate.
Interface for beam diagnostics.
Definition: Diagnostic.h:32
Interface for a marker.
Definition: Marker.h:32
virtual void visitMonitor(const Monitor &)
Apply the algorithm to a Monitor.
Interface for drift space.
Definition: Drift.h:33
virtual void visitDiagnostic(const Diagnostic &)
Apply the algorithm to a Diagnostic.
virtual void visitBeamStripping(const BeamStripping &)
Apply the algorithm to a BeamStripping.
Definition: ThickMapper.cpp:95
Interface for general multipole.
Definition: Multipole.h:46
void operator=(const ThickMapper &)
Interface for probe.
Definition: Probe.h:16
virtual void visitFlexibleCollimator(const FlexibleCollimator &)
Apply the algorithm to a flexible collimator.
Interface for cyclotron collimator.
Definition: CCollimator.h:13
virtual void visitCorrector(const Corrector &)
Apply the algorithm to a Corrector.
Abstract beam-beam interaction.
Definition: BeamBeam.h:37
Definition: SBend.h:68
virtual void visitRFQuadrupole(const RFQuadrupole &)
Apply the algorithm to a RFQuadrupole.
Interface for cyclotron valley.
virtual void visitDegrader(const Degrader &)
Apply the algorithm to a Degrader.
virtual void visitSolenoid(const Solenoid &)
Apply the algorithm to a Solenoid.
Build transfer map.
Definition: Mapper.h:85
Interface for solenoids.
Definition: Solenoid.h:36
An abstract sequence of beam line components.
Definition: Beamline.h:37
void applyEntranceFringe(double edge, double curve, const BMultipoleField &field, double scale)
The magnetic field of a multipole.
Interface for RF cavity.
Definition: RFCavity.h:37
virtual void visitSeptum(const Septum &)
Apply the algorithm to a Septum.
Abstract collimator.
Definition: Degrader.h:37
virtual void visitProbe(const Probe &)
Apply the algorithm to a Probe.
virtual void visitCCollimator(const CCollimator &)
Apply the algorithm to a collimator.
Definition: ThickMapper.cpp:99
virtual void visitMultipole(const Multipole &)
Apply the algorithm to a Multipole.
virtual ~ThickMapper()
Definition: ThickMapper.cpp:87
void applyExitFringe(double edge, double curve, const BMultipoleField &field, double scale)
virtual void visitCyclotronValley(const CyclotronValley &)
Apply the algorithm to a CyclotronValley.
void applyDrift(double length)
virtual void visitRFCavity(const RFCavity &)
Apply the algorithm to a RFCavity.
Build a map using a finite-length lens for each element.
Definition: ThickMapper.h:84
Interface for a Lambertson septum.
Definition: Lambertson.h:33