|
CbmRoot
|
An utility class to create a material budget map from the TGeo. More...
#include <KfMaterialMapFactory.h>
Public Member Functions | |
| MaterialMapFactory (int verbose=0) | |
| Constructor from parameters. | |
| ~MaterialMapFactory () | |
| Destructor. | |
| void | SetDoRadialProjection (double targetZ) |
| Project rays radially from the targetZ througth the XY-bins at a reference z. | |
| void | SetDoHorisontalProjection () |
| Project rays horisontally along the Z axis (default) | |
| void | SetNraysPerDim (int nRaysDim) |
| Shoots nRaysDim * nRaysDim rays for each bin in the map. | |
| cbm::algo::kf::MaterialMap | GenerateMaterialMap (double zRef, double zMin, double zMax, double xyMax, int nBinsDim) override |
| Generates a material budget map. | |
| void | SetSafeMaterialInitialization (bool val=true) |
| Enables safe mode of the material initialization. | |
Private Member Functions | |
| void | InitThreads () |
| Initializes the necessary amount of threads in TGeoManager. | |
| void | CleanUpThreads () |
| Cleans up the TGeoManager: threadIds, create a default navigator. | |
| TGeoNavigator * | GetCurrentNavigator (int iThread) |
| Gets navigator for current thread, creates it if it does not exist. | |
Private Attributes | |
| std::vector< TGeoNavigator * > | fNavigators {} |
| list of created navigators | |
| double | fTargetZ {0.} |
| z of the target for the radial projection | |
| int | fNthreadsOld {0} |
| number of threads in TGeoManager before the helper was created | |
| int | fNthreads {0} |
| number of threads | |
| int | fNraysBinPerDim {3} |
| shoot fNraysBinPerDim * fNraysBinPerDim rays in each map bin | |
| int | fVerbose {0} |
| verbosity level | |
| bool | fDoRadialProjection {false} |
| if project rays horizontally along the Z axis (special mode) | |
| bool | fDoSafeInitialization {false} |
Static Private Attributes | |
| static constexpr double | kMinRadLength = 0.3 |
| Minimal radiational length allowed [cm]. | |
An utility class to create a material budget map from the TGeo.
Definition at line 27 of file KfMaterialMapFactory.h.
| MaterialMapFactory::MaterialMapFactory | ( | int | verbose = 0 | ) |
Constructor from parameters.
| verbose | Verbosity level (0 - only warning/error output) |
Definition at line 31 of file KfMaterialMapFactory.cxx.
References fDoSafeInitialization, fNthreads, fNthreadsOld, fVerbose, and InitThreads().
| MaterialMapFactory::~MaterialMapFactory | ( | ) |
Destructor.
Definition at line 146 of file KfMaterialMapFactory.cxx.
References CleanUpThreads(), fNavigators, fNthreadsOld, GetCurrentNavigator(), and ~MaterialMapFactory().
Referenced by ~MaterialMapFactory().
|
private |
Cleans up the TGeoManager: threadIds, create a default navigator.
Definition at line 203 of file KfMaterialMapFactory.cxx.
References CleanUpThreads(), and GetCurrentNavigator().
Referenced by CleanUpThreads(), GenerateMaterialMap(), InitThreads(), and ~MaterialMapFactory().
|
overridevirtual |
Generates a material budget map.
| zRef | Reference z-coordinate of the material layer [cm] |
| zMin | z-coordinate of the material layer lower boundary [cm] |
| zMax | z-coordinate of the material layer upper boundary [cm] |
| xyMax | Transverse size of the material layer [cm] |
| nBinsDim | Number of bins in the x(y) axis |
generate a material map, collecting the material between [zMin, zMax] with radial rays from (0,0,targetZ) through the XY-bins at z == zRef.
It creates a map with [nBinsDim x nBinsDim] bins, of a size of [+-xyMax, +-xyMax] shooting fNraysBinPerDim x fNraysBinPerDim through each bin
The calculated radiation thickness is a projection of the rad.thickness along the ray onto the Z axis. RadThick = sum of (dZ / radLength) over ray trajectory pieces
When doRadialProjection==false the rays are shoot horizontally along the Z axis
Implements cbm::algo::kf::IMaterialMapFactory.
Definition at line 233 of file KfMaterialMapFactory.cxx.
References CleanUpThreads(), fDoRadialProjection, fNraysBinPerDim, fNthreads, fTargetZ, fVerbose, GenerateMaterialMap(), GetCurrentNavigator(), InitThreads(), kMinRadLength, cbm::algo::kf::MaterialMap::SetRadThickBin(), sqrt(), x, and y.
Referenced by GenerateMaterialMap().
|
private |
Gets navigator for current thread, creates it if it does not exist.
| iThread | Index of the thread |
| std::runtime_error | If the TGeoNavigator is not found |
Definition at line 175 of file KfMaterialMapFactory.cxx.
References fNavigators, and GetCurrentNavigator().
Referenced by CleanUpThreads(), GenerateMaterialMap(), GetCurrentNavigator(), and ~MaterialMapFactory().
|
private |
Initializes the necessary amount of threads in TGeoManager.
Definition at line 215 of file KfMaterialMapFactory.cxx.
References CleanUpThreads(), fNthreads, and InitThreads().
Referenced by GenerateMaterialMap(), InitThreads(), and MaterialMapFactory().
|
inline |
Project rays horisontally along the Z axis (default)
Definition at line 45 of file KfMaterialMapFactory.h.
References fDoRadialProjection.
|
inline |
Project rays radially from the targetZ througth the XY-bins at a reference z.
| targetZ | z-coordinate of the target [cm] |
Definition at line 38 of file KfMaterialMapFactory.h.
References fDoRadialProjection, and fTargetZ.
|
inline |
Shoots nRaysDim * nRaysDim rays for each bin in the map.
Definition at line 48 of file KfMaterialMapFactory.h.
References fNraysBinPerDim.
|
inline |
Enables safe mode of the material initialization.
Definition at line 73 of file KfMaterialMapFactory.h.
References fDoSafeInitialization.
|
private |
if project rays horizontally along the Z axis (special mode)
Definition at line 96 of file KfMaterialMapFactory.h.
Referenced by GenerateMaterialMap(), SetDoHorisontalProjection(), and SetDoRadialProjection().
|
private |
performs slow but safe initialization to get around the crashes in TGeoVoxelFinder
Definition at line 97 of file KfMaterialMapFactory.h.
Referenced by MaterialMapFactory(), and SetSafeMaterialInitialization().
|
private |
list of created navigators
Definition at line 90 of file KfMaterialMapFactory.h.
Referenced by GetCurrentNavigator(), and ~MaterialMapFactory().
|
private |
shoot fNraysBinPerDim * fNraysBinPerDim rays in each map bin
Definition at line 94 of file KfMaterialMapFactory.h.
Referenced by GenerateMaterialMap(), and SetNraysPerDim().
|
private |
number of threads
Definition at line 93 of file KfMaterialMapFactory.h.
Referenced by GenerateMaterialMap(), InitThreads(), and MaterialMapFactory().
|
private |
number of threads in TGeoManager before the helper was created
Definition at line 92 of file KfMaterialMapFactory.h.
Referenced by MaterialMapFactory(), and ~MaterialMapFactory().
|
private |
z of the target for the radial projection
Definition at line 91 of file KfMaterialMapFactory.h.
Referenced by GenerateMaterialMap(), and SetDoRadialProjection().
|
private |
verbosity level
Definition at line 95 of file KfMaterialMapFactory.h.
Referenced by GenerateMaterialMap(), and MaterialMapFactory().
|
staticconstexprprivate |
Minimal radiational length allowed [cm].
Definition at line 88 of file KfMaterialMapFactory.h.
Referenced by GenerateMaterialMap().