9#include <geometry/modules/DensityScalerModule.h>
10#include <geometry/GeometryManager.h>
11#include <geometry/Materials.h>
13#include <framework/core/ModuleParam.templateDetails.h>
22 setDescription(R
"DOC(Scale density of simulation/reconstruction geometry
24This is obviously only meant for systematic studies to scale the density in different
25parts of the detector to estimate the effect on for example tracking performance.
27This module is to be placed **before** the Geometry module itself and will then
28change the density of all materials which are created using the Materials service
31 This doesn't affect any materials created manually somewhere. A way to check is
32 to set a global scaling factor and then do a material scan with the :b2:mod:`MaterialScan`
33 module split by materials. The scaled materials will have a different name
34 starting with 'scaled:' followed by the scaling factor and the original name
39 "The scale factor for each geometry component that should be scaled. '*' "
40 "can be used to scale all components by the same factor. If a component is "
41 "specified manually and '*' is present the result will be the product of both)");
43 "**not** be scaled, usually things like vaccum or air. To scale everything this "
44 "parameter should be set to an empty set (``{}`` or ``set()``)",
52 B2FATAL(
"Geometry already created, DensityScaler needs to come before the Geometry module");
virtual void initialize() override
Set the scaling.
std::map< std::string, double > m_scaling
The scale factor for each geometry component that should be scaled.
DensityScalerModule()
Constructor: Sets the description, the properties and the parameters of the module.
std::set< std::string > m_ignoredMaterials
Set of material names to not scale.
void setDescription(const std::string &description)
Sets the description of the module.
static GeometryManager & getInstance()
Return a reference to the instance.
void setDensityScaling(const std::map< std::string, double > &components)
Set the density scaling: This is intended for systematic studies only and will scale the density of a...
void setDensityScaleIgnoredMaterials(const std::set< std::string > &ignored)
set the set of material names which will not be scaled in any way
static Materials & getInstance()
Get a reference to the singleton instance.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.