<?xml version="1.0" encoding="UTF-8"?>
<!--DOCTYPE HDDS>
  Hall D Geometry Data Base: Solenoid
  ************************************
     version 1.0: Initial version	-rtj
 
<HDDS specification="v1.0" xmlns="http://www.gluex.org/hdds">
-->

<section name        = "Solenoid"
         version     = "3.0"
         date        = "2007-12-20"
         author      = "R.T. Jones"
         top_volume  = "LASS"
         specification = "v1.0">

<!-- Origin of Solenoid is center of the upstream edge of the first coil
    which also coincides with the inside surface of upstream mirror plate.  -->

<!-- 2016/02/10 
     a) The origin is set to the front surface of the upstream endplate
        plus 20 inches. The front face can be easily surveyed, but not the inner face. 
     b) The dimensions and positions of the yoke pieces are updated. The yoke cylinder
        is simplified (as it was), incorporating the combined coils.   
-->

  <composition name="Solenoid">
    <posXYZ volume="solenoid" X_Y_Z="0.0 0.0 0.0" />
  </composition>

  <composition name="solenoid">
    <posXYZ volume="IYUP" X_Y_Z="0.0 0.0 -25.4"> </posXYZ>
    <posXYZ volume="IYOK" X_Y_Z="0.0 0.0 177.925"> </posXYZ>
    <posXYZ volume="IYDN" X_Y_Z="0.0 0.0 392.26"> </posXYZ>
  </composition>

  <pcon name="LASS" material="Air">
    <polyplane Rio_Z="0.0 188.0  -72.0" /> 
    <polyplane Rio_Z="0.0   188.0  460.0" />
  </pcon>

  <tubs name="IYUP" Rio_Z=" 92.71 187.96   50.8"  material="Iron" />
  <tubs name="IYOK" Rio_Z=" 95.0  187.96  355.85" material="Iron" />
  <tubs name="IYDN" Rio_Z=" 92.71 187.96   72.82" material="Iron" />

  <!-- The following elements describe an early rendition of the GlueX
       detector simulated using a fast Monte Carlo program MCFast.  They
       are retained for future reference, do not rely on their values. -->

  <parameters name="solenoid_pars" type="mcfast">
    <string name="name" value="LASS"   comment="name of magnetic volume" />
    <real name="bfield" value="2.240"  comment="max magnetic field"
                        unit="Tesla"   />
    <real name="rmin"   value="0.000"  comment="inner limits of field"
                        unit="cm" />
    <real name="rmax"   value="95.000" comment="outer limits of field"
                        unit="cm" />
    <real name="z0"     value="196.5"  comment="z-position of center"
                        unit="cm" />
    <real name="zlen"   value="494.6"  comment="z-length of solenoid"
                        unit="cm" />
    <reference name="mat_fill" value="Air" comment="air inside solenoid" />
    <real_array name="thick_boun" comment="inner outer upstream downstream
                wall thicknesses" values=" 0.000 2.000   0.000    0.000"
                        unit="cm" />
    <reference_vector name="mat_boun" comment="wall materials"   >
      <reference_data value="Vacuum"  comment="inner wall??"    />
      <reference_data value="Iron"    comment="outer wall"      />
      <reference_data value="Iron"    comment="upstream wall"   />
      <reference_data value="Iron"    comment="downstream wall" />
    </reference_vector>
  </parameters>

  <mcfast model="Solenoid" template="db/solenoid.db" 
                           parameters="solenoid_pars" />

</section>

<!-- </HDDS> -->
