I used the magnetic field map provided by Yamaoka-san. First, I took the field at the inner surface and the field at the outer surface of each layer at each point and averaged them. The average field is plotted below for each layer as a function of z. Units here are Tesla and z is in meters.
I then used linear interpolations of the field in each layer as a function of z to calculate the field. When the field dropped to less than 10 gauss I set it to zero. This is true for the radial field in the outer nine layers of iron. My linear interpolations of the field are shown below. There is an offset from z=0 which is the z_shift variable in the BELLE package. The units here are kgauss and cm.
I created a subroutine called gufld_klm.F which is called by gufld.F when a particle is within the barrel KLM volume. The first time it is called it calculates the fit parameters using the value of "b_nominal" to scale the field. The field in the gap between the iron layers is set to zero.
Yamaoka-san generated two field maps for the endcap. end-gap-gauss.txt has the radial and axial fields at 49 points along r for each of the 14 gaps in the endcap. end-iron-gauss.txt has the radial and axial fields at 49 points along r for each of the 15 layers of iron in the endcap. The units in these files are gauss and meters and the map is for the backward endcap.
After examining the field map I decided to break each layer into 5 regions in the radial dimension. Each region has a slope and intercept to define the field in that region. I created a subroutine called gufld_eklm.F which is called by gufld.F when a point is within the endcap volume. It steps through the 15 + 14 layers of the endcap to determine which layer the point is in, then steps through the 5 regions for that layer to calculate the radial field, then similarly for the axial field. Below are the field maps (black circles) and the results of my linear approximation (blue lines) for each of the layers. Units are kgauss and cm. Fields shown are the forward endcap (+z).
Axial field iron layers 0-7
Axial field iron layers 8-14
Radial field iron layers 0-7
Radial field iron layers 8-14
Axial field gap layers 0-7
Axial field gap layers 8-14
Radial field gap layers 0-7
Radial field gap layers 8-13
Last Updated: 12 May 1999