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
52 void SetIgnoreHitPresence(bool ok = true)
53 {
55 fbInitialized = false;
57 }
58
59 // Disable copy and move
64
65 private:
66 template<typename T>
68
71 {"MvdHit", "StsHit", "MuchPixelHit", "TrdHit", "TofHit"}};
72
75
78
81
90 void SetMaterialCacheFile(const TString& filename, size_t geoHash)
91 {
92 fBuilder.SetMaterialCacheFile(filename.Data(), geoHash);
93 }
94
97 void Init();
98
99 // Material map creator properties (TODO: Provide setters, if needed)
100 static constexpr double kMatCreatorPitch{0.1};
101 static constexpr int kMatCreatorMaxNbins{100};
102 static constexpr int kMatCreatorNrays{3};
103 static constexpr bool kMatCreatorSafeMode{true};
104 static constexpr double kTargFieldInitStep{2.5};
105 static constexpr double kTargMaterialOffset{1};
106
107 inline static TrackingSetupBuilder* fpInstance{nullptr};
108 inline static std::mutex fMutex{};
109
113
117 std::shared_ptr<cbm::algo::kf::Setup<double>> fpGeoSetup{nullptr};
118
122 bool fbInitialized{false};
124 };
125
126
127} // 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.
void SetIgnoreHitPresence(bool ok=true)
Sets hits ignoring (DEBUG FLAG)
DetectorIDArray_t< bool > fvbDetHasHits
Does detector subsystem have hits?
TrackingSetupBuilder & operator=(TrackingSetupBuilder &&)=delete
void CheckDetectorPresence()
Check detector presence.
static TrackingSetupBuilder * fpInstance
bool fbIgnoreHitPresence
Ignores hit presence, when active subsystems are determined.
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