CbmRoot
Loading...
Searching...
No Matches
KfMaterialMapFactory.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
10
11#pragma once
12
14#include "Rtypes.h"
15#include "TObject.h"
16
17class TGeoNavigator;
18namespace cbm::algo::kf
19{
20 class MaterialMap;
21}
22
23namespace kf::tools
24{
28 public:
31 MaterialMapFactory(int verbose = 0);
32
35
38 void SetDoRadialProjection(double targetZ)
39 {
41 fTargetZ = targetZ;
42 }
43
46
48 void SetNraysPerDim(int nRaysDim) { fNraysBinPerDim = (nRaysDim > 0) ? nRaysDim : 1; }
49
50
69 cbm::algo::kf::MaterialMap GenerateMaterialMap(double zRef, double zMin, double zMax, double xyMax,
70 int nBinsDim) override;
71
74
75 private:
77 void InitThreads();
78
80 void CleanUpThreads();
81
85 TGeoNavigator* GetCurrentNavigator(int iThread);
86
87 private:
88 static constexpr double kMinRadLength = 0.3;
89
90 std::vector<TGeoNavigator*> fNavigators{};
91 double fTargetZ{0.};
92 int fNthreadsOld{0};
93 int fNthreads{0};
95 int fVerbose{0};
96 bool fDoRadialProjection{false};
99 };
100
101} // namespace kf::tools
Interface to the material map creator.
Interface to the material map creator.
A map of station thickness in units of radiation length (X0) to the specific point in XY plane.
An utility class to create a material budget map from the TGeo.
MaterialMapFactory(int verbose=0)
Constructor from parameters.
int fNthreadsOld
number of threads in TGeoManager before the helper was created
void SetDoRadialProjection(double targetZ)
Project rays radially from the targetZ througth the XY-bins at a reference z.
std::vector< TGeoNavigator * > fNavigators
list of created navigators
void SetSafeMaterialInitialization(bool val=true)
Enables safe mode of the material initialization.
bool fDoRadialProjection
if project rays horizontally along the Z axis (special mode)
cbm::algo::kf::MaterialMap GenerateMaterialMap(double zRef, double zMin, double zMax, double xyMax, int nBinsDim) override
Generates a material budget map.
TGeoNavigator * GetCurrentNavigator(int iThread)
Gets navigator for current thread, creates it if it does not exist.
void CleanUpThreads()
Cleans up the TGeoManager: threadIds, create a default navigator.
double fTargetZ
z of the target for the radial projection
static constexpr double kMinRadLength
Minimal radiational length allowed [cm].
void InitThreads()
Initializes the necessary amount of threads in TGeoManager.
void SetDoHorisontalProjection()
Project rays horisontally along the Z axis (default)
int fNraysBinPerDim
shoot fNraysBinPerDim * fNraysBinPerDim rays in each map bin
void SetNraysPerDim(int nRaysDim)
Shoots nRaysDim * nRaysDim rays for each bin in the map.