OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
CorrectorRep.h
Go to the documentation of this file.
1 #ifndef CLASSIC_CorrectorRep_HH
2 #define CLASSIC_CorrectorRep_HH
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: CorrectorRep.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.1.1 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: CorrectorRep
13 //
14 // ------------------------------------------------------------------------
15 // Class category: BeamlineCore
16 // ------------------------------------------------------------------------
17 //
18 // $Date: 2000/03/27 09:32:33 $
19 // $Author: fci $
20 //
21 // ------------------------------------------------------------------------
22 
23 #include "AbsBeamline/Corrector.h"
25 #include "Fields/BDipoleField.h"
26 
27 
28 // Class CorrectorRep
29 // ------------------------------------------------------------------------
31 // The base class acts on both planes.
32 
33 class CorrectorRep: public Corrector {
34 
35 public:
36 
38  explicit CorrectorRep(const std::string &name);
39 
40  CorrectorRep();
41  CorrectorRep(const CorrectorRep &right);
42  virtual ~CorrectorRep();
43 
45  // Return an identical deep copy of the element.
46  virtual ElementBase *clone() const;
47 
49  // This method constructs a Channel permitting read/write access to
50  // the attribute [b]aKey[/b] and returns it.
51  // If the attribute does not exist, it returns NULL.
52  virtual Channel *getChannel(const std::string &aKey, bool = false);
53 
55  // Return the element geometry.
56  // Version for non-constant object.
57  virtual StraightGeometry &getGeometry();
58 
60  // Return the element geometry
61  // Version for constant object.
62  virtual const StraightGeometry &getGeometry() const;
63 
65  // Return the image of the element, containing the name and type string
66  // of the element, and a copy of the user-defined attributes.
67  virtual ElementImage *getImage() const;
68 
70  virtual Plane getPlane() const;
71 
73  virtual double getBx() const;
74 
76  virtual double getBy() const;
77 
79  virtual BDipoleField &getField();
80 
82  virtual const BDipoleField &getField() const;
83 
85  virtual void setBx(double);
86 
88  virtual void setBy(double);
89 
91  // Build a FieldWrapper pointing to the corrector and return a pointer to
92  // that wrapper.
93  virtual ElementBase *makeFieldWrapper();
94 
96  // If [b]flag[/b] is true, the corrector is activated,
97  // otherwise deactivated.
98  virtual void setActive(bool flag = true);
99 
100 protected:
101 
104 
107 
109  bool active;
110 
111 private:
112 
113  // Not implemented.
114  void operator=(const CorrectorRep &);
115 };
116 
117 #endif // CLASSIC_CorrectorRep_HH
Representation of a closed orbit corrector.
Definition: CorrectorRep.h:33
StraightGeometry geometry
The corrector geometry.
Definition: CorrectorRep.h:103
Interface for basic beam line object.
Definition: ElementBase.h:128
The field of a magnetic dipole.
Definition: BDipoleField.h:31
virtual Channel * getChannel(const std::string &aKey, bool=false)
Construct a read/write channel.
Interface for general corrector.
Definition: Corrector.h:35
virtual ElementImage * getImage() const
Construct an image.
virtual StraightGeometry & getGeometry()
Get geometry.
virtual ~CorrectorRep()
virtual double getBy() const
Get vertical field component in Teslas.
virtual ElementBase * makeFieldWrapper()
Allow field errors.
virtual Plane getPlane() const
Get plane(s) of action.
virtual double getBx() const
Get horizontal field component in Teslas.
Plane
Plane selection.
Definition: Corrector.h:40
BDipoleField field
The corrector strengths.
Definition: CorrectorRep.h:106
virtual ElementBase * clone() const
Return clone.
An image of an element.
Definition: ElementImage.h:35
virtual BDipoleField & getField()
Get corrector field.
virtual void setBy(double)
Set vertical field component in Teslas.
A geometry representing a straight line.
Abstract interface for read/write access to variable.
Definition: Channel.h:32
void operator=(const CorrectorRep &)
const std::string name
virtual void setActive(bool flag=true)
Set active flag.
virtual void setBx(double)
Set horizontal field component in Teslas.
bool active
The active/inactive flag.
Definition: CorrectorRep.h:109