skip to main content
OSTI.GOV title logo U.S. Department of Energy
Office of Scientific and Technical Information

Title: LEGO: A Modular Approach to Accelerator Alignment Data Analysis

Technical Report ·
DOI:https://doi.org/10.2172/813116· OSTI ID:813116

The underlying unity of the numerous surveying computational methods is hidden by many practical differences in data acquisition. Traditional programming languages have added to the confusion by requiring programmers to describe the numeric data in very concrete and low-level structures (mostly arrays). In fact the algorithms behind all coordinate determination from surveying observations come down to basic methods of linear algebra. Lego uses the paradigm of object oriented programming (OOP) to more closely model the fundamental mathematical structures of all geodetic methods. Once the methods are in OOP form, the commonality across them becomes more obvious and a general architecture for a wide range of geodetic treatments becomes possible. This paper describes the fundamental concepts of this architecture and its advantages in terms of clarity (maintainability, testability and multi-author), portability and extensibility (observation types, resolution techniques and storage methods). The very first version of Lego was built in 1994 as a set of C routines to be used for the adjustment of theodolite data and tracker data. The routines were organized into six modules. Each module answered a specific task. The tasks had been identified as followed: general implementation, input, generic surveying formulas, statistical functions, matrix manipulation and specific resolution technique. This organization was the reason for the name Lego, but more seriously the purpose of this separation was to make Lego easily adaptable to any environment and easily expandable to new resolution techniques. At a second look, it was also a cry for being converted into a more modern language. Because C++ is primarily a superset of C, most C++ compilers have no problems compiling regular C code and may also handle a mixture of C and C++. This made the transformation of Lego very fast and painless. Up to now Lego is still using C functions for file access and dynamic memory allocation but is organized into classes allowing stronger data typing and, most of all, data hiding. It also benefits from some of the more advanced concepts of object programming such as encapsulation and virtual functions. Unlike with the C version where different executables coexisted there is only one C++ Lego.

Research Organization:
SLAC National Accelerator Lab., Menlo Park, CA (United States)
Sponsoring Organization:
USDOE Office of Science (US)
DOE Contract Number:
AC03-76SF00515
OSTI ID:
813116
Report Number(s):
SLAC-PUB-9824; TRN: US0303663
Resource Relation:
Other Information: PBD: 14 May 2003
Country of Publication:
United States
Language:
English