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

  Hall D Geometry Data Base: Upstream Photon Veto
  **************************************************

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

<section name        = "UpstreamEMveto"
         version     = "2.0"
         date        = "2006-11-28"
         author      = "A. Ostrovidov, R.T. Jones"
         top_volume  = "UPV"
         specification = "v1.0">

<!-- Origin of UpstreamEMVeto is center of the outside upstream
     surface of the UPV aluminum box -->
  <composition name="UpstreamEMveto">
    <posXYZ volume="upstreamEMveto" X_Y_Z="0.0  0.0  13.0" />
  </composition>

<!-- Dimensions of the full UPV box:
     Depth(Z)  is  26cm: 18*1cm(Scint) + 24*0.25cm(Lead) + 2*1cm(Al)
     Height(Y) is 240cm: 56*4.25cm(Scint) + 2*1cm(Al) 
     Width(X)  is 240cm: 238cm(Scint) + 2*1cm(Al)
     The UPV box is made of 1cm thick Aluminum. Upstream/Downstream,
     Top/Bottom and Left/Right walls are identical. U/D walls have
     a square 25.5x25.5 beam hole, equal to 6 scint. heights -->

  <pgon name="UPV" segments="4" profile="-45 360" material="Aluminum"
                                                  comment="UPV mother">
    <polyplane Rio_Z="11.75 120 -13"  />
    <polyplane Rio_Z="11.75 120 +13" />
  </pgon>

<!-- UPV body has 12 single-width layers downstream and 
     6 double-width layers upstream -->
  
  <composition name="upstreamEMveto" envelope="UPV">
    <mposZ volume="UPVsingleLayer" ncopy="12" Z0="-2.375" dZ="1.25">
      <layer value="12" step="-1" />    
    </mposZ>
    <mposZ volume="UPVdoubleLayer" ncopy="6" Z0="-11.25" dZ="1.50">
      <layer value="18" step="-1" />    
    </mposZ>
  </composition>

<!-- UPV single layer has 1 plane of scintillators and 1 sheet of lead -->

  <composition name="UPVsingleLayer">
    <posXYZ volume="UPVleadSheet"          X_Y_Z="0.0 0.0 +0.5"   />
    <posXYZ volume="UPVscintillatorPlane"  X_Y_Z="0.0 0.0 -0.125" />
  </composition>

<!-- UPV double layer has 1 plane of scintillators and 2 sheets of lead -->

  <composition name="UPVdoubleLayer">
    <posXYZ volume="UPVleadSheet"          X_Y_Z="0.0 0.0 +0.625" />
    <posXYZ volume="UPVleadSheet"          X_Y_Z="0.0 0.0 +0.375" />
    <posXYZ volume="UPVscintillatorPlane"  X_Y_Z="0.0 0.0 -0.25"  />
  </composition>


<!-- UPV lead sheet is assumed to be 0.25cm thick. It's a 238x238 square with
     25.5x25.5 square beam hole in it -->

  <composition name="UPVleadSheet">
    <posXYZ volume="UPL1" X_Y_Z="   0.0   -65.875  0.0" />
    <posXYZ volume="UPL1" X_Y_Z="   0.0   +65.875  0.0" />
    <posXYZ volume="UPL2" X_Y_Z=" -65.875   0.0    0.0" />
    <posXYZ volume="UPL2" X_Y_Z=" +65.875   0.0    0.0" />
  </composition>
  <box name="UPL1"  X_Y_Z="238.0  106.25 0.25"   material="Lead" />
  <box name="UPL2"  X_Y_Z="106.25  25.5  0.25"   material="Lead" />

<!-- UPV scintillator plane has 56 vertically stacked paddles. However,
     6 middle  paddles are cut for a beam hole. Therefore, it is
     25uncut + 6cut + 25uncut channels. First, we divide it into
     4 parts to accomodate a square beam hole -->

  <composition name="UPVscintillatorPlane">
    <posXYZ volume="UPVscintillatorBottom" X_Y_Z="   0.0   -65.875  0.0" />
    <posXYZ volume="UPVscintillatorTop"    X_Y_Z="   0.0   +65.875  0.0" />
    <posXYZ volume="UPVscintillatorLeft"   X_Y_Z=" -65.875   0.0    0.0" />
    <posXYZ volume="UPVscintillatorRight"  X_Y_Z=" +65.875   0.0    0.0" />  
  </composition>

<!-- 25 long paddles in the Top or Bottom parts -->

  <composition name="UPVscintillatorBottom" envelope="UPE1">
    <mposY volume="UPVP" ncopy="25" Z_X="0.0 0.0" Y0="-51.0" dY="4.25">
      <row  value="1" step="1" />
      <column value="0" step="0" />
    </mposY>  
  </composition>
  <composition name="UPVscintillatorTop" envelope="UPE2">
    <mposY volume="UPVP" ncopy="25" Z_X="0.0 0.0" Y0="-51.0" dY="4.25">
      <row  value="32" step="1" />
      <column value="0"  step="0" />
    </mposY>  
  </composition>
  <box name="UPE1" X_Y_Z="238.0 106.25 1.0" material="Air" />
  <box name="UPE2" X_Y_Z="238.0 106.25 1.0" material="Air" />

<!-- 6 short paddles in the Left or Right parts -->

  <composition name="UPVscintillatorLeft" envelope="UPE3">
    <mposY volume="UPVC" ncopy="6" Z_X="0.0 0.0" Y0="-10.625" dY="4.25">
      <row  value="26" step="1" />
      <column value="1"  step="0" />
    </mposY>  
  </composition>
  <composition name="UPVscintillatorRight" envelope="UPE4">
    <mposY volume="UPVC" ncopy="6" Z_X="0.0 0.0" Y0="-10.625" dY="4.25">
      <row  value="26" step="1" />
      <column value="2"  step="0" />
    </mposY>  
  </composition>
  <box name="UPE3" X_Y_Z="106.25 25.5 1.0" material="Air" />
  <box name="UPE4" X_Y_Z="106.25 25.5 1.0" material="Air" />

<!-- Single scintillator paddles -->
  <box name="UPVP" X_Y_Z="238.00 4.25 1.0" material="Scintillator"
      sensitive="true"    comment="UPV long scintillator channel"  />
  <box name="UPVC" X_Y_Z="106.25 4.25 1.0" material="Scintillator"
      sensitive="true"    comment="UPV short scintillator channel" />

  <!-- 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="upstreamEMveto_pars" type="mcfast">
<!-- To be defined later, if ever -->
  </parameters>

</section>

<!-- </HDDS> -->
