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
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";
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 };
51 }
52 }
53
54} // namespace cbm::kf::tools
Common constant definitions for the Kalman Filter library.
Magnetic flux density interpolation along the track vs. z-coordinate (header)
Some class B.
static void SetFieldFunction(EFieldType fldType, const FieldFn_t &fn)
Sets global field function.
constexpr auto ZeroFieldFn
Zero magnetic field function.
Definition KfDefs.h:237
@ Normal
Field near the tracker subsystem.
Definition KfDefs.h:127
@ Null
No magnetic field.
Definition KfDefs.h:128
void SetOriginalCbmField()
pass the original magnetic field to L1Algo