CMS Detector Description: New Developments

23
9/29/2004 1 CMS Detector CMS Detector Description: New Description: New Developments Developments Ad Aerts Ad Aerts Eindhoven University of Technology, Eindhoven, The Netherlands Eindhoven University of Technology, Eindhoven, The Netherlands Martin Liendl Martin Liendl CERN, Geneva, Switzerland CERN, Geneva, Switzerland Michael Case Michael Case University of California, Davis and CERN University of California, Davis and CERN Asif Jan Muhamad Asif Jan Muhamad CERN & NUST Pakistan CERN & NUST Pakistan

description

CMS Detector Description: New Developments. Ad Aerts Eindhoven University of Technology, Eindhoven, The Netherlands Martin Liendl CERN, Geneva, Switzerland Michael Case University of California, Davis and CERN Asif Jan Muhamad CERN & NUST Pakistan. Introduction. - PowerPoint PPT Presentation

Transcript of CMS Detector Description: New Developments

Page 1: CMS Detector Description: New Developments

9/29/2004 1

CMS Detector CMS Detector Description: New Description: New Developments Developments

Ad AertsAd AertsEindhoven University of Technology, Eindhoven, The NetherlandsEindhoven University of Technology, Eindhoven, The Netherlands

Martin LiendlMartin LiendlCERN, Geneva, SwitzerlandCERN, Geneva, Switzerland

Michael CaseMichael CaseUniversity of California, Davis and CERNUniversity of California, Davis and CERN

Asif Jan MuhamadAsif Jan MuhamadCERN & NUST PakistanCERN & NUST Pakistan

Page 2: CMS Detector Description: New Developments

9/29/2004 2

IntroductionIntroduction

CMS Detector Description Database CMS Detector Description Database (DDD)(DDD) What is the DDD?What is the DDD? RequirementsRequirements Model, Software Design, XML Model, Software Design, XML

New DevelopmentsNew Developments DDAlgorithmDDAlgorithm Oracle Database Oracle Database DDStreamerDDStreamer Integration into COBRAIntegration into COBRA

Page 3: CMS Detector Description: New Developments

9/29/2004 3

What is the DDD?What is the DDD?

“The Detector Description Database is the common source of detector description data for the CMS reconstruction and simulation software.

“It helps application clients to build up a consistent and coherent view of the detector and provides basic services to examine the detector structure and related data.

“It provides means of describing the detector (shapes, materials, geometrical hierarchies, application or sub-detector specific data).

“It is not: a tool for simulation, e.g. particle tracking; a tool for reconstruction; [or visualization.]”

From: CMS Week 3 Dec. 2002: DDD Deployment (M. Liendl)

Page 4: CMS Detector Description: New Developments

9/29/2004 4

RequirementsRequirements

One Definition RuleOne Definition Rule Each part in the detector that is identical should Each part in the detector that is identical should

only be defined once then positioned multiple only be defined once then positioned multiple times.times.

Each material should only be defined once, etc.Each material should only be defined once, etc. Common Application Program Interface Common Application Program Interface

(API) for Reconstruction (ORCA), Simulation (API) for Reconstruction (ORCA), Simulation (OSCAR) and other CMS software.(OSCAR) and other CMS software.

Similar ease of access and portability of Similar ease of access and portability of sources as compared to CMSIM (Geant3 sources as compared to CMSIM (Geant3 based simulation of CMS).based simulation of CMS).

Page 5: CMS Detector Description: New Developments

9/29/2004 5

Requirements Requirements (continued)(continued)

It must contain all information necessary It must contain all information necessary to build up application specific internal to build up application specific internal representations of the detector.representations of the detector.

Will not be used as 'internal' representation Will not be used as 'internal' representation of the detector within the applications. of the detector within the applications.

Deal only with the ideal detector and not Deal only with the ideal detector and not re-alignment or other conditions.re-alignment or other conditions.

Provide a generic way for client Provide a generic way for client applications to extend the DDD.applications to extend the DDD.

Provide a hierarchical querying and Provide a hierarchical querying and filtering mechanism.filtering mechanism.

Page 6: CMS Detector Description: New Developments

9/29/2004 6

Model OverviewModel Overview

“The 'platform independent' domain model is the base for deriving implementation models. From implementation models the actual models are directly mapped or generated (MDA approach).” --From: CMS Week 3 Dec. 2002: DDD Deployment (M. Liendl)

From: CHEP 2003 Poster

Page 7: CMS Detector Description: New Developments

9/29/2004 7

DDD Domain Model DDD Domain Model From: CMS Week 3 Dec. 2002: DDD Deployment (M. Liendl)

Page 8: CMS Detector Description: New Developments

9/29/2004 8

DDD API ModelDDD API Model

IGUANA

OSCAR

ORCA

FAMOS

Documents

CMS Offline Software

DDD Runtime System

External DocumentHandling

Ed

itors

Dete

ctor

Exp

ert

s

Converters

CMSIM - RZCMSIM - ASCII

C++ External Code

DDD Services

Document Processing

Document Management

RepositoriesExpanded from CHEP 2003 Poster

Page 9: CMS Detector Description: New Developments

9/29/2004 9

DDD API Model DDD API Model (continued)(continued)

Page 10: CMS Detector Description: New Developments

9/29/2004 10

DDD Description Model - DDD Description Model - XMLXML

Example XML:Example XML:<LogicalPart name=“MF12”><LogicalPart name=“MF12”> <Trapezoid name="MF12" <Trapezoid name="MF12" dz="94.7*cm “ …/> dz="94.7*cm “ …/> <rMaterial name=“Copper”/><rMaterial name=“Copper”/></LogicalPart></LogicalPart>

<PosPart copyNo=“1”><PosPart copyNo=“1”> <rParent name=“MF12”/><rParent name=“MF12”/> <rChild name="MA12"/> <rChild name="MA12"/> <rRotation <rRotation name="rotations:000D"/>name="rotations:000D"/> <Translation x="0*fm " <Translation x="0*fm " y="1.5*cm " y="1.5*cm " z="0*fm " /> z="0*fm " /> </PosPart></PosPart>

C++ Classes:C++ Classes:class DDMaterial;class DDMaterial;class DDSolid;class DDSolid; class DDTrap;class DDTrap; class DDBox;class DDBox; … …class DDLogicalPart;class DDLogicalPart;class DDSpecifics;class DDSpecifics;class DDRotation;class DDRotation;class DDTranslation;class DDTranslation;void Ddpos void Ddpos (DDLogicalPart parent,(DDLogicalPart parent, DDLogicalPart child,DDLogicalPart child, DDTranslation t,DDTranslation t, DDRotation r)DDRotation r)

Page 11: CMS Detector Description: New Developments

9/29/2004 11

New Developments: New Developments: DDAlgorithmDDAlgorithm

Required by sub-detector software experts to Required by sub-detector software experts to enable the algorithmic positioning and enable the algorithmic positioning and creation of DDLogicalParts, DDSolids and etc. creation of DDLogicalParts, DDSolids and etc. Especially in the case where detector symmetry Especially in the case where detector symmetry

makes this a very useful and fast way to build the makes this a very useful and fast way to build the geometry.geometry.

We do not want to store such sub-detector We do not want to store such sub-detector code with the main DDD when it is sub-code with the main DDD when it is sub-detector specific.detector specific.

We need to allow DDD access to these We need to allow DDD access to these algorithms with a clearly defined C++ algorithms with a clearly defined C++ interface and its corresponding XML.interface and its corresponding XML.

Solution: Seal PluginsSolution: Seal Plugins

Page 12: CMS Detector Description: New Developments

9/29/2004 12

DDAlgorithm DesignDDAlgorithm Design

IGUANA

OSCAR

ORCA

FAMOS

Documents

CMS Offline Software

DDD Runtime System

External DocumentHandling

Ed

itors

Dete

ctor

Exp

ert

s

Converters

CMSIM - RZCMSIM - ASCII

C++ External Code

DDD Services

Document Processing

Document Management

RepositoriesExpanded from CHEP 2003 Poster

Page 13: CMS Detector Description: New Developments

9/29/2004 13

DDAlgorithm Design DDAlgorithm Design (continued)(continued)

Documents

External DocumentHandling

C++ External CodeVia SEAL Plugin(DDAlgorithm)

DDD Services

Document Processing

Document Management

Document defines parameters to pass to the Algorithm and specifies which algorithm by name

<Algorithm name="hcal:DDHCalBarrelAlgo"><Algorithm name="hcal:DDHCalBarrelAlgo">

DDD calls specific plugin via the DDAlgorithm interface.

The plugin makes Solids and LogicalParts and positions them in the parent

DDD Runtime System

Page 14: CMS Detector Description: New Developments

9/29/2004 14

DDAlgorithm XMLDDAlgorithm XML

General Form:General Form:

<Algorithm name=“global:testAlgorithm”><Algorithm name=“global:testAlgorithm”> <rParent name=“thisdoc:myParentVolume”/><rParent name=“thisdoc:myParentVolume”/> <String name=“myName” value=“myValue”/><String name=“myName” value=“myValue”/> <Numeric name=“numToys” value=“5”/><Numeric name=“numToys” value=“5”/> <Vector name=“toyColors” numEntries=“[numToys]”<Vector name=“toyColors” numEntries=“[numToys]” type=“string”> type=“string”> blue, red, green, yellow, magentablue, red, green, yellow, magenta </Vector></Vector> <Map name=“toyNumbers” type=“numeric”<Map name=“toyNumbers” type=“numeric” nEntries=“[numToys]”>nEntries=“[numToys]”> A=3*[maindoc:Var1]/[thisdoc:Var1], A=3*[maindoc:Var1]/[thisdoc:Var1], B=2*[maindoc:Var1]/[thisdoc:Var2],B=2*[maindoc:Var1]/[thisdoc:Var2], C=2*[maindoc:Var1]/[thisdoc:Var3]C=2*[maindoc:Var1]/[thisdoc:Var3] </Map></Map></Algorithm></Algorithm>

Name will be used to get values in the algorithm.

Name of SEAL plugin defined by the DDAlgorithm sub-class

Can use other parameters defined in XML.

Page 15: CMS Detector Description: New Developments

9/29/2004 15

DDAlgorithm XMLDDAlgorithm XML

<Algorithm name=“global:linear"><Algorithm name=“global:linear"> <rParent name=“example:world"/><rParent name=“example:world"/> <Numeric name=“start” value=“1”/><Numeric name=“start” value=“1”/> <Numeric name=“incr” value=“1”/><Numeric name=“incr” value=“1”/> <Numeric name=“end” value=“5”/><Numeric name=“end” value=“5”/> <String name=“child” value=“example:box”/><String name=“child” value=“example:box”/> <Numeric name=“phi” value=“0*deg”/><Numeric name=“phi” value=“0*deg”/> <Numeric name=“theta” value=“90*deg”/><Numeric name=“theta” value=“90*deg”/> <Numeric name=“delta” value=“0.5*m”/><Numeric name=“delta” value=“0.5*m”/></Algorithm></Algorithm>

xy

zIGUANACMS output

Page 16: CMS Detector Description: New Developments

9/29/2004 16

DDAlgorithm C++DDAlgorithm C++

DDTranslation global_linear::translation() { double theta = nArgs["theta"]/rad; double phi = nArgs["phi"]/rad; double delta = nArgs["delta"]; DDTranslation direction( sin(theta)*cos(phi), sin(theta)*sin(phi), cos(theta) ); return (double(curr_)*delta)*direction; }

int startCount = int (nArgs[“start”]);int increment = int (nArgs[“incr”]);int endCount = int (nArgs[“end”]);string childName = sArgs[“child”];map<string, double> = mArgs[“mymap”];vector<string> = svArgs[“mystringvector”];vector<double> = vArgs[“vecdouble”];

Other examples:

Page 17: CMS Detector Description: New Developments

9/29/2004 17

Relational DatabasesRelational Databases Previous relational database work was done with Previous relational database work was done with

MySQL and Java. (A. Muhammad & M. Liendl)MySQL and Java. (A. Muhammad & M. Liendl)

Page 18: CMS Detector Description: New Developments

9/29/2004 18

Relational Databases Relational Databases (continued)(continued)

Reasons to revisit the relational Reasons to revisit the relational database as a repository for the DDDdatabase as a repository for the DDD The online software project will be writing The online software project will be writing

to relational databases.to relational databases. DDD gives a hierarchical index of the DDD gives a hierarchical index of the

detector geometry and is accessed by client detector geometry and is accessed by client software that also needs conditions, software that also needs conditions, calibrations, slow controls and other online calibrations, slow controls and other online databases.databases.

It seems logical that we make a map It seems logical that we make a map between the DDD and the relational between the DDD and the relational database world.database world.

Page 19: CMS Detector Description: New Developments

9/29/2004 19

New: Oracle Database New: Oracle Database SchemaSchema

Oracle Schema (A. Aerts & M. Liendl)Oracle Schema (A. Aerts & M. Liendl) Closely aligned with the DDD Domain Model.Closely aligned with the DDD Domain Model. Rigorous application of DB design principles.Rigorous application of DB design principles.

DataData Loaded from the DDD using C++ and Python.Loaded from the DDD using C++ and Python.

TechnologyTechnology Oracle 9iOracle 9i

Intended as a skeleton on which to hang Intended as a skeleton on which to hang conditions, alignment, calibration and slow conditions, alignment, calibration and slow controls data.controls data.

See poster session “A Database Perspective See poster session “A Database Perspective on CMS Data”on CMS Data”

Page 20: CMS Detector Description: New Developments

9/29/2004 20

New: StreamerNew: Streamer

Can be used to write local output file of DDD Can be used to write local output file of DDD objects.objects.

Can also be used to read in such files.Can also be used to read in such files. COBRA can be triggered using a COBRA can be triggered using a

SimpleConfigurable to write SimpleConfigurable to write (DDD:WriteCacheFile) and read (DDD:WriteCacheFile) and read (DDD:UseCacheFile) the geometry as files.(DDD:UseCacheFile) the geometry as files.

Speeds up building of initial DDD transient Speeds up building of initial DDD transient store. This is faster than the XML parsing.store. This is faster than the XML parsing.

Not currently in use but is there as an option.Not currently in use but is there as an option.

Page 21: CMS Detector Description: New Developments

9/29/2004 21

New: COBRA IntegrationNew: COBRA Integration

As you may have noticed the DDD is now a As you may have noticed the DDD is now a component of COBRA and no longer on its component of COBRA and no longer on its own as a project.own as a project.

Software is released with COBRA releases. Software is released with COBRA releases. XML Sources are currently in the Geometry XML Sources are currently in the Geometry project and this is also where the project and this is also where the DDAlgorithms reside at the moment.DDAlgorithms reside at the moment.

This is still in accordance with our original This is still in accordance with our original requirement that CMS client software rely on requirement that CMS client software rely on a common API to the geometry information a common API to the geometry information and integration with COBRA simplifies some and integration with COBRA simplifies some aspects of software management.aspects of software management.

Page 22: CMS Detector Description: New Developments

9/29/2004 22

SummarySummary DDD has been moved into the COBRA DDD has been moved into the COBRA

framework.framework. A new way of integrating algorithms into the A new way of integrating algorithms into the

DDD has been developed using the SEAL DDD has been developed using the SEAL Plug-in mechanism and will be used in the Plug-in mechanism and will be used in the next major Geometry release.next major Geometry release.

A new effort is on-going to correlate the DDD A new effort is on-going to correlate the DDD with slow controls, conditions and calibration with slow controls, conditions and calibration relational databases. In this case a new relational databases. In this case a new database model was developed with a more database model was developed with a more rigorous database design methodology.rigorous database design methodology.

A mechanism to stream out DDD objects has A mechanism to stream out DDD objects has been available if users want to gain a slight been available if users want to gain a slight time advantage at initialization.time advantage at initialization.

Page 23: CMS Detector Description: New Developments

9/29/2004 23

ReferencesReferences

CHEP 2004 Poster: Ad Aerts; A database perspective on CMS data CHEP 2004 Poster: Ad Aerts; A database perspective on CMS data http://indico.cern.ch/contributionDisplay.py?contribId=225&sessionId=24&confIhttp://indico.cern.ch/contributionDisplay.py?contribId=225&sessionId=24&confId=0d=0

CMS Note 2003/31 “Migration of XML Detector Description Data and Schema to CMS Note 2003/31 “Migration of XML Detector Description Data and Schema to a Relational Database” ; Asif Jan Muhammad, Martin Liendl, Frank van Lingen, a Relational Database” ; Asif Jan Muhammad, Martin Liendl, Frank van Lingen, Arshad Ali, Ian Willers; Arshad Ali, Ian Willers; http://cmsdoc.cern.ch/documents/03/note03_031.pdfhttp://cmsdoc.cern.ch/documents/03/note03_031.pdf

CHEP 2003 Poster: “CMS XML-based Detector Description Database System”; M. CHEP 2003 Poster: “CMS XML-based Detector Description Database System”; M. Case, A. Muhammad, M. Liendl, F. van Lingen; Case, A. Muhammad, M. Liendl, F. van Lingen; http://chep03.ucsd.edu/?day=posterhttp://chep03.ucsd.edu/?day=poster

CHEP 2001 Presentation: “The Role of XML in the CMS Detector Description”; M. CHEP 2001 Presentation: “The Role of XML in the CMS Detector Description”; M. Liendl, F. van Lingen, M. Case, T. Todorov, P. Arce, A. Furtjes, V. Innocente, A. Liendl, F. van Lingen, M. Case, T. Todorov, P. Arce, A. Furtjes, V. Innocente, A. de Roeck; http://www.ihep.ac.cn/~chep01/presentation/8-054.pdf de Roeck; http://www.ihep.ac.cn/~chep01/presentation/8-054.pdf

CMS Note-2001/057 “Detector Descripiton Domain Architecture & Data Model”; CMS Note-2001/057 “Detector Descripiton Domain Architecture & Data Model”; M. Case, M. Liendl, F. van Lingen; M. Case, M. Liendl, F. van Lingen; http://cmsdoc.cern.ch/documents/01/note01_057.pdf http://cmsdoc.cern.ch/documents/01/note01_057.pdf

COBRA: http://cobra.web.cern.ch/cobra/ COBRA: http://cobra.web.cern.ch/cobra/ DDD: http://cmsdoc.cern.ch/cms/software/ddd/www/index.html DDD: http://cmsdoc.cern.ch/cms/software/ddd/www/index.html

LCG Applications: http://lcgapp.cern.ch/project/ LCG Applications: http://lcgapp.cern.ch/project/ SEAL Plugin documentation: http://seal.web.cern.ch/seal/SEAL Plugin documentation: http://seal.web.cern.ch/seal/

BOOST: http://www.boost.org/BOOST: http://www.boost.org/ XML Technologies: http://www.w3c.org/ XML Technologies: http://www.w3c.org/ MDA: Model Driven Architecture at OMG (Object Management Group, Inc.) MDA: Model Driven Architecture at OMG (Object Management Group, Inc.)

http://www.omg.org/mda/ http://www.omg.org/mda/