10#include <framework/core/MRUCache.h>
19class G4MaterialPropertiesTable;
20class G4OpticalSurface;
21class G4NistElementBuilder;
22class G4NistMaterialBuilder;
29 namespace gearbox {
class Interface; }
32 class GeoOpticalSurface;
33 class GeoMaterialProperty;
50 enum { CacheSize = 100 };
80 G4Material*
getMaterial(
const std::string& name,
bool showErrors =
true);
86 G4Element*
getElement(
const std::string& name);
173 G4MaterialPropertiesTable*
createProperties(
const std::vector<GeoMaterialProperty>& props);
Class to represent a material informaion in the Database.
Represent an optical finish of a surface.
Class implementing a generic Most Recently Used cache.
Exception to be thrown in case of an empty result.
Thin wrapper around the Geant4 Material system.
void setDensityScaleIgnoredMaterials(const std::set< std::string > &ignored)
set the set of material names which will not be scaled in any way
GeoOpticalSurface createOpticalSurfaceConfig(const gearbox::Interface ¶meters)
Create Optical Surface Configuration from XML description.
static G4Material * get(const std::string &name)
Find given material.
G4Material * getMaterial(const std::string &name, bool showErrors=true)
Get a pointer to the G4Material with the given name.
GeoMaterial createMaterialConfig(const gearbox::Interface ¶meters)
Create Material from XML description.
Materials(const Materials &)=delete
Singleton: hide copy constructor.
void resetDensityScale()
Disable density scaling.
void setDensityScale(double scale)
Set the density scale to the given value.
~Materials()
Destructor for objects that I have created.
G4NistElementBuilder * m_nistElementBuilder
G4NistElementBuilder instance to create chemical elements with correct natural abundances from NIST d...
G4NistMaterialBuilder * m_nistMaterialBuilder
G4NistMaterialBuilder to create predefined materials from NIST database.
static Materials & getInstance()
Get a reference to the singleton instance.
Materials()
Singleton: hide constructor.
G4MaterialPropertiesTable * createProperties(const std::vector< GeoMaterialProperty > &props)
Create a properties table from a vector of properties.
void initBuilders()
Initialize Nist Builder instances.
G4Material * createMaterial(const gearbox::Interface ¶meters)
Create a material from the parameters specified by parameters.
MRUCache< std::string, G4Material * > m_materialCache
Cache for already searched Materials.
std::optional< double > m_densityScale
If set we scale all densities by a given factor.
std::set< std::string > getDensityScaleIgnoredMaterials() const
get the set of material names which will not be scaled in any way
G4Material * findMaterial(const std::string &name)
find an existing material by name
std::set< std::string > m_ignoreScaling
Names of materials we don't want to scale.
void clear()
Clear all existing materials.
std::vector< G4MaterialPropertiesTable * > m_PropTables
Vector of created G4MaterialProperties objects.
G4OpticalSurface * createOpticalSurface(const gearbox::Interface ¶meters)
Create an optical surface from parameters, will abort on error.
void operator=(const Materials &)=delete
Singleton: hide assignment operator.
G4Element * getElement(const std::string &name)
Find given chemical element.
Abstract base class for different kinds of events.