<?xml version="1.0" encoding="us-ascii"?>
<!--
?xml-stylesheet type="text/xsl"
href="http://ilcsoft.desy.de/marlin/marlin.xsl"?
-->
<!-- ?xml-stylesheet type="text/xsl" href="marlin.xsl"? -->

<marlin xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ilcsoft.desy.de/marlin/marlin.xsd">

  <!-- ======================================================================================================== -->
  <!-- ======================================================================================================== -->
  <!-- == List of processors to execute                                                                      == -->
  <!-- ======================================================================================================== -->
  <!-- ======================================================================================================== -->

  <execute>
    <processor name="EventNumber" />
    <processor name="InitDD4hep"/>
    <processor name="OverlayBIB"/>
    <processor name="Output_ALL"/>
  </execute>


  <!-- ======================================================================================================== -->
  <!-- ======================================================================================================== -->
  <!-- == Global setup                                                                                       == -->
  <!-- ======================================================================================================== -->
  <!-- ======================================================================================================== -->

  <processor name="EventNumber" type="Statusmonitor">
    <parameter name="HowOften" type="int">1 </parameter>
    <parameter name="Verbosity" type="string"> MESSAGE </parameter>
  </processor>

  <global>
    <parameter name="LCIOInputFiles">
      muonGun_sim.slcio
    </parameter>
    <parameter name="MaxRecordNumber" value="-1" />
    <parameter name="SkipNEvents" value="0" />
    <parameter name="SupressCheck" value="false" />
    <parameter name="Verbosity"	options="DEBUG0-4,MESSAGE0-4,WARNING0-4,ERROR0-4,SILENT">MESSAGE0</parameter>
  </global>

  <!-- ======================================================================================================== -->
  <!-- ======================================================================================================== -->
  <!-- == DD4hep configuration                                                                               == -->
  <!-- ======================================================================================================== -->
  <!-- ======================================================================================================== -->
  
  <processor name="InitDD4hep" type="InitializeDD4hep">
    <!--InitializeDD4hep reads a compact xml file and initializes the dd4hep::Detector object-->
    <!--Name of the DD4hep compact xml file to load-->
    <parameter name="DD4hepXMLFile" type="string">
      /opt/ilcsoft/muonc/detector-simulation/geometries/MuColl_v1/MuColl_v1.xml
    </parameter>
    <!--Alternate name for EncodingStringParameterName-->
    <!--If given, the Compact File parameter of that name will be used as argument to LCTrackerCellID::set_encoding_string()-->
    <parameter name="EncodingStringParameterName" type="string"> GlobalTrackerReadoutID  </parameter>
    <!--verbosity level of this processor ("DEBUG0-4,MESSAGE0-4,WARNING0-4,ERROR0-4,SILENT")-->
    <parameter name="Verbosity" type="string">MESSAGE</parameter>
  </processor>

  <!-- ======================================================================================================== -->
  <!-- ======================================================================================================== -->
  <!-- == Overlay configuration                                                                              == -->
  <!-- ======================================================================================================== -->
  <!-- ======================================================================================================== -->

  <processor name="OverlayBIB" type="OverlayTimingGeneric">
    <parameter name="Verbosity" options="DEBUG0-4,MESSAGE0-4,WARNING0-4,ERROR0-4,SILENT">DEBUG</parameter>

    <parameter name="MCParticleCollectionName" type="string">MCParticle</parameter>
    <parameter name="MCPhysicsParticleCollectionName" type="string"> MCPhysicsParticles </parameter>
    <parameter name="MergeMCParticles" type="bool" value="false"/>

    <parameter name="BackgroundFileNames" type="StringVec">
      /global/cfs/cdirs/atlas/kkrizka/MCC/tracking/sim_bib.slcio
    </parameter>
    <parameter name="StartBackgroundFileIndex" type="int" value="0"/>
    <parameter name="AllowReusingBackgroundFiles" type="bool" value="true" />

    <parameter name="NBunchtrain" type="int" value="1" />
    <parameter name="NumberBackground" type="float" value="2993" />
    <parameter name="Delta_t" type="float" value="1"/>
    <parameter name="NBunchtrain" type="int" value="1"/>

    <parameter name="Collection_IntegrationTimes" type="StringVec" >
      VertexBarrelCollection -0.18 0.24
      VertexEndcapCollection -0.18 0.24

      InnerTrackerBarrelCollection -0.36 0.48
      InnerTrackerEndcapCollection -0.36 0.48

      OuterTrackerBarrelCollection -0.36 0.48
      OuterTrackerEndcapCollection -0.36 0.48

      ECalBarrelCollection -0.25 10.
      ECalEndcapCollection -0.25 10.
      ECalPlugCollection   -0.25 10.

      HCalBarrelCollection -0.25 10.
      HCalEndcapCollection -0.25 10.
      HCalRingCollection   -0.25 10.

      YokeBarrelCollection -0.25 10.
      YokeEndcapCollection -0.25 10.

    </parameter>
    <!--Number of the Bunch crossing of the physics event-->
    <parameter name="PhysicsBX" type="int" value="1"/>
    <!--Draw random number of Events to overlay from Poisson distribution with  mean value NumberBackground-->
    <parameter name="Poisson_random_NOverlay" type="bool" value="false"/>
    <!--Place the physics event at an random position in the train - overrides PhysicsBX-->
    <parameter name="RandomBx" type="bool" value="false"/>
    <!--[mm/ns] (float) - default 5.0e-2 (5cm/us)-->
    <parameter name="TPCDriftvelocity" type="float" value="0.05"/>

  </processor>

  <!-- ======================================================================================================== -->
  <!-- ======================================================================================================== -->
  <!-- == Output configuration                                                                               == -->
  <!-- ======================================================================================================== -->
  <!-- ======================================================================================================== -->

  <processor name="Output_ALL" type="LCIOOutputProcessor">
    <parameter name="LCIOOutputFile" type="string"> sim_allHits.slcio </parameter>
    <parameter name="LCIOWriteMode" type="string" value="WRITE_NEW"/>
    <parameter name="Verbosity" type="string">WARNING </parameter>
    <parameter name="DropCollectionNames" type="StringVec"> </parameter>
    <parameter name="DropCollectionTypes" type="StringVec"> </parameter>
    <parameter name="KeepCollectionNames" type="StringVec"> </parameter>
  </processor>

</marlin>
