Physics at the Terascale Helmholtz Gemeinschaft



General Broken Lines are extending the scope of the original broken lines from a tracking setup with a solenoidal magnetic field, independent tracking in and perpendicular to the bending plane and multiple scattering in approximated thick scatterers to arbitrary propagation of the trajectory, arbitrary measurement planes and thick scatterers described by an equivalent pair of thin scatterers.

A trajectory based on General Broken Lines is a track refit to add the description of multiple scattering to an initial trajectory based on the propagation in a magnetic field (and average energy loss). It is constructed from a sequence of (pairs of) thin scatterers describing the multiple scattering in the material between adjacent measurement planes. Predictions for the measurements are obtained by interpolation between the enclosing scatterers and triplets of adjacent scatterers define kink angles with variance according to the material of the central scatterer. This requires the propagation (on the initial trajectory) from a measurement plane or scatterer to the previous and next scatterer. The propagation has to be provided by the user in form of the jacobians for the local track parameters (transformation matrices). In the case of an homogeneous magnetic field they can be calculated from NIM A566:687-698,2006 by A. Strandlie and W. Wittek. The initial trajectory can be the result of a fit of the measurements (internal seed) or a prediction from another detector part (external seed). A General Broken Lines fit with external seed and one (additional) measurement is equivalent to the filtering step of the track fit with a Kalman filter.

As the track refit can provide the complete covariance matrix of all track parameters General Broken Lines are well suited as track model for calibration and alignment with Millepede II.


Icon Draft manual (236KB)
General Broken Lines as advanced track model


Implementations in Fortran, Python and C++ are provided by DESY under the terms of the LGPLv2 license and are maintained in a publicly accessible subversion repository at DESY that can be browsed via viewvc or WebSVN.

The source code is publicly available via the subversion command line:

svn checkout GeneralBrokenLines

The further development is concentrating on the C++ version.


The usage of the software package is described in corresponding README files. The Makefile produces a test executable demonstrating the usage with a simplified track model. All versions can directly output the trajectory information to Millepede-II binary files.


Online documentation (doxygen) is available for:


  • The software can be freely used for research and education. We expect that all publications describing work using this software quote at least one reference from this page.
  • Disclaimer: This software is provided without any expressed or implied warranty. In particular there is no warranty of any kind concerning the fitness of this software for any particular purpose.


The C++ versions before V02-00-00 have worked with ROOT ( as linear algebra package. Since version V02-00-00 the EIGEN template library ( is in use.


Another problem (in V02) with sometimes uninitialised values (in composed trajectories) has been fixed.


A problem (in V02) with sometimes uninitialised values has been fixed.


The χ2 calculation for M-estimators has been fixed (usage of proper objective functions).


Several GBL methods implemented as templates to allow more EIGEN compile time optimization.


Replaced ROOT by Eigen3 as linear algebra package. User input and output with ROOT matrices is still possible with the preprocessor directive GBL_EIGEN_SUPPORT_ROOT.


Unbiased residuals implemented for Python and C++.


Authorship, copyright and license defined, cleanups and C++11 compatibility.


Bug fixes and fixes for (C++) code analysis by covertity (, diagonalization of scatterers implemented.


Adaptations for use by ILCSOFT (


First "complete" version building with CMAKE.


For questions, suggestions or help please contact: Claus(dot)Kleinwort(at)desy(dot)de


  • Fast alignment of a complex tracking detector using advanced track models, Volker Blobel, Claus Kleinwort, Frank Meier, Computer Phys. Communications (2011), doi:10.1016/j.cpc.2011.03.017
  • General Broken Lines as advanced track fitting method, Claus Kleinwort, NIM A, 673 (2012), 107-110, doi:10.1016/j.nima.2012.01.024