CbmRoot
Loading...
Searching...
No Matches
CbmGenerateMaterialMaps.h
Go to the documentation of this file.
1/* Copyright (C) 2024 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergei Zharko [committer] */
4
9
10#pragma once
11
12#include "FairTask.h"
13#include "KfMaterialMap.h"
15#include "yaml/Yaml.h"
16
17#include <map>
18#include <string>
19#include <string_view>
20#include <tuple>
21#include <vector>
22
25class CbmGenerateMaterialMaps : public FairTask {
27
45
66
67 public:
70
74 CbmGenerateMaterialMaps(const char* name, int verbose);
75
77 virtual ~CbmGenerateMaterialMaps() = default;
78
81
84
87
90
92 InitStatus Init();
93
95 InitStatus ReInit();
96
98 void Finish();
99
101 void SetOutputName(const char* fileName) { fsOutputFile = fileName; }
102
104 void SetUserConfig(const char* userConfig) { fsUserConfig = userConfig; }
105
107 const std::map<std::string, MaterialMap>& GetMaterial() const { return fmMaterial; }
108
109 private:
114 void WriteMaterialMaps();
115
116 static constexpr double kXYoffset = 1.3;
117 static constexpr double kTargetOffset = 1.;
118
120 std::string fsUserConfig = "";
121 std::string fsOutputFile = "matBudget.root";
122 std::map<std::string, MaterialMap> fmMaterial;
123 std::unique_ptr<::kf::tools::MaterialMapFactory> fpMaterialFactory{nullptr};
124
125 double fTargetZ;
126
128};
Utility to generate material budget map from the TGeoNavigator representation of the Setup (implement...
Steer class for executing the material budget maps generator independently from tracking.
static constexpr double kTargetOffset
Offset from station boarders [scale].
InitStatus ReInit()
Re-initializer.
CbmGenerateMaterialMaps(const CbmGenerateMaterialMaps &)=delete
Copy constructor.
Config fConfig
Offset from target to start generating mat. maps [cm].
std::map< std::string, MaterialMap > fmMaterial
Material budget maps.
CbmGenerateMaterialMaps()
Default constructor.
static constexpr double kXYoffset
void SetUserConfig(const char *userConfig)
Sets user configuration file.
CbmGenerateMaterialMaps & operator=(const CbmGenerateMaterialMaps &)=delete
Copy assignment operator.
std::string fsOutputFile
Output file name.
CbmGenerateMaterialMaps(CbmGenerateMaterialMaps &&)=delete
Move constructor.
double fTargetZ
z-coordinate of the target center
void SetOutputName(const char *fileName)
Sets output file name.
virtual ~CbmGenerateMaterialMaps()=default
Destructor.
CbmGenerateMaterialMaps & operator=(CbmGenerateMaterialMaps &&)=delete
Move assignment operator.
std::unique_ptr<::kf::tools::MaterialMapFactory > fpMaterialFactory
Material factory instance.
InitStatus Init()
Initializer.
void WriteMaterialMaps()
Writes material budget maps to file.
const std::map< std::string, MaterialMap > & GetMaterial() const
Gets material map.
ClassDef(CbmGenerateMaterialMaps, 0)
std::string fsUserConfig
User configuration file.
A map of station thickness in units of radiation length (X0) to the specific point in XY plane.
bool fbParallelRays
Rays mode (false - radial, true - parallel to z-axis)
std::vector< MaterialSlice > fvUserSlices
Material slices defined by user.
bool fbTrackingStations
Generates material maps for the actual geometry stations.
bool fbSafeMaterialInit
Safe material initialization (takes extra computational time)
CBM_YAML_PROPERTIES(cbm::algo::yaml::Property(&CbmGenerateMaterialMaps::Config::fvUserSlices, "user_slices", ""), cbm::algo::yaml::Property(&CbmGenerateMaterialMaps::Config::fPitch, "pitch", ""), cbm::algo::yaml::Property(&CbmGenerateMaterialMaps::Config::fMaxNofBins, "max_nof_bins", ""), cbm::algo::yaml::Property(&CbmGenerateMaterialMaps::Config::fNofRays, "nof_rays", ""), cbm::algo::yaml::Property(&CbmGenerateMaterialMaps::Config::fbParallelRays, "parallel_rays", ""), cbm::algo::yaml::Property(&CbmGenerateMaterialMaps::Config::fbTrackingStations, "tracking_stations", ""), cbm::algo::yaml::Property(&CbmGenerateMaterialMaps::Config::fbSafeMaterialInit, "safe_material_init", ""))
double fPitch
Minimal bin size (cm)
int fNofRays
Number of rays per dimension in each bin.
int fMaxNofBins
Number of bins in material budged map (x and y axes)
Input parameters for the material map generation.
double fMinZ
Lower bound along z-axis [cm].
double fRefZ
Reference z-coordinate [cm].
double fMaxZ
Upper bound along z-axis [cm].
double fMaxXY
Size in the transverse plane [cm].
CBM_YAML_PROPERTIES(cbm::algo::yaml::Property(&CbmGenerateMaterialMaps::MaterialSlice::fName, "name", ""), cbm::algo::yaml::Property(&CbmGenerateMaterialMaps::MaterialSlice::fRefZ, "ref_z", ""), cbm::algo::yaml::Property(&CbmGenerateMaterialMaps::MaterialSlice::fMinZ, "min_z", ""), cbm::algo::yaml::Property(&CbmGenerateMaterialMaps::MaterialSlice::fMaxZ, "max_z", ""), cbm::algo::yaml::Property(&CbmGenerateMaterialMaps::MaterialSlice::fMaxXY, "max_xy", ""))
bool operator<(const MaterialSlice &r) const