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

  Hall D Geometry Data Base: Forward TOF counter
  ***********************************************

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

<section name        = "ForwardTOF"
         version     = "2.2"
         date        = "2006-11-22"
         author      = "M. Shepherd, R.T. Jones"
         top_volume  = "FTOF"
         specification = "v1.0">

<!-- Origin of ForwardTOF is center of entrance plane of detector -->

<!-- upstream plane has vertical oriented bars -->
<!-- downstream plane has horizontal oriented bars -->

<!-- Fri Jan 16 08:14:30 EST 2009                                                 -->
<!-- changed order of paddle counting: 1-40 bottom to top and south to north      -->
<!-- the half paddles are counted separately 41,43 north halfs, 42,44 south halfs -->


<!-- Wed Feb 12 11:57:37 EST 2014  B. Zihlmann                                            -->
<!-- change the width of the innermost long paddles from 6cm to 3cm                       -->
<!-- e.g. the 2 long paddles closest to the center hole are split in half (lengthwise)    -->
<!-- CHANGE NUMBERING SCHEEME!!: paddles are counted through from the bottom up and where -->
<!-- they are split paddles the continue counting the north side only, the south side     -->
<!-- paddles are added in the end as counters                                             -->
<!-- 19(long wide paddles)(19) 2(long narrow paddles)(21) 2(short paddles)(23)            -->
<!-- 2(long narrow paddles)(25) 19(long wide paddles)(44) 2(short paddles top/south) (46) -->

<!-- version 2.2, January 8, 2019  Richard Jones                                          -->
<!--   small tweaks to eliminate overlaps between volumes.                                -->

<!-- Wed Dec 05 13:00:00 EST 2018 A. Ernst -->
<!-- Added the Lucite shield to the geometry. See GlueX TOF Meeting, Dec 5, 2018 for more information-->

<!-- Tue July 02, 2019 A. Ernst -->
<!-- Updated the geometry to match the upgrade in the hall. Removed lucite shielding.-->

  <composition name="ForwardTOF">
    <posXYZ volume="forwardTOF" X_Y_Z="0.0  0.0 3.85" rot="0 0 -90">
      <plane value="0" />
    </posXYZ>
    <posXYZ volume="forwardTOF" X_Y_Z="0.0  0.0 1.27" rot="0 0 0">
      <plane value="1" />
    </posXYZ>
  </composition>

  <composition name="forwardTOF" envelope="FTOF">
    <posXYZ volume="forwardTOF_bottom1" X_Y_Z="0.0 -76.305 0.0" />
    <posXYZ volume="forwardTOF_bottom2" X_Y_Z="0.0 -19.95 0.0" />
    <posXYZ volume="forwardTOF_bottom3" X_Y_Z="0.0 -12.27 0.0" />
    <posXYZ volume="forwardTOF_north" X_Y_Z="+67.5 0.0 0.0" /> 
    <posXYZ volume="forwardTOF_south" X_Y_Z="-67.5 0.0 0.0" /> 
    <posXYZ volume="forwardTOF_top3" X_Y_Z="0.0 +12.27 0.0" />
    <posXYZ volume="forwardTOF_top2" X_Y_Z="0.0 +19.95 0.0" />
    <posXYZ volume="forwardTOF_top1" X_Y_Z="0.0 +76.305 0.0" />
   </composition>

<!-- the attribute 'row' is synonymous with 'bar' -->
  <composition name="forwardTOF_top1" envelope="FTOT">
    <mposY volume="FTOC" ncopy="17" Z_X="0.0 0.0" Y0="-48.72" dY="6.09">
      <row value="30" step="1" />
      <column value="0" />
    </mposY>
  </composition>
  <composition name="forwardTOF_top2" envelope="FTOY">
    <mposY volume="FTOX" ncopy="2" Z_X="0.0 0.0" Y0="-2.295" dY="4.59">
      <row value="28" step="1" />
      <column value="0" />
    </mposY>
  </composition>
  <composition name="forwardTOF_top3" envelope="FTOK">
    <mposY volume="FTOL" ncopy="2" Z_X="0.0 0.0" Y0="-1.545" dY="3.09">
      <row value="26" step="1" />
      <column value="0" />
    </mposY>
  </composition>
  <composition name="forwardTOF_bottom1" envelope="FTOB">
    <mposY volume="FTOC" ncopy="17" Z_X="0.0 0.0" Y0="-48.72" dY="6.09">
      <row value="1" step="1" />
      <column value="0" />
    </mposY>
  </composition>
  <composition name="forwardTOF_bottom2" envelope="FTOZ">
    <mposY volume="FTOX" ncopy="2" Z_X="0.0 0.0" Y0="-2.295" dY="4.59">
      <row value="18" step="1" />
      <column value="0" />
    </mposY>
  </composition>
  <composition name="forwardTOF_bottom3" envelope="FTOJ">
    <mposY volume="FTOL" ncopy="2" Z_X="0.0 0.0" Y0="-1.545" dY="3.09">
      <row value="20" step="1" />
      <column value="0" />
    </mposY>
  </composition>
  <composition name="forwardTOF_north" envelope="FTON">
    <mposY volume="FTOH" ncopy="4" Z_X = "0.0 0.0" Y0="-6.885" dY="4.59">
      <row value="22" step="1" />
      <column value="1" />
    </mposY>
  </composition>
  <composition name="forwardTOF_south" envelope="FTOS">
    <mposY volume="FTOH" ncopy="4" Z_X="0.0 0.0" Y0="-6.885" dY="4.59">
      <row value="47" step="1" />
      <identifier field="paired_row" value="22" step="1" />
      <column value="2" />
    </mposY>
  </composition>

  <box name="FTOF" X_Y_Z="252.0 268.8 2.55" material="Air" />
  <box name="FTOB" X_Y_Z="252.0 103.53 2.55" material="Air" />
  <box name="FTOT" X_Y_Z="252.0 103.53 2.55" material="Air" />
  <box name="FTOJ" X_Y_Z="252.0   6.18 2.55" material="Air" />
  <box name="FTOK" X_Y_Z="252.0   6.18 2.55" material="Air" />
  <box name="FTOY" X_Y_Z="252.0   9.18 2.55" material="Air" />
  <box name="FTOZ" X_Y_Z="252.0   9.18 2.55" material="Air" />
  <box name="FTON" X_Y_Z="117.0  18.36 2.55" material="Air" />  
  <box name="FTOS" X_Y_Z="117.0  18.36 2.55" material="Air" /> 
  <box name="FTOC" X_Y_Z="252.0   6.0 2.54" material="Scintillator"
					    sensitive="true" />
  <box name="FTOL" X_Y_Z="252.0   3.0 2.54" material="Scintillator"
					    sensitive="true" />
  <box name="FTOH" X_Y_Z="117.0   4.5 2.54" material="Scintillator"
					    sensitive="true" />
  <box name="FTOX" X_Y_Z="252.0   4.5 2.54" material="Scintillator"
					    sensitive="true" />

  <!-- 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="forwardTOF_pars" type="mcfast">
    <real_array	name="xlimit"	values="-126.0 126.0" comment="x dimensions"
				unit="cm"	/>
    <real_array	name="ylimit"	values="-126.0 126.0" comment="y dimensions"
				unit="cm"	/>
    <real_array	name="xlimit_gap" values="-3.0  3.0" comment="beam hole x"
				unit="cm"	/>
    <real_array	name="ylimit_gap" values="-3.0  3.0" comment="beam hole y"
				unit="cm"	/>
    <real	name="z0"	value="620.07"	comment="z of midplane"
				unit="cm"	/>
    <real	name="zlen"	value="2.54"	comment="thickness"
				unit="cm"	/>
    <reference	name="material"	value="Scintillator" />
  </parameters>

  <mcfast model="AbsorberBox" template="db/absorberbox.db"
			      parameters="forwardTOF_pars">
    <string	name="name"	value="FTOF" />
    <string	name="shape"	value="BOX"  />
    <int	name="type"	value="42"   />
  </mcfast>

</section>

<!-- </HDDS> -->
