CbmRoot
Loading...
Searching...
No Matches
KfToolsField.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
9
10
#pragma once
// include this header only once per compilation unit
11
12
#include "FairField.h"
13
#include "FairRunAna.h"
14
#include "
KfDefs.h
"
15
#include "
KfFieldRegion.h
"
16
17
namespace
cbm::kf::tools
18
{
20
inline
void
SetOriginalCbmField
()
21
{
22
static
FairField* fairField{
nullptr
};
23
24
auto
* run = FairRunAna::Instance();
25
26
if
(!run) {
27
LOG(fatal) <<
"FairRunAna::Instance() is not initialized. Cannot set the original field function."
;
28
return
;
29
}
30
31
fairField = run->GetField();
32
33
if
(
nullptr
== fairField) {
34
LOG(debug) <<
"Kf Setup: No Cbm Field found"
;
35
cbm::algo::kf::GlobalField::SetFieldFunction
(
cbm::algo::kf::EFieldType::Null
,
cbm::algo::kf::defs::ZeroFieldFn
);
36
}
37
else
{
38
39
LOG(debug) <<
"Kf Setup: Cbm Field "
<< fairField->ClassName() <<
" "
<< fairField->GetName();
40
LOG(debug) <<
"Field parameters at the origin: "
<< fairField->GetBx(0., 0., 0.) <<
", "
41
<< fairField->GetBy(0., 0., 0.) <<
", "
<< fairField->GetBz(0., 0., 0.) <<
", type "
42
<< fairField->GetType();
43
44
static
auto
fld = [&](
double
x
,
double
y
,
double
z) {
45
double
pos
[3] = {
x
,
y
, z};
46
double
B
[3] = {0., 0., 0.};
47
fairField->GetFieldValue(
pos
,
B
);
48
return
std::tuple(
B
[0],
B
[1],
B
[2]);
49
};
50
cbm::algo::kf::GlobalField::SetFieldFunction
(
cbm::algo::kf::EFieldType::Normal
, fld);
51
}
52
}
53
54
}
// namespace cbm::kf::tools
y
Double_t y
Definition
CbmMvdSensorDigiToHitTask.cxx:64
x
Double_t x
Definition
CbmMvdSensorDigiToHitTask.cxx:64
pos
TVector3 pos
Definition
CbmMvdSensorDigiToHitTask.cxx:56
KfDefs.h
Common constant definitions for the Kalman Filter library.
KfFieldRegion.h
Magnetic flux density interpolation along the track vs. z-coordinate (header)
B
Some class B.
Definition
_GTestStructLooper.cxx:36
cbm::algo::kf::GlobalField::SetFieldFunction
static void SetFieldFunction(EFieldType fldType, const FieldFn_t &fn)
Sets global field function.
Definition
KfFieldRegion.h:50
cbm::algo::kf::defs::ZeroFieldFn
constexpr auto ZeroFieldFn
Zero magnetic field function.
Definition
KfDefs.h:237
cbm::algo::kf::EFieldType::Normal
@ Normal
Field near the tracker subsystem.
Definition
KfDefs.h:127
cbm::algo::kf::EFieldType::Null
@ Null
No magnetic field.
Definition
KfDefs.h:128
cbm::kf::tools
Definition
KfToolsField.h:18
cbm::kf::tools::SetOriginalCbmField
void SetOriginalCbmField()
pass the original magnetic field to L1Algo
Definition
KfToolsField.h:20
reco
kfnew
tools
KfToolsField.h
Generated on Fri Jan 30 2026 23:05:31 for CbmRoot by
1.13.2