OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
RBendWrapper.h
Go to the documentation of this file.
1 #ifndef CLASSIC_RBendWrapper_HH
2 #define CLASSIC_RBendWrapper_HH
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: RBendWrapper.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.1.1.2.1 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: RBendWrapper
13 //
14 // ------------------------------------------------------------------------
15 // Class category: ComponentWrappers
16 // ------------------------------------------------------------------------
17 //
18 // $Date: 2004/11/12 18:57:54 $
19 // $Author: adelmann $
20 //
21 // ------------------------------------------------------------------------
22 
23 #include "AbsBeamline/RBend.h"
24 #include "Fields/BMultipoleField.h"
26 
27 class BMultipoleField;
28 
29 
30 // Class RBendWrapper
31 // ------------------------------------------------------------------------
33 // A RBendWrapper represents a unique instance of a bend magnet
34 // in the accelerator model. It defines imperfections of the field,
35 // related to an ``ideal'' magnet contained in the wrapper.
36 
37 class RBendWrapper: public RBend {
38 
39 public:
40 
42  // Constructs a wrapper for its argument.
43  // The wrapper is not sharable by default.
44  explicit RBendWrapper(RBend *);
45 
46  RBendWrapper(const RBendWrapper &right);
47  virtual ~RBendWrapper();
48 
49 
51  virtual void accept(BeamlineVisitor &) const;
52 
54  virtual ElementBase *clone() const;
55 
57  virtual ElementBase *copyStructure();
58 
60  // This method can be used to get or set the error field. The error field
61  // offset is mutable, so as to allow changing it in a constant structure.
62  virtual BMultipoleField &errorField() const;
63 
65  // The whole structure depending on [b]this[/b] is marked as sharable.
66  // After this call a [b]copyStructure()[/b] call reuses the element.
67  virtual void makeSharable();
68 
70  // Return the perturbed field.
71  // Version for non-constant object.
72  virtual BMultipoleField &getField();
73 
75  // Return the perturbed field.
76  // Version for constant object.
77  virtual const BMultipoleField &getField() const;
78 
80  // Version for non-constant object.
81  virtual RBendGeometry &getGeometry();
82 
84  // Version for constant object.
85  virtual const RBendGeometry &getGeometry() const;
86 
88  virtual double getB() const;
89 
91  // Return the rotation of the entry pole face with respect to the x-axis.
92  // A positive angle rotates the pole face normal away from the centre
93  // of the machine.
94  virtual double getEntryFaceRotation() const;
95 
97  // Return the rotation of the exit pole face with respect to the x-axis.
98  // A positive angle rotates the pole face normal away from the centre
99  // of the machine.
100  virtual double getExitFaceRotation() const;
101 
103  // Return the curvature of the entry pole face.
104  // A positive curvature creates a convex pole face.
105  virtual double getEntryFaceCurvature() const;
106 
108  // Return the curvature of the exit pole face.
109  // A positive curvature creates a convex pole face.
110  virtual double getExitFaceCurvature() const;
111 
113  virtual double getSlices() const;
114 
116  virtual double getStepsize() const;
117 
119  virtual ElementBase::ElementType getType() const;
120 
122  // Version for constant object.
123  virtual const RBend &getDesign() const;
124 
126  // Version for non-constant object.
127  virtual RBend &getDesign();
128 
130  // Return [b]this[/b], since this is already a field wrapper.
131  virtual ElementBase *makeFieldWrapper();
132 
134  virtual ElementBase *removeFieldWrapper();
135 
137  virtual const ElementBase *removeFieldWrapper() const;
138 
140  virtual ElementBase *removeWrappers();
141 
143  virtual const ElementBase *removeWrappers() const;
144 
145 private:
146 
147  // Not implemented.
148  RBendWrapper();
149  void operator=(const RBendWrapper &);
150 
151  // The ``design'' magnet.
153 
156 
157  // The magnetic field after application of all modifiers.
159 };
160 
161 #endif // CLASSIC_RBendWrapper_HH
virtual ElementBase * makeFieldWrapper()
Make wrapper for this bend.
Interface for basic beam line object.
Definition: ElementBase.h:128
virtual ElementBase::ElementType getType() const
Get element type string.
Definition: RBend.h:73
void operator=(const RBendWrapper &)
virtual double getEntryFaceRotation() const
Get pole face rotation.
virtual ElementBase * removeWrappers()
Remove all wrappers.
virtual const RBend & getDesign() const
Get design RBend.
virtual BMultipoleField & errorField() const
Get multipole field error.
virtual void accept(BeamlineVisitor &) const
Apply visitor to modified bend.
virtual double getSlices() const
Get number of slices.
virtual double getB() const
Get dipole component.
virtual double getExitFaceRotation() const
Get pole face rotation.
virtual ElementBase * removeFieldWrapper()
Remove field wrapper.
virtual double getEntryFaceCurvature() const
Get pole face curvature.
virtual ElementBase * clone() const
Make clone.
The geometry for a RBend element.
Definition: RBendGeometry.h:41
virtual ~RBendWrapper()
virtual BMultipoleField & getField()
Get field.
virtual void makeSharable()
Set sharable flag.
The magnetic field of a multipole.
virtual ElementBase * copyStructure()
Make structural copy.
BMultipoleField itsError
The error field.
Definition: RBendWrapper.h:155
BMultipoleField tempField
Definition: RBendWrapper.h:158
virtual RBendGeometry & getGeometry()
Get geometry.
virtual double getExitFaceCurvature() const
Get pole face curvature.
Representation of a perturbed rectangular bend.
Definition: RBendWrapper.h:37
Abstract algorithm.
virtual double getStepsize() const
Get stepsize.
Pointer< RBend > itsDesign
Definition: RBendWrapper.h:152