Geant4 VMC Version 6.6
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 ()
 
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)
 
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)
 

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 56 of file TG4GeometryServices.h.

Constructor & Destructor Documentation

◆ TG4GeometryServices() [1/2]

TG4GeometryServices::TG4GeometryServices ( )

Default constructor

Definition at line 56 of file TG4GeometryServices.cxx.

◆ ~TG4GeometryServices()

TG4GeometryServices::~TG4GeometryServices ( )
virtual

Destructor

Definition at line 77 of file TG4GeometryServices.cxx.

◆ TG4GeometryServices() [2/2]

TG4GeometryServices::TG4GeometryServices ( const TG4GeometryServices & right)
private

Not implemented.

Member Function Documentation

◆ Instance()

TG4GeometryServices * TG4GeometryServices::Instance ( )
inlinestatic

◆ CreateG4doubleArray() [1/2]

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

◆ 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 226 of file TG4GeometryServices.cxx.

◆ CutName()

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

Remove spaces after the name if present.

Definition at line 246 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 258 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 269 of file TG4GeometryServices.cxx.

Referenced by TG4MCGeometry::GetTransformation().

◆ 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 309 of file TG4GeometryServices.cxx.

Referenced by TG4OpGeometryManager::DefineOpSurface().

◆ SurfaceType()

G4SurfaceType TG4GeometryServices::SurfaceType ( EMCOpSurfaceType surfType) const

Convert VMC enum to G4 enum

Definition at line 330 of file TG4GeometryServices.cxx.

Referenced by TG4OpGeometryManager::DefineOpSurface().

◆ SurfaceFinish()

G4OpticalSurfaceFinish TG4GeometryServices::SurfaceFinish ( EMCOpSurfaceFinish finish) const

Convert VMC enum to G4 enum

Definition at line 352 of file TG4GeometryServices.cxx.

Referenced by TG4OpGeometryManager::DefineOpSurface().

◆ Convert()

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

Convert CLHEP Transform3D in Root TGeoHMatrix

Definition at line 414 of file TG4GeometryServices.cxx.

Referenced by TG4MCGeometry::GetTransformation().

◆ MixMaterials()

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

Create a mixture of selected materials.

Definition at line 433 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 470 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 480 of file TG4GeometryServices.cxx.

Referenced by TG4ComposedPhysicsMessenger::SetNewValue().

◆ PrintStatistics()

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

Print G4 geometry statistics.

Definition at line 498 of file TG4GeometryServices.cxx.

Referenced by TG4RunManager::LateInitialize().

◆ PrintLogicalVolumeStore()

void TG4GeometryServices::PrintLogicalVolumeStore ( ) const

Print all logical volumes and their daughters.

Definition at line 516 of file TG4GeometryServices.cxx.

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

◆ PrintPhysicalVolumeStore()

void TG4GeometryServices::PrintPhysicalVolumeStore ( ) const

Print all physical volumes

Definition at line 551 of file TG4GeometryServices.cxx.

◆ PrintElementTable()

void TG4GeometryServices::PrintElementTable ( ) const

Print the G4 element table.

Definition at line 566 of file TG4GeometryServices.cxx.

◆ PrintMaterials()

void TG4GeometryServices::PrintMaterials ( ) const

Print all materials

Definition at line 583 of file TG4GeometryServices.cxx.

Referenced by TG4DetConstructionMessenger::SetNewValue().

◆ PrintMaterialsProperties()

void TG4GeometryServices::PrintMaterialsProperties ( ) const

Print all material properties tables

Definition at line 593 of file TG4GeometryServices.cxx.

Referenced by TG4DetConstructionMessenger::SetNewValue().

◆ PrintMedia()

void TG4GeometryServices::PrintMedia ( ) const

Print all media from medium map

Definition at line 623 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 631 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 662 of file TG4GeometryServices.cxx.

Referenced by TG4DetConstructionMessenger::SetNewValue().

◆ SetWorld()

void TG4GeometryServices::SetWorld ( G4VPhysicalVolume * world)
inline

◆ SetIsG3toG4()

void TG4GeometryServices::SetIsG3toG4 ( G4bool isG3toG4)
inline

Set the info if user geometry is defined via G3toG4

Definition at line 181 of file TG4GeometryServices.h.

Referenced by TG4GeometryManager::ConstructG4GeometryViaVMC().

◆ SetG3toG4Separator()

void TG4GeometryServices::SetG3toG4Separator ( char separator)

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

Definition at line 699 of file TG4GeometryServices.cxx.

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 707 of file TG4GeometryServices.cxx.

◆ NofG4LogicalVolumes()

Int_t TG4GeometryServices::NofG4LogicalVolumes ( ) const

Return the total number of logical volumes in the geometry.

Definition at line 726 of file TG4GeometryServices.cxx.

Referenced by TG4GeometryManager::ConstructG4Geometry(), and PrintStatistics().

◆ NofG4PhysicalVolumes()

Int_t TG4GeometryServices::NofG4PhysicalVolumes ( ) const

Return the total number of physical volumes in the geometry.

Definition at line 735 of file TG4GeometryServices.cxx.

Referenced by TG4GeometryManager::ConstructG4Geometry(), and PrintStatistics().

◆ GetWorld()

◆ 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 767 of file TG4GeometryServices.cxx.

◆ FindLogicalVolume()

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

◆ 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 813 of file TG4GeometryServices.cxx.

Referenced by TG4MCGeometry::GetShape(), TG4MCGeometry::GetTransformation(), and TG4OpGeometryManager::SetBorderSurface().

◆ 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 840 of file TG4GeometryServices.cxx.

Referenced by TG4MCGeometry::GetTransformation().

◆ FindLimits() [1/2]

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

Find limits with the specified name.

Definition at line 860 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 881 of file TG4GeometryServices.cxx.

Referenced by TG4GeometryManager::SetUserLimits().

◆ FindLimits() [2/2]

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

Find limits with the specified name.

Definition at line 906 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 919 of file TG4GeometryServices.cxx.

Referenced by TG4SDConstruction::CreateSD(), TG4MCGeometry::GetMedium(), 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 932 of file TG4GeometryServices.cxx.

Referenced by TG4StepManager::CurrentMaterial(), TG4MCGeometry::GetMaterial(), TG4OpGeometryManager::GetMaterial(), and TG4OpGeometryManager::Gfmate().

◆ 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 959 of file TG4GeometryServices.cxx.

Referenced by TG4StepManager::CurrentMaterial(), TG4MCGeometry::GetMaterial(), TG4OpGeometryManager::GetMaterial(), and TG4OpGeometryManager::Gfmate().

◆ 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 985 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 1007 of file TG4GeometryServices.cxx.

◆ GetMediumMap()

◆ GetOpSurfaceMap()

TG4OpSurfaceMap * TG4GeometryServices::GetOpSurfaceMap ( ) const
inline

Return the medium map

Definition at line 199 of file TG4GeometryServices.h.

Referenced by TG4OpGeometryManager::TG4OpGeometryManager().

◆ 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 130 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 140 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 151 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 170 of file TG4GeometryServices.cxx.

Referenced by FindMaterial().

Member Data Documentation

◆ fgInstance

TG4GeometryServices * TG4GeometryServices::fgInstance = 0
staticprivate

this instance

Definition at line 146 of file TG4GeometryServices.h.

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

◆ fgBuffer

G4String TG4GeometryServices::fgBuffer = ""
staticprivate

string buffer

Definition at line 147 of file TG4GeometryServices.h.

Referenced by UserVolumeName().

◆ fgkAZTolerance

const G4double TG4GeometryServices::fgkAZTolerance = 0.001
staticprivate

A,Z tolerance.

Definition at line 148 of file TG4GeometryServices.h.

Referenced by FindMaterial().

◆ fgkDensityTolerance

const G4double TG4GeometryServices::fgkDensityTolerance = 0.005
staticprivate

density tolerance (percentual)

Definition at line 149 of file TG4GeometryServices.h.

Referenced by CompareMaterial().

◆ fIsG3toG4

G4bool TG4GeometryServices::fIsG3toG4
private

info if user geometry is defined via G3toG4

Definition at line 155 of file TG4GeometryServices.h.

Referenced by SetIsG3toG4(), and UserVolumeName().

◆ fMediumMap

TG4MediumMap* TG4GeometryServices::fMediumMap
private

◆ fOpSurfaceMap

TG4OpSurfaceMap* TG4GeometryServices::fOpSurfaceMap
private

map of optical surfaces names to their objects

Definition at line 161 of file TG4GeometryServices.h.

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

◆ fWorld

G4VPhysicalVolume* TG4GeometryServices::fWorld
private

top physical volume (world)

Definition at line 164 of file TG4GeometryServices.h.

Referenced by GetWorld(), and SetWorld().


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