DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Public Member Functions | Public Attributes | List of all members
dd4hep::sim::Geant4Converter Class Reference

Geometry converter from dd4hep to Geant 4. More...

#include <Geant4Converter.h>

Inheritance diagram for dd4hep::sim::Geant4Converter:
dd4hep::detail::GeoHandler dd4hep::sim::Geant4Mapping dd4hep::detail::GeoHandlerTypes dd4hep::detail::GeoHandlerTypes

Public Member Functions

 Geant4Converter (const Detector &description)
 Initializing Constructor. More...
 
 Geant4Converter (const Detector &description, PrintLevel level)
 Initializing Constructor. More...
 
virtual ~Geant4Converter ()
 Standard destructor. More...
 
Geant4Convertercreate (DetElement top)
 Create geometry conversion. More...
 
virtual void * handleMaterialProperties (TObject *matrix) const
 Convert the geometry type material into the corresponding Geant4 object(s). More...
 
void * handleOpticalSurface (TObject *surface) const
 Convert the optical surface to Geant4. More...
 
void * handleSkinSurface (TObject *surface) const
 Convert the skin surface to Geant4. More...
 
void * handleBorderSurface (TObject *surface) const
 Convert the border surface to Geant4. More...
 
virtual void * handleMaterial (const std::string &name, Material medium) const
 Convert the geometry type material into the corresponding Geant4 object(s). More...
 
virtual void * handleIsotope (const std::string &name, const TGeoIsotope *iso) const
 Handle the conversion of isotopes. More...
 
virtual void * handleElement (const std::string &name, Atom element) const
 Convert the geometry type element into the corresponding Geant4 object(s). More...
 
virtual void * handleSolid (const std::string &name, const TGeoShape *volume) const
 Convert the geometry type solid into the corresponding Geant4 object(s). More...
 
virtual void * handleVolume (const std::string &name, const TGeoVolume *volume) const
 Convert the geometry type logical volume into the corresponding Geant4 object(s). More...
 
virtual void * collectVolume (const std::string &name, const TGeoVolume *volume) const
 Dump logical volume in GDML format to output stream. More...
 
virtual void * handlePlacement (const std::string &name, const TGeoNode *node) const
 Convert the geometry type volume placement into the corresponding Geant4 object(s). More...
 
virtual void * handleAssembly (const std::string &name, const TGeoNode *node) const
 Dump volume placement in GDML format to output stream. More...
 
virtual void * handleRegion (Region region, const std::set< const TGeoVolume * > &volumes) const
 Convert the geometry type region into the corresponding Geant4 object(s). More...
 
virtual void * handleVis (const std::string &name, VisAttr vis) const
 Convert the geometry visualisation attributes to the corresponding Geant4 object(s). More...
 
virtual void * handleLimitSet (LimitSet limitset, const std::set< const TGeoVolume * > &volumes) const
 Convert the geometry type LimitSet into the corresponding Geant4 object(s). More...
 
void handleProperties (Detector::Properties &prp) const
 Handle the geant 4 specific properties. More...
 
virtual void printSensitive (SensitiveDetector sens_det, const std::set< const TGeoVolume * > &volumes) const
 Print the geometry type SensitiveDetector. More...
 
virtual void * printPlacement (const std::string &name, const TGeoNode *node) const
 Print Geant4 placement. 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 Member Functions inherited from dd4hep::sim::Geant4Mapping
 Geant4Mapping (const Detector &description)
 Initializing Constructor. More...
 
virtual ~Geant4Mapping ()
 Standard destructor. More...
 
const DetectordetectorDescription () const
 Accesor to the Detector instance. More...
 
Geant4GeometryInfodata () const
 Access to the data pointer. More...
 
Geant4GeometryInfoptr () const
 Access to the data pointer. More...
 
Geant4GeometryInfoinit ()
 Create and attach new data block. Delete old data block if present. More...
 
Geant4GeometryInfodetach ()
 Release data and pass over the ownership. More...
 
void attach (Geant4GeometryInfo *data)
 Set a new data block. More...
 
Geant4VolumeManager volumeManager () const
 Access the volume manager. More...
 
PlacedVolume placement (const G4VPhysicalVolume *node) const
 Accessor to resolve geometry placements. More...
 

Public Attributes

bool debugMaterials = false
 Property: Flag to debug materials during conversion mechanism. More...
 
bool debugElements = false
 Property: Flag to debug elements during conversion mechanism. More...
 
bool debugShapes = false
 Property: Flag to debug shapes during conversion mechanism. More...
 
bool debugVolumes = false
 Property: Flag to debug volumes during conversion mechanism. More...
 
bool debugPlacements = false
 Property: Flag to debug placements during conversion mechanism. More...
 
bool debugReflections = false
 Property: Flag to debug reflections during conversion mechanism. More...
 
bool debugRegions = false
 Property: Flag to debug regions during conversion mechanism. More...
 
bool debugLimits = false
 Property: Flag to debug LimitSets during conversion mechanism. More...
 
bool debugSurfaces = false
 Property: Flag to debug surfaces during conversion mechanism. More...
 
bool printPlacements = false
 Property: Flag to dump all placements after the conversion procedure. More...
 
bool printSensitives = false
 Property: Flag to dump all sensitives after the conversion procedure. More...
 
bool checkOverlaps = true
 Property: Check geometrical overlaps for volume placements and G4 imprints. More...
 
PrintLevel outputLevel = INFO
 Property: Output level for debug printing. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from dd4hep::sim::Geant4Mapping
static Geant4Mappinginstance ()
 Possibility to define a singleton instance. More...
 
- 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 Member Functions inherited from dd4hep::sim::Geant4Mapping
void checkValidity () const
 When resolving pointers, we must check for the validity of the data block. 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 }
 
- Protected Attributes inherited from dd4hep::sim::Geant4Mapping
const Detectorm_detDesc
 
Geant4GeometryInfom_dataPtr
 

Detailed Description

Geometry converter from dd4hep to Geant 4.

Author
M.Frank
Version
1.0

Definition at line 32 of file Geant4Converter.h.

Constructor & Destructor Documentation

◆ Geant4Converter() [1/2]

Geant4Converter::Geant4Converter ( const Detector description)

Initializing Constructor.

Definition at line 289 of file Geant4Converter.cpp.

◆ Geant4Converter() [2/2]

Geant4Converter::Geant4Converter ( const Detector description,
PrintLevel  level 
)

Initializing Constructor.

Definition at line 297 of file Geant4Converter.cpp.

◆ ~Geant4Converter()

Geant4Converter::~Geant4Converter ( )
virtual

Standard destructor.

Definition at line 304 of file Geant4Converter.cpp.

Member Function Documentation

◆ collectVolume()

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

Dump logical volume in GDML format to output stream.

Definition at line 852 of file Geant4Converter.cpp.

◆ create()

Geant4Converter & Geant4Converter::create ( DetElement  top)

Create geometry conversion.

Handle concrete surfaces

Definition at line 1670 of file Geant4Converter.cpp.

◆ handleAssembly()

void * Geant4Converter::handleAssembly ( const std::string &  name,
const TGeoNode *  node 
) const
virtual

Dump volume placement in GDML format to output stream.

Definition at line 872 of file Geant4Converter.cpp.

◆ handleBorderSurface()

void * Geant4Converter::handleBorderSurface ( TObject surface) const

Convert the border surface to Geant4.

Definition at line 1575 of file Geant4Converter.cpp.

◆ handleElement()

void * Geant4Converter::handleElement ( const std::string &  name,
Atom  element 
) const
virtual

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

Handle the conversion of elements.

Definition at line 322 of file Geant4Converter.cpp.

◆ handleIsotope()

void * Geant4Converter::handleIsotope ( const std::string &  name,
const TGeoIsotope *  iso 
) const
virtual

Handle the conversion of isotopes.

Definition at line 308 of file Geant4Converter.cpp.

◆ handleLimitSet()

void * Geant4Converter::handleLimitSet ( LimitSet  limitset,
const std::set< const TGeoVolume * > &  volumes 
) const
virtual

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

Definition at line 1192 of file Geant4Converter.cpp.

◆ handleMaterial()

void * Geant4Converter::handleMaterial ( const std::string &  name,
Material  medium 
) const
virtual

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

Dump material in GDML format to output stream.

Attach the material properties if any

Attach the material properties if any

Definition at line 350 of file Geant4Converter.cpp.

◆ handleMaterialProperties()

void * Geant4Converter::handleMaterialProperties ( TObject matrix) const
virtual

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

Definition at line 1295 of file Geant4Converter.cpp.

◆ handleOpticalSurface()

void * Geant4Converter::handleOpticalSurface ( TObject surface) const

Convert the optical surface to Geant4.

Convert non-scalar properties from GDML tables

Convert scalar properties

Definition at line 1424 of file Geant4Converter.cpp.

◆ handlePlacement()

void * Geant4Converter::handlePlacement ( const std::string &  name,
const TGeoNode *  node 
) const
virtual

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

Dump volume placement in GDML format to output stream.

Update replica list to avoid additional conversions...

Definition at line 945 of file Geant4Converter.cpp.

◆ handleProperties()

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

Handle the geant 4 specific properties.

Definition at line 1260 of file Geant4Converter.cpp.

◆ handleRegion()

void * Geant4Converter::handleRegion ( Region  region,
const std::set< const TGeoVolume * > &  volumes 
) const
virtual

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

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

Assign cuts to region if they were created

Definition at line 1114 of file Geant4Converter.cpp.

◆ handleSkinSurface()

void * Geant4Converter::handleSkinSurface ( TObject surface) const

Convert the skin surface to Geant4.

Definition at line 1557 of file Geant4Converter.cpp.

◆ handleSolid()

void * Geant4Converter::handleSolid ( const std::string &  name,
const TGeoShape *  volume 
) const
virtual

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

Dump solid in GDML format to output stream.

Definition at line 597 of file Geant4Converter.cpp.

◆ handleVis()

void * Geant4Converter::handleVis ( const std::string &  name,
VisAttr  vis 
) const
virtual

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

Definition at line 1234 of file Geant4Converter.cpp.

◆ handleVolume()

void * Geant4Converter::handleVolume ( const std::string &  name,
const TGeoVolume *  volume 
) const
virtual

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

Dump logical volume in GDML format to output stream.

Check all pre-conditions

Set smartless optimization

Assign limits if necessary

Definition at line 742 of file Geant4Converter.cpp.

◆ printPlacement()

void * Geant4Converter::printPlacement ( const std::string &  name,
const TGeoNode *  node 
) const
virtual

Print Geant4 placement.

Print G4 placement.

Definition at line 1639 of file Geant4Converter.cpp.

◆ printSensitive()

void Geant4Converter::printSensitive ( SensitiveDetector  sens_det,
const std::set< const TGeoVolume * > &  volumes 
) const
virtual

Print the geometry type SensitiveDetector.

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

Definition at line 1594 of file Geant4Converter.cpp.

Member Data Documentation

◆ checkOverlaps

bool dd4hep::sim::Geant4Converter::checkOverlaps = true

Property: Check geometrical overlaps for volume placements and G4 imprints.

Definition at line 59 of file Geant4Converter.h.

◆ debugElements

bool dd4hep::sim::Geant4Converter::debugElements = false

Property: Flag to debug elements during conversion mechanism.

Definition at line 37 of file Geant4Converter.h.

◆ debugLimits

bool dd4hep::sim::Geant4Converter::debugLimits = false

Property: Flag to debug LimitSets during conversion mechanism.

Definition at line 49 of file Geant4Converter.h.

◆ debugMaterials

bool dd4hep::sim::Geant4Converter::debugMaterials = false

Property: Flag to debug materials during conversion mechanism.

Definition at line 35 of file Geant4Converter.h.

◆ debugPlacements

bool dd4hep::sim::Geant4Converter::debugPlacements = false

Property: Flag to debug placements during conversion mechanism.

Definition at line 43 of file Geant4Converter.h.

◆ debugReflections

bool dd4hep::sim::Geant4Converter::debugReflections = false

Property: Flag to debug reflections during conversion mechanism.

Definition at line 45 of file Geant4Converter.h.

◆ debugRegions

bool dd4hep::sim::Geant4Converter::debugRegions = false

Property: Flag to debug regions during conversion mechanism.

Definition at line 47 of file Geant4Converter.h.

◆ debugShapes

bool dd4hep::sim::Geant4Converter::debugShapes = false

Property: Flag to debug shapes during conversion mechanism.

Definition at line 39 of file Geant4Converter.h.

◆ debugSurfaces

bool dd4hep::sim::Geant4Converter::debugSurfaces = false

Property: Flag to debug surfaces during conversion mechanism.

Definition at line 51 of file Geant4Converter.h.

◆ debugVolumes

bool dd4hep::sim::Geant4Converter::debugVolumes = false

Property: Flag to debug volumes during conversion mechanism.

Definition at line 41 of file Geant4Converter.h.

◆ outputLevel

PrintLevel dd4hep::sim::Geant4Converter::outputLevel = INFO

Property: Output level for debug printing.

Definition at line 61 of file Geant4Converter.h.

◆ printPlacements

bool dd4hep::sim::Geant4Converter::printPlacements = false

Property: Flag to dump all placements after the conversion procedure.

Definition at line 54 of file Geant4Converter.h.

◆ printSensitives

bool dd4hep::sim::Geant4Converter::printSensitives = false

Property: Flag to dump all sensitives after the conversion procedure.

Definition at line 56 of file Geant4Converter.h.


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