STAR  Computing  Simulation  
Issues related to using the XML-based approach in geometry description
  Maintenance

Introduction

We are considering using a XML-based approach for the STAR geometry description. One example of work being done in that directions can be found in our local pages and GDML documentation available from CERN

The curent issues in our development are the following:

Database Interface

An introduction on the subject of interfacing the XML and the database can be found here. In addition, there is a list of relevant database products available.

Database interfaces for XML

There are hundreds of products available, differing in approach (datacentric versus documentcentric), licensing scheme and language platforms. Some of the more interesting listed here:

Case study: MySQL

Mapping STARSIM structures onto tables

Let's assume we'll use MySQL as the RDBMS layer. Let's consider pre-extracting the data from the database and cashing in a XML document, referenced by GDML or other XML-based source code, for example.

Typically, any detector subsystems in STAR is characterized by tens or hundreds of parameters. There is an obvious need to structure these data in any implementation. In the existing STAR geometry description system (Starsim), there are the so-called "structures" (in the software sense of this word), which are a way to group parameters of a relatively small physicall part of the detector. For example, there is a structure describing the numerical data for the beam support in the SVT geometry description, a structure for the shielding parameters, a structure for the support wheel of the TPC etc.

Preserving this data organization would probably facilitate the transition to the new platform. One solution is to create database tables under the same names as structures found in our existing code, with column names matching the names of the data members. A query of these tables would yield a XML document which would contain the totality of the numerical data for a particular geometry.

The structures currently used contain a field called version, although the name can be anything.. It can indeed be used for versioning, but more often is is used as an index to effectively create an array of structures, further used in an iterator in the code generating the geometrical model. It is important then to insure there is no confusion about versioning. The "version" should be therefore be named isomething else ("index", "layer" etc), and a column "version" created and used according to its name. For example, if the SVT ladders were shifted between runs, we could increment the version and insert a few rows (because there are indices) to reflect that.

Here is a crude example. Consider a simplified variant of one of the structures found in the SVT description (effectively an array of 3 elements):

   Fill SCBP                ! Cabling
      Layer=1               ! Layer
      Len  =1.85            ! Length
      Rmin1=2.1             ! Min radius closer to wafers
      Rmin2=3.2             ! Min radius further from wafers
   EndFill
*
   Fill SCBP                ! Cabling
      Layer=2               ! Layer
      Len  =1.85            ! Length
      Rmin1=4.1             ! Min radius closer to wafers
      Rmin2=5.3             ! Min radius further from wafers
   EndFill
*
   Fill SCBP                ! Cabling
      Layer=3               ! Layer
      Len  =1.85            ! Length
      Rmin1=7.2             ! Min radius closer to wafers
      Rmin2=9.7             ! Min radius further from wafers
   EndFill

Now assume that there was a shift in the position of this part of the SVT, hence a change in numerical values. A second version of the array needs to be introduced.

In order to implement the database storage of these data, we can proceed to create a database table with the following contents (the schema is quite simple and self-explanatory). Note that we normalize out the comment into a separate table.

Table SCBP
VersionLayerLen Rmin1Rmin2
1 1 1.852.1 3.2
1 2 1.854.1 5.3
1 3 1.857.2 9.7
2 1 1.872.2 3.3
2 2 1.874.2 5.4
2 3 1.877.2 9.8

Table SCBPDOC
Parameter Comment
LayerNumber of the SVT Layer
LenLength of the cabling
Rmin1Min radius closer to wafers
Rmin2Min radius further to wafers

Table SCBPDOC obviously contains two versions corresponding to two surveys as mentioned above.

Extracting the XML Data

select Layer, Len, Rmin1, Rmin2 from SCBP where Version='2'


 

Page updated by Maxim Potekhin on 11/05/2004