DD4hep
1.30.0
Detector Description Toolkit for High Energy Physics
|
Namespace for the AIDA detector description toolkit supporting XML utilities. More...
Namespaces | |
cond | |
Namespace of conditions unicode tags. | |
tools | |
Declaration of the XML tools namespace. | |
Classes | |
class | Collection_t |
Class to support the access to collections of XmlNodes (or XmlElements) More... | |
class | Document |
Class supporting the basic functionality of an XML document. More... | |
class | DocumentErrorHandler |
XML-DOM ERror handler class for the XercesC document parser. More... | |
class | DocumentHandler |
Class supporting to read and parse XML documents. More... | |
class | DocumentHolder |
Class supporting the basic functionality of an XML document including ownership. More... | |
class | Element |
User abstraction class to manipulate XML elements within a document. More... | |
class | Handle_t |
Class to easily access the properties of single XmlElements. More... | |
class | LayeringCnv |
XML converter for layering objects. More... | |
class | NodeList |
Class describing a list of XML nodes. More... | |
class | RefElement |
User abstraction class to manipulate named XML elements (references) within a document. More... | |
class | Strng_t |
Helper class to encapsulate a unicode string. More... | |
class | Tag_t |
Class to support both way translation between C++ and XML strings. More... | |
class | UriContextReader |
Class supporting to read data given a URI. More... | |
class | UriReader |
Class supporting to read data given a URI. More... | |
class | XmlString |
Definition of the XmlString class. More... | |
Typedefs | |
typedef std::size_t | XmlSize_t |
typedef XERCES_XMLCH_T | XmlChar |
Use the definition from the autoconf header of Xerces: More... | |
typedef const XmlAttr * | Attribute |
typedef const std::string & | CSTR |
typedef const XmlChar * | cpXmlChar |
typedef xercesc::DOMException | XmlException |
Functions | |
Transform3D | createTransformation (xml::Element element) |
Create layered transformation from xml information. More... | |
Volume | createStdVolume (Detector &description, xml::Element element) |
Create a simple volume using the shape plugin mechanism from the attributes of the XML element. More... | |
Volume | createVolume (Detector &description, const std::string &type, xml::Element element) |
Create a volume using the plugin mechanism from the attributes of the XML element. More... | |
Solid | createShape (Detector &description, const std::string &shape_type, xml::Element element) |
Create a solid shape using the plugin mechanism from the attributes of the XML element. More... | |
Volume | createPlacedEnvelope (dd4hep::Detector &description, dd4hep::xml::Handle_t e, dd4hep::DetElement sdet) |
void | setDetectorTypeFlag (dd4hep::xml::Handle_t e, dd4hep::DetElement sdet) |
std::size_t | configVolume (dd4hep::Detector &detector, dd4hep::xml::Handle_t element, dd4hep::Volume volume, bool propagate, bool ignore_unknown_attr=false) |
Configure volume properties from XML element. More... | |
std::size_t | configSensitiveDetector (dd4hep::Detector &detector, dd4hep::SensitiveDetector sensitive, dd4hep::xml::Handle_t element) |
Configure sensitive detector from XML element. More... | |
void | dumpTree (XmlDocument *doc) |
Dump DOM tree of a document. More... | |
int | set_float_precision (int precision) |
Change floating point precision on conversion to string. More... | |
int | get_float_precision () |
Access floating point precision on conversion to string. More... | |
std::string | _toString (const Attribute attr) |
Convert xml attribute to STL string. More... | |
std::string | _toString (const XmlChar *toTranscode) |
Convert xml string to STL string. More... | |
std::string | _toString (const char *s) |
Do-nothing version. Present for completeness and argument interchangeability. More... | |
std::string | _toString (const std::string &s) |
Do-nothing version. Present for completeness and argument interchangeability. More... | |
std::string | _toString (unsigned long i, const char *fmt="%lu") |
Format unsigned long integer to string with arbitrary format. More... | |
std::string | _toString (unsigned int i, const char *fmt="%u") |
Format unsigned integer (32 bits) to string with arbitrary format. More... | |
std::string | _toString (int i, const char *fmt="%d") |
Format signed integer (32 bits) to string with arbitrary format. More... | |
std::string | _toString (long i, const char *fmt="%ld") |
Format signed long integer to string with arbitrary format. More... | |
std::string | _toString (float d, const char *fmt="%.17e") |
Format single procision float number (32 bits) to string with arbitrary format. More... | |
std::string | _toString (double d, const char *fmt="%.17e") |
Format double procision float number (64 bits) to string with arbitrary format. More... | |
std::string | _ptrToString (const void *p, const char *fmt="%p") |
Format void pointer (64 bits) to string with arbitrary format. More... | |
template<typename T > | |
std::string | _toString (const T *p, const char *fmt="%p") |
Format void pointer (64 bits) to string with arbitrary format. More... | |
void | _toDictionary (const XmlChar *name, const XmlChar *value) |
Helper function to populate the evaluator dictionary. More... | |
template<typename T > | |
void | _toDictionary (const XmlChar *name, T value) |
Helper function to populate the evaluator dictionary. More... | |
void | _toDictionary (const XmlChar *name, float value) |
Helper function to populate the evaluator dictionary. More... | |
void | _toDictionary (const XmlChar *name, double value) |
Helper function to populate the evaluator dictionary. More... | |
bool | _toBool (const XmlChar *value) |
Conversion function from raw unicode string to bool. More... | |
int | _toInt (const XmlChar *value) |
Conversion function from raw unicode string to int. More... | |
unsigned int | _toUInt (const XmlChar *value) |
Conversion function from raw unicode string to unsigned int. More... | |
long | _toLong (const XmlChar *value) |
Conversion function from raw unicode string to long. More... | |
unsigned long | _toULong (const XmlChar *value) |
Conversion function from raw unicode string to unsigned long. More... | |
float | _toFloat (const XmlChar *value) |
Conversion function from raw unicode string to float. More... | |
double | _toDouble (const XmlChar *value) |
Conversion function from raw unicode string to double. More... | |
std::string | getEnviron (const std::string &env) |
Helper function to lookup environment from the expression evaluator. More... | |
bool | enableEnvironResolution (bool new_value) |
Enable/disable environment resolution when parsing strings. More... | |
Strng_t | operator+ (const Strng_t &a, const char *b) |
Unicode string concatenation of a normal ASCII string from right side. More... | |
Strng_t | operator+ (const Strng_t &a, const std::string &b) |
Unicode string concatenation of a encapsulated and an STL string from right side. More... | |
Strng_t | operator+ (const Strng_t &a, const Strng_t &b) |
Unicode string concatenation of a encapsulated and an encapsulated string from right side. More... | |
Strng_t | operator+ (const char *a, const Strng_t &b) |
Unicode string concatenation of a normal ASCII string from left side. More... | |
Strng_t | operator+ (const std::string &a, const Strng_t &b) |
Unicode string concatenation of a STL string and an encapsulated string from the left. More... | |
Strng_t | operator+ (const Strng_t &a, const XmlChar *b) |
Unicode string concatenation of a encapsulated and raw unicode string from right side. More... | |
Strng_t | operator+ (const XmlChar *a, const Strng_t &b) |
Unicode string concatenation of a encapsulated and raw unicode string from left side. More... | |
Strng_t | operator+ (const XmlChar *a, const std::string &b) |
Unicode string concatenation of a raw unicode and an STL string from the right. More... | |
Strng_t | operator+ (const std::string &a, const XmlChar *b) |
Unicode string concatenation of a raw unicode and an STL string from the left. More... | |
Tag_t | operator+ (const Tag_t &a, const char *b) |
Tag/string concatenation with a normal ASCII string from right side. More... | |
Tag_t | operator+ (const char *a, const Tag_t &b) |
Tag/string concatenation with a normal ASCII string from left side. More... | |
Tag_t | operator+ (const Tag_t &a, const XmlChar *b) |
Tag/string concatenation with a unicode string from right side. More... | |
Tag_t | operator+ (const Tag_t &a, const Strng_t &b) |
Tag/string concatenation with a internal Xml string from right side. More... | |
Tag_t | operator+ (const Tag_t &a, const std::string &b) |
Tag/string concatenation with a STL string from right side. More... | |
bool | operator== (const std::string &c, const Tag_t &b) |
Equality operator between tag object and STL string. More... | |
std::string | _toString (const Strng_t &s) |
Convert Strng_t to std::string. More... | |
std::string | _toString (const Tag_t &s) |
Convert Tag_t to std::string. More... | |
void | _toDictionary (const XmlChar *name, const Strng_t &s) |
Helper function to populate the evaluator dictionary. More... | |
void | _toDictionary (const XmlChar *name, const Tag_t &t) |
Helper function to populate the evaluator dictionary. More... | |
template<> | |
INLINE std::string | Handle_t::attr< std::string > (const XmlChar *tag_value) const |
template<> | |
INLINE std::string | Handle_t::attr< std::string > (const XmlChar *tag_value, std::string default_value) const |
void | dump_tree (Handle_t elt) |
Dump partial or full XML trees to stdout. More... | |
void | dump_tree (Handle_t elt, std::ostream &os) |
Dump partial or full XML trees. More... | |
void | dump_tree (Document doc) |
Dump partial or full XML documents to stdout. More... | |
void | dump_tree (Document doc, std::ostream &os) |
Dump partial or full XML documents. More... | |
bool | setXMLParserDebug (bool new_value) |
Set debug print level for this module. Default is OFF. More... | |
void | parse (Handle_t e, RotationZYX &rot) |
Convert rotation XML objects to dd4hep::RotationZYX. More... | |
void | parse (Handle_t e, Position &pos) |
Convert XML position objects to dd4hep::Position. More... | |
void | parse (Handle_t e, Translation3D &tr) |
Convert XML pivot objects to dd4hep::Translation3D objects. More... | |
void | parse (Handle_t e, Delta &delta) |
Convert alignment delta objects to Delta. More... | |
void | parse_delta (Handle_t e, OpaqueDataBlock &block) |
Parse delta into an opaque data block. More... | |
void | parse_mapping (Handle_t e, OpaqueDataBlock &block) |
Converts opaque maps to OpaqueDataBlock objects. More... | |
void | parse_sequence (Handle_t e, OpaqueDataBlock &block) |
Converts linear STL containers from their string representation. More... | |
void | dumpTree (DOMNode *doc, std::ostream &os) |
Dump DOM tree using XercesC handles. More... | |
void | dump_doc (DOMDocument *doc, std::ostream &os) |
Dump DOM tree using XercesC handles. More... | |
void | tags_init () |
Variables | |
const Tag_t | Unicode_NULL ("NULL", "0", __Init::register_tag) |
const Tag_t | Unicode_empty ("", "", __Init::register_tag) |
const Tag_t | Unicode_star ("star", "*", __Init::register_tag) |
const Tag_t | Unicode_PI ("PI", "3.14159265358979323846", __Init::register_tag) |
const Tag_t | Unicode_TWOPI ("TWOPI", "6.28318530717958647692", __Init::register_tag) |
Namespace for the AIDA detector description toolkit supporting XML utilities.
Namespace containing utilities to parse XML files using XercesC or TinyXML.
typedef const XmlAttr* dd4hep::xml::Attribute |
Definition at line 38 of file XMLElements.h.
typedef const XmlChar* dd4hep::xml::cpXmlChar |
Definition at line 526 of file XMLElements.h.
typedef const std::string& dd4hep::xml::CSTR |
Definition at line 95 of file XMLElements.h.
typedef XERCES_XMLCH_T dd4hep::xml::XmlChar |
typedef xercesc::DOMException dd4hep::xml::XmlException |
Definition at line 53 of file DetectorImp.cpp.
typedef std::size_t dd4hep::xml::XmlSize_t |
std::string dd4hep::xml::_toString | ( | const Strng_t & | s | ) |
Convert Strng_t to std::string.
Definition at line 301 of file XMLElements.cpp.
std::string dd4hep::xml::_toString | ( | const Tag_t & | s | ) |
Convert Tag_t to std::string.
Definition at line 306 of file XMLElements.cpp.
std::size_t dd4hep::xml::configSensitiveDetector | ( | dd4hep::Detector & | detector, |
dd4hep::SensitiveDetector | sensitive, | ||
dd4hep::xml::Handle_t | element | ||
) |
Configure sensitive detector from XML element.
Example: <some-xml-tag debug="true"> <combine_hits value="true"> <verbose value="true"> <type value="tracker"> <ecut value="5*keV"> <hits_collection value="hits_collection_5"> </some-xml-tag>
Definition at line 378 of file Utilities.cpp.
std::size_t dd4hep::xml::configVolume | ( | dd4hep::Detector & | detector, |
dd4hep::xml::Handle_t | element, | ||
dd4hep::Volume | volume, | ||
bool | propagate, | ||
bool | ignore_unknown_attr = false |
||
) |
Configure volume properties from XML element.
Example: <volume> <regionref name="world_region"> <limitsetref name="world_limits"> <visref name="world_vis"> </volume>
with dd4hep::Detector& detector: Handle to dd4hep Detector instance dd4hep::xml::Handle_t element: XML element <volume> dd4hep::Volume volume: the volume to be configured. bool propagate: apply setting also to all children bool ignore_unknown_attr: Ignore unknown attrs
Definition at line 331 of file Utilities.cpp.
dd4hep::Volume dd4hep::xml::createPlacedEnvelope | ( | dd4hep::Detector & | description, |
dd4hep::xml::Handle_t | e, | ||
dd4hep::DetElement | sdet | ||
) |
Create an envelope volume that is placed into the world volume (the parent volume of sdet) from an xml element <envelope/> with child nodes <shape/> and optionally <position/> and <rotation/>. For special cases no volume but an assembly can be created with <shape type="Assembly"/>. Example:
<envelope vis="ILD_ECALVis"> <shape type="PolyhedraRegular" numsides="8" rmin="TPC_outer_radius+Ecal_Tpc_gap" rmax="Ecal_outer_radius" dz="2.*TPC_Ecal_Hcal_barrel_halfZ" material = "Air" /> <rotation x="0*deg" y="0*deg" z="90*deg-180*deg/8"/> </envelope>
Definition at line 220 of file Utilities.cpp.
dd4hep::Solid dd4hep::xml::createShape | ( | Detector & | description, |
const std::string & | shape_type, | ||
xml::Element | element | ||
) |
Create a solid shape using the plugin mechanism from the attributes of the XML element.
Definition at line 84 of file Utilities.cpp.
dd4hep::Volume dd4hep::xml::createStdVolume | ( | Detector & | description, |
xml::Element | element | ||
) |
Create a simple volume using the shape plugin mechanism from the attributes of the XML element.
Create a volume using the plugin mechanism from the attributes of the XML element.
Trigger on:
<volume name="..." type="Assembly"> or <volume name="..." material="Air">
<shape .... /> or <volume .... />
optional: <position x="0" ... /> <rotation x="0" ... /> </volume>
Trigger on:
<shape name="Assembly" type="Assembly"> <shape .... /> <position x="0" ... /> <rotation x="0" ... /> </shape>
Definition at line 100 of file Utilities.cpp.
dd4hep::Transform3D dd4hep::xml::createTransformation | ( | xml::Element | element | ) |
Create layered transformation from xml information.
The xml content of the information supposedly looks like this: <transformation> <position> <rotation x="-90*degree"> <position> <rotation y="-90*degree"> <position x="CutX" y=" 0.5*YokeHorHeight" z="-0.5*(YokeHorD1+YokeHorA1)"> <rotation x="-HoleAngle"> <position> <rotation z="CutTrapTheta"> </transformation>
Every pair position, rotation will be combined to a Transform3D and combined to the resulting transformation.
Definition at line 42 of file Utilities.cpp.
dd4hep::Volume dd4hep::xml::createVolume | ( | Detector & | description, |
const std::string & | type, | ||
xml::Element | element | ||
) |
Create a volume using the plugin mechanism from the attributes of the XML element.
Definition at line 197 of file Utilities.cpp.
void dd4hep::xml::dump_doc | ( | DOMDocument * | doc, |
std::ostream & | os | ||
) |
Dump DOM tree using XercesC handles.
Definition at line 236 of file DocumentHandler.cpp.
void dd4hep::xml::dump_tree | ( | Document | doc | ) |
Dump partial or full XML documents to stdout.
Definition at line 704 of file DocumentHandler.cpp.
void dd4hep::xml::dump_tree | ( | Document | doc, |
std::ostream & | os | ||
) |
Dump partial or full XML documents.
Dump DOM tree using XercesC handles.
Definition at line 244 of file DocumentHandler.cpp.
void dd4hep::xml::dump_tree | ( | Handle_t | elt | ) |
Dump partial or full XML trees to stdout.
Definition at line 699 of file DocumentHandler.cpp.
void dd4hep::xml::dump_tree | ( | Handle_t | elt, |
std::ostream & | os | ||
) |
Dump partial or full XML trees.
Dump DOM tree using XercesC handles.
Definition at line 240 of file DocumentHandler.cpp.
void dd4hep::xml::dumpTree | ( | DOMNode * | doc, |
std::ostream & | os | ||
) |
Dump DOM tree using XercesC handles.
Definition at line 218 of file DocumentHandler.cpp.
void dd4hep::xml::dumpTree | ( | XmlDocument * | doc | ) |
Dump DOM tree of a document.
bool dd4hep::xml::enableEnvironResolution | ( | bool | new_value | ) |
Enable/disable environment resolution when parsing strings.
Definition at line 408 of file XMLElements.cpp.
int dd4hep::xml::get_float_precision | ( | ) |
Access floating point precision on conversion to string.
Definition at line 229 of file XMLElements.cpp.
std::string dd4hep::xml::getEnviron | ( | const std::string & | env | ) |
Helper function to lookup environment from the expression evaluator.
Evaluate string constant using environment stored in the evaluator.
Definition at line 403 of file XMLElements.cpp.
INLINE std::string dd4hep::xml::Handle_t::attr< std::string > | ( | const XmlChar * | tag_value | ) | const |
Definition at line 564 of file XMLElements.h.
INLINE std::string dd4hep::xml::Handle_t::attr< std::string > | ( | const XmlChar * | tag_value, |
std::string | default_value | ||
) | const |
Definition at line 608 of file XMLElements.h.
Convert alignment delta objects to Delta.
A generic alignment transformation is defined by
The absence of a pivot point implies the origine (0,0,0)
<xx> <position x="0" y="0" z="0.0001*mm"> <rotation x="0" y="0" z="0"> <pivot x="0" y="0" z="100"> </xx>
Definition at line 73 of file XMLParsers.cpp.
Convert XML position objects to dd4hep::Position.
<position x="0.5" y="0" z="0"> => dd4hep::Position
Definition at line 57 of file XMLParsers.cpp.
void dd4hep::xml::parse | ( | Handle_t | e, |
RotationZYX & | rot | ||
) |
Convert rotation XML objects to dd4hep::RotationZYX.
<rotation x="0.5" y="0" z="0"> => dd4hep::RotationZYX
Definition at line 48 of file XMLParsers.cpp.
void dd4hep::xml::parse | ( | Handle_t | e, |
Translation3D & | tr | ||
) |
Convert XML pivot objects to dd4hep::Translation3D objects.
<pivot x="0.5" y="0" z="0">
Definition at line 65 of file XMLParsers.cpp.
void dd4hep::xml::parse_delta | ( | Handle_t | e, |
OpaqueDataBlock & | block | ||
) |
Parse delta into an opaque data block.
See void parse(Handle_t e, Delta& delta) for details.
Definition at line 99 of file XMLParsers.cpp.
void dd4hep::xml::parse_mapping | ( | Handle_t | e, |
OpaqueDataBlock & | block | ||
) |
Converts opaque maps to OpaqueDataBlock objects.
Opaque data mappings are formalized std::map objects (or std::hash_map etc.) where the data source is parsed into the map using boost::spirit as a data interpretation mechanism.
Definition at line 105 of file XMLParsers.cpp.
void dd4hep::xml::parse_sequence | ( | Handle_t | e, |
OpaqueDataBlock & | block | ||
) |
Converts linear STL containers from their string representation.
Opaque data sequences are formalized linear STL container objects (std::vector, std::list, std::set, std::deque etc.) where the data source is parsed into the map using boost::spirit as a data interpretation mechanism.
Definition at line 125 of file XMLParsers.cpp.
int dd4hep::xml::set_float_precision | ( | int | precision | ) |
Change floating point precision on conversion to string.
Definition at line 222 of file XMLElements.cpp.
void dd4hep::xml::setDetectorTypeFlag | ( | dd4hep::xml::Handle_t | e, |
dd4hep::DetElement | sdet | ||
) |
Sets the type flag specified in the <type_flags> element for the given DetElement, example:
<type_flags type=" DetType_TRACKER + DetType_PIXEL + DetType_VERTEX "/>
Definition at line 284 of file Utilities.cpp.
bool dd4hep::xml::setXMLParserDebug | ( | bool | new_value | ) |
Set debug print level for this module. Default is OFF.
Set debug level for this module. Default is OFF.
Definition at line 41 of file XMLParsers.cpp.
void dd4hep::xml::tags_init | ( | ) |
Definition at line 82 of file XMLTags.cpp.
const Tag_t dd4hep::xml::Unicode_empty("", "", __Init::register_tag) |
const Tag_t dd4hep::xml::Unicode_NULL("NULL", "0", __Init::register_tag) |
const Tag_t dd4hep::xml::Unicode_PI("PI", "3.14159265358979323846", __Init::register_tag) |
const Tag_t dd4hep::xml::Unicode_star("star", "*", __Init::register_tag) |
const Tag_t dd4hep::xml::Unicode_TWOPI("TWOPI", "6.28318530717958647692", __Init::register_tag) |