OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
SBendRep.h
Go to the documentation of this file.
1 //
2 // Class SBendRep
3 // Representation for a sector bend magnet.
4 // A sector bend magnet has a planar arc geometry about which its
5 // multipole components are specified.
6 //
7 // Copyright (c) 200x - 2020, Paul Scherrer Institut, Villigen PSI, Switzerland
8 // All rights reserved
9 //
10 // This file is part of OPAL.
11 //
12 // OPAL is free software: you can redistribute it and/or modify
13 // it under the terms of the GNU General Public License as published by
14 // the Free Software Foundation, either version 3 of the License, or
15 // (at your option) any later version.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with OPAL. If not, see <https://www.gnu.org/licenses/>.
19 //
20 #ifndef CLASSIC_SBendRep_HH
21 #define CLASSIC_SBendRep_HH
22 
23 #include "AbsBeamline/SBend.h"
25 #include "Fields/BMultipoleField.h"
26 
27 
28 class SBendRep: public SBend {
29 
30 public:
31 
33  explicit SBendRep(const std::string &name);
34 
35  SBendRep();
36  SBendRep(const SBendRep &);
37  virtual ~SBendRep();
38 
40  // Return an identical deep copy of the element.
41  virtual ElementBase *clone() const;
42 
44  // This method constructs a Channel permitting read/write access to
45  // the attribute [b]aKey[/b] and returns it.
46  // If the attribute does not exist, it returns NULL.
47  virtual Channel *getChannel(const std::string &aKey, bool = false);
48 
50  // Version for non-constant object.
51  virtual BMultipoleField &getField();
52 
54  // Version for constant object.
55  virtual const BMultipoleField &getField() const;
56 
58  // Version for non-constant object.
59  virtual PlanarArcGeometry &getGeometry();
60 
62  // Version for constant object.
63  virtual const PlanarArcGeometry &getGeometry() const;
64 
66  // Return the vertical component of the field in Teslas.
67  virtual double getB() const;
68 
70  // Assign the vertical component of the field in Teslas.
71  virtual void setB(double By);
72 
74  // Assign the multipole expansion.
75  virtual void setField(const BMultipoleField &field);
76 
78  // Return the rotation of the entry pole face with respect to the x-axis.
79  // A positive angle rotates the pole face normal away from the centre
80  // of the machine.
81  virtual double getEntryFaceRotation() const;
82 
84  // Return the rotation of the exit pole face with respect to the x-axis.
85  // A positive angle rotates the pole face normal away from the centre
86  // of the machine.
87  virtual double getExitFaceRotation() const;
88 
90  // Return the curvature of the entry pole face.
91  // A positive curvature creates a convex pole face.
92  virtual double getEntryFaceCurvature() const;
93 
95  // Return the curvature of the exit pole face.
96  // A positive curvature creates a convex pole face.
97  virtual double getExitFaceCurvature() const;
98 
100  // Return the rotation of the entry pole face with respect to the x-axis.
101  // A positive angle rotates the pole face normal away from the centre
102  // of the machine.
103  virtual void setEntryFaceRotation(double e1);
104 
106  // Return the rotation of the exit pole face with respect to the x-axis.
107  // A positive angle rotates the pole face normal away from the centre
108  // of the machine.
109  virtual void setExitFaceRotation(double e2);
110 
112  // Return the curvature of the entry pole face.
113  // A positive curvature creates a convex pole face.
114  virtual void setEntryFaceCurvature(double h1);
115 
117  // Return the curvature of the exit pole face.
118  // A positive curvature creates a convex pole face.
119  virtual void setExitFaceCurvature(double h2);
120 
122  virtual double getSlices() const;
123 
125  virtual double getStepsize() const;
126 
128  virtual void setSlices(double sl);
129 
131  virtual void setStepsize(double ds);
132 
133 private:
134 
135  // Not implemented.
136  void operator=(const SBendRep &);
137 
140 
143 
144  // The pole face angles and curvatures.
145  double rEntry;
146  double rExit;
147  double hEntry;
148  double hExit;
149 
150  // Parameters that determine integration step-size.
151  double slices;
152  double stepsize;
153 };
154 
155 #endif // CLASSIC_SBendRep_HH
const std::string name
Definition: SBend.h:68
virtual BMultipoleField & getField()
Get field.
Definition: SBendRep.cpp:137
double rEntry
Definition: SBendRep.h:145
virtual double getEntryFaceCurvature() const
Get entry pole face curvature.
Definition: SBendRep.cpp:181
virtual void setEntryFaceCurvature(double h1)
Set entry pole face curvature.
Definition: SBendRep.cpp:189
double hExit
Definition: SBendRep.h:148
virtual void setEntryFaceRotation(double e1)
Set pole entry face rotation.
Definition: SBendRep.cpp:173
virtual void setExitFaceCurvature(double h2)
Set exit pole face curvature.
Definition: SBendRep.cpp:193
virtual PlanarArcGeometry & getGeometry()
Get geometry.
Definition: SBendRep.cpp:146
PlanarArcGeometry geometry
The bend geometry.
Definition: SBendRep.h:139
virtual Channel * getChannel(const std::string &aKey, bool=false)
Construct a read/write channel.
Definition: SBendRep.cpp:104
virtual void setSlices(double sl)
Set number of slices.
Definition: SBendRep.cpp:206
virtual double getExitFaceCurvature() const
Get exit pole face curvature.
Definition: SBendRep.cpp:185
virtual void setField(const BMultipoleField &field)
Set field.
Definition: SBendRep.cpp:215
double stepsize
Definition: SBendRep.h:152
virtual ElementBase * clone() const
Return clone.
Definition: SBendRep.cpp:99
double slices
Definition: SBendRep.h:151
double hEntry
Definition: SBendRep.h:147
virtual void setExitFaceRotation(double e2)
Set exit pole face rotation.
Definition: SBendRep.cpp:177
virtual double getStepsize() const
Get stepsize.
Definition: SBendRep.cpp:202
virtual double getB() const
Get field.
Definition: SBendRep.cpp:155
virtual void setB(double By)
Set vertical component.
Definition: SBendRep.cpp:159
double rExit
Definition: SBendRep.h:146
virtual double getSlices() const
Get number of slices.
Definition: SBendRep.cpp:198
SBendRep()
Definition: SBendRep.cpp:68
virtual double getEntryFaceRotation() const
Get pole entry face rotation.
Definition: SBendRep.cpp:164
virtual ~SBendRep()
Definition: SBendRep.cpp:95
void operator=(const SBendRep &)
virtual void setStepsize(double ds)
Set stepsize.
Definition: SBendRep.cpp:210
BMultipoleField field
The multipole expansion.
Definition: SBendRep.h:142
virtual double getExitFaceRotation() const
Get exit pole face rotation.
Definition: SBendRep.cpp:169
A simple arc in the XZ plane.
Abstract interface for read/write access to variable.
Definition: Channel.h:32
The magnetic field of a multipole.