G4Root Version 6.6
Loading...
Searching...
No Matches
TG4RootDetectorConstruction Class Reference

Builder creating a pseudo G4 geometry starting from a TGeo geometry. More...

#include <TG4RootDetectorConstruction.h>

Inheritance diagram for TG4RootDetectorConstruction:

Public Member Functions

 TG4RootDetectorConstruction ()
 
 TG4RootDetectorConstruction (TGeoManager *geom)
 
virtual ~TG4RootDetectorConstruction ()
 
virtual G4VPhysicalVolume * Construct ()
 
virtual void ConstructSDandField ()
 
TGeoManager * GetGeometryManager () const
 Return TGeo geometry manager.
 
G4VPhysicalVolume * GetTopPV () const
 Return the World G4 physical volume.
 
G4Material * GetG4Material (const TGeoMaterial *mat) const
 
G4LogicalVolume * GetG4Volume (const TGeoVolume *vol) const
 
TGeoVolume * GetVolume (const G4LogicalVolume *g4vol) const
 
G4VPhysicalVolume * GetG4VPhysicalVolume (const TGeoNode *node) const
 
TGeoNode * GetNode (const G4VPhysicalVolume *g4vol) const
 
TVirtualUserPostDetConstructionGetSDInit () const
 Return the sensitive detector hook.
 
Bool_t IsConstructed () const
 Return the flag Construct() called.
 
void Initialize (TVirtualUserPostDetConstruction *sdinit=0)
 

Protected Member Functions

void CreateG4LogicalVolumes ()
 
void CreateG4Materials ()
 
void CreateG4Elements ()
 
void CreateG4PhysicalVolumes ()
 
G4VSolidCreateG4Solid (TGeoShape *shape)
 
G4LogicalVolume * CreateG4LogicalVolume (TGeoVolume *vol)
 
G4VPhysicalVolume * CreateG4PhysicalVolume (TGeoNode *node)
 
G4Material * CreateG4Material (const TGeoMaterial *mat)
 
G4RotationMatrix * CreateG4Rotation (const TGeoMatrix *matrix)
 
G4Element * CreateG4Element (TGeoElement *elem)
 

Protected Attributes

Bool_t fIsConstructed
 flag Construct() called
 
TGeoManager * fGeometry
 TGeo geometry manager.
 
G4VPhysicalVolume * fTopPV
 World G4 physical volume.
 
TVirtualUserPostDetConstructionfSDInit
 Sensitive detector hook.
 

Private Types

typedef std::unordered_map< const TGeoMaterial *, G4Material * > G4MaterialMap_t
 the map from TGeoMaterial to G4Material
 
typedef G4MaterialMap_t::const_iterator G4MaterialIt_t
 the constant iterator for the map from TGeoMaterial to G4Material
 
typedef G4MaterialMap_t::value_type G4MaterialVal_t
 the value type for the map from TGeoMaterial to G4Material
 
typedef std::unordered_map< const TGeoVolume *, G4LogicalVolume * > G4VolumeMap_t
 the map from TGeoVolume to G4LogicalVolume
 
typedef G4VolumeMap_t::const_iterator G4VolumeIt_t
 the constant iterator for the map from TGeoVolume to G4LogicalVolume
 
typedef G4VolumeMap_t::value_type G4VolumeVal_t
 the value type for the map from TGeoVolume to G4LogicalVolume
 
typedef std::unordered_map< const G4LogicalVolume *, TGeoVolume * > VolumeMap_t
 the map from G4LogicalVolume to TGeoVolume
 
typedef VolumeMap_t::const_iterator VolumeIt_t
 the constant iterator for the map from G4LogicalVolume to TGeoVolume
 
typedef VolumeMap_t::value_type VolumeVal_t
 the value type for the map from G4LogicalVolume to TGeoVolume
 
typedef std::unordered_map< const TGeoNode *, G4VPhysicalVolume * > G4PVolumeMap_t
 the map from TGeoNode to G4VPhysicalVolume
 
typedef G4PVolumeMap_t::const_iterator G4PVolumeIt_t
 the constant iterator for the map from TGeoNode to G4VPhysicalVolume
 
typedef G4PVolumeMap_t::value_type G4PVolumeVal_t
 the value type for the map from TGeoNode to G4VPhysicalVolume
 
typedef std::unordered_map< const G4VPhysicalVolume *, TGeoNode * > PVolumeMap_t
 the map from G4VPhysicalVolume to TGeoNode
 
typedef PVolumeMap_t::const_iterator PVolumeIt_t
 the constant iterator for the map from G4VPhysicalVolume to TGeoNode
 
typedef PVolumeMap_t::value_type PVolumeVal_t
 the value type for the map from G4VPhysicalVolume to TGeoNode
 

Private Attributes

G4MaterialMap_t fG4MaterialMap
 map of G4 materials
 
G4VolumeMap_t fG4VolumeMap
 map of G4 volumes
 
VolumeMap_t fVolumeMap
 map of TGeo volumes
 
G4PVolumeMap_t fG4PVolumeMap
 map of G4 physical volumes
 
PVolumeMap_t fPVolumeMap
 map of TGeo volumes
 

Detailed Description

Builder creating a pseudo G4 geometry starting from a TGeo geometry.

To invoke the method Construct() the ROOT geometry must be in memory. The G4 objects created are:

  • TGeoElement ---> G4Element
  • TGeoMaterial/TGeoMixture ---> G4Material
  • TGeoMatrix ---> G4RotationMatrix
  • TGeoVolume ---> G4LogicalVolume
  • TGeoShape ---> TG4RootSolid : public G4Solid
  • TGeoNode ---> G4PVPlacement : public G4VPhysicalVolume
Author
A. Gheata; CERN

Definition at line 57 of file TG4RootDetectorConstruction.h.

Member Typedef Documentation

◆ G4MaterialMap_t

std::unordered_map<const TGeoMaterial*, G4Material*> TG4RootDetectorConstruction::G4MaterialMap_t
private

the map from TGeoMaterial to G4Material

Definition at line 62 of file TG4RootDetectorConstruction.h.

◆ G4MaterialIt_t

G4MaterialMap_t::const_iterator TG4RootDetectorConstruction::G4MaterialIt_t
private

the constant iterator for the map from TGeoMaterial to G4Material

Definition at line 64 of file TG4RootDetectorConstruction.h.

◆ G4MaterialVal_t

G4MaterialMap_t::value_type TG4RootDetectorConstruction::G4MaterialVal_t
private

the value type for the map from TGeoMaterial to G4Material

Definition at line 66 of file TG4RootDetectorConstruction.h.

◆ G4VolumeMap_t

std::unordered_map<const TGeoVolume*, G4LogicalVolume*> TG4RootDetectorConstruction::G4VolumeMap_t
private

the map from TGeoVolume to G4LogicalVolume

Definition at line 70 of file TG4RootDetectorConstruction.h.

◆ G4VolumeIt_t

G4VolumeMap_t::const_iterator TG4RootDetectorConstruction::G4VolumeIt_t
private

the constant iterator for the map from TGeoVolume to G4LogicalVolume

Definition at line 72 of file TG4RootDetectorConstruction.h.

◆ G4VolumeVal_t

G4VolumeMap_t::value_type TG4RootDetectorConstruction::G4VolumeVal_t
private

the value type for the map from TGeoVolume to G4LogicalVolume

Definition at line 74 of file TG4RootDetectorConstruction.h.

◆ VolumeMap_t

std::unordered_map<const G4LogicalVolume*, TGeoVolume*> TG4RootDetectorConstruction::VolumeMap_t
private

the map from G4LogicalVolume to TGeoVolume

Definition at line 78 of file TG4RootDetectorConstruction.h.

◆ VolumeIt_t

VolumeMap_t::const_iterator TG4RootDetectorConstruction::VolumeIt_t
private

the constant iterator for the map from G4LogicalVolume to TGeoVolume

Definition at line 80 of file TG4RootDetectorConstruction.h.

◆ VolumeVal_t

VolumeMap_t::value_type TG4RootDetectorConstruction::VolumeVal_t
private

the value type for the map from G4LogicalVolume to TGeoVolume

Definition at line 82 of file TG4RootDetectorConstruction.h.

◆ G4PVolumeMap_t

std::unordered_map<const TGeoNode*, G4VPhysicalVolume*> TG4RootDetectorConstruction::G4PVolumeMap_t
private

the map from TGeoNode to G4VPhysicalVolume

Definition at line 87 of file TG4RootDetectorConstruction.h.

◆ G4PVolumeIt_t

G4PVolumeMap_t::const_iterator TG4RootDetectorConstruction::G4PVolumeIt_t
private

the constant iterator for the map from TGeoNode to G4VPhysicalVolume

Definition at line 89 of file TG4RootDetectorConstruction.h.

◆ G4PVolumeVal_t

G4PVolumeMap_t::value_type TG4RootDetectorConstruction::G4PVolumeVal_t
private

the value type for the map from TGeoNode to G4VPhysicalVolume

Definition at line 91 of file TG4RootDetectorConstruction.h.

◆ PVolumeMap_t

std::unordered_map<const G4VPhysicalVolume*, TGeoNode*> TG4RootDetectorConstruction::PVolumeMap_t
private

the map from G4VPhysicalVolume to TGeoNode

Definition at line 95 of file TG4RootDetectorConstruction.h.

◆ PVolumeIt_t

PVolumeMap_t::const_iterator TG4RootDetectorConstruction::PVolumeIt_t
private

the constant iterator for the map from G4VPhysicalVolume to TGeoNode

Definition at line 97 of file TG4RootDetectorConstruction.h.

◆ PVolumeVal_t

PVolumeMap_t::value_type TG4RootDetectorConstruction::PVolumeVal_t
private

the value type for the map from G4VPhysicalVolume to TGeoNode

Definition at line 99 of file TG4RootDetectorConstruction.h.

Constructor & Destructor Documentation

◆ TG4RootDetectorConstruction() [1/2]

TG4RootDetectorConstruction::TG4RootDetectorConstruction ( )

Dummy ctor.

Definition at line 41 of file TG4RootDetectorConstruction.cxx.

◆ TG4RootDetectorConstruction() [2/2]

TG4RootDetectorConstruction::TG4RootDetectorConstruction ( TGeoManager * geom)

Default ctor.

Definition at line 52 of file TG4RootDetectorConstruction.cxx.

◆ ~TG4RootDetectorConstruction()

TG4RootDetectorConstruction::~TG4RootDetectorConstruction ( )
virtual

Destructor. Cleans all G4 geometry objects created.

Definition at line 69 of file TG4RootDetectorConstruction.cxx.

Member Function Documentation

◆ CreateG4LogicalVolumes()

void TG4RootDetectorConstruction::CreateG4LogicalVolumes ( )
protected

Create logical volumes for GEANT4 based on TGeo volumes.

Definition at line 176 of file TG4RootDetectorConstruction.cxx.

◆ CreateG4Materials()

void TG4RootDetectorConstruction::CreateG4Materials ( )
protected

Create GEANT4 native materials and map them to the corresponding TGeo ones.

Definition at line 209 of file TG4RootDetectorConstruction.cxx.

Referenced by Construct().

◆ CreateG4Elements()

void TG4RootDetectorConstruction::CreateG4Elements ( )
protected

Create all necessary G4 elements.

Definition at line 226 of file TG4RootDetectorConstruction.cxx.

◆ CreateG4PhysicalVolumes()

void TG4RootDetectorConstruction::CreateG4PhysicalVolumes ( )
protected

Create physical volumes for GEANT4 based on TGeo hierarchy.

Definition at line 189 of file TG4RootDetectorConstruction.cxx.

Referenced by Construct().

◆ CreateG4Solid()

G4VSolid * TG4RootDetectorConstruction::CreateG4Solid ( TGeoShape * shape)
protected

Create a G4 generic solid working with any TGeo shape. If already created return just a pointer to the existing one.

Definition at line 492 of file TG4RootDetectorConstruction.cxx.

Referenced by CreateG4LogicalVolume().

◆ CreateG4LogicalVolume()

G4LogicalVolume * TG4RootDetectorConstruction::CreateG4LogicalVolume ( TGeoVolume * vol)
protected

Create a G4LogicalVolume object based on a TGeo one. If already created return just a pointer to the existing one.

Definition at line 247 of file TG4RootDetectorConstruction.cxx.

Referenced by CreateG4LogicalVolumes(), and CreateG4PhysicalVolume().

◆ CreateG4PhysicalVolume()

G4VPhysicalVolume * TG4RootDetectorConstruction::CreateG4PhysicalVolume ( TGeoNode * node)
protected

Create a G4VPhysicalVolume object based on a TGeo node.

Definition at line 288 of file TG4RootDetectorConstruction.cxx.

Referenced by CreateG4PhysicalVolumes().

◆ CreateG4Material()

G4Material * TG4RootDetectorConstruction::CreateG4Material ( const TGeoMaterial * mat)
protected

Create a GEANT4 material based on a TGeo one. If already created return just a pointer to the existing one.

Definition at line 329 of file TG4RootDetectorConstruction.cxx.

Referenced by CreateG4Materials().

◆ CreateG4Rotation()

G4RotationMatrix * TG4RootDetectorConstruction::CreateG4Rotation ( const TGeoMatrix * matrix)
protected

Create a G4Transform3D object based on a TGeo matrix. If already created return just a pointer to the existing one.

Definition at line 465 of file TG4RootDetectorConstruction.cxx.

Referenced by CreateG4PhysicalVolume().

◆ CreateG4Element()

G4Element * TG4RootDetectorConstruction::CreateG4Element ( TGeoElement * elem)
protected

Definition at line 417 of file TG4RootDetectorConstruction.cxx.

Referenced by CreateG4Material().

◆ Construct()

G4VPhysicalVolume * TG4RootDetectorConstruction::Construct ( )
virtual

Main construct method.

Definition at line 140 of file TG4RootDetectorConstruction.cxx.

Referenced by Initialize().

◆ ConstructSDandField()

void TG4RootDetectorConstruction::ConstructSDandField ( )
virtual

Definition at line 166 of file TG4RootDetectorConstruction.cxx.

◆ GetGeometryManager()

TGeoManager * TG4RootDetectorConstruction::GetGeometryManager ( ) const
inline

Return TGeo geometry manager.

Definition at line 130 of file TG4RootDetectorConstruction.h.

Referenced by TG4RootNavigator::SetDetectorConstruction().

◆ GetTopPV()

G4VPhysicalVolume * TG4RootDetectorConstruction::GetTopPV ( ) const
inline

Return the World G4 physical volume.

Definition at line 132 of file TG4RootDetectorConstruction.h.

Referenced by TG4RootNavigator::TG4RootNavigator().

◆ GetG4Material()

G4Material * TG4RootDetectorConstruction::GetG4Material ( const TGeoMaterial * mat) const

Retreive a G4 material mapped to a ROOT material.

Definition at line 501 of file TG4RootDetectorConstruction.cxx.

Referenced by CreateG4LogicalVolume(), and CreateG4Material().

◆ GetG4Volume()

G4LogicalVolume * TG4RootDetectorConstruction::GetG4Volume ( const TGeoVolume * vol) const

Retreive a G4 logical volume mapped to a ROOT volume.

Definition at line 511 of file TG4RootDetectorConstruction.cxx.

Referenced by CreateG4LogicalVolume().

◆ GetVolume()

TGeoVolume * TG4RootDetectorConstruction::GetVolume ( const G4LogicalVolume * g4vol) const

Retreive a TGeo logical volume mapped to a G4 volume.

Definition at line 521 of file TG4RootDetectorConstruction.cxx.

◆ GetG4VPhysicalVolume()

G4VPhysicalVolume * TG4RootDetectorConstruction::GetG4VPhysicalVolume ( const TGeoNode * node) const

Retreive a G4 physical volume mapped to a ROOT node.

Definition at line 531 of file TG4RootDetectorConstruction.cxx.

Referenced by CreateG4PhysicalVolume(), and TG4RootNavigator::SynchronizeHistory().

◆ GetNode()

TGeoNode * TG4RootDetectorConstruction::GetNode ( const G4VPhysicalVolume * g4vol) const

Retreive a TGeo node mapped to a G4 physical volume.

Definition at line 541 of file TG4RootDetectorConstruction.cxx.

Referenced by TG4RootNavigator::SynchronizeGeoManager().

◆ GetSDInit()

TVirtualUserPostDetConstruction * TG4RootDetectorConstruction::GetSDInit ( ) const
inline

Return the sensitive detector hook.

Definition at line 139 of file TG4RootDetectorConstruction.h.

◆ IsConstructed()

Bool_t TG4RootDetectorConstruction::IsConstructed ( ) const
inline

Return the flag Construct() called.

Definition at line 141 of file TG4RootDetectorConstruction.h.

◆ Initialize()

void TG4RootDetectorConstruction::Initialize ( TVirtualUserPostDetConstruction * sdinit = 0)

Main construct method.

Definition at line 125 of file TG4RootDetectorConstruction.cxx.

Referenced by TG4RootNavMgr::Initialize().

Member Data Documentation

◆ fG4MaterialMap

G4MaterialMap_t TG4RootDetectorConstruction::fG4MaterialMap
private

map of G4 materials

Definition at line 67 of file TG4RootDetectorConstruction.h.

Referenced by CreateG4Material(), and GetG4Material().

◆ fG4VolumeMap

G4VolumeMap_t TG4RootDetectorConstruction::fG4VolumeMap
private

map of G4 volumes

Definition at line 75 of file TG4RootDetectorConstruction.h.

Referenced by CreateG4LogicalVolume(), and GetG4Volume().

◆ fVolumeMap

VolumeMap_t TG4RootDetectorConstruction::fVolumeMap
private

map of TGeo volumes

Definition at line 83 of file TG4RootDetectorConstruction.h.

Referenced by CreateG4LogicalVolume(), and GetVolume().

◆ fG4PVolumeMap

G4PVolumeMap_t TG4RootDetectorConstruction::fG4PVolumeMap
private

map of G4 physical volumes

Definition at line 92 of file TG4RootDetectorConstruction.h.

Referenced by CreateG4PhysicalVolume(), and GetG4VPhysicalVolume().

◆ fPVolumeMap

PVolumeMap_t TG4RootDetectorConstruction::fPVolumeMap
private

map of TGeo volumes

Definition at line 100 of file TG4RootDetectorConstruction.h.

Referenced by CreateG4PhysicalVolume(), and GetNode().

◆ fIsConstructed

Bool_t TG4RootDetectorConstruction::fIsConstructed
protected

flag Construct() called

Definition at line 103 of file TG4RootDetectorConstruction.h.

Referenced by Construct(), Initialize(), and IsConstructed().

◆ fGeometry

TGeoManager* TG4RootDetectorConstruction::fGeometry
protected

◆ fTopPV

G4VPhysicalVolume* TG4RootDetectorConstruction::fTopPV
protected

World G4 physical volume.

Definition at line 105 of file TG4RootDetectorConstruction.h.

Referenced by Construct(), CreateG4PhysicalVolumes(), and GetTopPV().

◆ fSDInit

TVirtualUserPostDetConstruction* TG4RootDetectorConstruction::fSDInit
protected

Sensitive detector hook.

Definition at line 106 of file TG4RootDetectorConstruction.h.

Referenced by ConstructSDandField(), GetSDInit(), Initialize(), and ~TG4RootDetectorConstruction().


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