OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
OpalBend.cpp
Go to the documentation of this file.
1 // ------------------------------------------------------------------------
2 // $RCSfile: OpalBend.cpp,v $
3 // ------------------------------------------------------------------------
4 // $Revision: 1.2.4.1 $
5 // ------------------------------------------------------------------------
6 // Copyright: see Copyright.readme
7 // ------------------------------------------------------------------------
8 //
9 // Class: OpalBend
10 // The parent class of all OPAL bending magnets.
11 // This class factors out all special behaviour for the DOOM interface
12 // and the printing in OPAL format, as well as the bend attributes.
13 //
14 // ------------------------------------------------------------------------
15 //
16 // $Date: 2004/11/12 20:10:11 $
17 // $Author: adelmann $
18 //
19 // ------------------------------------------------------------------------
20 
21 #include "Elements/OpalBend.h"
22 #include "Attributes/Attributes.h"
23 #include "Utilities/Options.h"
24 #include <iostream>
25 
26 
27 // Class OpalBend
28 // ------------------------------------------------------------------------
29 
30 OpalBend::OpalBend(const char *name, const char *help):
31  OpalElement(SIZE, name, help) {
33  ("ANGLE", "Upright dipole coefficient in m^(-1)");
35  ("K0", "Normal dipole coefficient in m^(-1)");
37  ("K0S", "Skew dipole coefficient in m^(-1)");
39  ("K1", "Upright quadrupole coefficient in m^(-2)");
41  ("K1S", "Skew quadrupole coefficient in m^(-2)");
43  ("K2", "Upright sextupole coefficient in m^(-3)");
45  ("K2S", "Skew sextupole coefficient in m^(-3)");
47  ("K3", "Upright octupole coefficient in m^(-4)");
49  ("K3S", "Skew octupole coefficient in m^(-4)");
51  ("E1", "Entry pole face angle in rad", 0.0);
53  ("E2", "Exit pole face angle in rad", 0.0);
55  ("H1", "Entry pole face curvature in m^(-1)");
57  ("H2", "Exit pole face curvature in m^(-1)");
59  ("HGAP", "Half gap width m");
61  ("FINT", "Field integral (no dimension)", 0.5);
63  ("SLICES", "Number of slices to use", 1.0);
65  ("STEPSIZE", "Step-size to use for integration");
67  ("FMAPFN", "Filename for the fieldmap");
69  ("GAP", "Full gap height of the magnet (m)", 0.0);
71  ("HAPERT", "Bend plane magnet aperture (m)", 0.0);
73  ("ROTATION", "-- not supported any more; use PSI instead --");
75  ("DESIGNENERGY", "the mean energy of the particles in MeV");
77  ("GREATERTHANPI",
78  "-- not supported any more --");
80  ("NSLICES",
81  "The number of slices/ steps for this element in Map Tracking", 1);
82 
83  registerRealAttribute("ANGLE");
84  registerRealAttribute("K0L");
85  registerRealAttribute("K0SL");
86  registerRealAttribute("K1L");
87  registerRealAttribute("K1SL");
88  registerRealAttribute("K2L");
89  registerRealAttribute("K2SL");
90  registerRealAttribute("K3L");
91  registerRealAttribute("K3SL");
96  registerRealAttribute("HGAP");
97  registerRealAttribute("FINT");
98  registerRealAttribute("SLICES");
99  registerRealAttribute("STEPSIZE");
100  registerStringAttribute("FMAPFN");
101  registerRealAttribute("GAP");
102  registerRealAttribute("HAPERT");
103  registerRealAttribute("ROTATION");
104  registerRealAttribute("DESIGNENERGY");
105  registerRealAttribute("NSLICES");
106 }
107 
108 
109 OpalBend::OpalBend(const std::string &name, OpalBend *parent):
110  OpalElement(name, parent)
111 {}
112 
113 
115 {}
116 
117 
118 void OpalBend::print(std::ostream &os) const {
119 
120  OpalElement::print(os);
121 
122 }
static AttCell * registerStringAttribute(const std::string &name)
Register a ``string&#39;&#39; element attribute.
virtual void print(std::ostream &) const
Print the bend magnet.
Definition: OpalBend.cpp:118
OpalBend(const char *name, const char *help)
Exemplar constructor.
Definition: OpalBend.cpp:30
std::vector< Attribute > itsAttr
The object attributes (see Attribute.hh).
Definition: Object.h:214
Base class for all bending magnets.
Definition: OpalBend.h:30
Base class for all beam line elements.
Definition: OpalElement.h:41
Attribute makeBool(const std::string &name, const std::string &help)
Make logical attribute.
Definition: Attributes.cpp:56
const std::string name
virtual ~OpalBend()
Definition: OpalBend.cpp:114
Attribute makeString(const std::string &name, const std::string &help)
Make string attribute.
Definition: Attributes.cpp:296
Attribute makeReal(const std::string &name, const std::string &help)
Make real attribute.
Definition: Attributes.cpp:205
static AttCell * registerRealAttribute(const std::string &name)
Register a ``real&#39;&#39; element attribute.
virtual void print(std::ostream &) const
Print the object.