OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
CyclotronWrapper.h
Go to the documentation of this file.
1 #ifndef CLASSIC_CyclotronWrapper_HH
2 #define CLASSIC_CyclotronWrapper_HH
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: CyclotronWrapper.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.1.1.2.1 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: CyclotronWrapper
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/Cyclotron.h"
25 #include "Fields/BMultipoleField.h"
27 
28 class BMultipoleField;
29 
30 // Class CyclotronWrapper
31 // ------------------------------------------------------------------------
33 // A CyclotronWrapper represents a unique instance of a cyclotron
34 // in the accelerator model. It defines imperfections of the field,
35 // related to an ``ideal'' magnet contained in the wrapper.
36 
37 class CyclotronWrapper: public Cyclotron {
38 
39 public:
40 
42  // Constructs a wrapper for its argument.
43  // The wrapper is not sharable by default.
44  explicit CyclotronWrapper(Cyclotron *);
45 
47  virtual ~CyclotronWrapper();
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 PlanarArcGeometry &getGeometry();
82 
84  // Version for constant object.
85  virtual const PlanarArcGeometry &getGeometry() const;
86 
88  virtual double getSlices() const;
89 
91  virtual double getStepsize() const;
92 
94  virtual ElementBase::ElementType getType() const;
95 
97  // Version for constant object.
98  virtual const Cyclotron &getDesign() const;
99 
101  // Version for non-constant object.
102  virtual Cyclotron &getDesign();
103 
105  // Return [b]this[/b], since this is already a field wrapper.
106  virtual ElementBase *makeFieldWrapper();
107 
109  virtual ElementBase *removeFieldWrapper();
110 
112  virtual const ElementBase *removeFieldWrapper() const;
113 
115  virtual ElementBase *removeWrappers();
116 
118  virtual const ElementBase *removeWrappers() const;
119 
120 private:
121 
122  // Not implemented.
124  void operator=(const CyclotronWrapper &);
125 
126  // The ``design'' magnet.
128 
131 
132  // The magnetic field after application of all modifiers.
134 };
135 
136 #endif // CLASSIC_CyclotronWrapper_HH
virtual void accept(BeamlineVisitor &) const
Apply visitor to modified bend.
Interface for basic beam line object.
Definition: ElementBase.h:128
Interface for a Cyclotron.
Definition: Cyclotron.h:91
A simple arc in the XZ plane.
void operator=(const CyclotronWrapper &)
Pointer< Cyclotron > itsDesign
virtual ElementBase * clone() const
Make clone.
virtual BMultipoleField & errorField() const
Get multipole field error.
virtual PlanarArcGeometry & getGeometry()
Get geometry.
virtual const Cyclotron & getDesign() const
Get design Cyclotron.
virtual ElementBase * makeFieldWrapper()
Make wrapper for this bend.
Representation of a perturbed cyclotron.
virtual double getSlices() const
Get number of slices.
virtual ~CyclotronWrapper()
virtual void makeSharable()
Set sharable flag.
virtual ElementBase * removeWrappers()
Remove all wrappers.
virtual ElementBase * copyStructure()
Make structural copy.
BMultipoleField itsError
The error field.
The magnetic field of a multipole.
virtual ElementBase::ElementType getType() const
Get element type string.
virtual ElementBase * removeFieldWrapper()
Remove field wrapper.
virtual double getStepsize() const
Get stepsize.
Abstract algorithm.
virtual BMultipoleField & getField()
Get field.
BMultipoleField tempField