Object Oriented C++ Software Components For Accelerator Design
Object Oriented C++ Software Components For Accelerator Design
space map for particles passing through it, so the code while any parameters relevant to the simulation are
can be used for tracking, and it allows the user to specify stored in the TxDataSet class of TxID. The X/Motif
whether tracking should use 2, 4, or 6 dimensions. [19] GUI can extract data from these classes, thus allowing
TxAC also includes a beamline class, allowing the user the user interactive control over the simulation with im-
to define an arbitrarily deep hierarchy of beamlines mediate rendering of the resulting data.
within beamlines -- critical for describing large rings,
which may consist of only a dozen or so unique elements 5 GRAPHICAL USER INTERFACE
that are repeated in various combinations for a total of
The X/Motif GUI supports on-line tracking and renders
hundreds or thousands. Synchrotron radiation effects are
the resulting surface-of-section (SOS) plots. Initial con-
optional.
ditions for the next particle can be specified simply by
The TxAC class hierarchy is shown in Fig. 1. A new
clicking in the windows. These SOS plots can be resized
element type can derive from the most appropriate part
interactively, and the phase space variables can be paired
of this hierarchy and thus obtain most of the needed
up in any order. Fixed points can also be found.
features. New features can then be added in the derived
The GUI also allows one to browse the local file system
C++ class, which must also provide the code that im-
for an appropriate input file, and then to save changes in
plements tracking through the element. Once a new
the same file or in a new file. The GUI can plot a sche-
element class has been defined, it need only be regis-
matic layout of the accelerator, warning the user if, for
tered with a name in the TxacElements file and, upon
example, a ring does not close on itself.
recompilation, the new element type will be supported
The GUI provides appropriate windows for interactively
by the parser and the graphical user interface (GUI).
changing any relevant parameters for the accelerator, for
individual elements or for the analyses. For each type of
TxID TxMap
analysis, the GUI provides a menu item allowing the
user to activate the simulation, and then renders line
GUI TxDataSet TxTransMap
plots of the resulting data. Developers can define new
TxDataTransMap
element classes or analysis classes through inheritance,
TxDataAndMap
and these new types will be directly supported by the
ElemGeometry ElementImg
Accelerator GUI after compiling the new classes and relinking the
application.
Element SimpElemImg BeamlineImg
370
Proceedings of the 1999 Particle Accelerator Conference, New York, 1999
are also now implementing the Levenberg-Marquardt al- accelerator class library, allowing for direct model inter-
gorithm, which is effective for nonlinear least squares comparisons.
fitting and, more generally, for simultaneous optimiza- There are two prices to be paid for this approach. The
tion of many nonlinear functions. LION++ is readily first is that such heavy use of templates can lead to very
extensible so developers can implement their favorite long compilation times. The second is that the use of
algorithms or create a thin interface to other C and C++ traits requires the use of rather awkward syntax in the
algorithms, all with the same convenient user interface. source code for the accelerator class library.
371