<?xml version="1.0" encoding="us-ascii"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

  <xsd:annotation>
    <xsd:documentation source="http://ilcsoft.desy.de/marlin/" xml:lang="en">
      XML Schema for Marlin XML Steering Files &#x2014; Adrian Vogel, DESY FLC &#x2014; 2008-05-30.
      Note that the Marlin XML parser will also accept steering files that do not fully comply with this schema.
    </xsd:documentation>
    <xsd:documentation source="http://www.thaiopensource.com/relaxng/trang.html" xml:lang="en">
      The initial version of this XML Schema was created from an approximate DTD with the help of the &#x201C;Trang&#x201D; converter by Thai Open Source.
    </xsd:documentation>
  </xsd:annotation>

  <!-- The <marlin> element should be the root element of any steering file. It must contain one <execute> element, one <global> element (or the other way around), and then an arbitrary number of <processor> and <group> elements (in any order). -->
  <xsd:element name="marlin">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:choice>
          <xsd:sequence>
            <xsd:element ref="execute"/>
            <xsd:element ref="global"/>
          </xsd:sequence>
          <xsd:sequence>
            <xsd:element ref="global"/>
            <xsd:element ref="execute"/>
          </xsd:sequence>
        </xsd:choice>
        <xsd:choice minOccurs="0" maxOccurs="unbounded">
          <xsd:element ref="processor"/>
          <xsd:element ref="group"/>
        </xsd:choice>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

  <!-- The <execute> element contains an arbitrary number of <processor> invocations, <group> invocations, and <if> elements (in any order). -->
  <xsd:element name="execute">
    <xsd:complexType>
      <xsd:choice minOccurs="0" maxOccurs="unbounded">
        <xsd:element name="processor" type="callingElement"/>
        <xsd:element name="group" type="callingElement"/>
        <xsd:element ref="if"/>
      </xsd:choice>
    </xsd:complexType>
  </xsd:element>

  <!-- The <if> element must have a "condition" attribute and may contain the same elements as <execute>. -->
  <xsd:element name="if">
    <xsd:complexType>
      <xsd:choice minOccurs="0" maxOccurs="unbounded">
        <xsd:element name="processor" type="callingElement"/>
        <xsd:element name="group" type="callingElement"/>
        <xsd:element ref="if"/>
      </xsd:choice>
      <xsd:attribute name="condition" use="required" type="xsd:string"/>
    </xsd:complexType>
  </xsd:element>

  <!-- The <global> element contains an arbitrary number of <parameter> elements. -->
  <xsd:element name="global">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element minOccurs="0" maxOccurs="unbounded" ref="parameter"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

  <!-- The <parameter> element must have a "name" attribute and may have some further attributes. It is the only element that may contain text, but it cannot contain further elements. Only certain values are allowed for "type", "lcioInType", and "lcioOutType". -->
  <!-- This schema cannot verify that the actual content (or the "value" attribute) matches the data type that is specified in the "type" attribute. -->
  <xsd:element name="parameter">
    <xsd:complexType>
      <xsd:simpleContent>
        <xsd:extension base="xsd:string">
          <xsd:attribute name="name" use="required" type="xsd:string"/>
          <xsd:attribute name="type" type="parameterType"/>
          <xsd:attribute name="lcioInType" type="lcioType"/>
          <xsd:attribute name="lcioOutType" type="lcioType"/>
          <xsd:attribute name="value" type="xsd:string"/>
          <xsd:attribute name="options" type="xsd:string"/>
        </xsd:extension>
      </xsd:simpleContent>
    </xsd:complexType>
  </xsd:element>

  <!-- The <processor> element must have a unique "name" attribute and a "type" attribute. It may contain an arbitrary number of <parameter> elements. -->
  <xsd:element name="processor">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element minOccurs="0" maxOccurs="unbounded" ref="parameter"/>
      </xsd:sequence>
      <xsd:attribute name="name" use="required" type="xsd:ID"/>
      <xsd:attribute name="type" use="required" type="xsd:string"/>
    </xsd:complexType>
  </xsd:element>

  <!-- The <group> element must have a unique "name" attribute. It may contain an arbitrary number of <parameter> elements and then an arbitrary number of <processor> elements (in that order). -->
  <xsd:element name="group">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element minOccurs="0" maxOccurs="unbounded" ref="parameter"/>
        <xsd:element minOccurs="0" maxOccurs="unbounded" ref="processor"/>
      </xsd:sequence>
      <xsd:attribute name="name" use="required" type="xsd:ID"/>
    </xsd:complexType>
  </xsd:element>

  <!-- The <processor> and <group> elements inside the <execute> element must have a "name" attribute that refers to an existing <processor> or <group> element. -->
  <xsd:complexType name="callingElement">
    <xsd:attribute name="name" use="required" type="xsd:IDREF"/>
  </xsd:complexType>

  <!-- The "type" attribute of the <parameter> element should have one of the following values. -->
  <xsd:simpleType name="parameterType">
    <xsd:restriction base="xsd:token">
      <xsd:enumeration value="bool"/>
      <xsd:enumeration value="int"/>
      <xsd:enumeration value="float"/>
      <xsd:enumeration value="double"/>
      <xsd:enumeration value="string"/>
      <xsd:enumeration value="IntVec"/>
      <xsd:enumeration value="FloatVec"/>
      <xsd:enumeration value="StringVec"/>
    </xsd:restriction>
  </xsd:simpleType>

  <!-- The "lcioInType" and "lcioOutType" attributes of the <parameter> element can have only one of the following values. -->
  <xsd:simpleType name="lcioType">
    <xsd:restriction base="xsd:token">
      <!-- Marlin processors will never access "LCRunHeader" collections -->
      <xsd:enumeration value="LCGenericObject"/>
      <xsd:enumeration value="LCRelation"/>
      <xsd:enumeration value="LCIntVec"/>
      <xsd:enumeration value="LCFloatVec"/>
      <xsd:enumeration value="LCStrVec"/>
      <xsd:enumeration value="SimCalorimeterHit"/>
      <xsd:enumeration value="RawCalorimeterHit"/>
      <xsd:enumeration value="CalorimeterHit"/>
      <xsd:enumeration value="SimTrackerHit"/>
      <xsd:enumeration value="TrackerRawData"/>
      <xsd:enumeration value="TrackerData"/>
      <xsd:enumeration value="TrackerPulse"/>
      <xsd:enumeration value="TrackerHit"/>
      <xsd:enumeration value="TPCHit"/>
      <xsd:enumeration value="MCParticle"/>
      <xsd:enumeration value="Vertex"/>
      <xsd:enumeration value="Cluster"/>
      <xsd:enumeration value="Track"/>
      <xsd:enumeration value="ParticleID"/>
      <xsd:enumeration value="ReconstructedParticle"/>
    </xsd:restriction>
  </xsd:simpleType>

</xsd:schema>

