190 likes | 338 Views
XML for LCD. Outline. The LCD project and a little something about GLAST Attraction of XML What it looks like (current implementation) New technology to watch. LCD Project.
E N D
XML for LCD J. Bogart XML Detector Descr. Workshop
Outline • The LCD project and a little something about GLAST • Attraction of XML • What it looks like (current implementation) • New technology to watch J. Bogart XML Detector Descr. Workshop
LCD Project The purpose of the Linear Collider Detector project is to evaluate different detector designs for a linear collider and eventually settle on one or two in light of the hoped-for physics and expected characteristics (energy range, backgrounds, …) of the collider. Efforts so far have centered on two fundamentally different designs, known as Small and Large. J. Bogart XML Detector Descr. Workshop
LCD Large S design has magnet inside HAD J. Bogart XML Detector Descr. Workshop
GLAST Gamma-ray Large Area Space Telescope: a NASA project. The Stanford/SLAC proposal was recently approved. There has already been considerable development effort, including a recent (pre-apporval) testbeam run with a prototype at SLAC. The instrument is like a HEP detector in a box rather than a barrel. HEP tools and methods are used for simulation, reconstruction, etc., so the problem of how to represent the detector is fundamentally the same. J. Bogart XML Detector Descr. Workshop
GLAST Instrument The picture is old. Current design is a 4x4 array of towers. J. Bogart XML Detector Descr. Workshop
Environment • Both LCD and GLAST use Gismo, written in C++, for simulation; both will probably someday move to Geant4. • There are FastMC programs for LCD running in the Root environment and also in Java Analysis Studio. Reconstruction and analysis are done primarily in JAS. J. Bogart XML Detector Descr. Workshop
Attractions of XML Flexibility: extensible element design and ability to edit values easily LCD: Since the whole point of the exercise is to optimize the detector design, multiple descriptions must be supported and it must be straightforward to modify an existing design, preferably interactively. GLAST: Design is still being fine-tuned. Need support for rather different prototype and final design. J. Bogart XML Detector Descr. Workshop
More Attractions • Portable, accessible because text-based • Choice of programming interfaces (SAX or DOM) and languages (C++, Java,…) • Well-designed syntax with a standard behind it • Lots of free tools available, more coming J. Bogart XML Detector Descr. Workshop
largeParms2.xml Start subdetector description <lcdparm> <global file=“largeParms2.xml” /> <physical_detector topology=“large” id = “L2” > <volume id=“EM_BARREL” > <tube> <barrel_dimensions inner_r = “196.0” outer_z = “322.0” /> <layering n=“40”> <slice material = “Pb” width = “0.4” /> <slice material = “Tyvek” width = “0.05” /> <slice material = “Polystyrene” width = “0.1” sensitive = “yes” /> </layering> <segmentation theta = “300” phi = “300” /> </tube> <calorimeter type = “em” /> </volume> ... function End subdectector description J. Bogart XML Detector Descr. Workshop
detParms.dtd <!-- Mark-up language for lcd detector description, possibly other parms. --> <!ELEMENT lcdparm (global, physical_detector, proc_parm?)> <!ELEMENT global EMPTY> <!ATTLIST global file NMTOKEN #REQUIRED> <!ELEMENT physical_detector (volume | complex_volume)+ > <!ATTLIST physical_detector topology (large | small) #REQUIRED id ID #IMPLIED> <!ELEMENT volume ((tube | disk | cone), (calorimeter | tracker | coil | cryo | support)?) > <!ATTLIST volume id ID #REQUIRED inter_len_cm NMTOKEN #IMPLIED rad_len_cm NMTOKEN #IMPLIED> comment content model element declaration attributes declarations J. Bogart XML Detector Descr. Workshop
Utilities Layer (generic) Low-level, to address deficiencies in DOM: class LCD_DocumentUtil { public: static bool convertValue(const DOMString& strVal, double *val); static bool convertValue(const DOMString& strVal, int *val); // ..and so forth } class LCD_DocumentImpl : public LCD_Document { public: DOM_Element getElement(DOMString id, DOMString elementName = DOMString("*")); } ..and others meant for use with DOM level 2 events. J. Bogart XML Detector Descr. Workshop
Utilities (DTD-specific) class LCD_DocGeoUtil { public: static double getLayerWidth(DOM_Element elt, bool all = false); static bool barrelDim(const DOM_Element& tube, double (*pInnerR, double *pOuterZ, double *pOuterR = 0); // ..and others for tube, disk, cone // Given a segmentation elt or something that contains one, return theta, phi divisions static bool getSegmentation(const DOM_Element& elt, double *nTheta, double *nPhi); } J. Bogart XML Detector Descr. Workshop
Choices - parser • Use DOM. Detector description files are not large enough to worry about. Random in-memory access is simpler to deal with, and will support interactive changes. • Validate. Screens out at least some errors. • Make use of defaults. Particularly important if detector description files are edited by hand. J. Bogart XML Detector Descr. Workshop
Choices – DTD design • Volume elements have two primary children: one for physical description and one to express function. See dtd slide • Volumes may have a number of identical layerswhich in turn may consist of slicesof different materials. • Materials database was kept elsewhere (historical; not a conscious decision) J. Bogart XML Detector Descr. Workshop
Lessons • Should have separated tranformation (translation, rotation) from definition of volume • Tried to express concept of “neighbor” but it was too simplistic, unusable. • More generic geometry description? Can consumer applications handle it? J. Bogart XML Detector Descr. Workshop
New Technology • Schemas should be a boon when spec and associated tools settle down. • explicit numeric datatypes • namespace support • object-like inheritance for element definitions • DOM 2 event model supports more interactive applications (but application-level validation could be a problem) J. Bogart XML Detector Descr. Workshop
New Technology (cont’d) • XSLT: don’t need to design a single schema for all applications as long as there is a way to translate documents from one type to another as needed. • Possibility to build on other initiatives • MathML content model for geometry, magnetic field modelling? • XML for Materials Property Data (MatML)? Just starting; nothing publicly available yet J. Bogart XML Detector Descr. Workshop
References • LCD (general): http://www-sldnt.slac.stanford.edu/nld/ • LCD (full dtd, xml documents): http://www.slac.stanford.edu/~jrb/nlc_detectors/ • GLAST: http://www-glast.stanford.edu/ • MatML: http://www.ceramics.nist.gov/matml/matml.htm J. Bogart XML Detector Descr. Workshop