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

  Hall D Geometry Data Base: Start counter
  *****************************************

     version 1.0: Initial version	-rtj

     version 1.1: Fix some problems with the start Detector -cam
                  Length and center were wrong in the previous version.
     version 2.0: template file, start counter parameters calculated
                  DO NOT EDIT THIS FILE !!! W. Boeglin January 09
 
<HDDS specification="v1.0" xmlns="http://www.gluex.org/hdds">
-->

<section name        = "StartCntr"
         version     = "4"
         date        = "2009-02-04"
         author      = "W. Boeglin" 
         top_volume  = "STRT" 
         specification = "v1.0">


<!-- Origin of StartCntr is on the axis of the cylinder
     at the upstream limit of the sensitive region.        -->

  <composition name="StartCntr">
     <posXYZ volume="startCntr" X_Y_Z="0.0  0.0  0.0" />
  </composition>

  <composition name="startCntr" envelope="STRT">
     <mposPhi volume="STRC" ncopy="40" Phi0="4.500000" R_Z="0.0  0.0"
              impliedRot="true">
         <sector value="1" step="1" />
     </mposPhi>
     <posXYZ volume="STIS" />
     <posXYZ volume="STOS" />
     <posXYZ volume="STWR" />
     <posXYZ volume="startCntrSupport" X_Y_Z="0.0 0.0 -70.000000" />
  </composition>

  <composition name="startCntrSupport" envelope="TARM">
     <posXYZ volume="STLG" />
  </composition>

  <tubs name="TARM" Rio_Z="6.921336 8.927521 140.000000" material="Aluminum"
                                  comment="target region support arm" />
  <tubs name="STLG" Rio_Z="7.300000 7.800000 140.000000" material="Plexiglas"
                                  comment="start counter light guides" />
  <pgon name="STRT" segments="40" material="Air"
				  comment="start counter assembly">
    <polyplane Rio_Z="6.911305 8.937551 -140.010000" />
    <polyplane Rio_Z="6.911305 8.937551 49.990000" />
    <polyplane Rio_Z="6.907519 8.937551 50.051907" />
    <polyplane Rio_Z="6.884555 8.914588 50.427356" />
    <polyplane Rio_Z="6.838703 8.899456 50.674755" />
    <polyplane Rio_Z="6.804705 8.865458 50.858193" />
    <polyplane Rio_Z="6.672943 8.788006 51.276087" />
    <polyplane Rio_Z="6.639577 8.774437 51.349302" />
    <polyplane Rio_Z="6.491236 8.671805 51.674808" />
    <polyplane Rio_Z="6.289760 8.568142 52.003585" />
    <polyplane Rio_Z="6.262290 8.547713 52.048412" />
    <polyplane Rio_Z="5.856563 8.283648 52.627850" />
    <polyplane Rio_Z="5.484013 7.957603 53.159908" />
    <polyplane Rio_Z="0.675656 3.149246 60.026953" />
    <polyplane Rio_Z="2.335460 2.335460 61.189160" />
    </pgon>
  <pgon name="STOS" segments="40" material="LowDensityROHACELL"
				  comment="start counter outer support">
    <polyplane Rio_Z="7.924428 8.456067 0.000000" />
    <polyplane Rio_Z="7.924428 8.456067 50.000000" />
    <polyplane Rio_Z="7.923435 8.456067 50.016243" />
    <polyplane Rio_Z="7.890127 8.422759 50.560825" />
    <polyplane Rio_Z="7.878096 8.418789 50.625737" />
    <polyplane Rio_Z="7.787734 8.328426 51.113290" />
    <polyplane Rio_Z="7.747106 8.304544 51.242145" />
    <polyplane Rio_Z="7.618775 8.176214 51.649157" />
    <polyplane Rio_Z="7.531787 8.116030 51.840036" />
    <polyplane Rio_Z="7.385770 7.970014 52.160440" />
    <polyplane Rio_Z="7.232536 7.856057 52.410496" />
    <polyplane Rio_Z="7.092192 7.715713 52.639516" />
    <polyplane Rio_Z="6.887991 7.537002 52.931146" />
    <polyplane Rio_Z="1.511294 2.160305 60.609865" />
    <polyplane Rio_Z="1.946787 1.946787 60.914801" />
    </pgon>
  <pgon name="STRC" segments="1" profile="-4.500000 9.000000" material="Scintillator"
		sensitive="true" comment="start counter scintillator">
    <polyplane Rio_Z="7.322573 7.623501 0.000000" />
    <polyplane Rio_Z="7.322573 7.623501 50.000000" />
    <polyplane Rio_Z="7.322011 7.623501 50.009194" />
    <polyplane Rio_Z="7.292758 7.594248 50.487477" />
    <polyplane Rio_Z="7.285948 7.592000 50.524220" />
    <polyplane Rio_Z="7.203756 7.509808 50.967688" />
    <polyplane Rio_Z="7.180759 7.496290 51.040625" />
    <polyplane Rio_Z="7.056895 7.372426 51.433472" />
    <polyplane Rio_Z="7.007656 7.338360 51.541516" />
    <polyplane Rio_Z="6.854363 7.185067 51.877886" />
    <polyplane Rio_Z="6.767627 7.120563 52.019427" />
    <polyplane Rio_Z="6.599181 6.952118 52.294306" />
    <polyplane Rio_Z="6.483595 6.850960 52.459379" />
    <polyplane Rio_Z="1.022298 1.389662 60.258921" />
    <polyplane Rio_Z="1.268803 1.268803 60.431526" />
    </pgon>
  <pgon name="STIS" segments="40" material="HighDensityROHACELL"
				  comment="start counter support cylinder">
    <polyplane Rio_Z="6.921336 7.318561 0.000000" />
    <polyplane Rio_Z="6.921336 7.318561 50.000000" />
    <polyplane Rio_Z="6.920594 7.318561 50.012136" />
    <polyplane Rio_Z="6.894419 7.292386 50.440086" />
    <polyplane Rio_Z="6.885430 7.289420 50.488586" />
    <polyplane Rio_Z="6.814070 7.218059 50.873612" />
    <polyplane Rio_Z="6.783714 7.200216 50.969889" />
    <polyplane Rio_Z="6.681486 7.097988 51.294114" />
    <polyplane Rio_Z="6.616491 7.053020 51.436732" />
    <polyplane Rio_Z="6.498644 6.935174 51.695324" />
    <polyplane Rio_Z="6.384152 6.850028 51.882158" />
    <polyplane Rio_Z="6.268270 6.734146 52.071260" />
    <polyplane Rio_Z="6.115697 6.600619 52.289157" />
    <polyplane Rio_Z="0.691387 1.176308 60.035876" />
    <polyplane Rio_Z="1.016774 1.016774 60.263714" />
    </pgon>
  <pgon name="STWR" segments="40" material="Cellulose"
				  comment="start counter wrapping tape">
    <polyplane Rio_Z="7.633501 7.683655 0.000000" />
    <polyplane Rio_Z="7.633501 7.683655 50.000000" />
    <polyplane Rio_Z="7.633407 7.683655 50.001532" />
    <polyplane Rio_Z="7.601368 7.651616 50.525370" />
    <polyplane Rio_Z="7.600233 7.651241 50.531494" />
    <polyplane Rio_Z="7.505448 7.556456 51.042908" />
    <polyplane Rio_Z="7.501615 7.554203 51.055064" />
    <polyplane Rio_Z="7.347171 7.399759 51.544898" />
    <polyplane Rio_Z="7.338964 7.394082 51.562906" />
    <polyplane Rio_Z="7.128896 7.184014 52.023858" />
    <polyplane Rio_Z="7.114440 7.173263 52.047448" />
    <polyplane Rio_Z="6.853878 6.912701 52.472647" />
    <polyplane Rio_Z="6.834614 6.895841 52.500159" />
    <polyplane Rio_Z="1.276995 1.338222 60.437262" />
    <polyplane Rio_Z="1.318079 1.318079 60.466029" />
    </pgon>

  <!-- 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="startCntr_pars" type="mcfast">
    <real       name="rmin"	value="10.00"	comment="inner radius"
				unit="cm"	/>
    <real       name="rmax"	value="10.20"	comment="outer radius"
				unit="cm"	/>
    <real       name="z0"	value="72.5"	comment="z of midplane"
				unit="cm"	/>
    <real       name="zlen"	value="50.0"	comment="length of cntr"
				unit="cm"	/>
  </parameters>

  <parameters name="startCntrLayer_pars" type="mcfast">
    <int	name="det"	value="1"	comment="num of mother"   />
    <real	name="zlen"	value="50.0"	comment="length of layer"
				unit="cm"	/>
    <real	name="cell_height" value="0.2"	comment="thickness"
				unit="cm"	/>
    <int	name="nwires"	value="25"	comment="segmentation"	  />
    <int	name="ID_readout" value="-1"	/>
    <int	name="ID_cathode" value="1"	/>
    <real	name="phi0"	value="0."	comment="offset to wire 1"
				unit="cm"	/>
    <real	name="stereo_offset" value="0."	comment="where is phi0"
				unit="cm"	/>
    <real	name="eff_hit"	value="0.96"	comment="hit efficiency"
				unit="cm"	/>
    <real	name="eff_dedx"	value="0.96"	comment="dE/dx efficiency"
				unit="cm"	/>
    <real	name="siga"	value="0.04"	comment="xy resolution"
				unit="cm"	/>
    <real	name="sigb"	value="0.00"	comment="?? resolution"
				unit="cm"	/>
    <real	name="sigc"	value="0.00"	comment="?? resolution"
				unit="cm"	/>
  </parameters>

  <parameters name="startCntrOffset_pars" type="mcfast">
    <int	name="det"	value="1"	comment="num of mother"   />
    <real	name="cell_offset" value="0.0"	comment="offset in phi"
				unit="cm"	/>
    <real	name="sag"	value="0.0"	comment="sagitta of wire"
				unit="cm"	/>
    <real_array	name="offset"	values="0.0 0.0 0.0" comment="not used"
				unit="cm"	/>
    <real_array	name="dircos"	values="0.0 0.0 0.0" comment="not used"
				unit="cm"	/>
  </parameters>


  <mcfast model="Drift" template="db/drift.db" parameters="startCntr_pars">
    <int	name="num"	value="1"	/>
    <string     name="name"	value="STRT"	/>

  <!-- for mcfast model the start counter as a vertex drift chamber -->

    <int	name="num_anode"    value="3"	comment="anode layers" />
    <int	name="num_cathode"  value="0"		 />
    <reference  name="material"	    value="Scintillator" />
    <real_array name="thick_boun"   comment="inner outer upstream downstream
		window thicknesses" values=" 0.20  0.05    0.20     0.20"
				    unit="cm"	/>
    <reference_vector name="mat_boun">
      <reference_data value="Mylar" comment="inner window material"  />
      <reference_data value="Mylar" comment="outer window material"  />
      <reference_data value="Mylar" comment="upstream window matl"   />
      <reference_data value="Mylar" comment="downstream window matl" />
    </reference_vector>

    <mcfast model="LayerDRFAno" template="db/drift_layer.db"
			        parameters="startCntrLayer_pars">
      <int	name="lyr"	value="1"	comment="layer number" 	 />
      <real	name="radius"	value="10.1"	comment="central radius"
				unit="cm"	/>
      <real	name="stereo_tau" value="-0.10"	comment="twist angle tau"
				unit="cm"	/>
    </mcfast>
    <mcfast model="LayerDRFAno" template="db/drift_layer.db"
			        parameters="startCntrLayer_pars">
      <int	name="lyr"	value="2"	comment="layer number" 	 />
      <real	name="radius"	value="10.3"	comment="central radius"
				unit="cm"	/>
      <real	name="stereo_tau" value="0.0"	comment="twist angle tau"
				unit="cm"	/>
    </mcfast>
    <mcfast model="LayerDRFAno" template="db/drift_layer.db"
			        parameters="startCntrLayer_pars">
      <int	name="lyr"	value="3"	comment="layer number" 	 />
      <real	name="radius"	value="10.5"	comment="central radius"
				unit="cm"	/>
      <real	name="stereo_tau" value="+0.10"	comment="twist angle tau"
				unit="cm"	/>
    </mcfast>

    <mcfast model="OffsetDRFAno" template="db/drift_offset.db"
				 parameters="startCntrOffset_pars">
      <int	name="lyr"	value="1"	comment="layer number"	/>
    </mcfast>
    <mcfast model="OffsetDRFAno" template="db/drift_offset.db"
				 parameters="startCntrOffset_pars">
      <int	name="lyr"	value="2"	comment="layer number"	/>
    </mcfast>
    <mcfast model="OffsetDRFAno" template="db/drift_offset.db"
				 parameters="startCntrOffset_pars">
      <int	name="lyr"	value="3"	comment="layer number"	/>
    </mcfast>
  </mcfast>

</section>

<!-- </HDDS> -->