G4Root Version 6.6
|
Builder creating a pseudo G4 geometry starting from a TGeo geometry. More...
#include <TG4RootDetectorConstruction.h>
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 |
TVirtualUserPostDetConstruction * | GetSDInit () 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 () |
G4VSolid * | CreateG4Solid (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. | |
TVirtualUserPostDetConstruction * | fSDInit |
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 | |
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:
Definition at line 57 of file TG4RootDetectorConstruction.h.
|
private |
the map from TGeoMaterial to G4Material
Definition at line 62 of file TG4RootDetectorConstruction.h.
|
private |
the constant iterator for the map from TGeoMaterial to G4Material
Definition at line 64 of file TG4RootDetectorConstruction.h.
|
private |
the value type for the map from TGeoMaterial to G4Material
Definition at line 66 of file TG4RootDetectorConstruction.h.
|
private |
the map from TGeoVolume to G4LogicalVolume
Definition at line 70 of file TG4RootDetectorConstruction.h.
|
private |
the constant iterator for the map from TGeoVolume to G4LogicalVolume
Definition at line 72 of file TG4RootDetectorConstruction.h.
|
private |
the value type for the map from TGeoVolume to G4LogicalVolume
Definition at line 74 of file TG4RootDetectorConstruction.h.
|
private |
the map from G4LogicalVolume to TGeoVolume
Definition at line 78 of file TG4RootDetectorConstruction.h.
|
private |
the constant iterator for the map from G4LogicalVolume to TGeoVolume
Definition at line 80 of file TG4RootDetectorConstruction.h.
|
private |
the value type for the map from G4LogicalVolume to TGeoVolume
Definition at line 82 of file TG4RootDetectorConstruction.h.
|
private |
the map from TGeoNode to G4VPhysicalVolume
Definition at line 87 of file TG4RootDetectorConstruction.h.
|
private |
the constant iterator for the map from TGeoNode to G4VPhysicalVolume
Definition at line 89 of file TG4RootDetectorConstruction.h.
|
private |
the value type for the map from TGeoNode to G4VPhysicalVolume
Definition at line 91 of file TG4RootDetectorConstruction.h.
|
private |
the map from G4VPhysicalVolume to TGeoNode
Definition at line 95 of file TG4RootDetectorConstruction.h.
|
private |
the constant iterator for the map from G4VPhysicalVolume to TGeoNode
Definition at line 97 of file TG4RootDetectorConstruction.h.
|
private |
the value type for the map from G4VPhysicalVolume to TGeoNode
Definition at line 99 of file TG4RootDetectorConstruction.h.
TG4RootDetectorConstruction::TG4RootDetectorConstruction | ( | ) |
Dummy ctor.
Definition at line 41 of file TG4RootDetectorConstruction.cxx.
TG4RootDetectorConstruction::TG4RootDetectorConstruction | ( | TGeoManager * | geom | ) |
Default ctor.
Definition at line 52 of file TG4RootDetectorConstruction.cxx.
|
virtual |
Destructor. Cleans all G4 geometry objects created.
Definition at line 69 of file TG4RootDetectorConstruction.cxx.
|
protected |
Create logical volumes for GEANT4 based on TGeo volumes.
Definition at line 176 of file TG4RootDetectorConstruction.cxx.
|
protected |
Create GEANT4 native materials and map them to the corresponding TGeo ones.
Definition at line 209 of file TG4RootDetectorConstruction.cxx.
Referenced by Construct().
|
protected |
Create all necessary G4 elements.
Definition at line 226 of file TG4RootDetectorConstruction.cxx.
|
protected |
Create physical volumes for GEANT4 based on TGeo hierarchy.
Definition at line 189 of file TG4RootDetectorConstruction.cxx.
Referenced by Construct().
|
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().
|
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().
|
protected |
Create a G4VPhysicalVolume object based on a TGeo node.
Definition at line 288 of file TG4RootDetectorConstruction.cxx.
Referenced by CreateG4PhysicalVolumes().
|
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().
|
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().
|
protected |
Definition at line 417 of file TG4RootDetectorConstruction.cxx.
Referenced by CreateG4Material().
|
virtual |
Main construct method.
Definition at line 140 of file TG4RootDetectorConstruction.cxx.
Referenced by Initialize().
|
virtual |
Definition at line 166 of file TG4RootDetectorConstruction.cxx.
|
inline |
Return TGeo geometry manager.
Definition at line 130 of file TG4RootDetectorConstruction.h.
Referenced by TG4RootNavigator::SetDetectorConstruction().
|
inline |
Return the World G4 physical volume.
Definition at line 132 of file TG4RootDetectorConstruction.h.
Referenced by TG4RootNavigator::TG4RootNavigator().
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().
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().
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.
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().
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().
|
inline |
Return the sensitive detector hook.
Definition at line 139 of file TG4RootDetectorConstruction.h.
|
inline |
Return the flag Construct() called.
Definition at line 141 of file TG4RootDetectorConstruction.h.
void TG4RootDetectorConstruction::Initialize | ( | TVirtualUserPostDetConstruction * | sdinit = 0 | ) |
Main construct method.
Definition at line 125 of file TG4RootDetectorConstruction.cxx.
Referenced by TG4RootNavMgr::Initialize().
|
private |
map of G4 materials
Definition at line 67 of file TG4RootDetectorConstruction.h.
Referenced by CreateG4Material(), and GetG4Material().
|
private |
map of G4 volumes
Definition at line 75 of file TG4RootDetectorConstruction.h.
Referenced by CreateG4LogicalVolume(), and GetG4Volume().
|
private |
map of TGeo volumes
Definition at line 83 of file TG4RootDetectorConstruction.h.
Referenced by CreateG4LogicalVolume(), and GetVolume().
|
private |
map of G4 physical volumes
Definition at line 92 of file TG4RootDetectorConstruction.h.
Referenced by CreateG4PhysicalVolume(), and GetG4VPhysicalVolume().
|
private |
map of TGeo volumes
Definition at line 100 of file TG4RootDetectorConstruction.h.
Referenced by CreateG4PhysicalVolume(), and GetNode().
|
protected |
flag Construct() called
Definition at line 103 of file TG4RootDetectorConstruction.h.
Referenced by Construct(), Initialize(), and IsConstructed().
|
protected |
TGeo geometry manager.
Definition at line 104 of file TG4RootDetectorConstruction.h.
Referenced by Construct(), CreateG4Element(), CreateG4Elements(), CreateG4LogicalVolume(), CreateG4LogicalVolumes(), CreateG4Material(), CreateG4Materials(), CreateG4PhysicalVolume(), CreateG4PhysicalVolumes(), and GetGeometryManager().
|
protected |
World G4 physical volume.
Definition at line 105 of file TG4RootDetectorConstruction.h.
Referenced by Construct(), CreateG4PhysicalVolumes(), and GetTopPV().
|
protected |
Sensitive detector hook.
Definition at line 106 of file TG4RootDetectorConstruction.h.
Referenced by ConstructSDandField(), GetSDInit(), Initialize(), and ~TG4RootDetectorConstruction().