CbmRoot
Loading...
Searching...
No Matches
CbmKfTrackingGeoSetupFactory.h
Go to the documentation of this file.
1/* Copyright (C) 2024-2025 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 "CbmKfUtil.h"
15#include "KfISetupFactory.h"
16#include "KfSetupBuilder.h"
17#include "TString.h"
18
19#include <tuple>
20
21namespace cbm::kf
22{
26 public:
30 TrackingGeoSetupFactory(bool requireHitPresence = false);
31
36 {
37 return fBuilder.template MakeSetup<double>(fldMode);
38 }
39
44 {
45 return fBuilder.template MakeSetup<float>(fldMode);
46 }
47
52 {
53 return fBuilder.template MakeSetup<fvec>(fldMode);
54 }
55
57 bool IsInGeometry(algo::ca::EDetectorID detID) const { return fvbDetInGeometry[detID]; }
58
60 bool HasHits(algo::ca::EDetectorID detID) const { return fvbDetHasHits[detID]; }
61
63 const algo::kf::FieldFn_t& GetFieldFunction() const override { return fBuilder.GetFieldFunction(); }
64
65
66 private:
67 template<typename T>
69
71 {"MvdHit", "StsHit", "MuchPixelHit", "TrdHit", "TofHit"}};
72
73 // Material map creator properties (TODO: Provide setters, if needed)
74 static constexpr double kMatCreatorPitch{0.1};
75 static constexpr int kMatCreatorMaxNbins{100};
76 static constexpr int kMatCreatorNrays{3};
77 static constexpr bool kMatCreatorSafeMode{true};
78 static constexpr double kTargFieldInitStep{2.5};
79 static constexpr double kTargMaterialOffset{1};
80
84
87 void CheckDetectorPresence(bool requireHitPresence);
88
97 void SetMaterialCacheFile(const TString& filename, size_t geoHash)
98 {
99 fBuilder.SetMaterialCacheFile(filename.Data(), geoHash);
100 }
101
103 std::string MaterialCacheFile() const;
104 };
105
106
107} // namespace cbm::kf
An abstract factory for different setups.
A base KF-Setup initialization class (source)
Abstract factory for different setups.
Creates a valid initialized Setup instance.
KF-framework representation of the detector setup.
Definition KfSetup.h:37
static constexpr double kTargFieldInitStep
Step between nodes in the target field initialization [cm].
bool HasHits(algo::ca::EDetectorID detID) const
Checks, if a tracking detector has hits.
cbm::core::EnumArray< algo::ca::EDetectorID, T > DetectorIDArray_t
Setup< fvec > Create(FloatTag< algo::kf::fvec >, EFieldMode fldMode) const override
Method to create a setup with vectorized floating point type.
algo::kf::SetupBuilder fBuilder
KF-setup builder.
void SetMaterialCacheFile(const TString &filename, size_t geoHash)
Sets the material budget cache file name.
bool IsInGeometry(algo::ca::EDetectorID detID) const
Checks, if a tracking detector is in geometry.
static constexpr DetectorIDArray_t< const char * > kDetHitBrName
Hit branch names vs. EDetectorID.
static constexpr double kTargMaterialOffset
Offset between target upper limit and its material zMax [cm].
DetectorIDArray_t< bool > fvbDetHasHits
Does detector subsystem have hits?
static constexpr int kMatCreatorNrays
Number of rays per dimension for the material budget.
const algo::kf::FieldFn_t & GetFieldFunction() const override
Access to field function.
TrackingGeoSetupFactory(bool requireHitPresence=false)
Constructor (RAII)
DetectorIDArray_t< bool > fvbDetInGeometry
Is detector subsystem in geometry?
Setup< double > Create(FloatTag< double >, EFieldMode fldMode) const override
Method to create a setup with double-precision floating point type.
void CheckDetectorPresence(bool requireHitPresence)
Check detector presence.
Setup< float > Create(FloatTag< float >, EFieldMode fldMode) const override
Method to create a setup with single-precision floating point type.
static constexpr double kMatCreatorPitch
Material budget map minimal bin size [cm].
static constexpr bool kMatCreatorSafeMode
Safe mode of the material map creation.
std::string MaterialCacheFile() const
Gets the material budget cache-file.
static constexpr int kMatCreatorMaxNbins
Max number of bins in the material budget map in x(y) axis.
EDetectorID
Enumeration for the tracking detector subsystems in CBM-CA.
Definition CbmDefs.h:216
EFieldMode
Enumiration for the magnetic field representation variants in the track fitting algorithm.
Definition KfDefs.h:108
std::function< std::tuple< double, double, double >(double, double, double)> FieldFn_t
Magnetic field function type Signature: tuple<Bx, By, Bz>(x, y, z);.
Definition KfDefs.h:169
A floating-point tag for tag dispatching.
Definition KfDefs.h:117