Creates a valid initialized Setup instance.
More...
#include <KfSetupBuilder.h>
|
| static void | Store (const Setup< double > &setup, const std::string &fileName) |
| | Stores a serialized setup to a file.
|
| |
| template<typename F> |
| static Setup< F > | Load (const std::string &fileName) |
| | Loads a serialized setup from a file.
|
| |
Creates a valid initialized Setup instance.
Initialization scenarios: (a) Manual:
- adding geometry layers one by one
- setting target
- setting field function (function + field type) (b) From setup:
- adding source setup (material layers, field slices and target)
- adding field function (if field – interpolated)
Definition at line 43 of file KfSetupBuilder.h.
◆ SetupBuilder() [1/3]
| cbm::algo::kf::SetupBuilder::SetupBuilder |
( |
| ) |
|
|
default |
◆ SetupBuilder() [2/3]
| cbm::algo::kf::SetupBuilder::SetupBuilder |
( |
const SetupBuilder & | | ) |
|
|
delete |
◆ SetupBuilder() [3/3]
| cbm::algo::kf::SetupBuilder::SetupBuilder |
( |
SetupBuilder && | | ) |
|
|
delete |
◆ ~SetupBuilder()
| virtual cbm::algo::kf::SetupBuilder::~SetupBuilder |
( |
| ) |
|
|
virtualdefault |
◆ AddLayer()
Adds material layer.
- Parameters
-
| geoLayer | A geometrical layer |
Definition at line 33 of file KfSetupBuilder.cxx.
◆ GetFieldFunction()
| const FieldFn_t & cbm::algo::kf::SetupBuilder::GetFieldFunction |
( |
| ) |
const |
|
inline |
◆ Init()
| void SetupBuilder::Init |
( |
| ) |
|
Initializes, validates and caches the parameters.
- Exceptions
-
| std::runtime_error | If pre-initialization was incomplete |
- Note
- Does not touch the field function and field type/mode
Definition at line 51 of file KfSetupBuilder.cxx.
◆ InitStatusMsg()
| std::string SetupBuilder::InitStatusMsg |
( |
| ) |
const |
|
private |
◆ Load()
| Setup< F > cbm::algo::kf::SetupBuilder::Load |
( |
const std::string & | fileName | ) |
|
|
static |
Loads a serialized setup from a file.
- Template Parameters
-
| F | Underlying floating-point type for the output setup object |
- Parameters
-
- Exceptions
-
| std::runtime_error | If the fileName cannot be opened |
Definition at line 308 of file KfSetupBuilder.h.
◆ LoadMaterial()
| bool SetupBuilder::LoadMaterial |
( |
| ) |
|
|
private |
Reads material from file.
- Returns
- true Material budget was read from file
-
false Material budget could not read (file does not exist or has incorrect properties)
Definition at line 155 of file KfSetupBuilder.cxx.
◆ MakeSetup()
Creates a setup instance.
- Template Parameters
-
| F | Floating point underlying type |
- Parameters
-
| fldMode | Field mode of the setup |
- Exceptions
-
| std::runtime_error | If the setup is not initialized |
Definition at line 287 of file KfSetupBuilder.h.
◆ operator=() [1/2]
Copy assignment operator.
◆ operator=() [2/2]
Move assignment operator.
◆ Reset()
| void SetupBuilder::Reset |
( |
| ) |
|
◆ SetFieldFunction()
| void cbm::algo::kf::SetupBuilder::SetFieldFunction |
( |
const FieldFn_t & | fieldFn, |
|
|
EFieldType | fieldType ) |
|
inline |
Sets magnetic field function.
- Parameters
-
| fieldFn | Magnetic field function |
| fieldType | Magnetic field type |
- Note
- The fieldType, passed in this function is a global flag for the whole setup. When it is assigned to a geometrical layer (see. AddLayer)
Definition at line 125 of file KfSetupBuilder.h.
◆ SetFromSetup()
| void cbm::algo::kf::SetupBuilder::SetFromSetup |
( |
const Setup< F > & | inSetup | ) |
|
Initializes the setup builder from existing setup.
- Template Parameters
-
| F | Underlying data type of the setup |
- Parameters
-
Definition at line 237 of file KfSetupBuilder.h.
◆ SetMaterialCacheFile()
| void cbm::algo::kf::SetupBuilder::SetMaterialCacheFile |
( |
const std::string & | filename, |
|
|
size_t | refHash ) |
|
inline |
Sets the material budget cache file name.
- Parameters
-
| filename | Material budget cache file name |
| refHash | Reference hash of the geometry |
If provided, the instance will try to read the material budget maps from the file. If the file does not exist,or the geometry hash was changed since the last time (reference hash differs from the one read from the file), a warning will be produced, the material budget maps will be recreated on the fly and they will be stored again to the file (meaning a new cache file will be generated over the existing one).
Definition at line 155 of file KfSetupBuilder.h.
◆ SetMaterialMapFactory()
| void cbm::algo::kf::SetupBuilder::SetMaterialMapFactory |
( |
const std::shared_ptr< IMaterialMapFactory > & | pMaterialFactory | ) |
|
|
inline |
Sets material map creator.
- Parameters
-
| pMaterialFactory | Pointer to the actual material map creator instance |
Definition at line 141 of file KfSetupBuilder.h.
◆ SetTargetProperty()
| void SetupBuilder::SetTargetProperty |
( |
double | x, |
|
|
double | y, |
|
|
double | z, |
|
|
double | dz, |
|
|
double | r ) |
◆ Store()
| void SetupBuilder::Store |
( |
const Setup< double > & | setup, |
|
|
const std::string & | fileName ) |
|
static |
Stores a serialized setup to a file.
- Parameters
-
| setup | A reference to the Setup (NOTE: a double-Setup must be passed explicitly) |
| fileName | Output file name |
Only a Setup with T = double can be serialized, so if a particular setup instance has another floating-point type, it will be converted to the double-version. In the serialization only the interpolated magnetic field variant is stored, the original field version will be set to nullopt during the loading from the file.
Definition at line 222 of file KfSetupBuilder.cxx.
◆ StoreMaterial()
| void SetupBuilder::StoreMaterial |
( |
| ) |
const |
|
private |
◆ fbIfFieldFunctionSet
| bool cbm::algo::kf::SetupBuilder::fbIfFieldFunctionSet {false} |
|
private |
◆ fbIfGeoLayersInit
| bool cbm::algo::kf::SetupBuilder::fbIfGeoLayersInit {false} |
|
private |
◆ fbIfSetFromSetup
| bool cbm::algo::kf::SetupBuilder::fbIfSetFromSetup {false} |
|
private |
◆ fbIfTargetSet
| bool cbm::algo::kf::SetupBuilder::fbIfTargetSet {false} |
|
private |
◆ fbReady
| bool cbm::algo::kf::SetupBuilder::fbReady {false} |
|
private |
◆ fFieldBuilder
◆ fGeoHash
| size_t cbm::algo::kf::SetupBuilder::fGeoHash {0} |
|
private |
◆ fGeoLayers
| std::set<LayerProperty> cbm::algo::kf::SetupBuilder::fGeoLayers {} |
|
private |
◆ fMatMapNofBins
| int cbm::algo::kf::SetupBuilder::fMatMapNofBins {100} |
|
private |
◆ fModuleIndexFactory
| ModuleIndexMapFactory cbm::algo::kf::SetupBuilder::fModuleIndexFactory |
|
private |
◆ fpMaterialMapFactory
| std::shared_ptr<IMaterialMapFactory> cbm::algo::kf::SetupBuilder::fpMaterialMapFactory {nullptr} |
|
private |
◆ fsMaterialCacheFile
| std::string cbm::algo::kf::SetupBuilder::fsMaterialCacheFile {""} |
|
private |
◆ fTarget
| Target<double> cbm::algo::kf::SetupBuilder::fTarget |
|
private |
◆ fvMaterial
| std::vector<MaterialMap> cbm::algo::kf::SetupBuilder::fvMaterial {} |
|
private |
◆ kTargetCenterOffset
| double cbm::algo::kf::SetupBuilder::kTargetCenterOffset {0.05} |
|
staticconstexprprivate |
◆ kTargetFieldInitStep
| double cbm::algo::kf::SetupBuilder::kTargetFieldInitStep |
|
staticconstexprprivate |
Initial value:
Step between nodal points to determine field near target [cm].
Definition at line 207 of file KfSetupBuilder.h.
◆ kTargetMaterialMapNofBins
| int cbm::algo::kf::SetupBuilder::kTargetMaterialMapNofBins {20} |
|
staticconstexprprivate |
Number of bins along x- and y-axis in the target region;.
Definition at line 209 of file KfSetupBuilder.h.
◆ kTargetMaterialOffset
| double cbm::algo::kf::SetupBuilder::kTargetMaterialOffset {2.} |
|
staticconstexprprivate |
◆ kTargetMaterialTransverseSizeMargin
| double cbm::algo::kf::SetupBuilder::kTargetMaterialTransverseSizeMargin {1.3} |
|
staticconstexprprivate |
The documentation for this class was generated from the following files: