OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
CorrectorRep.h
Go to the documentation of this file.
1 //
2 // Class CorrectorRep
3 // Representation of a closed orbit corrector.
4 // The base class acts on both planes.
5 //
6 // Copyright (c) 200x - 2020, Paul Scherrer Institut, Villigen PSI, Switzerland
7 // All rights reserved
8 //
9 // This file is part of OPAL.
10 //
11 // OPAL is free software: you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation, either version 3 of the License, or
14 // (at your option) any later version.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with OPAL. If not, see <https://www.gnu.org/licenses/>.
18 //
19 #ifndef CLASSIC_CorrectorRep_HH
20 #define CLASSIC_CorrectorRep_HH
21 
22 #include "AbsBeamline/Corrector.h"
24 #include "Fields/BDipoleField.h"
25 
26 class CorrectorRep: public Corrector {
27 
28 public:
29 
31  explicit CorrectorRep(const std::string &name);
32 
33  CorrectorRep();
34  CorrectorRep(const CorrectorRep &right);
35  virtual ~CorrectorRep();
36 
38  // Return an identical deep copy of the element.
39  virtual ElementBase *clone() const;
40 
42  // This method constructs a Channel permitting read/write access to
43  // the attribute [b]aKey[/b] and returns it.
44  // If the attribute does not exist, it returns NULL.
45  virtual Channel *getChannel(const std::string &aKey, bool = false);
46 
48  // Return the element geometry.
49  // Version for non-constant object.
50  virtual StraightGeometry &getGeometry();
51 
53  // Return the element geometry
54  // Version for constant object.
55  virtual const StraightGeometry &getGeometry() const;
56 
58  virtual Plane getPlane() const;
59 
61  virtual double getBx() const;
62 
64  virtual double getBy() const;
65 
67  virtual BDipoleField &getField();
68 
70  virtual const BDipoleField &getField() const;
71 
73  virtual void setBx(double);
74 
76  virtual void setBy(double);
77 
79  // If [b]flag[/b] is true, the corrector is activated,
80  // otherwise deactivated.
81  virtual void setActive(bool flag = true);
82 
83 protected:
84 
87 
90 
92  bool active;
93 
94 private:
95 
96  // Not implemented.
97  void operator=(const CorrectorRep &);
98 };
99 
100 #endif // CLASSIC_CorrectorRep_HH
const std::string name
Interface for general corrector.
Definition: Corrector.h:35
Plane
Plane selection.
Definition: Corrector.h:40
virtual double getBy() const
Get vertical field component in Teslas.
bool active
The active/inactive flag.
Definition: CorrectorRep.h:92
virtual double getBx() const
Get horizontal field component in Teslas.
virtual BDipoleField & getField()
Get corrector field.
virtual Channel * getChannel(const std::string &aKey, bool=false)
Construct a read/write channel.
void operator=(const CorrectorRep &)
virtual ~CorrectorRep()
virtual void setBx(double)
Set horizontal field component in Teslas.
virtual void setBy(double)
Set vertical field component in Teslas.
virtual StraightGeometry & getGeometry()
Get geometry.
virtual Plane getPlane() const
Get plane(s) of action.
BDipoleField field
The corrector strengths.
Definition: CorrectorRep.h:89
StraightGeometry geometry
The corrector geometry.
Definition: CorrectorRep.h:86
virtual void setActive(bool flag=true)
Set active flag.
virtual ElementBase * clone() const
Return clone.
A geometry representing a straight line.
Abstract interface for read/write access to variable.
Definition: Channel.h:32
The field of a magnetic dipole.
Definition: BDipoleField.h:31