gdml “geometry description markup language” by daniele francesco kruse university of rome...
DESCRIPTION
GDML A means to share Geometry Information among applications POWERFUL -Able to describe geometry in a clear and readable way -It’s easy to understand / edit / update GDML files -Flow-control and modularity INDEPENDENT -Architecture independent -Operating system independent -MOST IMPORTANT: Application independent EXTENSIBLE -Defined by XML Schema files (.xsd) -Possibility to extend it with new tags and structure changes -Easily interfaced with future applications common I/O coreTRANSCRIPT
GDML“Geometry Description
Markup Language”by
Daniele Francesco Kruse
University of Rome “Tor Vergata”
European Organization for Nuclear Research
OutlineWhy is GDML so useful? What am I going to talk about?
We need a standard detector geometry description language thatwe can use in our applications
Motivation
Summary of the presentation1) What is GDML?2) What is my job here at CERN?3) Achievement 1: MODULARITY4) Achievement 2: LOOPS & MATRICES5) Achievement 3: IMPORTING CAD FILES
GDMLA means to share Geometry Information among applications
POWERFUL-Able to describe geometry in a clear and readable way-It’s easy to understand / edit / update GDML files-Flow-control and modularity
INDEPENDENT-Architecture independent-Operating system independent-MOST IMPORTANT: Application independent
EXTENSIBLE-Defined by XML Schema files (.xsd)-Possibility to extend it with new tags and structure changes-Easily interfaced with future applications common I/O core
The InterfaceThe Binding with User Applications
InputGDML File
The Interface -Common I/O core (multiple apps)-Specialized interface (1 per app)
The Application -Applications that use Geometry Info-Geant4, ROOT, etc...
OutputGDML File
GDMLA simple GDML document...
DefineMaterials
<material name=“Oxygen” Z=“8”> <D value=“0.00143”> <atom value=“16.0”></material>
DefineSolids
<box name=“MyBox” x=“5” y=“10” z=“10”/><tube name=“TheTube” rmin=“8” rmax=“9” z=“3”/><sphere name=“Ball” rmin=“8” rmax=“9”/>
DefineStructure
<volume name=“Detector”> <materialref=“Oxygen”> <solidref=“Ball”></volume>(you can then put this volume in a mother volume)
My job@CERNThe Interface with ROOT and Geant4
The Geant4 – GDML Binding- Support for the exportation of new solids (tet, tess, etc...)- Multiple GDML files support (input & output)- Support for variable name scope- Support for the <matrix> tag- Support for the <loop> tag
The ROOT – GDML Binding- Support for new complex solids (Xtru, Arb8, etc...)- I/O System refinement
ModularityDivide et Impera...
BEFOREAtlas geometry
(Tens of Millions ofphysical volumes)
would bedescribed using
only 1 GDML file!(Tens of MB)
-Huge-Very complicated
ATLASATLASMODULARISATION
Big GDML file
Main file
Mod. 1
Mod. 1.1 Mod. 1.2
Mod. 2
Mod. 2.2Mod. 2.1
2.1.1 2.1.2 2.1.3
AFTERSplit the geometry
into smallmodules
ADVANTAGES:
1) Readability
2) Indipendency
3) Reusability
Some Example CodeInstead of writing:
<physvol> <volumeref ref=“pipe” /> <positionref ref=“pipe_pos” /> <rotationref ref=“pipe_rot” /></physvol>
You should write:<physvol> <file name=“pipe.gdml” /> <positionref ref=“pipe_pos” /> <rotationref ref=“pipe_rot” /></physvol>
Loop & MatrixAvoiding repetitions and using tables of values
Suppose you want tocreate the following...
...normally you would haveto write all this GDML code:
<solids> <box name=“box1” x=“10” y=“5” z=“5” /> <box name=“box2” x=“9” y=“4.5” z=“4” /> <box name=“box3” x=“8” y=“4” z=“3.2” /> <box name=“box4” x=“7” y=“3.5” z=“2.56” /> <box name=“box5” x=“6” y=“3” z=“2.048” /></solids><structure> <volume name=“volbox1”> <solidref ref=“box1” /> <materialref ref=“iron” /> </volume> <volume name=“volbox2”> <solidref ref=“box2” /> <materialref ref=“iron” /> </volume> <volume name=“volbox3”> <solidref ref=“box3” /> <materialref ref=“iron” /> </volume> <volume name=“volbox4”> <solidref ref=“box4” /> <materialref ref=“iron” /> </volume> <volume name=“volbox5”> <solidref ref=“box5” /> <materialref ref=“iron” /> </volume>
<volume name=“world”> ... <physvol> <volumeref ref=“volbox1” /> <position x=“5” y=“0” z=“40” /> </physvol> <physvol> <volumeref ref=“volbox2” /> <position x=“5” y=“2” z=“38” /> </physvol> <physvol> <volumeref ref=“volbox3” /> <position x=“5” y=“3.5” z=“36” /> </physvol> <physvol> <volumeref ref=“volbox4” /> <position x=“5” y=“3.9” z=“34” /> </physvol> <physvol> <volumeref ref=“volbox5” /> <position x=“5” y=“4.15” z=“32” /> </physvol> </volume></structure>
...but using the <loop> & <matrix> tags the GDML code will be much shorter:
<define> <matrix name=“m” coldim=“5” values=“0 2 3.5 3.9 4.15 5 4 3.2 2.56 2.048” /> <variable name=“x” value=“1” /> <variable name=“x1” value=“0” /> <variable name=“x2” value=“0” /></define><solids> <loop for=“x” to=“5” step=“1”> <box name=“box” x=“10-(x-1)” y=“5-(x-1)/2” z=“m[2,x]” /> </loop></solids><structure> <loop for=“x1” to=“4” step=“1”> <volume name=“volbox”> <solidref ref=“box” /> <materialref ref=“iron” /> </volume> </loop> <volume name=“world”> ... <loop for=“x2” to=“8” step=“2”> <physvol> <volumeref ref=“volbox” /> <position x=“5” y=“m[1,x2/2+1]” z=“40-x2”/> </physvol> </loop> </volume></structure>
STEPGDMLThe GDML - STEP Binding
ST - ViewerAn interactive tool for viewing
3D CAD information
STEP filesST – Viewer uses an internalfile format (.geom & .tree)
to store geometry info
STEPGDMLLibrary functions created
to convert STEP filesinto GDML files
GDML Output File Equivalent to the original STEP file
Contains only tessellated solidsDoes not contain material info
Conclusionswhat was this all about? what have I done for CERN?
GDML is more flexible now because you can:
a) use many new kinds of solids in your geometry description
b) split huge geometry info into smaller GDML modular files
c) use the <loop> flow-control tag to avoid tedious repetitions of solids and volumesd) use the <matrix> tag to store values in a table formate) import geometries constructed in classical CAD tools
That’s All Folks!Many Thanks to:
Witold Pokorski (my supervisor)for his help and understanding during these 3 months
My good Friends at CERNfor the great times we had together
and to All of Youfor your kind Attention...