The Calorimeter Detector Description

Slides:



Advertisements
Similar presentations
Sistemi basati su conoscenza XML Prof. M.T. PAZIENZA a.a
Advertisements

Introduction to XML This material is based heavily on the tutorial by the same name at
CVSQL 2 The Design. System Overview System Components CVSQL Server –Three network interfaces –Modular data source provider framework –Decoupled SQL parsing.
Conditions DB in LHCb LCG Conditions DB Workshop 8-9 December 2003 P. Mato / CERN.
XP Tutorial 9 1 Working with XHTML. XP SGML 2 Standard Generalized Markup Language (SGML) A standard for specifying markup languages. Large, complex standard.
Copyrighted material John Tullis 10/17/2015 page 1 04/15/00 XML Part 3 John Tullis DePaul Instructor
XML - DTD Week 4 Anthony Borquez. What can XML do? provides an application independent way of sharing data. independent groups of people can agree to.
CERN Tutorial, September Job Options and Printing.
Job Options and Printing 1 LHCb software tutorial - September 2011.
Gaudi Framework Tutorial, XML The persistent world.
GLAST Gaudi Code Review, 10 Sept. 2002, H. Kelly, 2-1 GLAST Event Data Model and Persistency.
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.
XML 2nd EDITION Tutorial 4 Working With Schemas. XP Schemas A schema is an XML document that defines the content and structure of one or more XML documents.
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.
N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER Charles Leggett Interval of Validity Service IOVSvc EDM Workshop Detector Description Session.
FTP Server API Implementing the FTP Server Registering FTP Command Callbacks Data and Control Port Close Callbacks Other Server Calls.
Detector Description in LHCb (Extended Version) Detector Description Workshop 4 July 2002 S. Ponce - CERN.
CHEP /21/03 Detector Description Framework in LHCb Sébastien Ponce CERN.
GAUDI Muon Software  Algorithms : Muon Digitization MuonL0Trigger MuonIdentification  Detector Description Database  Transient Detector Store  Detector.
Tutorial: Examples (09may00 - ATLAS Software LBNL) May 2000 Prototype Framework Tutorial: Examples Paolo Calafiura, Charles Leggett HCG/NERSC/LBNL.
Singleton Pattern. Problem Want to ensure a single instance of a class, shared by all uses throughout a program Context Need to address initialization.
Proposal for extension of GaudiAlgorithm and GaudiTool classes Vanya Belyaev CERN & ITEP/Moscow.
Gaudi Framework Tutorial, Algorithm Tools: what they are and how to use them.
Class Definitions and Writing Methods Chapter 3 3/31/16 & 4/4/16.
ENCAPSULATION. WHY ENCAPSULATE? So far, the objects we have designed have all of their methods and variables visible to any part of the program that has.
N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER Charles Leggett Transient Conditions/Detector Store using StoreGate ATLAS Software Workshop.
New Xml Converters General presentation of Xml converters The old way
Chapter 2 Objects and Classes
“Algorithm Tools” what they are, how to get them and how to use them
New Xml Converters General presentation of Xml converters The old way
Java Programming: Guided Learning with Early Objects
FUNCTIONS In C++.
GLAST Gaudi Review T. Burnett H.Kelly 10 Sept 02 Gaudi code review
Writing Physics Tools Schedule: Timing Topic 20 minutes Lecture
Handling Several Geometry Configurations in XML
Review: Two Programming Paradigms
University of Central Florida COP 3330 Object Oriented Programming
Potential Changes to Gaudi / Athena I/O
HEP detector description supporting the full experiment life cycle
This pointer, Dynamic memory allocation, Constructors and Destructor
Introduction to Classes
XML in LHCb Detector Description Framework Radovan Chytracek CERN
OOP Paradigms There are four main aspects of Object-Orientated Programming Inheritance Polymorphism Abstraction Encapsulation We’ve seen Encapsulation.
Variables ICS2O.
LHCb Detector Description Framework Radovan Chytracek CERN Switzerland
Various News From Detector Description
Detector Description in LHCb
Classes and Objects.
User-Defined Classes and ADTs
Tonga Institute of Higher Education
WebDAV Design Overview
Jeff West - Quiz Section 9
Object Oriented Programming in java
Data Structures & Algorithms
Quiz Points 1 Rules Raise your hand if you know the question
CS410 – Software Engineering Lecture #5: C++ Basics III
Detector Geometry Description
Use of GEANT4 in CMS The OSCAR Project
GAUDI Detector Description News Radovan Chytracek 5/1/2019
Detector description News
Variables in C Topics Naming Variables Declaring Variables
(4 – 2) Introduction to Classes in C++
Creating and Using Classes
SPL – PS2 C++ Memory Handling.
LHCb Detector Description Framework Radovan Chytracek CERN Switzerland
Presentation transcript:

The Calorimeter Detector Description 6 April 2000 The Calorimeter Detector Description The calorimeter problem Detector element and volumes Objects to produce Suggested XML and C++ improvements

Calorimeter Detector Description Disclaimer This is my own personal views This work was performed in December and January, to produce a first version of the Calorimeter Detector description. This work hasn't been reviewed by the Calorimeter group One of the result was to suggest improvements to the Gaudi team, which have been implemented for the next (= this week's) release. All mistakes and misunderstandings are mine. Calorimeter Detector Description 6 April 2000

Calorimeter Detector Description What is the problem ? Wanted functionality Get the position (x,y,z), the transverse size, and the list of neighbours of every calorimeter cell Approach Don't describe each cell in the database ! Describe the calorimeter as volumes containing cells of the same size, deduce from the big volume the wanted properties. All questions addressed to a Calorimeter Detector Element Allow a different cell numbering scheme for HCAL and ECAL+PreShower+SPD, keeping the same routines Calorimeter Detector Description 6 April 2000

Solution for the geometry Outer/Inner Cell size is a property of the Detector Element. Two independent halves For alignment. Need C-shaped volumes This is a subtraction of boxes. Put all that in a big box Handle also Z Calorimeter Detector Description 6 April 2000

Understand the structure DetectorElement A DetectorElement is an object you can talk to Can have properties, like CodingBit or CellSize Global calorimeter and Sub Calorimeter will be DetectorElements It is a logical volume and has a support, refereed to by a 'support' and a 'rpath' It has a classID to identify that this is a special DetectorElement This ID should match the ID in the C++ header file ! <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE DDDB SYSTEM "xmldb.dtd" [ <!ELEMENT CodingBit EMPTY> <!ATTLIST CodingBit value CDATA #REQUIRED> <!ELEMENT CellSize EMPTY> <!ATTLIST CellSize value CDATA #REQUIRED> ]> <DDDB> <detelem classID="8900" name="Ecal"> <author>Olivier Callot</author> <version>0.1</version> <geometryinfo logvol = "/dd/Geometry/lvEcal" support = "/dd/Structure/LHCb" rpath = "5" /> <detelemref classID="8901" href="#Outer"/> <detelemref classID="8901" href="#Inner"/> <specific> <CodingBit value="6"/> </specific> </detelem> <detelem classID="8901" name="Outer"> <geometryinfo logvol = "/dd/Geometry/lvEcalOuter" support = "/dd/Structure/LHCb/Ecal" rpath = "0" /> <CellSize value="123.96"/> Calorimeter Detector Description 6 April 2000

Calorimeter Detector Description Volumes A Logical Volume describes the shape Box Subtraction It has a name which should be unique, material,... It may contain Physical Volumes This is a positioned logical volume inside the current logical volume. It has a name, which should be unique, and position attributes. <!-- ECAL from 12640 for 845+10 mm => center at 13067 Shashlik start at 86 mm from the front, for 435 mm => center off by -124 mm --> <logvol material="Vacuum" name="lvEcal"> <box sizeX="8000." sizeY="7000." sizeZ="855." name="lvEcalBox"/> <physvol name="pvEcalOuter" logvol="lvEcalOuter" x="0" y="0" z="-124" /> <physvol name="pvEcalInner" logvol="lvEcalInner" x="0" y="0" z="-124" /> </logvol> <logvol material="Vacuum" name="lvEcalOuter"> <box sizeX="8000." sizeY="7000." sizeZ="855." name="lvEcalBoxOuter"/> <physvol name="pvEcalOuterLeft" logvol="lvEcalOuterLeft" x="-1983.36" /> <physvol name="pvEcalOuterRight" logvol="lvEcalOuterRight" x=" 1983.36" /> <logvol material="Vacuum" name="lvEcalInner"> <box sizeX="2500." sizeY="2000." sizeZ="855." name="lvEcalBoxInner"/> <physvol name="pvEcalInnerLeft" logvol="lvEcalInnerLeft" x="-619.80" /> <physvol name="pvEcalInnerRight" logvol="lvEcalInnerRight" x=" 619.80" /> !-- Outer: 32 * 52 cells of 123.96 - 10 * 16 cells --> <logvol material="Vacuum" name="lvEcalOuterLeft"> <subtraction name="boxEcalOuterLeft"> <box sizeX="3966.72" sizeY="6445.92" sizeZ="435" name="boxEOLMain"/> <box sizeX="1239.60" sizeY="1983.36" sizeZ="435" x="-1363.56" y=0" z="0" name="boxEOLSubtracted"/> </subtraction> <logvol material="Vacuum" name="lvEcalOuterRight"> <subtraction name="boxEcalOuterRight"> <box sizeX="3966.72" sizeY="6445.92" sizeZ="435" name="boxEORMain"/> <box sizeX="1239.60" sizeY="1983.36" sizeZ="435" x= "1363.56" y="0" z="0" name="boxEORSubtracted"/> Calorimeter Detector Description 6 April 2000

Calorimeter Detector Description Other files General files lhcb.xml defines the complete detector. The order defines the rpath value. This means that if you change the order in this file, you have to change a value in other files. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE DDDB SYSTEM "xmldb.dtd"> <DDDB> <detelem classID="2" name="LHCb" type="passive"> <author>Radovan Chytracek</author> <version>0.1</version> <geometryinfo logvol="/dd/Geometry/lvLHCb"/> <detelemref classID="9999" href="vertex.xml#Vertex"/> <detelemref classID="2" href="rich1.xml#RICH1"/> <detelemref classID="2" href="shield.xml#Shield"/> <detelemref classID="2" href="magnet.xml#Magnet"/> <detelemref classID="2" href="tracker.xml#Tracker"/> <detelemref classID="2" href="rich2.xml#RICH2"/> <detelemref classID="8900" href="ecal.xml#Ecal"/> <detelemref classID="8900" href="hcal.xml#Hcal"/> <detelemref classID="2" href="muon.xml#Muon"/> </detelem> <logvol name="lvLHCb" material="Vacuum"> <box name="caveBox" sizeX="50000" sizeY="50000" sizeZ="50000"/> <physvol name="VertexSubsystem" x="0" y="0" z="0" logvol="lvVertex" /> <physvol name="RICH1Subsystem" x="0" y="0" z="1500" logvol="lvRICH1" /> <physvol name="ShieldSubsystem" x="0" y="0" z="2500" logvol="lvShield" /> <physvol name="MagnetSubsystem" x="0" y="0" z="5000" logvol="lvMagnet" /> <!-- This is a problem, left out <physvol name="TrackerSubsystem" x="0" y="0" z="0" logvol="/dd/Geometry/lvTracker" /> --> <physvol name="RICH2Subsystem" x="0" y="0" z="10500" logvol="lvRICH2" /> <physvol name="EcalSubsystem" x="0" y="0" z="13067" logvol="lvEcal" /> <physvol name="HcalSubsystem" x="0" y="0" z="14157.5" logvol="lvHcal" /> <physvol name="MuonSubsystem" x="0" y="0" z="16000" logvol="lvMuon" /> </logvol> </DDDB> Calorimeter Detector Description 6 April 2000

Calorimeter Detector Description catalog.xml defines the list of geometry files This file contains also Material and Structure catalogues Per detector ecal_geometry.xml lists (references) the various logical volumes which are defined in ecal.xml Its need is unclear for me now… <catalog name="Geometry"> <logvolref href="lhcb.xml#lvLHCb" /> &vertex_geometry; &rich1_geometry; &shield_geometry; &magnet_geometry; &tracker_geometry; &rich2_geometry; &ecal_geometry; &hcal_geometry; &muon_geometry; </catalog> <logvolref href="ecal.xml#lvEcal" /> <logvolref href="ecal.xml#lvEcalOuter" /> <logvolref href="ecal.xml#lvEcalInner" /> <logvolref href="ecal.xml#lvEcalOuterLeft" /> <logvolref href="ecal.xml#lvEcalOuterRight" /> <logvolref href="ecal.xml#lvEcalInnerLeft" /> <logvolref href="ecal.xml#lvEcalInnerRight" /> Calorimeter Detector Description 6 April 2000

Calorimeter Detector Description C++ Code Detector Elements Need one special Detector Element as soon as one wants some special property. This implies DeCalorimeter.cpp and DeCalorimeter.h with the proper classID XmlDeCalorimeter.cpp and XmlDeCalorimeter.h to convert the XML file and create the detector element This file is full of technicalities, only a few lines are specific. See later Four files for each new type of detector element We have DeSubCalorimeter just to return the cell size... const CLID& CLID_DECalorimeter = 8900; // User defined Calorimeter Detector Description 6 April 2000

Calorimeter Detector Description #include <cstdlib> #include <string> #include "Gaudi/Interfaces/ICnvManager.h" #include "Gaudi/Interfaces/ICnvFactory.h" #include "Gaudi/Kernel/CnvFactory.h" #include "Gaudi/MessageSvc/MsgStream.h" #include "DetDesc/XmlCnvSvc/XmlCnvAttrList.h" #include "DetDesc/XmlCnvSvc/IXmlCnv.h" #include "Gaudi/DataSvc/SmartDataPtr.h" #include "Calo/Xml/XmlCalorimeterCnv.h" #include "Calo/DetectorElement/DeCalorimeter.h" extern unsigned char XML_StorageType; extern const CLID& CLID_DetectorElement; /// Instantiation of a static factory class used by clients to create /// instances of this service static CnvFactory<XmlCalorimeterCnv> calost_factory; const ICnvFactory& XmlCalorimeterCnvFactory = calost_factory; const unsigned char& XmlCalorimeterCnv::storageType() { return XML_StorageType; } /// Report to outside the class ID this converter is used for const CLID& XmlCalorimeterCnv::classID() { return CLID_DECalorimeter; /// Constructor XmlCalorimeterCnv::XmlCalorimeterCnv(ISvcLocator* svc) : Converter( XML_StorageType, CLID_DECalorimeter, svc ), m_deCnv( 0 ), m_dataObj( 0 ) { StatusCode st = serviceLocator()->getService( "DetectorDataSvc", IID_IDataProviderSvc, (IInterface*&)m_detSvc); /// Desctructor XmlCalorimeterCnv::~XmlCalorimeterCnv() { Calorimeter Detector Description 6 April 2000

Calorimeter Detector Description /// Initialize the converter StatusCode XmlCalorimeterCnv::initialize() { // Initialize the grand father StatusCode status = Converter::initialize(); ICnvManager* cnvMgr; MsgStream log( messageService(), "XmlCaloCnv" ); log << MSG::DEBUG << "Initializing calorimeter detector element converter" << endreq; if( status.isSuccess() ) { status = serviceLocator()->queryInterface(IID_ICnvManager,(void **)&cnvMgr ); IXmlCnv* xmlCnv; const ICnvFactory* cf = cnvMgr->factory( XML_StorageType, CLID_DetectorElement ); m_deCnv = cf->instantiate( serviceLocator() ); try { xmlCnv = dynamic_cast<IXmlCnv*>(m_deCnv); } catch( ... ) { log << MSG::FATAL << "Can't get generic detector element converter" << endreq; return StatusCode::FAILURE; } // Must be initialized status = m_deCnv->initialize(); // Register myself as the recevier of User ASCII XML SAX events xmlCnv->setUserSaxDocHandler( *this ); cnvMgr->release(); return status; /// Finalize the converter StatusCode XmlCalorimeterCnv::finalize() { // RIP dear grand father! return Converter::finalize(); Calorimeter Detector Description 6 April 2000

Calorimeter Detector Description StatusCode XmlCalorimeterCnv::createObj( IOpaqueAddress* pAddress, DataObject*&refpObject) { MsgStream log( messageService(), "XmlCaloCnv"); log << MSG::DEBUG << "Converting ..." << endreq; m_dataObj = new DeCalorimeter(); StatusCode sc = m_deCnv->createObj( pAddress, (DataObject*&)m_dataObj ); if( sc.isFailure() ) { log << MSG::DEBUG << "Failure Converting DeCalorimeter..." << endreq; delete m_dataObj; } else { refpObject = m_dataObj; } return sc; /// Update the transient object from the other representation. StatusCode XmlCalorimeterCnv::updateObj( IOpaqueAddress* pAddress, DataObject* pObject) { return StatusCode::SUCCESS; /// Convert the transient object to the requested representation StatusCode XmlCalorimeterCnv::createRep( DataObject* pObject, IOpaqueAddress*& refpAddress) /// Update the converted representation of a transient object. StatusCode XmlCalorimeterCnv::updateRep( IOpaqueAddress* pAddress, StatusCode XmlCalorimeterCnv::fillObjRefs( IOpaqueAddress* pAddress, DataObject* pObject) { /// Parsed character data callback void XmlCalorimeterCnv::uCharacters( const char* const chars, const unsigned int length ) { Calorimeter Detector Description 6 April 2000

Calorimeter Detector Description MsgStream log( messageService(), "XmlCaloCnv" ); log << MSG::DEBUG << "\"" << chars << "\"" << endreq; //if( "stations" == context() ) { // log << MSG::DEBUG << "\"" << chars << "\"" << endreq; //} } /// White space characters callback void XmlCalorimeterCnv::uIgnorableWhitespace( const char* const chars, const unsigned int length ) { /// Start of the XML element callback void XmlCalorimeterCnv::uStartElement( const char* const name, XmlCnvAttributeList& attributes) { std::string tagName( name ); log << MSG::DEBUG << "<" << tagName << " "; for( unsigned int i = 0; i < attributes.getLength(); i++ ) { log << MSG::DEBUG << attributes.getName(i) << "=" << attributes.getValue(i) << " " << attributes.getType(i) << " "; ; log << ">" << endreq; if( tagName == "CodingBit" ) { // get a value of the 'value' attribute std::string value = attributes.getValue( "value" ); if( !value.empty() ) { log << MSG::DEBUG << "value has value : " << value << endreq; log << MSG::DEBUG << "value has converted value : " << atoi(value.c_str()) << endreq; m_dataObj->setCoding( atoi(value.c_str()) ); else { // Unknown tag, a warning message can be issued here /// End of the XML element callback void XmlCalorimeterCnv::uEndElement( const char* const name ) { log << MSG::DEBUG << "</" << name << ">" << endreq; Calorimeter Detector Description 6 April 2000

Calorimeter Detector Description Suggested changes Reported to the Gaudi team Several minor problems... File structure improved. It was more complex before XML syntax to be improved Use of units to specify millimetres, metres, … Use of logical units Define a cell size Define the calorimeter size as 64 cells in X and 52 in Y Default values for non specified quantities Do we need to specify x = "0" each time ? Unique names is sometimes a nuisance Could be built from the hierarchy Not always needed Calorimeter Detector Description 6 April 2000

Calorimeter Detector Description Hardcoding the classID in XML and C++ is no good. Who is allocating the numbers ? One should avoid copies of long code with only minor changes This is a long term maintenance issue Referencing files by there order in another file (rpath) is a maintenance issue ! The lhcb.xml file defines the rpath to use in ecal.xml Can I add the SPD without affecting ECAL, HCAL, MUON files ? I had very good support My requests were acknowledged, and handled I hope the new release will allow an easier use of the XML database, and a simplified DetectorElement C++ code. Calorimeter Detector Description 6 April 2000