Use GDML constants in ROOT script

Dear ROOT Experts:

I am using GDML to build detector geometry in my simulation project. And within the GDML file, I define some constants to specify volume dimensions and distances between them, e.g.

        <constant name="Chamber_Size_X" value="520"/>
        <constant name="Chamber_Size_Y" value="520"/>
        <constant name="Chamber_Size_Z" value="15"/>

        <constant name="ObjectAreaWidth" value="300"/>
        <constant name="Detector_Offset" value="100"/>
        <constant name="Plate_Size_X" value="500"/>
        <constant name="Plate_Size_Y" value="500"/>
        <constant name="Plate_Size_Z" value="2.5"/>

And I want to use these constants in my root script. In case i change the constant values, I want the ROOT scripts to trace the change automatically.

Is there any way to do so ?

Zhi Yu

Have you verified that the TGeoManager suports the constant tag? It appears that the quantity tag is not supported at the moment:


Sorry i didn’t upload the full gdml file, please refer to the attachment.

TGeoManager::Import(“Muon_Setup.gdml”) works fine on my computer.

Zhi Yu

Geometry.tar.gz (3.5 KB)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.