OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
CorrectorWrapper.h
Go to the documentation of this file.
1 #ifndef CLASSIC_CorrectorWrapper_HH
2 #define CLASSIC_CorrectorWrapper_HH
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: CorrectorWrapper.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.1.1 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: CorrectorWrapper
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/Corrector.h"
24 #include "Fields/BDipoleField.h"
26 
27 class BDipoleField;
28 
29 
30 // Class CorrectorWrapper
31 // ------------------------------------------------------------------------
33 // A CorrectorWrapper represents a unique instance of a corrector 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 CorrectorWrapper: public Corrector {
38 
39 public:
40 
42  // Construct a wrapper for the argument.
43  // The wrapper is not sharable by default.
45 
47  virtual ~CorrectorWrapper();
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 BDipoleField &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  // Version for non-constant object.
71  virtual BDipoleField &getField();
72 
74  // Version for constant object.
75  virtual const BDipoleField &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 Plane getPlane() const;
87 
89  virtual ElementBase::ElementType getType() const;
90 
92  // Version for constant object.
93  virtual const Corrector &getDesign() const;
94 
96  // Version for non-constant object.
97  virtual Corrector &getDesign();
98 
100  // Return [b]this[/b], since this is already a field wrapper.
101  virtual ElementBase *makeFieldWrapper();
102 
104  virtual ElementBase *removeFieldWrapper();
105 
107  virtual const ElementBase *removeFieldWrapper() const;
108 
110  virtual ElementBase *removeWrappers();
111 
113  virtual const ElementBase *removeWrappers() const;
114 
115 private:
116 
117  // Not implemented.
119  void operator=(const CorrectorWrapper &);
120 
121  // The pointer to the ``design'' magnet.
123 
126 
127  // The magnetic field after application of error.
129 };
130 
131 #endif // CLASSIC_CorrectorWrapper_HH
virtual void accept(BeamlineVisitor &) const
Apply visitor to modified corrector.
Interface for basic beam line object.
Definition: ElementBase.h:128
The field of a magnetic dipole.
Definition: BDipoleField.h:31
virtual BDipoleField & errorField() const
Get corrector field error.
virtual ElementBase::ElementType getType() const
Get element type string.
virtual ElementBase * removeWrappers()
Remove all wrappers.
Interface for general corrector.
Definition: Corrector.h:35
virtual ElementBase * removeFieldWrapper()
Remove field wrapper.
virtual void makeSharable()
Set sharable flag.
virtual ElementBase * copyStructure()
Make structural copy.
virtual BDipoleField & getField()
Get corrector field.
Plane
Plane selection.
Definition: Corrector.h:40
virtual Plane getPlane() const
Get plane of action.
void operator=(const CorrectorWrapper &)
BDipoleField tempField
BDipoleField itsError
The field modifiers.
virtual const Corrector & getDesign() const
Get design corrector.
virtual ElementBase * clone() const
Make clone.
Representation for a perturbed closed orbit corrector.
A geometry representing a straight line.
virtual ElementBase * makeFieldWrapper()
Make wrapper for this corrector.
virtual StraightGeometry & getGeometry()
Get geometry.
virtual ~CorrectorWrapper()
Pointer< Corrector > itsDesign
Abstract algorithm.