Geant4 VMC Version 6.6
|
Services for accessing to Geant4 geometry. More...
#include <TG4GeometryServices.h>
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 ©No) 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 |
TG4Limits * | GetLimits (G4UserLimits *limits) const |
TG4Limits * | GetLimits (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 |
TG4Limits * | FindLimits (const G4String &name, G4bool silent=false) const |
TG4Limits * | FindLimits2 (const G4String &name, G4bool silent=false) const |
TG4Limits * | FindLimits (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 |
TG4MediumMap * | GetMediumMap () const |
TG4OpSurfaceMap * | GetOpSurfaceMap () 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 TG4GeometryServices * | Instance () |
Private Member Functions | |
TG4GeometryServices (const TG4GeometryServices &right) | |
Not implemented. | |
TG4GeometryServices & | operator= (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 | |
TG4MediumMap * | fMediumMap |
map of madia | |
TG4OpSurfaceMap * | fOpSurfaceMap |
map of optical surfaces names to their objects | |
G4VPhysicalVolume * | fWorld |
top physical volume (world) | |
Static Private Attributes | |
static TG4GeometryServices * | fgInstance = 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) | |
Services for accessing to Geant4 geometry.
The class provides service methods for accessing to Geant4 geometry, namely using VMC volumes and materials identifiers.
Definition at line 56 of file TG4GeometryServices.h.
TG4GeometryServices::TG4GeometryServices | ( | ) |
Default constructor
Definition at line 56 of file TG4GeometryServices.cxx.
|
virtual |
Destructor
Definition at line 77 of file TG4GeometryServices.cxx.
|
private |
Not implemented.
|
inlinestatic |
Return this instance
Definition at line 169 of file TG4GeometryServices.h.
Referenced by TG4EmModelPhysics::AddModel(), TG4VRegionsManager::CheckRegionsInGeometry(), TG4DetConstruction::Construct(), TG4GeometryManager::ConstructLocalFields(), TG4GeometryManager::ConstructZeroFields(), TG4SDConstruction::CreateSD(), TG4StepManager::CurrentMaterial(), TG4StepManager::CurrentVolName(), TG4StepManager::CurrentVolOffName(), TG4StepManager::CurrentVolPath(), TG4RegionsManager2::DefineRegions(), TG4RegionsManager::DefineRegions(), TG4RegionsManager::DumpRegion(), TG4StepManager::Gdtom(), TG4StepManager::GetCurrentLimits(), TG4SDServices::GetMediumID(), TG4SDServices::GetMediumId(), 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().
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 206 of file TG4GeometryServices.cxx.
Referenced by TG4StepManager::Gdtom(), TG4StepManager::Gmtod(), TG4MCGeometry::Gsposp(), TG4MCGeometry::Gsvolu(), TG4MCGeometry::Material(), TG4MCGeometry::Medium(), TG4MCGeometry::Mixture(), TG4OpGeometryManager::SetCerenkov(), TG4OpGeometryManager::SetCerenkov(), TG4OpGeometryManager::SetMaterialProperty(), and TG4OpGeometryManager::SetMaterialProperty().
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.
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().
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.
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().
const G4String & TG4GeometryServices::UserVolumeName | ( | const G4String & | name | ) | const |
Cut _copyNo extension added to logical volume name in case the logical volume was created by Gsposp method.
Definition at line 290 of file TG4GeometryServices.cxx.
Referenced by TG4SDConstruction::CreateSD(), TG4StepManager::CurrentVolName(), TG4StepManager::CurrentVolOffName(), TG4StepManager::CurrentVolPath(), FindDaughter(), FindPhysicalVolume(), TG4SDServices::GetVolumeName(), TG4SDServices::MapVolume(), PrintPhysicalVolumeStore(), and TG4SDServices::VolDaughterName().
G4OpticalSurfaceModel TG4GeometryServices::SurfaceModel | ( | EMCOpSurfaceModel | model | ) | const |
Convert VMC enum to G4 enum
Definition at line 309 of file TG4GeometryServices.cxx.
Referenced by TG4OpGeometryManager::DefineOpSurface().
G4SurfaceType TG4GeometryServices::SurfaceType | ( | EMCOpSurfaceType | surfType | ) | const |
Convert VMC enum to G4 enum
Definition at line 330 of file TG4GeometryServices.cxx.
Referenced by TG4OpGeometryManager::DefineOpSurface().
G4OpticalSurfaceFinish TG4GeometryServices::SurfaceFinish | ( | EMCOpSurfaceFinish | finish | ) | const |
Convert VMC enum to G4 enum
Definition at line 352 of file TG4GeometryServices.cxx.
Referenced by TG4OpGeometryManager::DefineOpSurface().
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().
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.
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.
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().
void TG4GeometryServices::PrintStatistics | ( | G4bool | open, |
G4bool | close ) const |
Print G4 geometry statistics.
Definition at line 498 of file TG4GeometryServices.cxx.
Referenced by TG4RunManager::LateInitialize().
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().
void TG4GeometryServices::PrintPhysicalVolumeStore | ( | ) | const |
Print all physical volumes
Definition at line 551 of file TG4GeometryServices.cxx.
void TG4GeometryServices::PrintElementTable | ( | ) | const |
Print the G4 element table.
Definition at line 566 of file TG4GeometryServices.cxx.
void TG4GeometryServices::PrintMaterials | ( | ) | const |
Print all materials
Definition at line 583 of file TG4GeometryServices.cxx.
Referenced by TG4DetConstructionMessenger::SetNewValue().
void TG4GeometryServices::PrintMaterialsProperties | ( | ) | const |
Print all material properties tables
Definition at line 593 of file TG4GeometryServices.cxx.
Referenced by TG4DetConstructionMessenger::SetNewValue().
void TG4GeometryServices::PrintMedia | ( | ) | const |
Print all media from medium map
Definition at line 623 of file TG4GeometryServices.cxx.
Referenced by TG4DetConstructionMessenger::SetNewValue().
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().
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().
|
inline |
Set the world physical volume
Definition at line 175 of file TG4GeometryServices.h.
Referenced by TG4GeometryManager::ConstructG4GeometryViaVGM(), TG4GeometryManager::ConstructG4GeometryViaVMC(), and TG4GeometryManager::FinishGeometry().
|
inline |
Set the info if user geometry is defined via G3toG4
Definition at line 181 of file TG4GeometryServices.h.
Referenced by TG4GeometryManager::ConstructG4GeometryViaVMC().
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().
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.
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().
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().
|
inline |
Set the world physical volume
Definition at line 187 of file TG4GeometryServices.h.
Referenced by TG4EmModelPhysics::AddModel(), TG4DetConstruction::Construct(), TG4GeometryManager::ConstructG4GeometryViaVMC(), TG4RegionsManager2::DefineRegions(), TG4RegionsManager::DefineRegions(), TG4MCGeometry::GetTransformation(), and TG4RegionsManager::LoadRegions().
TG4Limits * TG4GeometryServices::GetLimits | ( | G4UserLimits * | limits | ) | const |
Check and convert the type of the given limits.
Definition at line 750 of file TG4GeometryServices.cxx.
Referenced by FindLimits(), FindLimits2(), TG4StepManager::GetCurrentLimits(), TG4MCGeometry::GetMedium(), TG4PhysicsManager::GstparControl(), TG4PhysicsManager::GstparCut(), TG4VSpecialCuts::PostStepGetPhysicalInteractionLength(), PrintControls(), PrintCuts(), PrintVolumeLimits(), TG4SpecialControlsV2::SetSwitch(), and TG4GeometryManager::SetUserLimits().
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.
G4LogicalVolume * TG4GeometryServices::FindLogicalVolume | ( | const G4String & | name, |
G4bool | silent = false ) const |
Find a logical volume with the specified name in G4LogicalVolumeStore.
Definition at line 793 of file TG4GeometryServices.cxx.
Referenced by TG4GeometryManager::ConstructLocalFields(), TG4RegionsManager::DumpRegion(), TG4MCGeometry::GetMaterial(), TG4MCGeometry::GetMedium(), TG4MediumMap::MapMedium(), PrintVolumeLimits(), and TG4OpGeometryManager::SetSkinSurface().
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().
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().
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().
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().
TG4Limits * TG4GeometryServices::FindLimits | ( | const G4Material * | material, |
G4bool | silent = false ) const |
Find limits with the specified name.
Definition at line 906 of file TG4GeometryServices.cxx.
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().
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().
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().
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.
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.
|
inline |
Return the medium map
Definition at line 193 of file TG4GeometryServices.h.
Referenced by TG4VRegionsManager::CheckRegionsInGeometry(), TG4GeometryManager::ConstructZeroFields(), TG4RegionsManager2::DefineRegions(), TG4RegionsManager::DefineRegions(), TG4GeometryManager::FillMediumMapFromG3(), TG4GeometryManager::FillMediumMapFromG4(), TG4GeometryManager::FillMediumMapFromRoot(), TG4GeometryManager::FinishGeometry(), TG4PhysicsManager::GstparControl(), TG4PhysicsManager::GstparCut(), TG4MCGeometry::MediumId(), TG4OpGeometryManager::SetCerenkov(), TG4OpGeometryManager::SetMaterialProperty(), TG4OpGeometryManager::SetMaterialProperty(), TG4ModelConfigurationManager::SetRegionsNames(), TG4GeometryManager::SetUserLimits(), and TG4RegionsManager2::UpdateProductionCutsTable().
|
inline |
Return the medium map
Definition at line 199 of file TG4GeometryServices.h.
Referenced by TG4OpGeometryManager::TG4OpGeometryManager().
|
private |
Not implemented.
|
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().
|
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().
|
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().
|
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().
|
staticprivate |
this instance
Definition at line 146 of file TG4GeometryServices.h.
Referenced by Instance(), TG4GeometryServices(), and ~TG4GeometryServices().
|
staticprivate |
|
staticprivate |
|
staticprivate |
density tolerance (percentual)
Definition at line 149 of file TG4GeometryServices.h.
Referenced by CompareMaterial().
|
private |
info if user geometry is defined via G3toG4
Definition at line 155 of file TG4GeometryServices.h.
Referenced by SetIsG3toG4(), and UserVolumeName().
|
private |
map of madia
Definition at line 158 of file TG4GeometryServices.h.
Referenced by FindLimits(), GetMediumId(), GetMediumMap(), PrintControls(), PrintCuts(), PrintMedia(), TG4GeometryServices(), and ~TG4GeometryServices().
|
private |
map of optical surfaces names to their objects
Definition at line 161 of file TG4GeometryServices.h.
Referenced by GetOpSurfaceMap(), PrintMaterialsProperties(), TG4GeometryServices(), and ~TG4GeometryServices().
|
private |
top physical volume (world)
Definition at line 164 of file TG4GeometryServices.h.
Referenced by GetWorld(), and SetWorld().