OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
RBendRep.h
Go to the documentation of this file.
1 #ifndef CLASSIC_RBendRep_HH
2 #define CLASSIC_RBendRep_HH
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: RBendRep.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.1.1.2.1 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: RBendRep
13 //
14 // ------------------------------------------------------------------------
15 // Class category: BeamlineCore
16 // ------------------------------------------------------------------------
17 //
18 // $Date: 2004/11/12 18:57:53 $
19 // $Author: adelmann $
20 //
21 // ------------------------------------------------------------------------
22 
23 #include "AbsBeamline/RBend.h"
25 #include "Fields/BMultipoleField.h"
26 
27 
28 // Class RBendRep
29 // ------------------------------------------------------------------------
31 // A rectangular bend magnet has a rectilinear geometry about which its
32 // multipole components are specified.
33 
34 class RBendRep: public RBend {
35 
36 public:
37 
39  explicit RBendRep(const std::string &name);
40 
41  RBendRep();
42  RBendRep(const RBendRep &);
43  virtual ~RBendRep();
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 RBendGeometry &getGeometry();
66 
68  // Version for constant object.
69  virtual const RBendGeometry &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 RBendRep &);
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_RBendRep_HH
virtual double getSlices() const
Get number of slices.
Definition: RBendRep.cpp:165
virtual double getExitFaceCurvature() const
Get exit pole face curvature.
Definition: RBendRep.cpp:152
virtual void setSlices(double sl)
Set number of slices.
Definition: RBendRep.cpp:173
Interface for basic beam line object.
Definition: ElementBase.h:128
virtual double getEntryFaceRotation() const
Get pole entry face rotation.
Definition: RBendRep.cpp:131
virtual ElementImage * getImage() const
Construct an image.
Definition: RBendRep.cpp:111
Representation for a rectangular bend magnet.
Definition: RBendRep.h:34
Definition: RBend.h:73
virtual void setStepsize(double ds)
Set stepsize.
Definition: RBendRep.cpp:177
virtual double getEntryFaceCurvature() const
Get entry pole face curvature.
Definition: RBendRep.cpp:148
virtual void setExitFaceRotation(double e2)
Set exit pole face rotation.
Definition: RBendRep.cpp:144
virtual double getStepsize() const
Get stepsize.
Definition: RBendRep.cpp:169
virtual BMultipoleField & getField()
Get field.
Definition: RBendRep.cpp:93
virtual double getB() const
Get field.
Definition: RBendRep.cpp:122
virtual ElementBase * clone() const
Return clone.
Definition: RBendRep.cpp:83
virtual void setB(double By)
Set vertical component.
Definition: RBendRep.cpp:126
virtual void setEntryFaceRotation(double e1)
Set pole entry face rotation.
Definition: RBendRep.cpp:140
double rEntry
Definition: RBendRep.h:161
An image of an element.
Definition: ElementImage.h:35
virtual void setEntryFaceCurvature(double h1)
Set entry pole face curvature.
Definition: RBendRep.cpp:156
virtual void setField(const BMultipoleField &field)
Set field.
Definition: RBendRep.cpp:182
virtual Channel * getChannel(const std::string &aKey, bool=false)
Construct a read/write channel.
Definition: RBendRep.cpp:88
virtual ~RBendRep()
Definition: RBendRep.cpp:79
The geometry for a RBend element.
Definition: RBendGeometry.h:41
virtual void setExitFaceCurvature(double h2)
Set exit pole face curvature.
Definition: RBendRep.cpp:160
virtual ElementBase * makeFieldWrapper()
Allow field errors.
Definition: RBendRep.cpp:187
Abstract interface for read/write access to variable.
Definition: Channel.h:32
void operator=(const RBendRep &)
The magnetic field of a multipole.
double hEntry
Definition: RBendRep.h:163
double rExit
Definition: RBendRep.h:162
const std::string name
RBendRep()
Definition: RBendRep.cpp:52
BMultipoleField field
The multipole expansion.
Definition: RBendRep.h:158
virtual RBendGeometry & getGeometry()
Get geometry.
Definition: RBendRep.cpp:102
virtual double getExitFaceRotation() const
Get exit pole face rotation.
Definition: RBendRep.cpp:136
double stepsize
Definition: RBendRep.h:168
double hExit
Definition: RBendRep.h:164
double slices
Definition: RBendRep.h:167
RBendGeometry geometry
The bend geometry.
Definition: RBendRep.h:155