Detector Description in LHCb (Extended Version) Detector Description Workshop 4 July 2002 S. Ponce - CERN.

Slides:



Advertisements
Similar presentations
1 Databases in ALICE L.Betev LCG Database Deployment and Persistency Workshop Geneva, October 17, 2005.
Advertisements

15 March, 2000LHCb Computing1 Software Review Panel LHCb Answers to Architecture, Data Model and Program Infrastructure Pere Mato for the LHCb Collaboration.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
25/03/2003Simulation Application for the LHCb Experiment CHEP March 2003 Presented by: W. Pokorski / CERN Authors: I. Belyaev, Ph. Charpentier,
LHCb Simulation Tutorial CERN, 21 st -22 nd February B 00 l e How to pass a detector geometry to.
LHCb Simulation Tutorial CERN, 21 st -22 nd February B 00 l e Detector Simulation and Geant4.
Gaudi Framework Tutorial, April Introduction.
M.Frank LHCb/CERN - In behalf of the LHCb GAUDI team Data Persistency Solution for LHCb ã Motivation ã Data access ã Generic model ã Experience & Conclusions.
Conditions DB in LHCb LCG Conditions DB Workshop 8-9 December 2003 P. Mato / CERN.
1 GAUDI - The Software Architecture and Framework for building LHCb data processing applications Marco Cattaneo, CERN February 2000.
CERN Tutorial, September Job Options and Printing.
Job Options and Printing 1 LHCb software tutorial - September 2011.
Gaudi Framework Tutorial, XML The persistent world.
Event Data History David Adams BNL Atlas Software Week December 2001.
Introduction to Gaudi LHCb software tutorial - September
XML in Atlas: from generic to parametric detector description Stan Bentvelsen NIKHEF Amsterdam XML workshop, CERN, May 22.
Use of Gaudi in Reconstruction Weidong Li 23/06/2004.
Darmstadt, 15. November 2015 Tobias Stockmanns, FZ Jülich1 A STEP to ROOT converter for the FairRoot framework ALICE-FAIR Computing Meeting, GSI,
Tutorial 13 Validating Documents with Schemas
CHEP /21/03 Detector Description Framework in LHCb Sébastien Ponce CERN.
Gaudi Framework Tutorial, April Job Options and Printing.
N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER Charles Leggett Interval of Validity Service IOVSvc ATLAS Software Week May Architecture.
The GeoModel Toolkit for Detector Description Joe Boudreau Vakho Tsulaia University of Pittsburgh CHEP’04 Interlaken.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
Managed by UT-Battelle for the Department of Energy CSS Update Matthias Clausen, Helge Rickens, Jan Hatje and DESY Delphy Armstrong, Xihui Chen,
WIRED Detector Description in XML Mark Dönszelmann, Applications for Physics and Infrastructure, IT, CERN XML Detector Description Workshop CERN, 14 April,
Hands on AGDD*: Atlas Generic Detector Description in XML
CHEP /21/03 Detector Description Framework in LHCb Sébastien Ponce CERN.
Detector Description in LHCb Detector Description Workshop 13 June 2002 S. Ponce, P. Mato / CERN.
23/2/2000Status of GAUDI 1 P. Mato / CERN Computing meeting, LHCb Week 23 February 2000.
IT / API 1 CERN 1-Feb-16 GBLIB: classes to deal with geometrical data Evgueni Tcherniaev IT / API CLHEP workshop, January.
Concepts and Realization of a Diagram Editor Generator Based on Hypergraph Transformation Author: Mark Minas Presenter: Song Gu.
General requirements for BES III offline & EF selection software Weidong Li.
CERN Tutorial, February Introduction to Gaudi.
CINT & Reflex – The Future CINT’s Future Layout Reflex API Work In Progress: Use Reflex to store dictionary data Smaller memory footprint First step to.
27 March 2003RD Schaffer & C. Arnault CHEP031 Use of a Generic Identification Scheme Connecting Events and Detector Description in Atlas  Authors: C.
21 Copyright © 2009, Oracle. All rights reserved. Working with Oracle Business Intelligence Answers.
Gloria Corti, CERN Credits to Chris Jones, Wouter Hulsbergen, Sajan Easo, Dima Popov Computing Workshop Online/Databases/Detector Description Session Paris.
Detector Description (Overview) C.Cheshkov. 25/9/2006Detector Description (C.Cheshkov)OutlineTerminology Overview on: Detector geometry implementation.
M.Frank, CERN/LHCb Persistency Workshop, Dec, 2004 Distributed Databases in LHCb  Main databases in LHCb Online / Offline and their clients  The cross.
Elements of LCG Architecture Application Architecture Blueprint RTAG 8 th June 2002 P. Mato / CERN.
1 SLAC simulation workshop, May 2003 Ties Behnke Mokka and LCDG4 Ties Behnke, DESY and SLAC MOKKA: european (france) developed GEANT4 based simulation.
LHCb Software Week 25/11/99 Gonzalo Gracia Abril 1 r Status of Geant4 in LHCb. r Ideas on how to populate the LHCb Detector Description Data Base (LHCb.
New Xml Converters General presentation of Xml converters The old way
“Algorithm Tools” what they are, how to get them and how to use them
Working in the Forms Developer Environment
New Xml Converters General presentation of Xml converters The old way
CMS High Level Trigger Configuration Management
A C++ generic model for the GLAST Geometric Description
Markus Frank CERN/LHCb CHEP2013, Amsterdam, October 14th–18th 2013
HEP detector description supporting the full experiment life cycle
Introduction to Gaudi LHCb software tutorial - December 2010.
Data Modeling II XML Schema & JAXB Marc Dumontier May 4, 2004
Marco Cattaneo, CERN February 2000
XML in LHCb Detector Description Framework Radovan Chytracek CERN
SW Architecture SG meeting 22 July 1999 P. Mato, CERN
LHCb Detector Description Framework Radovan Chytracek CERN Switzerland
Various News From Detector Description
Detector Description in LHCb
GAUSS - GEANT4 based simulation for LHCb
Raw Event Conversion Service in BOSS framework
Simulation and Physics
Detector Geometry Description
GAUDI Detector Description News Radovan Chytracek 5/1/2019
The Calorimeter Detector Description
Detector description News
Introduction to Gaudi Schedule: Timing Topic 20 minutes Lecture
Use Of GAUDI framework in Online Environment
Planning next release of GAUDI
LHCb Detector Description Framework Radovan Chytracek CERN Switzerland
Presentation transcript:

Detector Description in LHCb (Extended Version) Detector Description Workshop 4 July 2002 S. Ponce - CERN

July 3, 20022/57Detector Description in LHCb – Extended version Contents  Gaudi Architecture Overview  Transient Store Mechanism  Detector Description  XML Persistency  User extensions of the schema  Visualization  Simulation : Interfacing Geant4  Condition Database

July 3, 20023/57Detector Description in LHCb – Extended version Definition of Terms – Algorithm » Atomic data processing unit (visible & controlled by the framework) » Written by physicists, Called once per physics event – Service » Globally available software component providing some functionality – Data Object » Atomic data unit (visible and managed by transient data store) – Transient Store » Central service and repository for objects (load on demand)

July 3, 20024/57Detector Description in LHCb – Extended version Transient Event Store Gaudi Object Diagram Converter Algorithm Event Data Service Persistency Service Data Files Algorithm Detec. Data Service Persistency Service Data Files Transient Detector Store Message Service JobOptions Service Particle Prop. Service Other Services Histogram Service Persistency Service Data Files Transient Histogram Store Application Manager Converter Event Selector

July 3, 20025/57Detector Description in LHCb – Extended version Interfaces Concrete Algorithm EventDataSvc IDataProviderSvc IHistogramSvc IMessageSvc IAlgorithm IProperty Obj_B DetectorDataSvc HistogramSvc MessageSvc ParticlePropertySvc IParticlePropertySvc ApplicationMgr ISvcLocator Obj_A

July 3, 20026/57Detector Description in LHCb – Extended version Interfaces in Practice class IMyInterface { virtual void doSomething( int a, double b ) = 0; } #include “IMyInterface.h” ClientAlgorithm::myMethod() { // Declare the interface IMyInterface* myinterface; // Get the interface from somewhere service(“MyServiceProvider”, myinterface ); // Use the interface myinterface->doSomething( 10, 100.5); } ClientAlgorithm.cpp IMyInterface.h

July 3, 20027/57Detector Description in LHCb – Extended version Gaudi Services – JobOptions Service – Message Service – Particle Properties Service – Event Data Service – Histogram Service – N-tuple Service – Detector Data Service – Magnetic Field Service – Tracking Material Service – Random Number Generator – Chrono Service – (Persistency Services) – (User Interface & Visualization Services) – (Geant4 Services)

July 3, 20028/57Detector Description in LHCb – Extended version Algorithm & Transient Store Algorithm A Algorithm B Algorithm C Transient Store Data T1 Data T2, T3 Data T2 Data T3, T4 Data T4 Data T5 Data T1 Data T5 Real dataflow Apparent dataflow

July 3, 20029/57Detector Description in LHCb – Extended version Data Reside In Data Store  Tree - similar to file system  Identification by path ”/Event/MCEvent/MCEcalHit” ”/dd/Geometry/Ecal/Station1”  Objects loaded on demand

July 3, /57Detector Description in LHCb – Extended version Understanding Transient Store Loading (5) Register (2) Search in Store Data Store Unsuccessful if requested object is not present (3) Request load Persistency Service Converter (4) Request creation Conversion Service Request dispatcher Oracle, XML, ROOT,.. Data Service Algorithm (1) retrieveObject(…) Try to access an object data

Detector Description

July 3, /57Detector Description in LHCb – Extended version Detector Description  Logical Structure – Breakdown of detectors – Identification  Geometry Structure – Hierarchy of geometrical volumes – LogicalVolumes (unplaced dimensioned shape) – PhysicalVolumes (placed volume)  Other detector data – Calibration, Alignment, Readout maps, Slow control, etc.

July 3, /57Detector Description in LHCb – Extended version Logical Structure  The basic object is a Detector Element – Identification – Navigation (tree-like)  DetElement as information center – Be able to answer any detector related question » E.g. global position of strip#, temperature of detector, absolute channel gain, etc. – Placeholder for specific code » The specific answers will be coded by physicists DetElement * MyDetector

July 3, /57Detector Description in LHCb – Extended version Transient Detector Store Algorithm Accessing Detector Data Geometry DetectorData Service Algorithm Manages store Synchronization updates DetElement Geometry Info IGeometryInfo Calibration ReadOut IReadOut ICalibration IDetElement MuonStation request reference Conditions DB Other DBs Persistency Service Conversion Service Conversion Service Conversion Service

July 3, /57Detector Description in LHCb – Extended version Algorithm Accessing Detector Data // Algorithm code fragment (initialize() or execute()) SmartDataPtr mydet(detSvc(), "Structure/LHCb/MyDet"); if( !mydet ) { log << MSG::ERROR << "Can't retrieve MyDet" << endmsg; return StatusCode::FAILURE; }... // get the number of sub-DetectorElements ndet = mydet->childIDetectorElements().size() // get the material material = mydet->geometry()->lvolume()->materialName();

July 3, /57Detector Description in LHCb – Extended version Geometry Information  Constructed using Logical and Physical Volumes (Geant 4) – Logical Volume: Unplaced detector described as a solid of a given material (optional) and a set of daughters (physical volumes). – Physical Volume: Placement of a logical volume (rotation & translation).  Solids – A number of basic shapes (boxes, tubes, cones, trds, spheres,…) with dimensions – Boolean solids (unions, intersections and subtractions)

July 3, /57Detector Description in LHCb – Extended version Algorithm Accessing Geometry Info HepTransform3D& matrix() // To Local HepTransform3D& matrixInv() // To Global HepPoint3D toLocal( HepPoint3D& ) HepPoint3D toGlobal( HepPoint3D& ) bool isInside( HepPoint3D& ) string belongsToPath( HepPoint3D& ) IGeometryInfo* belongsTo( HepPoint3D& )... fullGeoInfoForPoint( HepPoint3D&,...) string lVolumeName() ILVolume* lvolume()... IGeometryInfo IGeometryInfo* geom = mydetelem->geometry();

July 3, /57Detector Description in LHCb – Extended version Two Hierarchies DetElement LHCb StructureGeometry DetElement LHCb DetElement Tracking DetElement Calo DetElement HCAL DetElement ECAL DetElement Module2 DetElement Module1 LVolume Experiment PVolume LVolume ECAL LVolume HCAL LVolume RICH PVolume Logical structureGeometry structure LVolume HCALModule

July 3, /57Detector Description in LHCb – Extended version Class Diagram (Simplified) DetectorElementMuonStation Geometry Info IGeometryInfo ReadOut Hierarchy Calibration IReadOut ICalibration Specific detector description questions from algorithms LVolumePVolumeDataObjectSolid ISolid MaterialElementMixture IMaterial Detector DescriptionGeometryMaterial IDetectorElement ILVolume Solid SolidBox Isotope IPVolume * * ** Association resolved on demand

July 3, /57Detector Description in LHCb – Extended version Transient Store Organization  Standard Gaudi Transient Store – “Catalogs” of Logical Volumes and Materials – “Structure” as a tree – All elements identified with names of the form: /xxx/yyy/zzzz

July 3, /57Detector Description in LHCb – Extended version Persistency Based on XML Files  XML is used as persistent representation of the Structure, Geometry and Materials  Why XML? Instead of inventing our own format use a standard one (extendible) Many available Parsers and Tools Strategic technology

July 3, /57Detector Description in LHCb – Extended version The LHCb Detector DTD – Divided into 3 main parts »structure »geometry »material –External DTDs, to be referenced in every LHCb XML files

July 3, /57Detector Description in LHCb – Extended version Some Specificities Expressions evaluator – units & functions known 12.2*mm +.17*m / tan (34*degree) parameter : a kind of macro protocol://hostname/path/file.xml#ObjectID References : element + “ref”

July 3, /57Detector Description in LHCb – Extended version Structure Elements –DDDB : the root –catalog : a list –detelem : a detector element –geometryInfo : connection to the geometry –userParameter(Vector) : hook for adding parameters –specific : hook for extending the DTD <geometryinfo lvname=“…” npath=“…” support=“…”/> <userParameter comment=“…” name=“…” type="string"> … …

July 3, /57Detector Description in LHCb – Extended version Geometry Elements (1) –DDDB : the root –catalog : a list –logvol : logical volume –physvol : physical volume –paramphysvol(2D)(3D) : replication of physical volumes –tabproperty : tabulated properties <logvol material=“…” name=“…”> <physvol logvol=“…” name=“…”/> <physvol logvol=“…” name=“…”/>

July 3, /57Detector Description in LHCb – Extended version Geometry Elements(2) –posXYZ, posRPhiZ, posRThPhi : translations –rotXYZ, rotAxis : rotations –transformation : composition of transformations –box, trd, trap, cons, tub, sphere, polycon –union, intersection, subtraction : boolean solids –surface <box name="box3“ sizeX="1*m“ sizeY="1*m“ sizeZ="15*cm"/> <tubs name="tub2“ outerRadius="15*cm“ sizeZ="25*cm"/>

July 3, /57Detector Description in LHCb – Extended version Material Elements –materials : the root –catalog : a list –tabproperty : tabulated properties –atom –isotope –element : a mixture of isotopes –material : mixtures of elements or materials <isotope A="11*g/mole“ name="Bor_11“ …/> <element name="Boron“ symbol="B“ …> <isotoperef href="#Bor_10“ fractionmass="0.20"/> <isotoperef href="#Bor_11“ fractionmass="0.80"/> <element name="Oxygen“ symbol="O“ …> <atom A="16*g/mole“ Zeff="8.0000"/> <component name="Carbon“ natoms="1"/> <component name="Oxygen“ natoms="2"/>

July 3, /57Detector Description in LHCb – Extended version XmlEditor – Explorer-like XML viewer – No need to know XML syntax – Checks the DTD when opening a file – Allows copy, paste and drag and drop of nodes – Allows view of several files at the same time – Hide references across files Easy XML edition $LHCBSOFT/Det/XmlEditor/v*/scripts/xmlEditor(.bat)

July 3, /57Detector Description in LHCb – Extended version XMLEditor

July 3, /57Detector Description in LHCb – Extended version Conversion From XML to C ++ – Converters used to build C ++ objets from XML – One converter per object type » XmlDetectorElementCnv » XmlLVolumeCnv » XmlMixtureCnv » XmlMuonStationCnv » … » XmlMySubDetCnv – almost 1 to 1 mapping between XML elements and C ++ objects – Uses the xerces-C parser – Could use any DOM parser

July 3, /57Detector Description in LHCb – Extended version First Summary – We are able to reach the geometry description from the C ++ transient world – Everything is transparent for the C ++ user, there is no need to know it comes from XML – At this point, we have no way to extend the schema and especially to add specific parameters to a detector element

July 3, /57Detector Description in LHCb – Extended version Specializing Detector Elements 1.adding userParameter(vector)s to default DetectorElements 2.extending and specializing the DetectorElement object in C ++, using userParameters in XML 3.extending XML DTD and writing a dedicated converter

July 3, /57Detector Description in LHCb – Extended version  Two elements : and  3 string attributes : name, type and comment  One value given as text Specializing by using UserParameter[Vector] <userParameter comment=“blablabla” name=“description” type=“string”> Calibration channels <userParameterVector name=“NbChannels” type=“int” comment=“blabla”>

July 3, /57Detector Description in LHCb – Extended version C ++ API for userParameters  Methods on DetectorElement for userParameters :  string userParameterAsString (string name)  double userParameterAsDouble (string name)  int userParameterAsInt (string name)  The equivalent exist for userParameterVectors std::string description = elem->userParameterAsString ("description"); std::vector channelNbs = elem->userParameterVectorAsInt ("NbChannels"); log << MSG::INFO << description << " : “; for (std::vector ::iterator it = channelNbs.begin(); it != channelNb.end(); it++) log << *it; log << endreq;

July 3, /57Detector Description in LHCb – Extended version  Free extension of the DetectorElement class  Specific initialization using initialize() – called after conversion – access to userParameters  A converter is needed but very simple (4 lines) #include “DetDesc/XmlUserDetElemCnv.h” #include “MyDetElem.h” static CnvFactory > s_factory; const ICnvFactory& XmlMyDetElemCnvFactory = s_factory; #include “DetDesc/XmlUserDetElemCnv.h” #include “MyDetElem.h” static CnvFactory > s_factory; const ICnvFactory& XmlMyDetElemCnvFactory = s_factory; Extending Detector Elements

July 3, /57Detector Description in LHCb – Extended version Full Customization – extension of the DTD to define new XML elements – parsing of the new XML code using the xerces parser – “real” converters to initialize C ++ objects according to XML

July 3, /57Detector Description in LHCb – Extended version The Element

July 3, /57Detector Description in LHCb – Extended version Writing a Converter  One needs : – to get a C ++ representation of the XML (DOM tree) – to deal with expressions and parameters – to reuse existing code (only convert specific XML elements !!!)

July 3, /57Detector Description in LHCb – Extended version Implementing the Converter  Real converter = 1. extension of XmlUserDetElemCnv 2. implementation of method StatusCode i_fillSpecificObj (DOM_Element, DeType*) – i_fillSpecificObj is called once per direct child of tag – the DOM_Element is given, the DeType object was created and must be populated – all other elements (not inside ) are automatically converted

July 3, /57Detector Description in LHCb – Extended version Converter Example (1) class XmlMyDetElemCnv : public XmlUserDetElemCnv { public: XmlMyDetElemCnv (ISvcLocator* svc); ~XmlMyDetElemCnv() {} protected: virtual StatusCode i_fillSpecificObj (DOM_Element childElement, MyDetElem* dataObj); }; static CnvFactory s_Factory; const ICnvFactory& XmlMyDetElemCnvFactory = s_Factory; XmlMyDetElemCnv::XmlMyDetElemCnv(ISvcLocator* svc) : XmlUserDetElemCnv (svc) {}

July 3, /57Detector Description in LHCb – Extended version Converter Example (2) StatusCode XmlMyDetElemCnv::i_fillSpecificObj (DOM_Element childElement, MyDetElem* dataObj) { std::string elementName = dom2Std (childElement.getNodeName()); if ("channelSet" == elementName) { const std::string name = dom2Std (childElement.getAttribute ("name")); const std::string description = dom2Std (childElement.getAttribute ("description")); dataObj->addChannelSet(name, description); … } else { … }

Panoramix

July 3, /57Detector Description in LHCb – Extended version Geometry Visualization  Visualization is essential for developing the geometry – Applicable at the different data representations  Generic geometry information conversion to 3D graphics data  Panoramix (OnX) Transient Store Structure + Geometry Visual CnvSvc G4 Geometry Giga CnvSvc Display Visual CnvSvc Display CnvSvcVis Display

July 3, /57Detector Description in LHCb – Extended version Panoramix – Events and Geometry viewer – Takes LHCb specificities into account » references » logical volumes hierarchy » subDetectors – Interactive move inside the geometry $LHCBSOFT/Vis/Panoramix/v*/scripts/panoramix(.bat)

July 3, /57Detector Description in LHCb – Extended version Panoramix GUI

July 3, /57Detector Description in LHCb – Extended version Event Visualization

July 3, /57Detector Description in LHCb – Extended version Zoom on Ecal

July 3, /57Detector Description in LHCb – Extended version The VisualizationSvc  A Gaudi service  Used by Panoramix/Geant4 converters  Allows independent customisation of visualization, shared by all visualization softwares  Takes into account : – colors (with alpha channel) – visibility – open status – display mode (wire Frame, Plain)

July 3, /57Detector Description in LHCb – Extended version Geant4

July 3, /57Detector Description in LHCb – Extended version Interfacing With Geant4  We integrate Gaudi with Geant4 by providing a number of “Gaudi Services” (GiGa)  The GiGaGeomCnvSvc is able to convert transient objects (DetElem, LVolume, Surfaces, etc.) into G4 geometry objects – The conversion does not require “user” code – Flexibility in mapping Gaudi model to Geant4 model  Single source of Geometry information

July 3, /57Detector Description in LHCb – Extended version GiGa Geometry Conversion  Unidirectional  Conversion of transient detector description (common) into Geant4 representation  Gaudi Conversion Service and Converters – Volumes & Surfaces – Materials  Instantiation of Sensitive Detector and Magnetic Field objects through Abstract Factory pattern Geo Conversion Service ConverterConverter Geant4Materials SensitiveDetectors Geant4Volumes Volumes Materials

July 3, /57Detector Description in LHCb – Extended version Condition Database

July 3, /57Detector Description in LHCb – Extended version Conditions DB  Detector conditions data (calibration, slow control, alignment, etc.) are characterized by: » Time validity period » Version  The conditions data objects will also appear in the Detector Transient Store  The persistency of conditions data is done with the Conditions DB (IT product)

July 3, /57Detector Description in LHCb – Extended version Condition Data Object  “Block” of data belonging to some detector element – coded in XML – seen as a BLOB by the database  Time (CondDBKey) validity range – [since, till] – CondDBKey is a 64 bit integer number. Sufficient flexibility (absolute time in ns, run number, etc.)  Version – Sequence version number  Extra information – Textual description, insertion time, etc.

July 3, /57Detector Description in LHCb – Extended version ConditionsDB: Integration in Gaudi Conditions DB ICondDataMgr ICondDataAccess DetectorData Service Algorithm Transient Detector Store Manages store Synchronization updates DetElement Geometry Info IGeometryInfo ReadOutCalibration IReadOut ICalibration IDetElement MuonStation Conditions DB Services request request: get, update reference beginEvent

July 3, /57Detector Description in LHCb – Extended version Conditions Conversion Service Conditions DB ICondDataMgr ICondDataAccess DetectorData Service Cnv address(folderName, tag, time) CondBase new{} MyCond update XML Conversion Service Persistency Service CondDB Conversion Service LHCb specific Transient Store

July 3, /57Detector Description in LHCb – Extended version Conditions DB Implementation  The databse used is ORACLE through the IT implementation of the interface already used for objectivity.  XML references are used to select between plain XML and condition DB : –  XML –  DataBase