OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
SBendRep.h
Go to the documentation of this file.
1 #ifndef CLASSIC_SBendRep_HH
2 #define CLASSIC_SBendRep_HH
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: SBendRep.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.1.1.2.1 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: SBendRep
13 //
14 // ------------------------------------------------------------------------
15 // Class category: BeamlineCore
16 // ------------------------------------------------------------------------
17 //
18 // $Date: 2004/11/12 18:57:54 $
19 // $Author: adelmann $
20 //
21 // ------------------------------------------------------------------------
22 
23 #include "AbsBeamline/SBend.h"
25 #include "Fields/BMultipoleField.h"
26 
27 
28 // Class SBendRep
29 // ------------------------------------------------------------------------
31 // A sector bend magnet has a planar arc geometry about which its
32 // multipole components are specified.
33 
34 class SBendRep: public SBend {
35 
36 public:
37 
39  explicit SBendRep(const std::string &name);
40 
41  SBendRep();
42  SBendRep(const SBendRep &);
43  virtual ~SBendRep();
44 
46  // Return an identical deep copy of the element.
47  virtual ElementBase *clone() const;
48 
50  // This method constructs a Channel permitting read/write access to
51  // the attribute [b]aKey[/b] and returns it.
52  // If the attribute does not exist, it returns NULL.
53  virtual Channel *getChannel(const std::string &aKey, bool = false);
54 
56  // Version for non-constant object.
57  virtual BMultipoleField &getField();
58 
60  // Version for constant object.
61  virtual const BMultipoleField &getField() const;
62 
64  // Version for non-constant object.
65  virtual PlanarArcGeometry &getGeometry();
66 
68  // Version for constant object.
69  virtual const PlanarArcGeometry &getGeometry() const;
70 
72  // Return the image of the element, containing the name and type string
73  // of the element, and a copy of the user-defined attributes.
74  virtual ElementImage *getImage() const;
75 
77  // Return the vertical component of the field in Teslas.
78  virtual double getB() const;
79 
81  // Assign the vertical component of the field in Teslas.
82  virtual void setB(double By);
83 
85  // Assign the multipole expansion.
86  virtual void setField(const BMultipoleField &field);
87 
89  // Build a FieldWrapper pointing to the bend and return a pointer to
90  // that wrapper.
91  virtual ElementBase *makeFieldWrapper();
92 
94  // Return the rotation of the entry pole face with respect to the x-axis.
95  // A positive angle rotates the pole face normal away from the centre
96  // of the machine.
97  virtual double getEntryFaceRotation() const;
98 
100  // Return the rotation of the exit pole face with respect to the x-axis.
101  // A positive angle rotates the pole face normal away from the centre
102  // of the machine.
103  virtual double getExitFaceRotation() const;
104 
106  // Return the curvature of the entry pole face.
107  // A positive curvature creates a convex pole face.
108  virtual double getEntryFaceCurvature() const;
109 
111  // Return the curvature of the exit pole face.
112  // A positive curvature creates a convex pole face.
113  virtual double getExitFaceCurvature() const;
114 
116  // Return the rotation of the entry pole face with respect to the x-axis.
117  // A positive angle rotates the pole face normal away from the centre
118  // of the machine.
119  virtual void setEntryFaceRotation(double e1);
120 
122  // Return the rotation of the exit pole face with respect to the x-axis.
123  // A positive angle rotates the pole face normal away from the centre
124  // of the machine.
125  virtual void setExitFaceRotation(double e2);
126 
128  // Return the curvature of the entry pole face.
129  // A positive curvature creates a convex pole face.
130  virtual void setEntryFaceCurvature(double h1);
131 
133  // Return the curvature of the exit pole face.
134  // A positive curvature creates a convex pole face.
135  virtual void setExitFaceCurvature(double h2);
136 
138  virtual double getSlices() const;
139 
141  virtual double getStepsize() const;
142 
144  virtual void setSlices(double sl);
145 
147  virtual void setStepsize(double ds);
148 
149 private:
150 
151  // Not implemented.
152  void operator=(const SBendRep &);
153 
156 
159 
160  // The pole face angles and curvatures.
161  double rEntry;
162  double rExit;
163  double hEntry;
164  double hExit;
165 
166  // Parameters that determine integration step-size.
167  double slices;
168  double stepsize;
169 };
170 
171 #endif // CLASSIC_SBendRep_HH
double slices
Definition: SBendRep.h:167
Interface for basic beam line object.
Definition: ElementBase.h:128
virtual double getEntryFaceRotation() const
Get pole entry face rotation.
Definition: SBendRep.cpp:210
virtual double getSlices() const
Get number of slices.
Definition: SBendRep.cpp:244
virtual BMultipoleField & getField()
Get field.
Definition: SBendRep.cpp:146
virtual ElementImage * getImage() const
Construct an image.
Definition: SBendRep.cpp:164
virtual ElementBase * clone() const
Return clone.
Definition: SBendRep.cpp:108
virtual void setExitFaceCurvature(double h2)
Set exit pole face curvature.
Definition: SBendRep.cpp:239
A simple arc in the XZ plane.
BMultipoleField field
The multipole expansion.
Definition: SBendRep.h:158
double rEntry
Definition: SBendRep.h:161
double hEntry
Definition: SBendRep.h:163
virtual double getStepsize() const
Get stepsize.
Definition: SBendRep.cpp:248
virtual void setField(const BMultipoleField &field)
Set field.
Definition: SBendRep.cpp:261
virtual double getExitFaceCurvature() const
Get exit pole face curvature.
Definition: SBendRep.cpp:231
virtual Channel * getChannel(const std::string &aKey, bool=false)
Construct a read/write channel.
Definition: SBendRep.cpp:113
virtual PlanarArcGeometry & getGeometry()
Get geometry.
Definition: SBendRep.cpp:155
virtual void setSlices(double sl)
Set number of slices.
Definition: SBendRep.cpp:252
An image of an element.
Definition: ElementImage.h:35
virtual void setEntryFaceCurvature(double h1)
Set entry pole face curvature.
Definition: SBendRep.cpp:235
virtual ElementBase * makeFieldWrapper()
Allow field errors.
Definition: SBendRep.cpp:266
Definition: SBend.h:68
SBendRep()
Definition: SBendRep.cpp:77
virtual ~SBendRep()
Definition: SBendRep.cpp:104
void operator=(const SBendRep &)
Abstract interface for read/write access to variable.
Definition: Channel.h:32
virtual double getExitFaceRotation() const
Get exit pole face rotation.
Definition: SBendRep.cpp:215
The magnetic field of a multipole.
virtual void setStepsize(double ds)
Set stepsize.
Definition: SBendRep.cpp:256
virtual double getEntryFaceCurvature() const
Get entry pole face curvature.
Definition: SBendRep.cpp:227
virtual void setExitFaceRotation(double e2)
Set exit pole face rotation.
Definition: SBendRep.cpp:223
const std::string name
PlanarArcGeometry geometry
The bend geometry.
Definition: SBendRep.h:155
virtual void setB(double By)
Set vertical component.
Definition: SBendRep.cpp:205
double hExit
Definition: SBendRep.h:164
double rExit
Definition: SBendRep.h:162
virtual double getB() const
Get field.
Definition: SBendRep.cpp:201
double stepsize
Definition: SBendRep.h:168
virtual void setEntryFaceRotation(double e1)
Set pole entry face rotation.
Definition: SBendRep.cpp:219
Representation for a sector bend magnet.
Definition: SBendRep.h:34