CbmRoot
Loading...
Searching...
No Matches
CbmKfTrackingSetupBuilder.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 "CbmDefs.h"
13#include "CbmEnumArray.h"
14#include "KfSetupBuilder.h"
15#include "TString.h"
16
17#include <mutex>
18#include <tuple>
19
20namespace cbm::kf
21{
25 public:
28
32 std::shared_ptr<const cbm::algo::kf::Setup<double>> GetSharedGeoSetup();
33
36 template<typename T>
38 {
39 if (!fbInitialized) {
40 this->Init();
41 }
42 return fBuilder.MakeSetup<T>(fldMode);
43 }
44
46 bool IsInGeometry(cbm::algo::ca::EDetectorID detID) const { return fvbDetInGeometry[detID]; }
47
49 bool HasHits(cbm::algo::ca::EDetectorID detID) const { return fvbDetHasHits[detID]; }
50
51 // Disable copy and move
56
57 private:
58 template<typename T>
60
63 {"MvdHit", "StsHit", "MuchPixelHit", "TrdHit", "TofHit"}};
64
67
70
73
82 void SetMaterialCacheFile(const TString& filename, size_t geoHash)
83 {
84 fBuilder.SetMaterialCacheFile(filename.Data(), geoHash);
85 }
86
89 void Init();
90
91 // Material map creator properties (TODO: Provide setters, if needed)
92 static constexpr double kMatCreatorPitch{0.1};
93 static constexpr int kMatCreatorMaxNbins{100};
94 static constexpr int kMatCreatorNrays{3};
95 static constexpr bool kMatCreatorSafeMode{true};
96 static constexpr double kTargFieldInitStep{2.5};
97 static constexpr double kTargMaterialOffset{1};
98
99 inline static TrackingSetupBuilder* fpInstance{nullptr};
100 inline static std::mutex fMutex{};
101
105
109 std::shared_ptr<cbm::algo::kf::Setup<double>> fpGeoSetup{nullptr};
110
114 bool fbInitialized{false};
115 };
116
117
118} // namespace cbm::kf
A base KF-Setup initialization class (source)
Creates a valid initialized Setup instance.
Setup< T > MakeSetup(EFieldMode fldMode)
Creates a setup instance.
void SetMaterialCacheFile(const std::string &filename, size_t refHash)
Sets the material budget cache file name.
KF-framework representation of the detector setup.
Definition KfSetup.h:33
Encapsulation of the kf::Setup initialization routines for CBM.
static constexpr bool kMatCreatorSafeMode
Safe mode of the material map creation.
cbm::algo::kf::Setup< T > MakeSetup(cbm::algo::kf::EFieldMode fldMode)
Makes setup object.
void SetMaterialCacheFile(const TString &filename, size_t geoHash)
Sets the material budget cache file name.
~TrackingSetupBuilder()=default
Destructor.
std::shared_ptr< const cbm::algo::kf::Setup< double > > GetSharedGeoSetup()
Gets a shared pointer to the geometry setup.
TrackingSetupBuilder()=default
Default constructor.
static constexpr double kTargMaterialOffset
Offset between target upper limit and its material zMax [cm].
static constexpr double kMatCreatorPitch
Material budget map minimal bin size [cm].
bool fbInitialized
Checks, if the setup was already initialized.
static constexpr int kMatCreatorNrays
Number of rays per dimension for the material budget.
static TrackingSetupBuilder * Instance()
Instance access.
static constexpr double kTargFieldInitStep
Step between nodes in the target field initialization [cm].
TrackingSetupBuilder & operator=(const TrackingSetupBuilder &)=delete
bool IsInGeometry(cbm::algo::ca::EDetectorID detID) const
Checks, if a tracking detector is used (is in geometry and has hits)
static constexpr int kMatCreatorMaxNbins
Max number of bins in the material budget map in x(y) axis.
void Init()
Initializes the instance.
cbm::algo::kf::SetupBuilder fBuilder
KF-setup builder.
std::shared_ptr< cbm::algo::kf::Setup< double > > fpGeoSetup
An instance of the tracking KF-setup in a double precision.
TrackingSetupBuilder(TrackingSetupBuilder &&)=delete
bool HasHits(cbm::algo::ca::EDetectorID detID) const
Checks, if a tracking detector has hits.
static constexpr DetectorIDArray_t< const char * > kDetHitBrName
Hit branch names vs. cbm::algo::ca::EDetectorID.
DetectorIDArray_t< bool > fvbDetHasHits
Does detector subsystem have hits?
TrackingSetupBuilder & operator=(TrackingSetupBuilder &&)=delete
void CheckDetectorPresence()
Check detector presence.
static TrackingSetupBuilder * fpInstance
DetectorIDArray_t< bool > fvbDetInGeometry
Is detector subsystem in geometry?
TrackingSetupBuilder(const TrackingSetupBuilder &)=delete
EDetectorID
Enumeration for the tracking detector subsystems in CBM-CA.
Definition CbmDefs.h:176
EFieldMode
Enumiration for the magnetic field representation variants in the track fitting algorithm.
Definition KfDefs.h:27