Difference between revisions of "Making your own XML"

From Nuclear Physics Group Documentation Pages
Jump to navigationJump to search
Line 35: Line 35:
 
>
 
>
  
+
------------------------------------------------------------------------------------------
 +
 
 
  <box name="SITE" X_Y_Z="3000. 3000. 3000." material="Vacuum" comment="Master Volume" >
 
  <box name="SITE" X_Y_Z="3000. 3000. 3000." material="Vacuum" comment="Master Volume" >
 
<!--  <apply region="ihep-solenoid"/>-->
 
<!--  <apply region="ihep-solenoid"/>-->
Line 78: Line 79:
 
   <!ENTITY INNER_spec_s      SYSTEM  "inner_detector_HDDS.xml">
 
   <!ENTITY INNER_spec_s      SYSTEM  "inner_detector_HDDS.xml">
 
]>
 
]>
 +
 +
==HDDS Specification, includes, and sections==
 +
 
</pre>
 
</pre>

Revision as of 17:13, 25 October 2007

The xml files defining the geometry you want smash particles into is fairly straightforward. I am no expert on the matter but xml is pretty intuitive. The first example is a simple xml file I created/hacked from clas12.xml in order to use just the target and our SVT. It is the full file seperated into chunks with dashed lines. The dashed lines should NOT be in your xml file. Each section seperated by dashed lines is described in it's own area below.


Example 1 - Full file, just SVT 1 & 2

-----------------------------------------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HDDS [
  <!ENTITY Regions_s   SYSTEM  "Regions_clas12.xml">
  <!ENTITY Material_s  SYSTEM  "Material_HDDS.xml">

  <!-- DETECTORS -->
  <!ENTITY INNER_spec_s       SYSTEM  "inner_detector_HDDS.xml">
]>

-----------------------------------------------------------------------------------------

<HDDS specification="v1.0" xmlns="http://www.gluex.org/hdds"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.gluex.org/hdds HDDS-1_0.xsd">

<!-- Include materials -->
     &Material_s;
<!-- Include magnetic fields -->
     &Regions_s;


<section name          = "Kyle's Geometry"
         version       = ".01"
         date          = "2007-10-25"
         author        = "Kyle Snavely"
         top_volume    = "SITE"
         specification = "v1.0"
>

------------------------------------------------------------------------------------------ 

 <box name="SITE" X_Y_Z="3000. 3000. 3000." material="Vacuum" comment="Master Volume" >
<!--   <apply region="ihep-solenoid"/>-->
 </box>


<!-- Inner Detector -->
  &INNER_spec_s;

<composition name="centralCLAS" envelope="CENT">
    <posXYZ volume="TARG" X_Y_Z="0. 0. 0."    />
    
    <posXYZ volume="SVT1" X_Y_Z="0. 0. 0."    />
    <posXYZ volume="SVT2" X_Y_Z="0. 0. 0."    />
</composition>



<!--Everything-->
  <composition name="everything" envelope="SITE">
  <posXYZ  volume="centralCLAS" X_Y_Z="0. 0. 0." />
  </composition>

</section>

</HDDS>

XML Decleration and DOCTYPE

The markup below contains the basic information the computer needs to read our XML. The line <?xml version="1.0" encoding="UTF-8"?> is the XML decleration. It tells whatever is using the XML which...well which version and character encoding our document uses. It's nothing to be concerned about but one should include it in his or her documents.

More importantly is the line <!DOCTYPE HDDS [.........]> The word HDDS signifies that our document is coded with tags from the HDDS document type definition; ie it is an HDDS document. The lines <!ENTITY Regions_s SYSTEM "Regions_clas12.xml"> and <!ENTITY Material_s SYSTEM "Material_HDDS.xml"> Basically tell one that any information regarding 'Regions_s' is found in 'Regions_clas12.xml'; the same for Material_s. Finally, the same is done for INNER_spec_s. This is the xml file containing the definitions for the inner detector; the SVTs, target and coil/cryostat.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HDDS [
  <!ENTITY Regions_s   SYSTEM  "Regions_clas12.xml">
  <!ENTITY Material_s  SYSTEM  "Material_HDDS.xml">

  <!-- DETECTORS -->
  <!ENTITY INNER_spec_s       SYSTEM  "inner_detector_HDDS.xml">
]>

==HDDS Specification, includes, and sections==