1 / 31

AGDD: Atlas Generic Detector Description in XML

AGDD: Atlas Generic Detector Description in XML. Christian Arnault, Stan Bentvelsen, Steven Goldfarb, Julius Hrivnac, Jean-François Laporte, Christopher Lester, RD Schaffer, Marc Virchaux. XML workshop Berkeley - May 2000. Detector description framework. Goal AGDD database

sinjin
Download Presentation

AGDD: Atlas Generic Detector Description in XML

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. AGDD:Atlas Generic Detector Descriptionin XML Christian Arnault, Stan Bentvelsen, Steven Goldfarb, Julius Hrivnac, Jean-François Laporte, Christopher Lester, RD Schaffer, Marc Virchaux XML workshop Berkeley - May 2000

  2. Detector description framework • Goal • AGDD database • geometry database • material database • identifier scheme • The generic model • parsing to transient C++ objects • Tools • Visualisation • Geant4 builder • Conclusions Stan Bentvelsen

  3. Detector description: Goals • Goals • single source generic detector description information • independent of client: visualisation, simulation, reconstruction, ... • not depend on client specific constraints • such as Geant optimisations, reconstruction algorithms, ... • not limited to geometrical information • (independent) logical organisation of the detector • geometry vs readout tree • additional parameters - reconstruction,... • description of materials • support simple relationship with alignment database • simple and portable implementation: XML • flexible & extensible description Stan Bentvelsen

  4. The architecture Persistency -Objectivity- Factory Generic Model Transient C++ objects AGDD xml-files Factory Visitor Geant4 generic builder PERSINT visualisation Reconstruction Visitor GraXML visualisation Stan Bentvelsen

  5. Creation of ‘Volumes’ Generic and descriptive Elementairy Solids Basic building blocks, described by shape, dimensions and material box tube, etc... Boolean Solids Boolean operations union subtraction, etc... Logical grouping of Volumes Create composite volumes composition stack, etc... Positioning of ‘Volumes’ Description of the instantiation of the volumes Absolute or relative, single or multiple positioners Define the translation and rotation matrix of a volume wrt the origin of the constituents, through parameterized algorithms posXYZ mposPhi axisPos, etc... Inspired by Geant The geometry database Stan Bentvelsen

  6. AGDD_Union AGDD_Subtraction AGDD_Intersection AGDD_StackX AGDD_StackY AGDD_StackZ AGDD_Box AGDD_Trapezoid AGDD_Tubes AGDD_Cons Transient model: volume hierarchy AGDD_Volume Logical grouping of volumes AGDD_Solid AGDD_Boolean AGDD_Composition AGDD_Stack Stan Bentvelsen

  7. Documentation Volume specific name ID, units, parameters Solid specific material IDREF Definition box Creation of Volumes • Definition ‘box’ in DTD: Stan Bentvelsen

  8. Solid creation with shape, dimensions & material IDREF to a parameter block allow to attach arbitrary numbers to any volume detector view specific information useful in e.g. Reconstruction parameters acquire name, value, unit and comment attributes Holadieje AGDD implementation: box Stan Bentvelsen

  9. gap0 shift0 a0 O1 gap shift a O1 O2 gap shift a O1 gap0 O2 shift0 b0 shift b gap O2 Positioning volumes Single Absolute Positioners Multiple Absolute Positioners Single Relative Positioners Multiple Relative Positioners O O O O R0 Phi0 Z0 gap a XYZ RPhiZ shift O1 O1 O1 dR dPhi dZ gap b shift O1 <composition ...> <posXYZ volume=O1 ../> </composition> <composition ...> <mposZ volume=O1 ../> </composition> <stackZ ...> <axisPos volume=O1 gap=a ../> <axisPos volume=O2 gap=b ../> </stackZ> <stackZ ...> <axisMPos volume=O1 shift0=a0 shift=a ../> <axisMPos volume=O2 shift0=b0 shift=b ../> </stackZ> Stan Bentvelsen

  10. Stack example Stack: reduce number-dependencies in AGDD source Stan Bentvelsen

  11. This hierarchy is subject to future changes/modifications AGDD_MPosPhi AGDD_MPosR AGDD_MPosX AGDD_MPosY AGDD_MPosZ Transient model positioning hierarchy AGDD_AbsolutePosition AGDD_RelativePosition AGDD_SinglePosition AGDD_MultiplePosition AGDD_AxisPos AGDD_AxisMPos AGDD_PosXYZ AGDD_PosRPhiZ Used in Stack Volumes Used in Composition Volumes Stan Bentvelsen

  12. Impose file-hierarchy on geometry description Place all geometries inside a ‘section’ typically one section in a file all attributes are required Name Short descriptive name; each volume is prepended with this name Version, date, author To keep track of the geometry version Top_volume Envelope volume name corresponding to the section DTD_version Only allowed value equals current DTD version Allow parallel development various parts of description implementation Administration & versioning Stan Bentvelsen

  13. Material definitions in separate XML tree Rudimentary DB for materials set-up define the elements create composite materials Material name provide the XML ID Reference (IDREF) to materials in definition of ‘Solids’ todo: material forms, pressure, state, etc. The material database Stan Bentvelsen

  14. Some materials Excerpt from the material DB Some elements Stan Bentvelsen

  15. AGDD Header, version of DTD Section: sub-detector + author + version Creation solid: tube Various positioning of volumes Example: XML implementation Stan Bentvelsen

  16. The identification scheme • Logical identifiers • Identify each copy of each positioned volume • independent from the specific design of the geometry tree • ordered (can be used to key a map) • Mechanism to obtain the identifier in positioning algorithms • increment for multiple positioning Use ‘pre-defined’ identifiers, as well as introducing new ones • Identifier • field=“name” • value=“1” (step=“1”) • Ring • field= “ring” • value=“1” (step=“1”) • Layer • field=“layer”, value, step • Sector • field=“sector”, value, step Pre-defined Stan Bentvelsen

  17. Interaction with generic model via identifiers Ranges of identifiers specify a sub-set within a collection Specialized collection contains identifiable objects interfaced with ranges Use of Identifier Identifier a (“4/5/5”); Identifier b; b << 1; b << 23; b << 4; int system_id = a[0]; if (a < b) ... IdentifierMap detectors; detectors[a] = ecal; detectors[b] = muon; Range r1 (“1/*/3-4”); Range r2; r2.add (1); r2.add (); r2.add (3, 4); if (r2.match (a)) ... MuonSpectrometer/StationName/eta/phi_sector/MDT/multilayer/tube_layer/tube MuonSpectrometer/StationName/eta/phi_sector/RPC/doublet/strip_layer_pair/strip_layer/strip MuonSpectrometer/StationName/eta/phi_sector/TGC/chamber_layer/chamber/strip Stan Bentvelsen

  18. Graphical tools : GraXML (Java) Stan Bentvelsen

  19. Converting AGDD XML (1) • Various tools to convert the AGDD geometry to standard visualisation formats: • VRML 97 • X3D • See the next presentation of J. Hrivnac. • Inspect & debug geometry in 3D ‘cave’ • SARA Amsterdam • LBL Berkeley • Example of VRML 97 display of ATLAS Muon chamber Stan Bentvelsen

  20. Graphical tools : Persint Stan Bentvelsen

  21. Example: SCT in PERSINT • DICE geometry • AGDD file provided by Lester • PERSINT visualisation • Nice features like • interactive selection • material colouring • object removal Stan Bentvelsen

  22. G4Builder: interface to GEANT4 • Set of classes, as client to the generic model, to transform the AGDD description to Geant4 geometry • Make use of the Material database in AGDD • Generic, i.e. Detector independent. • Price paid in speed • Track particles through geometry • Example: Scan geantinos in (,) to determine characteristics of the ATLAS SCT geometry Stan Bentvelsen

  23. G4Builder: scan (,) space • Accumulate observables along the trajectories • Lego plots • show the radiation lengths as a function of (,) • Tool to improve understanding and debug geometry? Example of Geant4 utility Stan Bentvelsen

  24. Creation and positioning of volumes require explicit numbers dimensions explicit positionings AGDD elements like ‘stack’ greatly reduced dependencies on numbers. Still dependencies remain, e.g. Users requests: possebility for expressions and evaluation of expressions in AGDD Do not want to extend AGDD syntax to include those. Possibilities? XSL Preprocessor like ‘m4’ A A Parameters in AGDD Stan Bentvelsen

  25. XSL (eXtensible Stylesheet Language) Infinite more ‘natural’ choice on top of XML possible to create a ‘calculator style sheet’ that resolves references? Needs more investigation and understanding AGDD to HTML conversion no problem Parameters in AGDD: XSL XML source file with parameters AGDD file Xalan XSL stylesheet calculator I am very curious to see a working example! Stan Bentvelsen

  26. ‘m4’ preprocessor define global parameters (m4-tags) in file-header reference to parameters inside attribute values can use ‘external’ shell calculator to perform simple arithmetic on parameters preprocessed file is XML-valid after pre-processing using m4: all parameters resolved Parameters in AGDD: m4 Stan Bentvelsen

  27. Conclusions • AGDD framework in XML provide useful and flexible DB for geometry, material and logical identifiers. • Parsing AGDD to transient C++ generic model, with clients connected via visitor pattern • Implement more ATLAS sub-detectors soon • bits and pieces of SCT, pixel, muon • Solve problem of variables and variable syntax (XML schema?) Stan Bentvelsen

  28. The DTD <!ENTITY % DTD_constraint'DTD_version ( v4 ) #REQUIRED'> <!ELEMENTAGDD ( materials | section )+> <!ATTLISTAGDD %DTD_constraint;> <!ELEMENTsection ( box | trd | tubs | cons | union | intersection | subtraction | composition | stackX | stackY | stackZ | parameters )+> <!ATTLISTsectionnameCDATA #REQUIREDtop_volumeIDREF #REQUIRED %DTD_constraint;> <!ENTITY % units'unit_length ( mm | m ) "mm” unit_angle ( deg | mrad ) "deg"'> <!ELEMENTidentifierEMPTY> <!ATTLISTidentifierfieldCDATA #REQUIREDvalueCDATA "0” stepCDATA "0"> <!ENTITY % solid_properties '%volume_properties; materialIDREF #REQUIRED sensitive ( true | false ) "false"'> <!ELEMENTboxEMPTY > <!ATTLISTboxX_Y_ZCDATA #REQUIRED %solid_properties; %units;> <!ENTITY % any_position ' posXYZ | posRPhiZ | mposR | mposPhi | mposX | mposY | mposZ '> <!ELEMENTcomposition ( %any_position; )+ > <!ATTLISTcomposition %volume_properties; envelopeIDREF #IMPLIED> <!ENTITY % any_relative_position ' axisPos | axisMPos '> <!ELEMENTstackX ( %any_relative_position; )+ > <!ATTLISTstackX %volume_properties;> <!ENTITY % position_properties'volumeIDREF #REQUIREDrotCDATA "0 0 0” %units; '> <!ELEMENTposXYZ ( %any_identifier; )* > <!ATTLISTposXYZX_Y_ZCDATA "0 0 0” %position_properties;> DTD keyword element or entity attribute value reference Stan Bentvelsen

  29. Identifier Range Range (const char* text); Range (const Identifier& min, const Identifier& max); void add (); void add (int value); void add (int minimum, int maximum); void add_minimum (int minimum); void add_maximum (int maximum); int match (const Identifier& id) const; const field& operator [] (int index) const; int fields () const; Identifier minimum () const; Identifier maximum () const; identifier_factory factory_begin (); const_identifier_factory factory_begin () const; identifier_factory factory_end (); const_identifier_factory factory_end () const; operator string () const; Identifier (); Identifier (const Identifier& other); Identifier (int numbers, ...); Identifier (const char* text); void add (int value); Identifier& operator << (int value); int& operator [] (int index); void clear (); int operator [] (int index) const; int fields () const; int operator == (const Identifier& other) const; int operator != (const Identifier& other) const; int operator < (const Identifier& other) const; int operator > (const Identifier& other) const; error_code last_error () const; operator string () const; Identifiable Identifier Identify () IdentifierMap iterator& end (); iterator begin (); iterator begin (const Identifier& id); iterator begin (const Range& r); void add (const Identifier& id, T* t); The identification scheme n Stan Bentvelsen

  30. AGDD_Factory XML4C_Factory Expat_Factory AGDD_Visitor AGDD_Strategy The C++ framework My_Visitor Decode the source file, instanciate objects: Sections, Volumes, Positions, Shapes, Materials Navigate the generic description, and applies specific algorithms on each object. My_Strategy class G4_BuildMaterial : public AGDD_Visitor { void visit_element (AGDD_Element* material); void visit_composite (AGDD_Composite* material); }; class G4_BuildDetector : public AGDD_Visitor { void visit_section (...) { std::cout << ... } void visit_solid (...); }; Stan Bentvelsen

  31. AGDD_Factory AGDD_Factory& Expat_instance (); AGDD_Factory& XML4C_instance (); void build_materials (file_name); void build_detector_description (file_name); AGDD* get_detector_description (); Generic description The C++ framework Void main () { G4_BuildMaterial material_builder; G4_BuildDetector detector_builder; AGDD* agdd = factory.get_detector_description (); material_builder.run (agdd); detector_builder.run (agdd); } XML source file .. .. .. .. .. Specific views to the detector description Formatter G4 volumes Visualisation Reconstruction model ... Stan Bentvelsen

More Related