110 likes | 122 Views
European Organization for Nuclear Research. GDML “ G eometry D escription M arkup L anguage” by Daniele Francesco Kruse University of Rome “Tor Vergata”. Motivation. We need a standard detector geometry description language that we can use in our applications. Summary of the presentation.
E N D
European Organization for Nuclear Research GDML“Geometry Description Markup Language”byDaniele Francesco KruseUniversity of Rome “Tor Vergata”
Motivation We need a standard detector geometry description language that we can use in our applications Summary of the presentation • What is GDML? • What is my job here at CERN? • Achievement 1: MODULARITY • Achievement 2: LOOPS & MATRICES • Achievement 3: IMPORTING CAD FILES Outline Why is GDML so useful? What am I going to talk about?
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 GDML A means to share Geometry Information among applications
Input GDML File Output GDML File • Common I/O core (multiple apps) • Specialized interface (1 per app) The Interface • Applications that use Geometry Info • Geant4, ROOT, etc... The Application The Interface The Binding with User Applications
Define Materials <material name=“Oxygen” Z=“8”> <D value=“0.00143”> <atom value=“16.0”> </material> Define Solids <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”/> Define Structure <volume name=“Detector”> <materialref=“Oxygen”> <solidref=“Ball”> </volume> (you can then put this volume in a mother volume) GDML A simple GDML document...
My job@CERN The 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
BEFORE AFTER ATLAS Some Example Code MODULARISATION ATLAS Instead 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> Split the geometry into small modules ADVANTAGES: 1) Readability 2) Indipendency 3) Reusability Atlas geometry (Tens of Millions of physical volumes) would be described using only 1 GDML file! (Tens of MB) -Huge -Very complicated Big GDML file Main file Mod. 2 Mod. 1 Mod. 2.1 Mod. 2.2 Mod. 1.1 Mod. 1.2 2.1.1 2.1.2 2.1.3 Modularity Divide et Impera...
...normally you would have to write all this GDML code: ...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> <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> Loop & Matrix Avoiding repetitions and using tables of values Suppose you want to create the following...
ST - Viewer STEP files An interactive tool for viewing 3D CAD information ST – Viewer uses an internal file format (.geom & .tree) to store geometry info GDML Output File STEPGDML Equivalent to the original STEP file Contains only tessellated solids Does not contain material info Library functions created to convert STEP files into GDML files STEPGDML The GDML - STEP Binding
Conclusions what 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 volumes d) use the <matrix> tag to store values in a table format e) 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 CERN for the great times we had together and to All of You for your kind Attention...