XML in LHCb Detector Description Framework - PowerPoint PPT Presentation

About This Presentation
Title:

XML in LHCb Detector Description Framework

Description:

XML in LHCb Detector Description Framework – PowerPoint PPT presentation

Number of Views:51
Avg rating:3.0/5.0
Slides: 26
Provided by: rado78
Category:

less

Transcript and Presenter's Notes

Title: XML in LHCb Detector Description Framework


1
  • XML in LHCbDetector Description Framework
  • Radovan Chytracek
  • CERN

2
Detector Description Overview
  • Component of the Gaudi framework
  • Inherits the Gaudi architecture decisions
  • Detector description provides
  • Single source of detector data for all clients
  • simulation, reconstruction, analysis, test beam
  • It is not detector geometry only!
  • logical detector structure, geometry positions,
    materials, mapping electronic channels to
    detector cells, detector control data needed for
    reconstruction, calibration and alignment data
  • Versioning of all detector data based on event
    time, run , etc.
  • Persistency of detector description in XML format
  • XML may be stored in files on disk , on the Web
    or in a DBMS

3
Detector Data Store
Algorithm
The transient detector store contains a
snapshot of the detector data valid for the
currently processed event
4
Transient Detector Store
Root of the store
Top level catalogues
Top level catalogues
Top level catalogues
  • Tree-like structure
  • Items identified by a logical name
  • Updated on demand
  • Automatic update when a new event is loaded

5
Loading on demand
6
Choices made for XML
  • XML DOM is not used
  • memory expensive
  • we dont write data back to XML (yet)
  • we have already the transient hierarchical object
    model in Gaudi
  • SAX is the choice for implementation
  • easy to implement and extend
  • we loose structure of XML documents
  • IBM XML4C parser

7
Numerical Expressions Parser
  • Simple parser for evaluation of expressions
  • Expressions can be composed of
  • integer and floating point numbers
  • 100 100. .05 0.1 1.34-e12-23
  • operations , -, , /, unary -, exponent
  • parenthesized expressions 1.4 ( 23.4-e12 / 1.8
    )
  • Result is always evaluated to double value
  • Operator precedence from left to right
  • () unary - / -
  • By default checks for units in expressions

8
CLHEP Units Compatibility
  • DTD for XML detector description defines units a
    la CLHEP
  • Units MUST be used where required
  • XML converters assume the use of units
  • In case the units are missing processing stops
    and an exception is thrown.
  • Use expressions parser where needed with check
    for units enabled
  • Examples
  • 23cm 12volt 23.6g/cm3

9
C to XML
10
DDDB Tag
lt!ENTITY elems "detelem logvol
material"gt lt!ELEMENT DDDB (catalog catalogref
elems)gt lt!ATTLIST DDDB version CDATA "3.0"gt
lt?xml version"1.0" encoding"UTF-8"?gt lt!DOCTYPE
DDDB SYSTEM "xmldb.dtd"gt ltDDDBgt ltcatalog
name"dd"gt ltcatalogref href"structure.xmlStr
ucture"/gt ltcatalogref href"materials/material
s.xmlMaterials"/gt ltcatalogref
href"geometry.xmlGeometry"/gt
lt/cataloggt lt/DDDBgt
11
Detector Element Tag
lt!ENTITY detelemdata "author?,version,geometryin
fo"gt lt!ENTITY nmclid "name ID REQUIRED classID
CDATA REQUIRED"gt lt!ELEMENT detelem
(detelemdata, detelemref, specific?)gt lt!ATTLIST
detelem nmclidgt
lt?xml version"1.0" encoding"UTF-8"?gt lt!DOCTYPE
DDDB SYSTEM "../xmldb.dtd"gt ltDDDBgt ltdetelem
classID"2" name"LHCb"gt ltauthorgtRCHlt/authorgt
ltversiongt0.1lt/versiongt ltgeometryinfogt
ltlvname name"/dd/Geometry/LHCb/lvLHCb"/gt
lt/geometryinfogt ltdetelemref classID"9999"
href"VertexRich1/Vertex/structure.xmlVertex"/gt
ltdetelemref classID"2" href"VertexRich1/Rich1
/structure.xmlRich1"/gt ltdetelemref
classID"2" href"TrackerRich2/Tracker/structure.x
mlTracker"/gt ltdetelemref classID"2"
href"TrackerRich2/Rich2/structure.xmlRICH2"/gt
ltdetelemref classID"8900" href"CaloMuon/Calo/s
tructure.xmlEcal"/gt ltdetelemref classID"2"
href"CaloMuon/Muon/structure.xmlMuon"/gt
lt/detelemgt lt/DDDBgt
12
Inheritance in XML
  • lt!DOCTYPE DDDB SYSTEM "xmldb.dtd"
  • lt!--Number of stations in Vertex detector--gt
  • lt!ELEMENT SiTankRadius EMPTYgt
  • lt!ATTLIST SiTankRadius n CDATA REQUIREDgt
  • lt!ELEMENT DiodePitch EMPTYgt
  • lt!ATTLIST PiodePitch n CDATA REQUIREDgt
  • lt!ELEMENT ReadoutPitch EMPTYgt
  • lt!ATTLIST ReadoutPitch n CDATA REQUIREDgt
  • gt
  • ltDDDBgt
  • ltdetelem classID"9999" name"Vertex"gt
  • ...
  • ltgeometryinfogt
  • ltlvname name"/dd/Geometry/lvVertex" /gt
  • ltsupport name"/dd/Structure/LHCb"gt ltnpath
    value"pvVertex_0" /gt lt/supportgt
  • lt/geometryinfogt
  • ltdetelemref classID"2" href"VStation01"/gt
  • ltdetelemref classID"2" href"VStation02"/gt
  • ltspecificgt

Definitionof the user XML tags
Detector specific data
13
Logical Volume Tag
lt!ENTITY solid "(box cons sphere tubs
trd union subtraction
intersection)"gt lt!ELEMENT logvol (solid,
(physvol paramphysvol))gt lt!ATTLIST logvol name
ID REQUIRED material CDATA REQUIRED
classID CDATA FIXED "1100"gt
lt?xml version"1.0" encoding"UTF-8"?gt lt!DOCTYPE
DDDB SYSTEM "../../xmldb.dtd"gt ltDDDBgt ltlogvol
name"lvVertexRich1" material"Vacuum"gt ltbox
name"VertexRich1Box sizeX"5000mm"
sizeY"5000mm" sizeZ"5000mm"/gt
ltphysvol name"pvVertex
logvol"/dd/Geometry/LHCb/Vertex/lvVertex"gt
ltposXYZ x"0mm" y"0mm" z"-1000mm"/gt
lt/physvolgt ltphysvol name"pvRich1
logvol"/dd/Geometry/LHCb/Rich1/lvRich1"gt
ltposXYZ x"0mm" y"0mm" z"2000mm"/gt
lt/physvolgt lt/logvolgt lt/DDDBgt
14
Physical Volume Tags
lt!ELEMENT physvol ((posXYZposRPhiZposRThPhi),(ro
tXYZrotAxis)?)gt lt!ATTLIST physvol name ID
REQUIRED logvol CDATA REQUIREDgt lt!ELEMENT
paramphysvol (physvol,(posXYZposRPhiZposRThPhi),
(rotXYZrotAxis))gt lt!ATTLIST paramphysvol number
CDATA REQUIREDgt
Parametric physical volume
Initial position of the first physical volume copy
Step for translation
Step for rotation
Simple physical volume
ltlogvol name"lvPVStation" material"Vacuum"gt
lttubs name"pvStationTubsPV" sizeZ"0.15mm
outerRadius"60degree" innerRadius"10de
gree startPhiAngle"-1.5degree"
deltaPhiAngle"181.5degree"/gt ltparamphysvol
number"6"gt ltphysvol name"waferPV"
logvol"/dd/Geometry/LHCb/Vertex/lvWafer"gt
ltposXYZ x"0mm" y"0mm" z"-0.5mm"/gt
ltrotXYZ rotX"0degree" rotY"0degree"
rotZ"0degree"/gt lt/physvolgt ltposXYZ
x"0mm" y"0mm" z"0mm"/gt ltrotXYZ
rotX"0degree" rotY"0degree"
rotZ"53.25degree"/gt lt/paramphysvolgt
ltphysvol name"pvwaferStrange" logvol"/dd/Geometr
y/LHCb/Vertex/lvWafer"gt ltposXYZ x"0mm"
y"0mm" z"-1.5mm"/gt ltrotXYZ
rotX"0degree" rotY"0degree"
rotZ"0degree"/gt lt/physvolgt lt/logvolgt
15
Solid Tags
lt!ENTITY simplesolid "(box cons sphere
tubs trd)"gt lt!ELEMENT box ((posXYZ posRPhiZ
posRThPhi), (rotXYZ rotAxis)?)?gt lt!ATTLIST box
name ID REQUIRED sizeX CDATA REQUIRED
sizeY CDATA REQUIRED sizeZ CDATA
REQUIREDgt lt!ELEMENT union (simplesolid)gt lt!ATT
LIST union name ID REQUIREDgt
Main or reference solid
Main or reference solid
ltlogvol material"Vacuum" name"lvEcalOuter"gt
ltsubtraction name"boxEcalOuter"gt ltbox
name"boxEOMain sizeZ"432mm"
sizeX"7933.44mm" sizeY"6445.92mm"gt
ltposXYZ z"0mm" y"0mm" x"0mm"/gt
lt/boxgt ltbox name"boxEOSubtracted
sizeZ"432mm" sizeX"2479.20mm"
sizeY"1983.36mm"gt ltposXYZ z"0mm"
y"0mm" x"0mm"/gt lt/boxgt
lt/subtractiongt lt/logvolgt
Subtracted solid placed relative to main solid
Subtracted solid placed relative to the main solid
16
Position Tags
Cartesian coordinate system lt!ELEMENT posXYZ
EMPTYgt lt!ATTLIST posXYZ x CDATA REQUIRED y CDATA
REQUIRED z CDATA REQUIREDgt
Cylindrical coordinate system lt!ELEMENT posRPhiZ
EMPTYgt lt!ATTLIST posRPhiZ r CDATA REQUIRED phi
CDATA REQUIRED z CDATA REQUIREDgt
Spherical coordinate system lt!ELEMENT posRThPhi
EMPTYgt lt!ATTLIST posRThPhi r CDATA REQUIRED
theta CDATA REQUIRED phi CDATA REQUIREDgt
17
Rotation Tags
Rotation around the axes X,Y and Z lt!ELEMENT
rotXYZ EMPTYgt lt!ATTLIST rotXYZ rotX CDATA
REQUIRED rotY CDATA REQUIRED rotZ CDATA
REQUIREDgt Rotation using vector and
angle lt!ELEMENT rotAxis EMPTYgt lt!ATTLIST rotAxis
axTheta CDATA REQUIRED axPhi CDATA REQUIRED
angle CDATA REQUIREDgt
18
Material Tag
lt!ENTITY materialdata "a?,z?,n?,density,x0?,lamb
da?"gt lt!ELEMENT fraction (atoms
mass)gt lt!ELEMENT atoms EMPTYgt lt!ATTLIST atoms n
CDATA REQUIREDgt lt!ELEMENT mass EMPTYgt lt!ATTLIST
mass n CDATA REQUIREDgt lt!ELEMENT material
(materialdata, (materialref))gt lt!ATTLIST
material nmclid form (isotope element
mixture) IMPLIED temperature CDATA
IMPLIED pressure CDATA IMPLIED state (solid
liquid gas) IMPLIED gt lt!ELEMENT a
(PCDATA)gt lt!ELEMENT z (PCDATA)gt lt!ELEMENT n
(PCDATA)gt lt!ELEMENT density (PCDATA)gt lt!ELEMENT
x0 (PCDATA)gt lt!ELEMENT lambda (PCDATA)gt
19
Material Tag
ltmaterial name"Bor_10" classID"isotope"gt
ltagt10.000g/molelt/agt ltzgt5.000lt/zgt
ltdensitygt2.3400g/cm3lt/densitygt
ltx0gt0.0000e00cmlt/x0gt ltlambdagt0.0000e00cm
lt/lambdagt lt/materialgt
ltmaterial name"Water" classID"mixture"gt
ltdensitygt1.0000g/cm3lt/densitygt
ltmaterialref classID"element"
href"elements.xmlHydrogen"gt ltfractiongt
ltatoms n"2"/gt lt/fractiongt lt/materialrefgt
ltmaterialref classID"element"
href"elements.xmlOxygen"gt ltfractiongt
ltatoms n"1"/gt lt/fractiongt
lt/materialrefgt lt/materialgt
20
Conclusions
  • Status
  • XML based det. descr. is the integral part of
    Gaudi
  • Working on NT, Linux
  • Future steps
  • Versioning
  • Population of the XML DDDB from the LHCb detector
    description based on Geant3
  • Define the XML format for conditions
  • calibration, alignment, channel maps, slow
    control, ...
  • Implement the XML DDDB in the conjunction with a
    real DB (RD45 Conditions/DB, Oracle, ...)

21
Geometry Info Tag
ltgeometryinfogt ltlvname name"/dd/Geometry/lvVer
tex" /gt ltsupport name"/dd/Structure/LHCb"gt
ltnpath value"pvVertex_0" /gt lt/supportgt lt/geometry
infogt
Replica path is /pvVertex_0
Replica path is /pvVertex_0/pvVst0
22
XML Converters Model
23
XML Conversion
  • It can be any XML parser supporting SAX API for
    C
  • SAX - Simple API for XML

24
XML Briefly
  • XML is the
  • W3C Recommendation
  • XML 1.0
  • subset of SGML
  • 20 complexity
  • 80 flexibility of SGML
  • Application independent data interchange format
  • XML features
  • User defined tags
  • Data self described
  • Hyperlinks
  • Properly nested tags forming a tree structure
  • Data separated from behavior
  • Problems with XML
  • C to XML mapping
  • Inheritance
  • Performance
  • Data Management
  • Safe investment in data and manpower
  • increasing support for XML in the industry
  • maintained outside CERN

25
Persistent Detector Store
  • The Gaudi architecture shields end users from a
    persistent technology
  • Allows co-existence of different persistency
    technologies
  • technology specific code only on well defined
    places
  • services and converters
  • We dont know which technologies will be
    available in 2005
  • We use XML as our persistent data format
  • XML can be stored in files, WWW, database
Write a Comment
User Comments (0)
About PowerShow.com