T. Todorov (CERN/IReS)
The simulation, reconstruction and analysis software access to the magnetic field has large impact both on CPU performance and on accuracy. An approach based on a volume geometry is described. The volumes are constructed in such a way that their boundaries correspond to field discontinuities, which are due to changes in magnetic permeability of the materials. The field in each volume is contiguous. The field in each volume is interpolated from a regular grid of values resulting from a TOSCA calculation. In case a parameterization is available for some volumes it is used instead of the grid interpolation. Global access to the magnetic field values requires efficient search for the volume that contains a global point. An algorithm that exploits explicitly the layout and the symmetries of the detector is presented. The main clients of the magnetic field, which are the simulation (geant4) and propagation of track parameters and errors in the reconstruction, can be made aware of the magnetic field volumes by connecting the per-volume magnetic field providers in their respective geometries to the corresponding volume in the magnetic field geometry. In this way the global volume search is by-passed and the access to the field is sped up significantly.