LCDD XML Format

Overview

The LCDD geometry format is built on the GDML package by Radovan Chytracek at CERN. LCDD uses this geometry format for full representation of geometric structure. Additionally, detector concepts are added in order to provide all required information to the simulator. These are sensitive detector and readout (or segmentation) definitions and assignments, region definitions and assignments, and EM field definition. Using these fields plus the data in the gdml tag, the simulator is able to create an in-memory representation of a full detector and its readouts from the lcdd element.

The document structure of LCDD and its embedded GDML element are described below.

<lcdd> (1)
  <header> ... </header> (2)
  <sensitive_detectors> ... </sensitive_detectors> (3)
  <regions> ... </regions> (4)
  <gdml> (5)
    <define> ... <define> (6)
    <materials> ... <materials> (7)
    <solids> ... <solids> (8)
    <structure> ... <structure> (9)
    <setup> ... <setup> (10)
  </gdml>
  <fields> ... </fields> (11)
<lcdd>

Figure 2. LCDD Structure

(1)
LCDD container element
(2)
header with meta-information for this file, such as author and unique tag and version
(4)
regions for setting attributes of groups of volumes
(3)
sensitive detectors for reading out Geant4 volumes into hits
(5)
GDML container element
(6)
constant and expression definitions using syntax of CLHEP expression evaluator
(7)
materials and elements used in volume definitions
(8)
geometric shapes used in volume definitions
(9)
geometric volume hierarchy including logical volume definitions, physical volume placements and the top-level world logical volume
(10)
specifies the world volume, possibly from multiple ones defined in the same file
(11)
field definitions and assignment of the global magnetic field

sensitive_detectors Element

The sensitive_detectors element contains definitions for all the unique readout configurations in the detector. sensitive_detector itself is an abstract type. Its basic, concrete subtypes are calorimeter, which can have a virtual segmentation of its volumes, and tracker, which writes out explicit step positions only.

The calorimeter-type sensitive detectors additionally have a volume segmentation tag, which is a concrete child class of segmentation. This specificies the virtual readout for assigned volumes. An example is gridXYZ, which reads out a uniform grid in up to 3 dimensions.

In addition to a name, each sensitive detector is assigned a hit collection. Also, an energy cut can be set to disregard low-energy hits, and verbosity can be assigned to output debugging information from specific sensitive detectors.

Following is an example sensitive_detectors element containing all the different combinations that are currently defined.

<sensitive_detectors>

  <calorimeter name="CalNP" (1)
                  hitsCollectionName="CalHitsA" 
                  ecut="0.25"
                  eunit="MeV"
                  verbose="0">

    <gridXYZ gridSizeX="5.0"
                gridSizeY="5.0"
                gridSizeZ="0.0"
                lunit="mm"/>

  </calorimeter>

  <calorimeter name="CalPrj" (2)
                  hitsCollectionName="CalHitsB"
                  ecut="0.25"
                  eunit="MeV"
                  verbose="0">

    <projectiveCylinder ntheta="1440" nphi="1440" />

  </calorimeter>

  <calorimeter name="CalPrjZ" (3)
                  hitsCollectionName="CalHitsC"
                  ecut="0.25"
                  eunit="MeV"
                  verbose="0">

    <projectiveZPlane ntheta="360" nphi="360" />

  </calorimeter>

  <calorimeter name="CalNPCyl" (4)
                  hitsCollectionName="CalNPCyl"
                  ecut="0.25
                  eunit="MeV"
                  verbose="0">

    <nonprojectiveCylinder gridSizeZ="1.0" 
                              gridSizePhi="1.0"
                              lunit="mm"/>

  </calorimeter>

  <tracker name="Tracker" (5)
              hitsCollectionName="TrackerHitsA" 
              ecut="0.25"
              eunit="MeV"
              verbose="0"/>

</sensitive_detectors>

Figure 3. Example sensitive_detectors

(1)
calorimeter with 3D grid segmentation
(2)
calorimeter using projective segmentation in theta, phi of a cylinder
(3)
calorimeter using projective segmentation in theta, phi of a z planar surface such as an endcap
(4)
calorimeter using a nonprojective segmentation (uniform cell size) of a cylinder
(5)
basic tracker

The sensitive_detector element, either calorimeter or tracker, is referenced by name using an sdref in the extended volume element.

regions Element

Regions define several physics parameters used within the simulation.

The store_secondaries attribute defines whether secondary particles are written into the output file's particle tree.

The cut defines the Geant4 range cut for physics processes.

The threshhold attribute defines an energy cut for creating trajectories from secondary particles in this region.

<regions>
<region name="TrackingRegion"
           store_secondaries="true"
           cut="1.0"
           lunit="mm" 
           threshhold="0.25"
           eunit="MeV"/<

Figure 4. Example regions element

A region is assigned to a volume using the regionref tag.

fields Element

Global fields are defined using the fields element.

Currently, the only valid type of field is solenoid, which has an inner and outer field value and inner and outer radii.

The example below illustrates that the field values can be specified using expressions from the GDML define section.

<fields>
  <solenoid name="GlobalSolenoid"
               inner_field="solenoid_inner_field"
               outer_field="solenoid_outer_field"
               zmin="solenoid_zmin"
               zmax="solenoid_zmax"
               inner_radius="solenoid_rmin"
               outer_radius="solenoid_rmax"
               funit="tesla"
               lunit="mm"/>
  <global_field>
    <fieldref ref="GlobalSolenoid" />
  </global_field>
</fields>

Figure 5. Example fields element

Extended volume Element

The LCDD Schema formally extends the GDML Schema 2.0 using the standard XML Schema tag xs:extension. A few tags are added to GDML in order to link the LCDD objects, such as sensitive detectors, with their corresponding geometric volumes.

The only changes to GDML proper are made within the volume element, which corresponds to the Geant4 class G4LogicalVolume. This is a logical description of a detector element with a shape and material. Optionally, a G4Region can be assigned to the volume and a concrete instance of G4VSensitiveDetector can also be set for volume readout. Visualization attributes can be setup using G4VisAttributes.

<volume name="ecal_barrel">
  <materialref ref="Tungsten">
  <solidref ref="ecal_barrel_tube">

  <physvol>
    <volumeref ref="ecal_barrel_layer"/>
    <positionref ref="ecal_barrel_pos"/>
    <rotationref ref="ecal_barrel_rot"/>
    <physvolid value="ecal_id"/> (1)
  </physvol>

  <sdref ref="EcalSD"/> (2)
  <regionref ref="EcalRegion"/> (3)
</volume>

Figure 6. Example Volume Element

(1)
assign an id to the volume
(2)
assign a sensitive detector to this volume by name
(3)
assign a region to this volume by name

These three additional elements compromise all the alterations to the GDML format. This allows parsers using its standard schema to easily skip over these few, extra elements.

Example Detectors

The SLIC application contains a number of example geometries in the $SLIC_BASE/examples directory. Most of these example geometries have corresponding macros found in the $SLIC_BASE/macros directory; typically, these load an example geometry file and run a test event using either GPS or StdHep input, possibly doing some visualization, also.

The bundled examples are summarized below with information on their respective macros.

Table 3. SLIC Examples

Name File rel to SLIC_BASE/examples Description Run Macro(s) rel to SLIC_BASE/macros
SDJan03 sdjan03/SDJan03.lcdd                   tube-based, projective, full detector geometry based on LCDG4's SDJan03 sdjan03.mac, sdjan03_min.mac
Testbeam tbeam/tb.lcdd ILC testbeam with geometry based on Mokka's TB03 tbeam.mac
LCDD Simple Test test.lcdd simple geometry with various LCDD elements for checking correct parsing test.mac
Segmentation Tests segtest/*.lcdd tests of calorimeter segmentations NPCylBarr.mac, NPPolyBarr.mac, NPPolyEcap.mac, PrjBarr.mac, PrjEcap.mac
StdHep Test stdhep/barr.lcdd test StdHep input and resulting LCIO output; includes tracking/non-tracking regions to test backscatter flag stdhep.mac
MDI-BDS mdi_bds/mdi_bds.lcdd Sample geometry for Machine Detector Interface and Beam Delivery Elements for ILC.  
SiD sid/SiDEnvelopes.lcdd SiD with corners, envelopes only. (work in progress)  

As an example, to run the SDJan03 example from your SLIC_BASE area: ./scripts/run-log.sh macros/sdjan03.mac.