OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
MPSplitIntegrator.h
Go to the documentation of this file.
1 #ifndef CLASSIC_MPSplitIntegrator_HH
2 #define CLASSIC_MPSplitIntegrator_HH
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: MPSplitIntegrator.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.1.1 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: MPSplitIntegrator
13 //
14 // ------------------------------------------------------------------------
15 //
16 // $Date: 2000/03/27 09:33:36 $
17 // $Author: Andreas Adelmann $
18 //
19 // ------------------------------------------------------------------------
20 
22 #include <vector>
23 
24 class BeamlineVisitor;
25 class BMultipoleField;
26 class Multipole;
27 template <class T, unsigned Dim>
28 class PartBunchBase;
29 class PartData;
30 class OpalParticle;
31 
32 template <class T, int N> class FVps;
33 
34 
35 // Class MPSplitIntegrator
36 // ------------------------------------------------------------------------
38 // The integrator may be used by algorithms to replace the normal
39 // procedure for traversing an element. Phase space coordinates numbering:
40 // [tab 3 b]
41 // [row]number [&]name [&]unit [/row]
42 // [row]0 [&]x [&]metres [/row]
43 // [row]1 [&]p_x/p_r [&]1 [/row]
44 // [row]2 [&]y [&]metres [/row]
45 // [row]3 [&]p_y/p_r [&]1 [/row]
46 // [row]4 [&]v*delta_t [&]metres [/row]
47 // [row]5 [&]delta_p/p_r [&]1 [/row]
48 // [/tab][p]
49 // Where $p_r$ is the constant reference momentum defining the reference
50 // frame velocity, $m$ is the rest mass of the particles, and $v$ is the
51 // instantaneous velocity of the particle.
52 // [p]
53 // Other units used:
54 // [tab 2 b]
55 // [row]quantity [&]unit [/row]
56 // [row]reference momentum [&]electron-volts [/row]
57 // [row]velocity [&]metres/second [/row]
58 // [row]accelerating voltage [&]volts [/row]
59 // [row]separator voltage [&]volts [/row]
60 // [row]frequencies [&]hertz [/row]
61 // [row]phase lags [&]$2*pi$ [/row]
62 // [/tab][p]
63 // A MPSplitIntegrator performs integration through an element using two
64 // thin lenses of force 1/2, one placed at 1/6 and the other at 5/6 of
65 // the length respectively.
66 
68 
69 public:
70 
72  // Attach this integrator to the given Multipole, using [b]slices[/b]
73  // subdivisions.
74  MPSplitIntegrator(Multipole *, int slices);
75 
77  virtual ~MPSplitIntegrator();
78 
80  virtual MPSplitIntegrator *clone() const;
81 
83  // Return the element geometry.
84  // Version for non-constant object.
85  virtual BGeometryBase &getGeometry();
86 
88  // Return the element geometry
89  // Version for constant object.
90  virtual const BGeometryBase &getGeometry() const;
91 
93  virtual ElementBase::ElementType getType() const;
94 
96  // The map is returned in [b]map[/b], the other values are the same
97  // as in the calling mapper.
98  virtual void getMap(FVps<double, 6> &map, const PartData &data,
99  bool revBeam, bool revTrack) const;
100 
102  // The map tracked is [b]map[/b], the other values are the same
103  // as in the calling mapper.
104  virtual void trackMap(FVps<double, 6> &map, const PartData &data,
105  bool revBeam, bool revTrack) const;
106 
108  // The particle tracked is [b]part[/b], the other values are the same
109  // as in the calling mapper.
110  virtual void trackParticle(OpalParticle &part, const PartData &data,
111  bool revBeam, bool revTrack) const;
112 
114  // The bunch tracked is [b]buch[/b], the other values are the same
115  // as in the calling mapper.
116  virtual void trackBunch(PartBunchBase<double, 3> *bunch, const PartData &data,
117  bool revBeam, bool revTrack) const;
118 
120  // Build a vector [b]v[/b] containing the longitudinal positions
121  // of the thin lens slices.
122  void getSlices(std::vector<double> &v) const;
123 
124 private:
125 
126  // Not implemented.
128  void operator=(const MPSplitIntegrator &);
129 
130  // Track a map through a particular element.
131  void applyDrift(FVps<double, 6> &map, double, const PartData &) const;
133  const BMultipoleField &field, double factor) const;
134 
135  // Track a particle through a particular element.
136  void applyDrift(OpalParticle &, double, const PartData &) const;
138  const BMultipoleField &field, double factor) const;
139 
140  // The embedded multipole.
142 
143  // The number of slices.
145 };
146 
147 #endif // CLASSIC_MPSplitIntegrator_HH
void getSlices(std::vector< double > &v) const
Return slice positions.
virtual MPSplitIntegrator * clone() const
Make clone.
Particle reference data.
Definition: PartData.h:38
virtual BGeometryBase & getGeometry()
Get geometry.
Interface for general multipole.
Definition: Multipole.h:46
Abstract base class for accelerator geometry classes.
Definition: Geometry.h:43
void operator=(const MPSplitIntegrator &)
Class: DataSink.
Definition: OpalData.h:29
virtual void getMap(FVps< double, 6 > &map, const PartData &data, bool revBeam, bool revTrack) const
Get map from MPSplitIntegrator.
Multipole * itsMultipole
void applyMultipole(FVps< double, 6 > &map, const BMultipoleField &field, double factor) const
virtual ElementBase::ElementType getType() const
Get element type string.
The magnetic field of a multipole.
virtual void trackParticle(OpalParticle &part, const PartData &data, bool revBeam, bool revTrack) const
Track particle through MPSplitIntegrator.
void applyDrift(FVps< double, 6 > &map, double, const PartData &) const
virtual void trackBunch(PartBunchBase< double, 3 > *bunch, const PartData &data, bool revBeam, bool revTrack) const
Track particle bunch through MPSplitIntegrator.
Integrator replacing each multipole by a set of thin lenses.
virtual void trackMap(FVps< double, 6 > &map, const PartData &data, bool revBeam, bool revTrack) const
Track map through MPSplitIntegrator.
Abstract algorithm.
OpalParticle position.
Definition: OpalParticle.h:38
Vector truncated power series in n variables.
Integrate a map.
Definition: MapIntegrator.h:41