Belle II Software development
Materials Class Reference

Thin wrapper around the Geant4 Material system. More...

#include <Materials.h>

Public Types

enum  { CacheSize = 100 }
 

Public Member Functions

 ~Materials ()
 Destructor for objects that I have created.
 
G4Material * getMaterial (const std::string &name, bool showErrors=true)
 Get a pointer to the G4Material with the given name.
 
G4Element * getElement (const std::string &name)
 Find given chemical element.
 
G4Material * createMaterial (const gearbox::Interface &parameters)
 Create a material from the parameters specified by parameters.
 
G4Material * createMaterial (const GeoMaterial &parameters)
 Create Geant4 Material from Material definition in DB.
 
G4OpticalSurface * createOpticalSurface (const gearbox::Interface &parameters)
 Create an optical surface from parameters, will abort on error.
 
G4OpticalSurface * createOpticalSurface (const GeoOpticalSurface &surface)
 Create an optical surface from Surface definition in DB.
 
GeoMaterial createMaterialConfig (const gearbox::Interface &parameters)
 Create Material from XML description.
 
GeoOpticalSurface createOpticalSurfaceConfig (const gearbox::Interface &parameters)
 Create Optical Surface Configuration from XML description.
 
void clear ()
 Clear all existing materials.
 
void setDensityScale (double scale)
 Set the density scale to the given value.
 
void resetDensityScale ()
 Disable density scaling.
 
std::set< std::string > getDensityScaleIgnoredMaterials () const
 get the set of material names which will not be scaled in any way
 
void setDensityScaleIgnoredMaterials (const std::set< std::string > &ignored)
 set the set of material names which will not be scaled in any way
 

Static Public Member Functions

static MaterialsgetInstance ()
 Get a reference to the singleton instance.
 
static G4Material * get (const std::string &name)
 Find given material.
 

Protected Member Functions

 Materials ()
 Singleton: hide constructor.
 
 Materials (const Materials &)=delete
 Singleton: hide copy constructor.
 
void operator= (const Materials &)=delete
 Singleton: hide assignment operator.
 
G4Material * findMaterial (const std::string &name)
 find an existing material by name
 
G4MaterialPropertiesTable * createProperties (const std::vector< GeoMaterialProperty > &props)
 Create a properties table from a vector of properties.
 
void initBuilders ()
 Initialize Nist Builder instances.
 

Protected Attributes

MRUCache< std::string, G4Material * > m_materialCache
 Cache for already searched Materials.
 
std::vector< G4MaterialPropertiesTable * > m_PropTables
 Vector of created G4MaterialProperties objects.
 
G4NistElementBuilder * m_nistElementBuilder {nullptr}
 G4NistElementBuilder instance to create chemical elements with correct natural abundances from NIST database.
 
G4NistMaterialBuilder * m_nistMaterialBuilder {nullptr}
 G4NistMaterialBuilder to create predefined materials from NIST database.
 
std::optional< double > m_densityScale
 If set we scale all densities by a given factor.
 
std::set< std::string > m_ignoreScaling {"G4_AIR", "Air", "Vacuum"}
 Names of materials we don't want to scale.
 

Detailed Description

Thin wrapper around the Geant4 Material system.

This class serves the purpose to simplify the access to the Geant4 materials using the G4NistManager and to directly create materials from a Gearbox parameter set. Since Geant4 keeps track of all defined materials, this class is also able to find Materials created directly by the user.

Care should be taken when a Material is created with a name that already exists. In that case it may be possible that we return the wrong material since the first material with the given name will be returned.

Definition at line 48 of file Materials.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Definition at line 50 of file Materials.h.

50{ CacheSize = 100 };

Constructor & Destructor Documentation

◆ ~Materials()

~Materials ( )

Destructor for objects that I have created.

Definition at line 91 of file Materials.cc.

92 {
93 clear();
94 }
void clear()
Clear all existing materials.
Definition: Materials.cc:384

◆ Materials()

Materials ( )
inlineprotected

Singleton: hide constructor.

Definition at line 152 of file Materials.h.

152: m_materialCache(CacheSize) {};
MRUCache< std::string, G4Material * > m_materialCache
Cache for already searched Materials.
Definition: Materials.h:161

Member Function Documentation

◆ clear()

void clear ( )

Clear all existing materials.

Definition at line 384 of file Materials.cc.

385 {
386 // delete all property tables we have
387 B2DEBUG(50, "Cleaning G4MaterialPropertiesTable");
388 for (G4MaterialPropertiesTable* prop : m_PropTables) delete prop;
389 m_PropTables.clear();
390 // and last but not least: get rid of all materials
391 B2DEBUG(50, "Cleaning G4Materials");
392 G4MaterialTable& materials = *G4Material::GetMaterialTable();
393 for (G4Material* mat : materials) delete mat;
394 materials.clear();
395 B2DEBUG(50, "Cleaning G4Elements");
396 G4ElementTable& elements = *G4Element::GetElementTable();
397 for (G4Element* elm : elements) delete elm;
398 elements.clear();
399 B2DEBUG(50, "Cleaning G4Isotopes");
400 auto& isotopes = const_cast<G4IsotopeTable&>(*G4Isotope::GetIsotopeTable());
401 for (G4Isotope* iso : isotopes) delete iso;
402 isotopes.clear();
403 // delete material and element builder as they keep indices to materials they created :/
406 m_nistMaterialBuilder = nullptr;
407 m_nistElementBuilder = nullptr;
408 // finally, get rid of the cache, it's invalid now anyway
409 B2DEBUG(50, "Clean up material cache");
411 }
void clear()
Clear cache.
Definition: MRUCache.h:125
G4NistElementBuilder * m_nistElementBuilder
G4NistElementBuilder instance to create chemical elements with correct natural abundances from NIST d...
Definition: Materials.h:168
G4NistMaterialBuilder * m_nistMaterialBuilder
G4NistMaterialBuilder to create predefined materials from NIST database.
Definition: Materials.h:170
std::vector< G4MaterialPropertiesTable * > m_PropTables
Vector of created G4MaterialProperties objects.
Definition: Materials.h:164

◆ createMaterial() [1/2]

G4Material * createMaterial ( const gearbox::Interface parameters)

Create a material from the parameters specified by parameters.

Parameters
parametersMaterial properties
Returns
pointer to the newly created material, 0 if there was an error creating it

Definition at line 158 of file Materials.cc.

159 {
160 GeoMaterial material = createMaterialConfig(parameters);
161 return createMaterial(material);
162 }
GeoMaterial createMaterialConfig(const gearbox::Interface &parameters)
Create Material from XML description.
Definition: Materials.cc:233
G4Material * createMaterial(const gearbox::Interface &parameters)
Create a material from the parameters specified by parameters.
Definition: Materials.cc:158

◆ createMaterial() [2/2]

G4Material * createMaterial ( const GeoMaterial parameters)

Create Geant4 Material from Material definition in DB.

Parameters
parametersMaterial properties
Returns
pointer to the newly created material, 0 if there was an error creating it

Definition at line 164 of file Materials.cc.

165 {
166 G4Material* oldmat = getMaterial(parameters.getName(), false);
167 if (oldmat) {
168 //We cannot modify or delete materials, so we just use existing ones
169 B2ERROR("Material with name " << parameters.getName() << " already existing");
170 return oldmat;
171 }
172 B2DEBUG(10, "Creating Material " << parameters.getName());
173 //If density is negative or smaller than epsilon we should calculate the
174 //density from the used materials
175 double density = parameters.getDensity() * CLHEP::g / CLHEP::cm3;
176 if (density < 1e-25) {
177 density = 0;
178 for (const GeoMaterialComponent& component : parameters.getComponents()) {
179 //Check if we can calculate density, only works if we just add materials,
180 //elements do not have density
181 if (component.getIselement()) {
182 B2ERROR("createMaterial " << parameters.getName()
183 << ": Cannot calculate density when adding elements, please provde a density");
184 return nullptr;
185 }
186 G4Material* mat = getMaterial(component.getName());
187 if (!mat) {
188 B2ERROR("createMaterial " << parameters.getName() << ": Material '" << component.getName() << "' not found");
189 return nullptr;
190 }
191 density += mat->GetDensity() * component.getFraction();
192 }
193 }
194
195 //Finally, create Material and add all components
196 G4Material* mat = new G4Material(parameters.getName(), density, parameters.getComponents().size(),
197 (G4State)parameters.getState(), parameters.getTemperature(), parameters.getPressure() * CLHEP::pascal);
198
199 for (const GeoMaterialComponent& component : parameters.getComponents()) {
200 if (component.getIselement()) {
201 G4Element* cmp = getElement(component.getName());
202 if (!cmp) {
203 B2ERROR("Cannot create material " << parameters.getName() << ": element " << component.getName() << " not found");
204#ifdef __clang_analyzer__
205 continue;
206#else
207 return nullptr;
208#endif
209 }
210 mat->AddElement(cmp, component.getFraction());
211 } else {
212 G4Material* cmp = getMaterial(component.getName());
213 if (!cmp) {
214 B2ERROR("Cannot create material " << parameters.getName() << ": material " << component.getName() << " not found");
215#ifdef __clang_analyzer__
216 continue;
217#else
218 return nullptr;
219#endif
220 }
221 mat->AddMaterial(cmp, component.getFraction());
222 }
223 }
224
225 //add properties
226 mat->SetMaterialPropertiesTable(createProperties(parameters.getProperties()));
227
228 //Insert into cache and return
229 m_materialCache.insert(parameters.getName(), mat);
230 return mat;
231 }
void insert(const KEY &key, const VALUE &value)
Insert a key value pair into the cache.
Definition: MRUCache.h:79
G4Material * getMaterial(const std::string &name, bool showErrors=true)
Get a pointer to the G4Material with the given name.
Definition: Materials.cc:127
G4MaterialPropertiesTable * createProperties(const std::vector< GeoMaterialProperty > &props)
Create a properties table from a vector of properties.
Definition: Materials.cc:69
G4Element * getElement(const std::string &name)
Find given chemical element.
Definition: Materials.cc:150

◆ createMaterialConfig()

GeoMaterial createMaterialConfig ( const gearbox::Interface parameters)

Create Material from XML description.

Parameters
parametersGearDir pointing to the Material description
Returns
GeoMaterial instance describing the material and suitable for serialization

Definition at line 233 of file Materials.cc.

234 {
235 //Get straightforward parameters from gearbox
236 string name = parameters.getString("@name");
237 B2DEBUG(10, "Creating Material Config " << name);
238 string stateStr = parameters.getString("state", "undefined");
239 double density = parameters.getDensity("density", 0); // * CLHEP::g / CLHEP::cm3;
240 double temperature = parameters.getDouble("temperature", CLHEP::STP_Temperature);
241 double pressure = parameters.getDouble("pressure", CLHEP::STP_Pressure / CLHEP::pascal);
242
243 // set the simple ones like they are
244 GeoMaterial material;
245 material.setName(name);
246 material.setPressure(pressure);
247 material.setTemperature(temperature);
248 material.setDensity(density);
249
250 //Sum up fractions to see if they are normalized
251 double sumFractions(0);
252
253 // Add all component materials
254 for (const GearDir& component : parameters.getNodes("Components/Material")) {
255 const string componentName = component.getString();
256 double fraction = component.getDouble("@fraction", 1.0);
257 material.addComponent({componentName, false, fraction});
258 sumFractions += fraction;
259 }
260 // Add all component elements
261 for (const GearDir& element : parameters.getNodes("Components/Element")) {
262 const std::string elementName = element.getString();
263 double fraction = element.getDouble("@fraction", 1.0);
264 material.addComponent({elementName, true, fraction});
265 sumFractions += fraction;
266 }
267
268 //Warn if the fractions are not normalized
269 if (abs(sumFractions - 1) > numeric_limits<double>::epsilon()) {
270 B2WARNING("createMaterial " << name << ": Fractions not normalized, scaling by 1/" << sumFractions);
271 for (GeoMaterialComponent& cmp : material.getComponents()) {
272 cmp.setFraction(cmp.getFraction() / sumFractions);
273 }
274 }
275
276 //Determine material state
277 boost::to_lower(stateStr);
278 G4State state = kStateUndefined;
279 if (stateStr == "solid") {
280 state = kStateSolid;
281 } else if (stateStr == "liquid") {
282 state = kStateLiquid;
283 } else if (stateStr == "gas") {
284 state = kStateGas;
285 } else if (stateStr != "undefined") {
286 B2WARNING("createMaterial " << name << ": Unknown state '" << stateStr << "', using undefined");
287 }
288 material.setState(state);
289
290 addProperties(material, parameters);
291 // all done, return material description
292 return material;
293 }

◆ createOpticalSurface() [1/2]

G4OpticalSurface * createOpticalSurface ( const gearbox::Interface parameters)

Create an optical surface from parameters, will abort on error.

Parameters
parametersOptical surface definition
Returns
new optical surface

Definition at line 295 of file Materials.cc.

296 {
297 GeoOpticalSurface surface = createOpticalSurfaceConfig(parameters);
298 return createOpticalSurface(surface);
299 }
GeoOpticalSurface createOpticalSurfaceConfig(const gearbox::Interface &parameters)
Create Optical Surface Configuration from XML description.
Definition: Materials.cc:313
G4OpticalSurface * createOpticalSurface(const gearbox::Interface &parameters)
Create an optical surface from parameters, will abort on error.
Definition: Materials.cc:295

◆ createOpticalSurface() [2/2]

G4OpticalSurface * createOpticalSurface ( const GeoOpticalSurface surface)

Create an optical surface from Surface definition in DB.

Parameters
surfaceOptical surface definition
Returns
new optical surface

Definition at line 301 of file Materials.cc.

302 {
303 G4OpticalSurface* optSurf = new G4OpticalSurface(surface.getName(),
304 (G4OpticalSurfaceModel) surface.getModel(),
305 (G4OpticalSurfaceFinish) surface.getFinish(),
306 (G4SurfaceType) surface.getType(),
307 surface.getValue());
308 optSurf->SetMaterialPropertiesTable(createProperties(surface.getProperties()));
309 //m_OptSurfaces.push_back(optSurf);
310 return optSurf;
311 }

◆ createOpticalSurfaceConfig()

GeoOpticalSurface createOpticalSurfaceConfig ( const gearbox::Interface parameters)

Create Optical Surface Configuration from XML description.

Parameters
parametersGearDir pointing to the Optical Surface description
Returns
GeoOpticalSurface instance describing the material and suitable for serialization

Definition at line 313 of file Materials.cc.

314 {
315 string name = parameters.getString("@name", "OpticalSurface");
316 string modelString = parameters.getString("Model", "glisur");
317 string finishString = parameters.getString("Finish", "polished");
318 string typeString = parameters.getString("Type", "dielectric_dielectric");
319 double value = parameters.getDouble("Value", 1.0);
320
321#define CHECK_ENUM_VALUE(name,value) if (name##String == #value) { name = value; }
322 G4OpticalSurfaceModel model;
323 boost::to_lower(modelString);
324 CHECK_ENUM_VALUE(model, glisur)
325 else CHECK_ENUM_VALUE(model, unified)
326 else CHECK_ENUM_VALUE(model, LUT)
327 else {
328 B2FATAL("Unknown Optical Surface Model: " << modelString);
329 }
330
331 G4OpticalSurfaceFinish finish;
332 boost::to_lower(finishString);
333 CHECK_ENUM_VALUE(finish, polished)
334 else CHECK_ENUM_VALUE(finish, polishedfrontpainted)
335 else CHECK_ENUM_VALUE(finish, polishedbackpainted)
336 else CHECK_ENUM_VALUE(finish, ground)
337 else CHECK_ENUM_VALUE(finish, groundfrontpainted)
338 else CHECK_ENUM_VALUE(finish, groundbackpainted)
339 else CHECK_ENUM_VALUE(finish, polishedlumirrorair)
340 else CHECK_ENUM_VALUE(finish, polishedlumirrorglue)
341 else CHECK_ENUM_VALUE(finish, polishedair)
342 else CHECK_ENUM_VALUE(finish, polishedteflonair)
343 else CHECK_ENUM_VALUE(finish, polishedtioair)
344 else CHECK_ENUM_VALUE(finish, polishedtyvekair)
345 else CHECK_ENUM_VALUE(finish, polishedvm2000air)
346 else CHECK_ENUM_VALUE(finish, polishedvm2000glue)
347 else CHECK_ENUM_VALUE(finish, etchedlumirrorair)
348 else CHECK_ENUM_VALUE(finish, etchedlumirrorglue)
349 else CHECK_ENUM_VALUE(finish, etchedair)
350 else CHECK_ENUM_VALUE(finish, etchedteflonair)
351 else CHECK_ENUM_VALUE(finish, etchedtioair)
352 else CHECK_ENUM_VALUE(finish, etchedtyvekair)
353 else CHECK_ENUM_VALUE(finish, etchedvm2000air)
354 else CHECK_ENUM_VALUE(finish, etchedvm2000glue)
355 else CHECK_ENUM_VALUE(finish, groundlumirrorair)
356 else CHECK_ENUM_VALUE(finish, groundlumirrorglue)
357 else CHECK_ENUM_VALUE(finish, groundair)
358 else CHECK_ENUM_VALUE(finish, groundteflonair)
359 else CHECK_ENUM_VALUE(finish, groundtioair)
360 else CHECK_ENUM_VALUE(finish, groundtyvekair)
361 else CHECK_ENUM_VALUE(finish, groundvm2000air)
362 else CHECK_ENUM_VALUE(finish, groundvm2000glue)
363 else {
364 B2FATAL("Unknown Optical Surface Finish: " << finishString);
365 }
366
367 G4SurfaceType type;
368 boost::to_lower(typeString);
369 CHECK_ENUM_VALUE(type, dielectric_metal)
370 else CHECK_ENUM_VALUE(type, dielectric_dielectric)
371 else CHECK_ENUM_VALUE(type, dielectric_LUT)
372 else CHECK_ENUM_VALUE(type, firsov)
373 else CHECK_ENUM_VALUE(type, x_ray)
374 else {
375 B2FATAL("Unknown Optical Surface Type: " << typeString);
376 }
377#undef CHECK_ENUM_VALUE
378
379 GeoOpticalSurface surface(name, model, finish, type, value);
380 addProperties(surface, GearDir(parameters, "Properties"));
381 return surface;
382 }

◆ createProperties()

G4MaterialPropertiesTable * createProperties ( const std::vector< GeoMaterialProperty > &  props)
protected

Create a properties table from a vector of properties.

Return 0 if the vector is empty

Definition at line 69 of file Materials.cc.

70 {
71 if (!props.size()) return nullptr;
72 auto* table = new G4MaterialPropertiesTable();
73 m_PropTables.push_back(table);
74 for (const GeoMaterialProperty& prop : props) {
75 std::vector<double> energies = prop.getEnergies();
76 std::vector<double> values = prop.getValues();
77 const size_t n = values.size();
78 // convert energies to Geant4 Units
79 for (double& energy : energies) energy *= CLHEP::GeV / Unit::GeV;
80 table->AddProperty(prop.getName().c_str(), energies.data(), values.data(), n);
81 }
82 return table;
83 }
static const double GeV
Standard of [energy, momentum, mass].
Definition: Unit.h:51

◆ findMaterial()

G4Material * findMaterial ( const std::string &  name)
protected

find an existing material by name

Definition at line 105 of file Materials.cc.

106 {
107 G4Material* mat{nullptr};
108 if (m_materialCache.retrieve(name, mat)) {
109 return mat;
110 }
111 initBuilders();
112 mat = m_nistMaterialBuilder->FindOrBuildMaterial(name);
113
114 //Try different combinations of the Material name to fallback to predefined G4 Elements
115 if (!mat && name.substr(0, 3) != "G4_") {
116 //Mainly for materials from single elements, e.g. G4_Al, G4_Si
117 mat = m_nistMaterialBuilder->FindOrBuildMaterial("G4_" + name);
118 //For predefined materials, e.g. G4_AIR, G4_TEFLON
119 if (!mat) mat = m_nistMaterialBuilder->FindOrBuildMaterial("G4_" + boost::to_upper_copy(name));
120 }
121
122 //Insert into cache
123 m_materialCache.insert(name, mat);
124 return mat;
125 }
bool retrieve(const KEY &key, VALUE &value)
Retrieve a value from the cache if it exists.
Definition: MRUCache.h:104
void initBuilders()
Initialize Nist Builder instances.
Definition: Materials.cc:96

◆ get()

static G4Material * get ( const std::string &  name)
inlinestatic

Find given material.

Shorthand for Materials::getInstance().getMaterial()

See also
Materials::getMaterial
Parameters
nameof the material to find

Definition at line 63 of file Materials.h.

63{ return Materials::getInstance().getMaterial(name); }
static Materials & getInstance()
Get a reference to the singleton instance.
Definition: Materials.cc:85

◆ getDensityScaleIgnoredMaterials()

std::set< std::string > getDensityScaleIgnoredMaterials ( ) const
inline

get the set of material names which will not be scaled in any way

Definition at line 147 of file Materials.h.

147{ return m_ignoreScaling; }
std::set< std::string > m_ignoreScaling
Names of materials we don't want to scale.
Definition: Materials.h:181

◆ getElement()

G4Element * getElement ( const std::string &  name)

Find given chemical element.

Parameters
nameName of the Element, e.g. Si, Al, He

Definition at line 150 of file Materials.cc.

151 {
152 initBuilders();
153 G4Element* elm = m_nistElementBuilder->FindOrBuildElement(name);
154 if (!elm) B2ERROR("Element '" << name << "' could not be found");
155 return elm;
156 }

◆ getInstance()

Materials & getInstance ( )
static

Get a reference to the singleton instance.

Definition at line 85 of file Materials.cc.

86 {
87 static unique_ptr<Materials> instance(new Materials());
88 return *instance;
89 }
Materials()
Singleton: hide constructor.
Definition: Materials.h:152

◆ getMaterial()

G4Material * getMaterial ( const std::string &  name,
bool  showErrors = true 
)

Get a pointer to the G4Material with the given name.

If the given name cannot be found we also try to find it in the Nist database by prepending the name with G4_ and trying in with given case and all uppercase since single element materials are defined as e.g. G4_Si, G4_Al and other materials are defined all uppercase, e.g. G4_AIR, G4_TEFLON.

Found materials are cached internaly using an MRU cache so repitive access to materials should be O(1) in most cases

Parameters
nameName of the material to be found
showErrorsIf false don't show any errors, just return nullptr if the material cannot be found

Definition at line 127 of file Materials.cc.

128 {
129 G4Material* mat = findMaterial(name);
130 if (!mat && showErrors) B2ERROR("Material '" << name << "' could not be found");
131 // There is a chance that we want to scale densities of all materials for studies.
132 // Now we have the original so we can look to the scaled one or create it if it's missing
133 if (m_densityScale) {
134 if (m_ignoreScaling.count(name) > 0) return mat;
135 if (name.substr(0, 7) == "scaled:")
136 B2WARNING("Requested an already scaled material ... scaling once more" << LogVar("material", name));
137 std::string scaled = "scaled:" + std::to_string(*m_densityScale) + ":" + name;
138 G4Material* scaledMat = findMaterial(scaled);
139 if (!scaledMat) {
140 assert(mat);
141 scaledMat = new G4Material(scaled, mat->GetDensity() * *m_densityScale, mat,
142 mat->GetState(), mat->GetTemperature(), mat->GetPressure());
143 m_materialCache.insert(scaled, scaledMat);
144 }
145 return scaledMat;
146 }
147 return mat;
148 }
std::optional< double > m_densityScale
If set we scale all densities by a given factor.
Definition: Materials.h:179
G4Material * findMaterial(const std::string &name)
find an existing material by name
Definition: Materials.cc:105
Class to store variables with their name which were sent to the logging service.

◆ initBuilders()

void initBuilders ( )
protected

Initialize Nist Builder instances.

Definition at line 96 of file Materials.cc.

97 {
99 B2DEBUG(50, "Creating new Nist Builder instances");
100 m_nistElementBuilder = new G4NistElementBuilder(0);
101 m_nistMaterialBuilder = new G4NistMaterialBuilder(m_nistElementBuilder, 0);
102 }
103 }

◆ resetDensityScale()

void resetDensityScale ( )
inline

Disable density scaling.

Definition at line 142 of file Materials.h.

143 {
144 m_densityScale.reset();
145 }

◆ setDensityScale()

void setDensityScale ( double  scale)
inline

Set the density scale to the given value.

Definition at line 136 of file Materials.h.

137 {
138 if (scale == 1.0) return resetDensityScale();
139 m_densityScale = scale;
140 }
void resetDensityScale()
Disable density scaling.
Definition: Materials.h:142

◆ setDensityScaleIgnoredMaterials()

void setDensityScaleIgnoredMaterials ( const std::set< std::string > &  ignored)
inline

set the set of material names which will not be scaled in any way

Definition at line 149 of file Materials.h.

149{ m_ignoreScaling = ignored; }

Member Data Documentation

◆ m_densityScale

std::optional<double> m_densityScale
protected

If set we scale all densities by a given factor.

Definition at line 179 of file Materials.h.

◆ m_ignoreScaling

std::set<std::string> m_ignoreScaling {"G4_AIR", "Air", "Vacuum"}
protected

Names of materials we don't want to scale.

Definition at line 181 of file Materials.h.

◆ m_materialCache

MRUCache<std::string, G4Material*> m_materialCache
mutableprotected

Cache for already searched Materials.

Definition at line 161 of file Materials.h.

◆ m_nistElementBuilder

G4NistElementBuilder* m_nistElementBuilder {nullptr}
protected

G4NistElementBuilder instance to create chemical elements with correct natural abundances from NIST database.

Definition at line 168 of file Materials.h.

◆ m_nistMaterialBuilder

G4NistMaterialBuilder* m_nistMaterialBuilder {nullptr}
protected

G4NistMaterialBuilder to create predefined materials from NIST database.

Definition at line 170 of file Materials.h.

◆ m_PropTables

std::vector<G4MaterialPropertiesTable*> m_PropTables
protected

Vector of created G4MaterialProperties objects.

Definition at line 164 of file Materials.h.


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