Geometry translation from AgSTAR to AgML/ROOT

Abstract:  We have developed several tools which enables the translation of the existing STAR geometry model from AgSTAR to a ROOT-based geometry.  These include (1) a parser which can read in the original AgSTAR format, (2) an exporter which can export the geometry to (a) the original AgSTAR format, (b) an XML-based language called AgML and (c) a set of c++ classes supported by a dedicated library which can generate a ROOT/TGeo based geometry.  This blog entry documents the current status of the project.
 

At present, we can convert every geometry used in the y2009a geometry tag to AgML.  These AgML files can be exported to a set of c++ source files. These files can be compiled and linked with a dedicated library (StarAgmlLibrary) which can create a ROOT/TGeo geometry. The translation is not yet automatic.  There are several modifications which need to be made to several files.  I will summarize these below.  Figure 1 shows the resulting detector.

Figure 1 -- The y2009a geometry converted from AgSTAR, exported into AgML, and converted to a set of c++ classes.
As a first sanity check, we can compare the mass of the detector computed analyitically by root (sum of density * volume of each detector element).
 

Analytical mass reported by ROOT for the original y2009a geometry:
Info in <TGeoManager::Weight>: Computing analytically weight of CALB
Info in <TGeoManager::Weight>: Computed weight: 119248.464024 [kg]

Info in <TGeoManager::Weight>: Computing analytically weight of ECAL
Info in <TGeoManager::Weight>: Computed weight: 26166.831867 [kg]

Info in <TGeoManager::Weight>: Computing analytically weight of BTOF
Info in <TGeoManager::Weight>: Computed weight: 2995.779982 [kg]

Info in <TGeoManager::Weight>: Computing analytically weight of TPCE
Info in <TGeoManager::Weight>: Computed weight: 7144.368263 [kg]

Info in <TGeoManager::Weight>: Computing analytically weight of PIPE
Info in <TGeoManager::Weight>: Computed weight: 22.124841 [kg]

Info in <TGeoManager::Weight>: Computing analytically weight of MAGP
Info in <TGeoManager::Weight>: Computed weight: 774396.399439 [kg]

Info in <TGeoManager::Weight>: Computing analytically weight of BBCM
Info in <TGeoManager::Weight>: Computed weight: 19.164608 [kg]

Info in <TGeoManager::Weight>: Computing analytically weight of FBOX
Info in <TGeoManager::Weight>: Computed weight: 148.289125 [kg]

Info in <TGeoManager::Weight>: Computing analytically weight of FTPC
Info in <TGeoManager::Weight>: Computed weight: 127.386452 [kg]

Info in <TGeoManager::Weight>: Computing analytically weight of SCON
Info in <TGeoManager::Weight>: Computed weight: 18.784701 [kg]

Analytical weight for the translated geometry:
Info in <TGeoManager::Weight>: Computing analytically weight of CALB
Info in <TGeoManager::Weight>: Computed weight: 120424.087164 [kg]

Info in <TGeoManager::Weight>: Computing analytically weight of ECAL
Info in <TGeoManager::Weight>: Computed weight: 26167.081929 [kg]

Info in <TGeoManager::Weight>: Computing analytically weight of BTOF
Info in <TGeoManager::Weight>: Computed weight: 2647.514625 [kg]

Info in <TGeoManager::Weight>: Computing analytically weight of TPCE
Info in <TGeoManager::Weight>: Computed weight: 7170.827237 [kg]

Info in <TGeoManager::Weight>: Computing analytically weight of PIPE
Info in <TGeoManager::Weight>: Computed weight: 22.124850 [kg]

Info in <TGeoManager::Weight>: Computing analytically weight of MAGP
Info in <TGeoManager::Weight>: Computed weight: 774396.434217 [kg]

Info in <TGeoManager::Weight>: Computing analytically weight of BBCM
Info in <TGeoManager::Weight>: Computed weight: 19.164610 [kg]

Info in <TGeoManager::Weight>: Computing analytically weight of FBOX
Info in <TGeoManager::Weight>: Computed weight: 148.289119 [kg]

Info in <TGeoManager::Weight>: Computing analytically weight of FTPC
Info in <TGeoManager::Weight>: Computed weight: 126.800333 [kg]

Info in <TGeoManager::Weight>: Computing analytically weight of SCON
Info in <TGeoManager::Weight>: Computed weight: 18.784701 [kg]

09/17/2010

As a second sanity check, I perform a geometry differential between the y2009a AgSTAR geometry and the y2009a AgML/ROOT geometry.  First I needed to add in a few more detectors and fix a bug in the DO-LOOP to for-loop translation.  Also, I had to edit several AgML source files by hand, because they improperly passed shape attributes using the CREATE operator.
 
The differential looks at the number of radiation lengths vs eta from -5 to +5, integrated over the phi range from +2.5 to +7.5 degrees.  The differential output is attached. 
 
Most modules have small differences between the two geometries.  The largest differences are seen in the magnet and barrel calorimeters.  I strongly suspect that this indicates differenences in either the global rotation of the STAR detector or differences in the local rotations of the individual detectors.
Differences in material distributions are unlikely due to relative rotations... looking at the magnet... both AgML/ROOT (left) and AgSTAR (right) appear to have the same alignment.