<?xml version="1.0" encoding="UTF-8"?>
<!--DOCTYPE HDDS>

  Hall D Geometry Data Base: Fields
  *********************************

     version 1.0: Initial version with constant fields
                  and maps.	                  -rtj
 
<HDDS specification="v1.0" xmlns="http://www.gluex.org/hdds">
-->

<regions version="1.0"
	 date="2006-01-08"
	 author="R.T. Jones"
         specification="v1.0" >

  <!-- The beam line dipole fields -->

  <region name="sweepDipoleBfield"
          comment="photon beam collimator cleanup dipole field">
    <uniformBfield Bx_By_Bz="0 2.3 0" unit="kG"/>
  </region>

  <!-- Pair Spectrometer dipole fields -->

  <region name="PairBfield"
          comment="photon beam pair spetrometer">
    <!-- use the line below to get a uniform field, useful for debugging 
    <uniformBfield Bx_By_Bz="0  16.4  0" unit="kG"/>
    -->

    <!--  hook to use field loaded from CCDB-->
    <computedBfield function="gufld_ps(r,B)" maxBfield="2.5" unit="T"/>
    <swim method="RungeKutta"/>
  </region>


  <!-- The tagger dipole field map -->

  <region name="taggerBfield" comment="tagging spectrometer field map">
    <mappedBfield map="file://taggermap.dat" encoding="utf-8"
                  maxBfield="1.8" unit="kG">
      <grid type="cartesian">
        <samples axis="x" n="351" bounds="-340 10" unit_length="cm">
          <samples axis="z" n="1611" bounds="-10 1600" unit_length="cm">
            <samples axis="y" n="16" bounds="0 -1.5" unit_length="cm"/>
          </samples>
        </samples>
      </grid>
      <grid type="cartesian">
        <samples axis="x" n="351" bounds="-340 10" unit_length="cm">
          <samples axis="z" n="1611" bounds="-10 1600" unit_length="cm">
            <samples axis="y" n="16" bounds="0 1.5" unit_length="cm"/>
          </samples>
        </samples>
      </grid>
    </mappedBfield>
    <swim method="RungeKutta"/>
  </region>

  <!-- The main solenoid field map -->

  <region name="solenoidBfield" comment="LASS spectrometer field map">
    <computedBfield function="gufld_db(r,B)" maxBfield="2.24" unit="T"/>
    <swim method="helix"/>
  </region>

  <!-- This region can be used to force tracking in calorimeter
       modules to ignore the magnetic field that they are imbedded in -->

  <region name="nullBfield" comment="zero field regions for calorimeters">
    <noBfield/>
  </region>

</regions>
