Geant4 VMC Version 6.8
Loading...
Searching...
No Matches
TG4GeometryServices Class Reference

Services for accessing to Geant4 geometry. More...

#include <TG4GeometryServices.h>

Inheritance diagram for TG4GeometryServices:

Public Member Functions

 TG4GeometryServices ()
virtual ~TG4GeometryServices ()
void BuildAssemblyLevels ()
const TG4AssemblyLevelsGetAssemblyLevels (const G4VPhysicalVolume *pv) const
G4double * CreateG4doubleArray (Float_t *array, G4int size, G4bool copyValues=true) const
G4double * CreateG4doubleArray (Double_t *array, G4int size, G4bool copyValues=true) const
G4String CutName (const char *name) const
G4String CutMaterialName (const char *name) const
G4String CutVolumePath (const G4String &volumePath, G4String &volName, G4int &copyNo) const
const G4String & UserVolumeName (const G4String &name) const
G4OpticalSurfaceModel SurfaceModel (EMCOpSurfaceModel model) const
G4SurfaceType SurfaceType (EMCOpSurfaceType surfType) const
G4OpticalSurfaceFinish SurfaceFinish (EMCOpSurfaceFinish finish) const
void Convert (const G4Transform3D &transform, TGeoHMatrix &matrix) const
G4Material * MixMaterials (G4String name, G4double density, const TG4StringVector &matNames, const TG4doubleVector &matWeights)
void PrintLimits (const G4String &name) const
void PrintVolumeLimits (const G4String &volumeName) const
void PrintStatistics (G4bool open, G4bool close) const
void PrintLogicalVolumeStore () const
void PrintPhysicalVolumeStore () const
void PrintElementTable () const
void PrintMaterials () const
void PrintMaterialsProperties () const
void PrintMedia () const
void PrintCuts (const G4String &cutName) const
void PrintControls (const G4String &controlName) const
void SetWorld (G4VPhysicalVolume *world)
void SetIsG3toG4 (G4bool isG3toG4)
void SetG3toG4Separator (char separator)
void SetAccountAssemblyLevels (G4bool option)
Int_t NofG3Volumes () const
Int_t NofG4LogicalVolumes () const
Int_t NofG4PhysicalVolumes () const
G4VPhysicalVolume * GetWorld () const
TG4LimitsGetLimits (G4UserLimits *limits) const
TG4LimitsGetLimits (G4UserLimits *limits, const TG4G3CutVector &cuts, const TG4G3ControlVector &controls) const
G4LogicalVolume * FindLogicalVolume (const G4String &name, G4bool silent=false) const
G4VPhysicalVolume * FindPhysicalVolume (const G4String &name, G4int copyNo, G4bool silent=false) const
G4VPhysicalVolume * FindDaughter (const G4String &name, G4int copyNo, G4LogicalVolume *mlv, G4bool silent=false) const
TG4LimitsFindLimits (const G4String &name, G4bool silent=false) const
TG4LimitsFindLimits2 (const G4String &name, G4bool silent=false) const
TG4LimitsFindLimits (const G4Material *, G4bool silent=false) const
G4int GetMediumId (G4LogicalVolume *lv) const
G4double GetEffA (G4Material *material) const
G4double GetEffZ (G4Material *material) const
G4Material * FindMaterial (G4double a, G4double z, G4double density) const
G4Material * FindMaterial (G4double *a, G4double *z, G4double density, G4int nmat, G4double *wmat) const
TG4MediumMapGetMediumMap () const
TG4OpSurfaceMapGetOpSurfaceMap () const
Public Member Functions inherited from TG4Verbose
 TG4Verbose (const G4String &cmdName)
 TG4Verbose (const G4String &cmdName, G4int verboseLevel)
virtual ~TG4Verbose ()
virtual void VerboseLevel (G4int level)
virtual G4int VerboseLevel () const

Static Public Member Functions

static TG4GeometryServicesInstance ()

Private Member Functions

 TG4GeometryServices (const TG4GeometryServices &right)
 Not implemented.
TG4GeometryServicesoperator= (const TG4GeometryServices &right)
 Not implemented.
G4bool IsG3Volume (const G4String &lvName) const
G4bool CompareElement (G4double a, G4double z, const G4Element *elem) const
G4bool CompareMaterial (G4int nofElements, G4double density, const G4Material *material) const
G4double * ConvertAtomWeight (G4int nmat, G4double *a, G4double *wmat) const

Private Attributes

G4bool fIsG3toG4
 info if user geometry is defined via G3toG4
TG4MediumMapfMediumMap
 map of madia
TG4OpSurfaceMapfOpSurfaceMap
 map of optical surfaces names to their objects
G4VPhysicalVolume * fWorld
 top physical volume (world)
G4bool fAccountAssemblyLevels
 option to account assembly levels in the volume level hierarchy
std::vector< TG4AssemblyLevelsfAssemblyLevels
 assembly levels per placement, indexed by its Geant4 instance id
G4bool fAssemblyLevelsBuilt
 whether fAssemblyLevels has been filled

Static Private Attributes

static TG4GeometryServicesfgInstance = 0
 this instance
static G4String fgBuffer = ""
 string buffer
static const G4double fgkAZTolerance = 0.001
 A,Z tolerance.
static const G4double fgkDensityTolerance = 0.005
 density tolerance (percentual)

Detailed Description

Services for accessing to Geant4 geometry.

The class provides service methods for accessing to Geant4 geometry, namely using VMC volumes and materials identifiers.

Author
I. Hrivnacova; IPN, Orsay

Definition at line 71 of file TG4GeometryServices.h.

Constructor & Destructor Documentation

◆ TG4GeometryServices() [1/2]

TG4GeometryServices::TG4GeometryServices ( )

Default constructor

Definition at line 62 of file TG4GeometryServices.cxx.

Referenced by Instance(), operator=(), and TG4GeometryServices().

◆ ~TG4GeometryServices()

TG4GeometryServices::~TG4GeometryServices ( )
virtual

Destructor

Definition at line 86 of file TG4GeometryServices.cxx.

◆ TG4GeometryServices() [2/2]

TG4GeometryServices::TG4GeometryServices ( const TG4GeometryServices & right)
private

Not implemented.

Member Function Documentation

◆ Instance()

TG4GeometryServices * TG4GeometryServices::Instance ( )
inlinestatic

Return this instance

Definition at line 196 of file TG4GeometryServices.h.

Referenced by TG4EmModelPhysics::AddModel(), TG4VRegionsManager::CheckRegionsInGeometry(), TG4DetConstruction::Construct(), TG4GeometryManager::ConstructGeometry(), TG4GeometryManager::ConstructLocalFields(), TG4GeometryManager::ConstructZeroFields(), TG4SDConstruction::CreateSD(), TG4StepManager::CurrentMaterial(), TG4StepManager::CurrentVolName(), TG4StepManager::CurrentVolOffID(), TG4StepManager::CurrentVolOffName(), TG4StepManager::CurrentVolPath(), TG4RegionsManager2::DefineRegions(), TG4RegionsManager::DefineRegions(), TG4RegionsManager::DumpRegion(), TG4StepManager::Gdtom(), TG4StepManager::GetCurrentLimits(), TG4SDServices::GetMediumID(), TG4SDServices::GetMediumId(), TG4StepManager::GetOffLevel(), TG4SDServices::GetVolumeID(), TG4SDServices::GetVolumeName(), TG4StepManager::Gmtod(), TG4PhysicsManager::Gstpar(), TG4PhysicsManager::GstparControl(), TG4PhysicsManager::GstparCut(), TG4RunManager::LateInitialize(), TG4RegionsManager::LoadRegions(), TG4MediumMap::MapMedium(), TG4SDServices::MapVolume(), TG4MCGeometry::MediumId(), TG4VSpecialCuts::PostStepGetPhysicalInteractionLength(), TG4VRegionsManager::PrintFromG4Table(), TG4ComposedPhysicsMessenger::SetNewValue(), TG4DetConstructionMessenger::SetNewValue(), TG4VGMMessenger::SetNewValue(), TG4ModelConfigurationManager::SetRegionsNames(), TG4SpecialControlsV2::SetSwitch(), TG4MCGeometry::TG4MCGeometry(), TG4OpGeometryManager::TG4OpGeometryManager(), TG4RegionsManager2::UpdateProductionCutsTable(), and TG4SDServices::VolDaughterName().

◆ BuildAssemblyLevels()

void TG4GeometryServices::BuildAssemblyLevels ( )

Decompose every VGM assembly-composite placement name once, so that the per-step lookup below is a plain array index.

Definition at line 215 of file TG4GeometryServices.cxx.

Referenced by TG4GeometryManager::ConstructGeometry().

◆ GetAssemblyLevels()

const TG4AssemblyLevels & TG4GeometryServices::GetAssemblyLevels ( const G4VPhysicalVolume * pv) const

◆ CreateG4doubleArray() [1/2]

G4double * TG4GeometryServices::CreateG4doubleArray ( Float_t * array,
G4int size,
G4bool copyValues = true ) const

Convert Float_t* array to G4double*.
!! The new array has to be deleted by user.

Definition at line 288 of file TG4GeometryServices.cxx.

Referenced by TG4StepManager::Gdtom(), and TG4StepManager::Gmtod().

◆ CreateG4doubleArray() [2/2]

G4double * TG4GeometryServices::CreateG4doubleArray ( Double_t * array,
G4int size,
G4bool copyValues = true ) const

Copy Double_t* array to G4double*.
!! The new array has to be deleted by user.

Definition at line 308 of file TG4GeometryServices.cxx.

◆ CutName()

G4String TG4GeometryServices::CutName ( const char * name) const

Remove spaces after the name if present.

Definition at line 328 of file TG4GeometryServices.cxx.

Referenced by CutMaterialName(), TG4SDServices::GetVolumeID(), and TG4PhysicsManager::Gstpar().

◆ CutMaterialName()

G4String TG4GeometryServices::CutMaterialName ( const char * name) const

Remove the $ with precedent spaces at the name if present.

Definition at line 340 of file TG4GeometryServices.cxx.

◆ CutVolumePath()

G4String TG4GeometryServices::CutVolumePath ( const G4String & volumePath,
G4String & volName,
G4int & copyNo ) const

Extract the first volume name and copy number from the volumePath

Definition at line 351 of file TG4GeometryServices.cxx.

◆ UserVolumeName()

const G4String & TG4GeometryServices::UserVolumeName ( const G4String & name) const

◆ SurfaceModel()

G4OpticalSurfaceModel TG4GeometryServices::SurfaceModel ( EMCOpSurfaceModel model) const

Convert VMC enum to G4 enum

Definition at line 391 of file TG4GeometryServices.cxx.

◆ SurfaceType()

G4SurfaceType TG4GeometryServices::SurfaceType ( EMCOpSurfaceType surfType) const

Convert VMC enum to G4 enum

Definition at line 412 of file TG4GeometryServices.cxx.

◆ SurfaceFinish()

G4OpticalSurfaceFinish TG4GeometryServices::SurfaceFinish ( EMCOpSurfaceFinish finish) const

Convert VMC enum to G4 enum

Definition at line 434 of file TG4GeometryServices.cxx.

◆ Convert()

void TG4GeometryServices::Convert ( const G4Transform3D & transform,
TGeoHMatrix & matrix ) const

Convert CLHEP Transform3D in Root TGeoHMatrix

Definition at line 496 of file TG4GeometryServices.cxx.

◆ MixMaterials()

G4Material * TG4GeometryServices::MixMaterials ( G4String name,
G4double density,
const TG4StringVector & matNames,
const TG4doubleVector & matWeights )

Create a mixture of selected materials.

Definition at line 515 of file TG4GeometryServices.cxx.

◆ PrintLimits()

void TG4GeometryServices::PrintLimits ( const G4String & name) const

Find the limits with the specified name and prints them.

Definition at line 552 of file TG4GeometryServices.cxx.

◆ PrintVolumeLimits()

void TG4GeometryServices::PrintVolumeLimits ( const G4String & volumeName) const

Find a logical volume with the specified name and prints its limits.

Definition at line 562 of file TG4GeometryServices.cxx.

Referenced by TG4ComposedPhysicsMessenger::SetNewValue().

◆ PrintStatistics()

void TG4GeometryServices::PrintStatistics ( G4bool open,
G4bool close ) const

Print G4 geometry statistics.

Definition at line 580 of file TG4GeometryServices.cxx.

Referenced by TG4RunManager::LateInitialize().

◆ PrintLogicalVolumeStore()

void TG4GeometryServices::PrintLogicalVolumeStore ( ) const

Print all logical volumes and their daughters.

Definition at line 598 of file TG4GeometryServices.cxx.

Referenced by TG4RunManager::LateInitialize(), and TG4DetConstructionMessenger::SetNewValue().

◆ PrintPhysicalVolumeStore()

void TG4GeometryServices::PrintPhysicalVolumeStore ( ) const

Print all physical volumes

Definition at line 633 of file TG4GeometryServices.cxx.

◆ PrintElementTable()

void TG4GeometryServices::PrintElementTable ( ) const

Print the G4 element table.

Definition at line 648 of file TG4GeometryServices.cxx.

◆ PrintMaterials()

void TG4GeometryServices::PrintMaterials ( ) const

Print all materials

Definition at line 665 of file TG4GeometryServices.cxx.

Referenced by TG4DetConstructionMessenger::SetNewValue().

◆ PrintMaterialsProperties()

void TG4GeometryServices::PrintMaterialsProperties ( ) const

Print all material properties tables

Definition at line 675 of file TG4GeometryServices.cxx.

Referenced by TG4DetConstructionMessenger::SetNewValue().

◆ PrintMedia()

void TG4GeometryServices::PrintMedia ( ) const

Print all media from medium map

Definition at line 705 of file TG4GeometryServices.cxx.

Referenced by TG4DetConstructionMessenger::SetNewValue().

◆ PrintCuts()

void TG4GeometryServices::PrintCuts ( const G4String & cutName) const

Print the cut value for the cut with given cutName for all tracking media

Definition at line 713 of file TG4GeometryServices.cxx.

Referenced by TG4DetConstructionMessenger::SetNewValue().

◆ PrintControls()

void TG4GeometryServices::PrintControls ( const G4String & controlName) const

Print the control value for the control with given controlName for all tracking media

Definition at line 744 of file TG4GeometryServices.cxx.

Referenced by TG4DetConstructionMessenger::SetNewValue().

◆ SetWorld()

void TG4GeometryServices::SetWorld ( G4VPhysicalVolume * world)
inline

Set the world physical volume

Definition at line 202 of file TG4GeometryServices.h.

◆ SetIsG3toG4()

void TG4GeometryServices::SetIsG3toG4 ( G4bool isG3toG4)
inline

Set the info if user geometry is defined via G3toG4

Definition at line 208 of file TG4GeometryServices.h.

◆ SetG3toG4Separator()

void TG4GeometryServices::SetG3toG4Separator ( char separator)

Set the volumes name separator that will be applied in both roottog4 and g3tog4

Definition at line 781 of file TG4GeometryServices.cxx.

Referenced by TG4DetConstructionMessenger::SetNewValue().

◆ SetAccountAssemblyLevels()

void TG4GeometryServices::SetAccountAssemblyLevels ( G4bool option)
inline

Set the option to account assembly levels in the volume level hierarchy

Definition at line 214 of file TG4GeometryServices.h.

Referenced by TG4DetConstructionMessenger::SetNewValue().

◆ NofG3Volumes()

Int_t TG4GeometryServices::NofG3Volumes ( ) const

Return the total number of logical volumes corresponding to G3 volumes. The logical volumes that were created by Gsposp method with a generic name (name_copyNo) are NOT included.

Definition at line 789 of file TG4GeometryServices.cxx.

◆ NofG4LogicalVolumes()

Int_t TG4GeometryServices::NofG4LogicalVolumes ( ) const

Return the total number of logical volumes in the geometry.

Definition at line 808 of file TG4GeometryServices.cxx.

Referenced by PrintStatistics().

◆ NofG4PhysicalVolumes()

Int_t TG4GeometryServices::NofG4PhysicalVolumes ( ) const

Return the total number of physical volumes in the geometry.

Definition at line 817 of file TG4GeometryServices.cxx.

Referenced by PrintStatistics().

◆ GetWorld()

G4VPhysicalVolume * TG4GeometryServices::GetWorld ( ) const
inline

◆ GetLimits() [1/2]

◆ GetLimits() [2/2]

TG4Limits * TG4GeometryServices::GetLimits ( G4UserLimits * limits,
const TG4G3CutVector & cuts,
const TG4G3ControlVector & controls ) const

Check and convert the type of the given limits; create TG4Limits object if it does not yet exist

Definition at line 849 of file TG4GeometryServices.cxx.

◆ FindLogicalVolume()

G4LogicalVolume * TG4GeometryServices::FindLogicalVolume ( const G4String & name,
G4bool silent = false ) const

Find a logical volume with the specified name in G4LogicalVolumeStore.

Definition at line 875 of file TG4GeometryServices.cxx.

Referenced by TG4GeometryManager::ConstructLocalFields(), TG4RegionsManager::DumpRegion(), TG4MediumMap::MapMedium(), and PrintVolumeLimits().

◆ FindPhysicalVolume()

G4VPhysicalVolume * TG4GeometryServices::FindPhysicalVolume ( const G4String & name,
G4int copyNo,
G4bool silent = false ) const

Find a physical volume with the specified name and copyNo in G4PhysicalVolumeStore.

Definition at line 895 of file TG4GeometryServices.cxx.

◆ FindDaughter()

G4VPhysicalVolume * TG4GeometryServices::FindDaughter ( const G4String & name,
G4int copyNo,
G4LogicalVolume * mlv,
G4bool silent = false ) const

Find daughter specified by name and copyNo in the given mother logical volume

Definition at line 922 of file TG4GeometryServices.cxx.

◆ FindLimits() [1/2]

TG4Limits * TG4GeometryServices::FindLimits ( const G4String & name,
G4bool silent = false ) const

Find limits with the specified name.

Definition at line 942 of file TG4GeometryServices.cxx.

Referenced by FindLimits(), TG4VRegionsManager::PrintFromG4Table(), and PrintLimits().

◆ FindLimits2()

TG4Limits * TG4GeometryServices::FindLimits2 ( const G4String & name,
G4bool silent = false ) const

Find limits with the specified name. Do not give an exception when limits of G4UserLimits are processed

Definition at line 963 of file TG4GeometryServices.cxx.

◆ FindLimits() [2/2]

TG4Limits * TG4GeometryServices::FindLimits ( const G4Material * material,
G4bool silent = false ) const

Find limits with the specified name.

Definition at line 988 of file TG4GeometryServices.cxx.

◆ GetMediumId()

G4int TG4GeometryServices::GetMediumId ( G4LogicalVolume * lv) const

Return the second index for materials (having its origin in G4 tracking media concept)

Definition at line 1001 of file TG4GeometryServices.cxx.

Referenced by TG4SDConstruction::CreateSD(), TG4SDServices::GetMediumID(), and TG4SDServices::GetMediumId().

◆ GetEffA()

G4double TG4GeometryServices::GetEffA ( G4Material * material) const

Return A or the effective A=sum(pi*Ai) (if compound/mixture) of the given material.

Definition at line 1014 of file TG4GeometryServices.cxx.

Referenced by TG4StepManager::CurrentMaterial().

◆ GetEffZ()

G4double TG4GeometryServices::GetEffZ ( G4Material * material) const

Return Z or the effective Z=sum(pi*Zi) (if compound/mixture) of the given material.

Definition at line 1041 of file TG4GeometryServices.cxx.

Referenced by TG4StepManager::CurrentMaterial().

◆ FindMaterial() [1/2]

G4Material * TG4GeometryServices::FindMaterial ( G4double a,
G4double z,
G4double density ) const

Find the material in G4MaterialTable with specified parameters, return 0 if not found.

Definition at line 1067 of file TG4GeometryServices.cxx.

◆ FindMaterial() [2/2]

G4Material * TG4GeometryServices::FindMaterial ( G4double * a,
G4double * z,
G4double density,
G4int nmat,
G4double * wmat ) const

Find the material in G4MaterialTable with specified parameters, return 0 if not found.

Definition at line 1089 of file TG4GeometryServices.cxx.

◆ GetMediumMap()

◆ GetOpSurfaceMap()

TG4OpSurfaceMap * TG4GeometryServices::GetOpSurfaceMap ( ) const
inline

Return the medium map

Definition at line 232 of file TG4GeometryServices.h.

◆ operator=()

TG4GeometryServices & TG4GeometryServices::operator= ( const TG4GeometryServices & right)
private

Not implemented.

◆ IsG3Volume()

G4bool TG4GeometryServices::IsG3Volume ( const G4String & lvName) const
private

Return true if the logical volume of given volumeName was not created by Gsposp method with a generic name (name_copyNo).

Definition at line 139 of file TG4GeometryServices.cxx.

Referenced by NofG3Volumes().

◆ CompareElement()

G4bool TG4GeometryServices::CompareElement ( G4double a,
G4double z,
const G4Element * elem ) const
private

Compare given parameters with those of a given element, return true if they are equal, false otherwise.

Definition at line 149 of file TG4GeometryServices.cxx.

Referenced by FindMaterial(), and FindMaterial().

◆ CompareMaterial()

G4bool TG4GeometryServices::CompareMaterial ( G4int nofElements,
G4double density,
const G4Material * material ) const
private

Compare given density with those of a given material, return true if they are equal, false otherwise.

Definition at line 160 of file TG4GeometryServices.cxx.

Referenced by FindMaterial(), and FindMaterial().

◆ ConvertAtomWeight()

G4double * TG4GeometryServices::ConvertAtomWeight ( G4int nmat,
G4double * a,
G4double * wmat ) const
private

In case of proportions given in atom counts (nmat<0), the wmat[i] are converted to weight fractions. (From g3tog4 G4gsmixt.)
The new array has to be deleted by client.

Definition at line 179 of file TG4GeometryServices.cxx.

Referenced by FindMaterial().

Member Data Documentation

◆ fgInstance

TG4GeometryServices * TG4GeometryServices::fgInstance = 0
staticprivate

this instance

Definition at line 164 of file TG4GeometryServices.h.

Referenced by Instance(), TG4GeometryServices(), and ~TG4GeometryServices().

◆ fgBuffer

G4String TG4GeometryServices::fgBuffer = ""
staticprivate

string buffer

Definition at line 165 of file TG4GeometryServices.h.

Referenced by UserVolumeName().

◆ fgkAZTolerance

const G4double TG4GeometryServices::fgkAZTolerance = 0.001
staticprivate

A,Z tolerance.

Definition at line 166 of file TG4GeometryServices.h.

Referenced by FindMaterial().

◆ fgkDensityTolerance

const G4double TG4GeometryServices::fgkDensityTolerance = 0.005
staticprivate

density tolerance (percentual)

Definition at line 167 of file TG4GeometryServices.h.

Referenced by CompareMaterial().

◆ fIsG3toG4

G4bool TG4GeometryServices::fIsG3toG4
private

info if user geometry is defined via G3toG4

Definition at line 173 of file TG4GeometryServices.h.

Referenced by SetIsG3toG4(), TG4GeometryServices(), and UserVolumeName().

◆ fMediumMap

TG4MediumMap* TG4GeometryServices::fMediumMap
private

◆ fOpSurfaceMap

TG4OpSurfaceMap* TG4GeometryServices::fOpSurfaceMap
private

map of optical surfaces names to their objects

Definition at line 179 of file TG4GeometryServices.h.

Referenced by GetOpSurfaceMap(), PrintMaterialsProperties(), TG4GeometryServices(), and ~TG4GeometryServices().

◆ fWorld

G4VPhysicalVolume* TG4GeometryServices::fWorld
private

top physical volume (world)

Definition at line 182 of file TG4GeometryServices.h.

Referenced by GetWorld(), SetWorld(), and TG4GeometryServices().

◆ fAccountAssemblyLevels

G4bool TG4GeometryServices::fAccountAssemblyLevels
private

option to account assembly levels in the volume level hierarchy

Definition at line 185 of file TG4GeometryServices.h.

Referenced by BuildAssemblyLevels(), SetAccountAssemblyLevels(), and TG4GeometryServices().

◆ fAssemblyLevels

std::vector<TG4AssemblyLevels> TG4GeometryServices::fAssemblyLevels
private

assembly levels per placement, indexed by its Geant4 instance id

Definition at line 188 of file TG4GeometryServices.h.

Referenced by BuildAssemblyLevels(), GetAssemblyLevels(), and TG4GeometryServices().

◆ fAssemblyLevelsBuilt

G4bool TG4GeometryServices::fAssemblyLevelsBuilt
private

whether fAssemblyLevels has been filled

Definition at line 191 of file TG4GeometryServices.h.

Referenced by BuildAssemblyLevels(), GetAssemblyLevels(), and TG4GeometryServices().


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