CbmRoot
Loading...
Searching...
No Matches
CbmKfUtil.h
Go to the documentation of this file.
1/* Copyright (C) 2023 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergey Gorbunov [committer] */
4
5#ifndef CbmKfUtil_H
6#define CbmKfUtil_H 1
7
8#include "CbmDefs.h"
10#include "KfTrackParam.h"
11
12#include <optional>
13
14class KFParticle;
15
16class FairTrackParam;
17
18
19namespace cbm::algo::kf
20{
21 template<typename Float>
22 class Setup;
23
24 template<typename Float>
25 struct FloatTag;
26} // namespace cbm::algo::kf
27
31namespace cbm::kf
32{
34 using cbm::algo::kf::FloatTag;
36 using cbm::algo::kf::Setup;
37
39 cbm::algo::kf::TrackParamD ConvertTrackParam(const FairTrackParam& par);
40
42 FairTrackParam ConvertTrackParam(const cbm::algo::kf::TrackParamD& t);
43
44 template<cbm::algo::ca::EDetectorID DetID>
46 {
47 const auto& recoSetup = cbm::RecoSetupManager::Instance()->GetSetup();
48 if constexpr (DetID == cbm::algo::ca::EDetectorID::kMvd) {
49 return recoSetup.template Get<ECbmModuleId::kMvd>();
50 }
51 else if constexpr (DetID == cbm::algo::ca::EDetectorID::kSts) {
52 return recoSetup.template Get<ECbmModuleId::kSts>();
53 }
54 else if constexpr (DetID == cbm::algo::ca::EDetectorID::kMuch) {
55 return recoSetup.template Get<ECbmModuleId::kMuch>();
56 }
57 else if constexpr (DetID == cbm::algo::ca::EDetectorID::kTrd) {
58 return recoSetup.template Get<ECbmModuleId::kTrd>();
59 }
60 else if constexpr (DetID == cbm::algo::ca::EDetectorID::kTof) {
61 return recoSetup.template Get<ECbmModuleId::kTof>();
62 }
63 __builtin_unreachable(); // No return is reachable
64 }
65
66 template<ECbmModuleId ModuleId>
67 const auto* GetTrackingInterface()
68 {
69 const auto& recoSetup = cbm::RecoSetupManager::Instance()->GetSetup();
70 return recoSetup.template Get<ModuleId>();
71 }
72
73 std::optional<KFParticle> CreateKfParticle(const cbm::algo::kf::TrackParamD& trackParam, double mass,
74 int absCharge = 1);
75
76} // namespace cbm::kf
77
78#endif
A manager for setup representation in CBM reconstruction.
const algo::RecoSetup & GetSetup() const
Setup accessor.
static RecoSetupManager * Instance()
Instance access.
KF-framework representation of the detector setup.
Definition KfSetup.h:37
EFieldMode
Enumiration for the magnetic field representation variants in the track fitting algorithm.
Definition KfDefs.h:108
Vc::float_v fvec
Definition KfSimdVc.h:15
TrackParam< double > TrackParamD
std::optional< KFParticle > CreateKfParticle(const cbm::algo::kf::TrackParamD &trackParam, double mass, int absCharge)
Definition CbmKfUtil.cxx:66
const auto * GetTrackingInterface()
Definition CbmKfUtil.h:45
cbm::algo::kf::TrackParamD ConvertTrackParam(const FairTrackParam &par)
copy fair track param to Ca track param
Definition CbmKfUtil.cxx:18
A floating-point tag for tag dispatching.
Definition KfDefs.h:117