DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
dd4hep::detail::LCDDConverter Class Reference

Geometry converter from dd4hep to Geant 4 in Detector format. More...

#include <LCDDConverter.h>

Inheritance diagram for dd4hep::detail::LCDDConverter:
dd4hep::detail::GeoHandler dd4hep::detail::GeoHandlerTypes

Classes

class  GeometryInfo
 Data structure of the geometry converter from dd4hep to Geant 4 in Detector format. More...
 

Public Types

typedef xml::XmlElement XmlElement
 
typedef std::map< Atom, XmlElement * > ElementMap
 
typedef std::map< Material, XmlElement * > MaterialMap
 
typedef std::map< LimitSet, XmlElement * > LimitMap
 
typedef std::map< PlacedVolume, XmlElement * > PlacementMap
 
typedef std::map< Region, XmlElement * > RegionMap
 
typedef std::map< SensitiveDetector, XmlElement * > SensDetMap
 
typedef std::map< Volume, XmlElement * > VolumeMap
 
typedef std::map< IDDescriptor, XmlElement * > IdSpecMap
 
typedef std::map< VisAttr, XmlElement * > VisMap
 
typedef std::map< const TGeoShape *, XmlElement * > SolidMap
 
typedef std::map< OverlayedField, XmlElement * > FieldMap
 
typedef std::map< const TGeoMatrix *, XmlElement * > TrafoMap
 
typedef std::set< std::string > NameSet
 

Public Member Functions

GeometryInfodata () const
 
void checkVolumes (const std::string &name, Volume volume) const
 Data integrity checker. More...
 
 LCDDConverter (Detector &description)
 Initializing Constructor. More...
 
virtual ~LCDDConverter ()
 Standard destructor. More...
 
xml_doc_t createGDML (DetElement top)
 Create geometry conversion in GDML format. More...
 
xml_doc_t createDetector (DetElement top)
 Create geometry conversion in Detector format. More...
 
xml_doc_t createVis (DetElement top)
 Create geometry conversion in Vis format. More...
 
virtual void handleHeader () const
 Add header information in Detector format. More...
 
virtual xml_h handleMaterial (const std::string &name, Material medium) const
 Convert the geometry type material into the corresponding Xml object(s). More...
 
virtual xml_h handleElement (const std::string &name, Atom element) const
 Convert the geometry type element into the corresponding Xml object(s). More...
 
virtual xml_h handleSolid (const std::string &name, const TGeoShape *volume) const
 Convert the geometry type solid into the corresponding Xml object(s). More...
 
virtual xml_h handleVolume (const std::string &name, Volume volume) const
 Convert the geometry type logical volume into the corresponding Xml object(s). More...
 
virtual xml_h handleVolumeVis (const std::string &name, const TGeoVolume *volume) const
 Dump logical volume in GDML format to output stream. More...
 
virtual void collectVolume (const std::string &name, const TGeoVolume *volume) const
 Dump logical volume in GDML format to output stream. More...
 
virtual xml_h handlePlacement (const std::string &name, PlacedVolume node) const
 Convert the geometry type volume placement into the corresponding Xml object(s). More...
 
virtual xml_h handleRegion (const std::string &name, Region region) const
 Convert the geometry type region into the corresponding Xml object(s). More...
 
virtual xml_h handleVis (const std::string &name, VisAttr vis) const
 Convert the geometry visualisation attributes to the corresponding Xml object(s). More...
 
virtual xml_h handleIdSpec (const std::string &name, IDDescriptor idspec) const
 Convert the geometry id dictionary entry to the corresponding Xml object(s). More...
 
virtual xml_h handleLimitSet (const std::string &name, LimitSet limitset) const
 Convert the geometry type LimitSet into the corresponding Xml object(s). More...
 
virtual xml_h handleSensitive (const std::string &name, SensitiveDetector sens_det) const
 Convert the geometry type SensitiveDetector into the corresponding Xml object(s). More...
 
virtual xml_h handleSegmentation (Segmentation seg) const
 Convert the segmentation of a SensitiveDetector into the corresponding Detector object. More...
 
virtual xml_h handlePosition (const std::string &name, const TGeoMatrix *trafo) const
 Convert the Position into the corresponding Xml object(s). More...
 
virtual xml_h handleRotation (const std::string &name, const TGeoMatrix *trafo) const
 Convert the Rotation into the corresponding Xml object(s). More...
 
virtual xml_h handleField (const std::string &name, OverlayedField field) const
 Convert the electric or magnetic fields into the corresponding Xml object(s). More...
 
void handleProperties (Detector::Properties &prp) const
 Handle the geant 4 specific properties. More...
 
- Public Member Functions inherited from dd4hep::detail::GeoHandler
 GeoHandler ()
 Default constructor. More...
 
 GeoHandler (std::map< int, std::vector< const TGeoNode * > > *ptr, std::map< int, std::set< const TGeoNode * > > *ptr_set, std::map< const TGeoNode *, std::vector< TGeoNode * > > *daus=nullptr)
 Initializing constructor. More...
 
virtual ~GeoHandler ()
 Default destructor. More...
 
bool setPropagateRegions (bool value)
 Propagate regions. Returns the previous value. More...
 
GeoHandlercollect (DetElement top)
 Collect geometry information from traversal. More...
 
GeoHandlercollect (DetElement top, GeometryInfo &info)
 Collect geometry information from traversal with aggregated information. More...
 
std::map< int, std::vector< const TGeoNode * > > * release ()
 Access to collected node list. More...
 

Public Attributes

Detectorm_detDesc
 Reference to detector description. More...
 
NameSet m_checkNames
 
GeometryInfom_dataPtr
 

Additional Inherited Members

- Protected Member Functions inherited from dd4hep::detail::GeoHandler
GeoHandleri_collect (const TGeoNode *parent, const TGeoNode *node, int level, Region rg, LimitSet ls)
 Internal helper to collect geometry information from traversal. More...
 
- Protected Attributes inherited from dd4hep::detail::GeoHandler
bool m_propagateRegions { false }
 
std::map< int, std::vector< const TGeoNode * > > * m_data { nullptr }
 actual container with std::vector (preserves order) More...
 
std::map< int, std::set< const TGeoNode * > > * m_set_data { nullptr }
 redundant container with std::set (for lookup purpose) More...
 
std::map< const TGeoNode *, std::vector< TGeoNode * > > * m_daughters { nullptr }
 

Detailed Description

Geometry converter from dd4hep to Geant 4 in Detector format.

Author
M.Frank
Version
1.0

Definition at line 50 of file LCDDConverter.h.

Member Typedef Documentation

◆ ElementMap

Definition at line 53 of file LCDDConverter.h.

◆ FieldMap

Definition at line 63 of file LCDDConverter.h.

◆ IdSpecMap

Definition at line 60 of file LCDDConverter.h.

◆ LimitMap

Definition at line 55 of file LCDDConverter.h.

◆ MaterialMap

Definition at line 54 of file LCDDConverter.h.

◆ NameSet

typedef std::set<std::string> dd4hep::detail::LCDDConverter::NameSet

Definition at line 118 of file LCDDConverter.h.

◆ PlacementMap

Definition at line 56 of file LCDDConverter.h.

◆ RegionMap

Definition at line 57 of file LCDDConverter.h.

◆ SensDetMap

Definition at line 58 of file LCDDConverter.h.

◆ SolidMap

typedef std::map<const TGeoShape*, XmlElement*> dd4hep::detail::LCDDConverter::SolidMap

Definition at line 62 of file LCDDConverter.h.

◆ TrafoMap

typedef std::map<const TGeoMatrix*, XmlElement*> dd4hep::detail::LCDDConverter::TrafoMap

Definition at line 64 of file LCDDConverter.h.

◆ VisMap

Definition at line 61 of file LCDDConverter.h.

◆ VolumeMap

Definition at line 59 of file LCDDConverter.h.

◆ XmlElement

Definition at line 52 of file LCDDConverter.h.

Constructor & Destructor Documentation

◆ LCDDConverter()

LCDDConverter::LCDDConverter ( Detector description)

Initializing Constructor.

Definition at line 126 of file LCDDConverter.cpp.

◆ ~LCDDConverter()

LCDDConverter::~LCDDConverter ( )
virtual

Standard destructor.

Definition at line 130 of file LCDDConverter.cpp.

Member Function Documentation

◆ checkVolumes()

void LCDDConverter::checkVolumes ( const std::string &  name,
Volume  volume 
) const

Data integrity checker.

Definition at line 779 of file LCDDConverter.cpp.

◆ collectVolume()

void LCDDConverter::collectVolume ( const std::string &  name,
const TGeoVolume *  volume 
) const
virtual

Dump logical volume in GDML format to output stream.

Definition at line 760 of file LCDDConverter.cpp.

◆ createDetector()

xml_doc_t LCDDConverter::createDetector ( DetElement  top)

Create geometry conversion in Detector format.

Create geometry conversion.

Definition at line 1203 of file LCDDConverter.cpp.

◆ createGDML()

xml_doc_t LCDDConverter::createGDML ( DetElement  top)

Create geometry conversion in GDML format.

Create geometry conversion.

Definition at line 1123 of file LCDDConverter.cpp.

◆ createVis()

xml_doc_t LCDDConverter::createVis ( DetElement  top)

Create geometry conversion in Vis format.

Create geometry conversion.

Definition at line 1179 of file LCDDConverter.cpp.

◆ data()

GeometryInfo& dd4hep::detail::LCDDConverter::data ( ) const
inline

Definition at line 125 of file LCDDConverter.h.

◆ handleElement()

xml_h LCDDConverter::handleElement ( const std::string &  name,
Atom  element 
) const
virtual

Convert the geometry type element into the corresponding Xml object(s).

Dump element in GDML format to output stream.

Definition at line 137 of file LCDDConverter.cpp.

◆ handleField()

xml_h LCDDConverter::handleField ( const std::string &  name,
OverlayedField  field 
) const
virtual

Convert the electric or magnetic fields into the corresponding Xml object(s).

Definition at line 1010 of file LCDDConverter.cpp.

◆ handleHeader()

void LCDDConverter::handleHeader ( ) const
virtual

Add header information in Detector format.

Definition at line 1084 of file LCDDConverter.cpp.

◆ handleIdSpec()

xml_h LCDDConverter::handleIdSpec ( const std::string &  name,
IDDescriptor  idspec 
) const
virtual

Convert the geometry id dictionary entry to the corresponding Xml object(s).

Definition at line 941 of file LCDDConverter.cpp.

◆ handleLimitSet()

xml_h LCDDConverter::handleLimitSet ( const std::string &  name,
LimitSet  limitset 
) const
virtual

Convert the geometry type LimitSet into the corresponding Xml object(s).

Convert the geometry type LimitSet into the corresponding Detector object(s)

Definition at line 861 of file LCDDConverter.cpp.

◆ handleMaterial()

xml_h LCDDConverter::handleMaterial ( const std::string &  name,
Material  medium 
) const
virtual

Convert the geometry type material into the corresponding Xml object(s).

Dump material in GDML format to output stream.

Definition at line 160 of file LCDDConverter.cpp.

◆ handlePlacement()

xml_h LCDDConverter::handlePlacement ( const std::string &  name,
PlacedVolume  node 
) const
virtual

Convert the geometry type volume placement into the corresponding Xml object(s).

Dump volume placement in GDML format to output stream.

Definition at line 803 of file LCDDConverter.cpp.

◆ handlePosition()

xml_h LCDDConverter::handlePosition ( const std::string &  name,
const TGeoMatrix *  trafo 
) const
virtual

Convert the Position into the corresponding Xml object(s).

Definition at line 604 of file LCDDConverter.cpp.

◆ handleProperties()

void LCDDConverter::handleProperties ( Detector::Properties prp) const

Handle the geant 4 specific properties.

Definition at line 1034 of file LCDDConverter.cpp.

◆ handleRegion()

xml_h LCDDConverter::handleRegion ( const std::string &  name,
Region  region 
) const
virtual

Convert the geometry type region into the corresponding Xml object(s).

Convert the geometry type region into the corresponding Detector object(s).

Convert the geometry type field into the corresponding Xml object(s). virtual xml_h handleField(const std::string& name, Ref_t field) const;

Definition at line 845 of file LCDDConverter.cpp.

◆ handleRotation()

xml_h LCDDConverter::handleRotation ( const std::string &  name,
const TGeoMatrix *  trafo 
) const
virtual

Convert the Rotation into the corresponding Xml object(s).

Definition at line 638 of file LCDDConverter.cpp.

◆ handleSegmentation()

xml_h LCDDConverter::handleSegmentation ( Segmentation  seg) const
virtual

Convert the segmentation of a SensitiveDetector into the corresponding Detector object.

Definition at line 883 of file LCDDConverter.cpp.

◆ handleSensitive()

xml_h LCDDConverter::handleSensitive ( const std::string &  name,
SensitiveDetector  sens_det 
) const
virtual

Convert the geometry type SensitiveDetector into the corresponding Xml object(s).

Convert the geometry type SensitiveDetector into the corresponding Detector object(s).

Definition at line 915 of file LCDDConverter.cpp.

◆ handleSolid()

xml_h LCDDConverter::handleSolid ( const std::string &  name,
const TGeoShape *  volume 
) const
virtual

Convert the geometry type solid into the corresponding Xml object(s).

Dump solid in GDML format to output stream.

Definition at line 221 of file LCDDConverter.cpp.

◆ handleVis()

xml_h LCDDConverter::handleVis ( const std::string &  name,
VisAttr  vis 
) const
virtual

Convert the geometry visualisation attributes to the corresponding Xml object(s).

Convert the geometry visualisation attributes to the corresponding Detector object(s).

Definition at line 976 of file LCDDConverter.cpp.

◆ handleVolume()

xml_h LCDDConverter::handleVolume ( const std::string &  name,
Volume  volume 
) const
virtual

Convert the geometry type logical volume into the corresponding Xml object(s).

Dump logical volume in GDML format to output stream.

Definition at line 672 of file LCDDConverter.cpp.

◆ handleVolumeVis()

xml_h LCDDConverter::handleVolumeVis ( const std::string &  name,
const TGeoVolume *  volume 
) const
virtual

Dump logical volume in GDML format to output stream.

Definition at line 739 of file LCDDConverter.cpp.

Member Data Documentation

◆ m_checkNames

NameSet dd4hep::detail::LCDDConverter::m_checkNames
mutable

Definition at line 122 of file LCDDConverter.h.

◆ m_dataPtr

GeometryInfo* dd4hep::detail::LCDDConverter::m_dataPtr

Definition at line 123 of file LCDDConverter.h.

◆ m_detDesc

Detector& dd4hep::detail::LCDDConverter::m_detDesc

Reference to detector description.

Definition at line 121 of file LCDDConverter.h.


The documentation for this class was generated from the following files: