OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
MultipoleWrapper.h
Go to the documentation of this file.
1 #ifndef CLASSIC_MultipoleWrapper_HH
2 #define CLASSIC_MultipoleWrapper_HH
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: MultipoleWrapper.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.1.1 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: MultipoleWrapper
13 //
14 // ------------------------------------------------------------------------
15 // Class category: ComponentWrappers
16 // ------------------------------------------------------------------------
17 //
18 // $Date: 2000/03/27 09:32:35 $
19 // $Author: fci $
20 //
21 // ------------------------------------------------------------------------
22 
23 #include "AbsBeamline/Multipole.h"
24 #include "Fields/BMultipoleField.h"
26 
27 
28 // Class MultipoleWrapper
29 // ------------------------------------------------------------------------
31 // A MultipoleWrapper represents a unique instance of a multipole magnet
32 // in the accelerator model. It defines imperfections of the field,
33 // related to an ``ideal'' magnet contained in the wrapper.
34 
35 class MultipoleWrapper: public Multipole {
36 
37 public:
38 
40  // Constructs a wrapper for its argument.
41  // The wrapper is not sharable by default.
42  explicit MultipoleWrapper(Multipole *);
43 
45  virtual ~MultipoleWrapper();
46 
47 
49  virtual void accept(BeamlineVisitor &) const;
50 
52  virtual ElementBase *clone() const;
53 
55  virtual ElementBase *copyStructure();
56 
58  // This method can be used to get or set the error field. The error field
59  // offset is mutable, so as to allow changing it in a constant structure.
60  virtual BMultipoleField &errorField() const;
61 
63  // The whole structure depending on [b]this[/b] is marked as sharable.
64  // After this call a [b]copyStructure()[/b] call reuses the element.
65  virtual void makeSharable();
66 
68  // Return the perturbed field.
69  // Version for non-constant object.
70  virtual BMultipoleField &getField();
71 
73  // Return the perturbed field.
74  // Version for constant object.
75  virtual const BMultipoleField &getField() const;
76 
78  // Version for non-constant object.
79  virtual StraightGeometry &getGeometry();
80 
82  // Version for constant object.
83  virtual const StraightGeometry &getGeometry() const;
84 
86  virtual ElementBase::ElementType getType() const;
87 
89  // Version for constant object.
90  virtual const Multipole &getDesign() const;
91 
93  // Version for non-constant object.
94  virtual Multipole &getDesign();
95 
97  // Return [b]this[/b], since this is already a field wrapper.
98  virtual ElementBase *makeFieldWrapper();
99 
101  virtual ElementBase *removeFieldWrapper();
102 
104  virtual const ElementBase *removeFieldWrapper() const;
105 
107  virtual ElementBase *removeWrappers();
108 
110  virtual const ElementBase *removeWrappers() const;
111 
112 private:
113 
114  // Not implemented.
116  void operator=(const MultipoleWrapper &);
117 
118  // The pointer to the ``design'' magnet.
120 
121  // The error field.
123 
124  // The magnetic field after application of all modifiers.
126 };
127 
128 #endif // CLASSIC_MultipoleWrapper_HH
virtual StraightGeometry & getGeometry()
Get geometry.
virtual void makeSharable()
Set sharable flag.
virtual const Multipole & getDesign() const
Get design corrector.
void operator=(const MultipoleWrapper &)
Interface for basic beam line object.
Definition: ElementBase.h:128
BMultipoleField tempField
virtual BMultipoleField & getField()
Get field.
virtual ElementBase * makeFieldWrapper()
Make wrapper for this multipole.
virtual ElementBase * clone() const
Make clone.
Representation of a perturbed multipole.
virtual void accept(BeamlineVisitor &) const
Apply visitor to modified multipole.
Interface for general multipole.
Definition: Multipole.h:46
virtual ElementBase * removeFieldWrapper()
Remove field wrapper.
BMultipoleField itsError
virtual ElementBase * removeWrappers()
Remove all wrappers.
virtual ElementBase * copyStructure()
Make structural copy.
virtual ~MultipoleWrapper()
virtual ElementBase::ElementType getType() const
Get element type string.
A geometry representing a straight line.
The magnetic field of a multipole.
virtual BMultipoleField & errorField() const
Get multipole field error.
Pointer< Multipole > itsDesign
Abstract algorithm.