ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkVertexFitter
TrkVKalVrtCore
src
VKalVrtBMag.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// Create object vkalMagFld which containg magnetic field.
6
// It accepts external handlers with magnetic field ( function or object)
7
// and takes data from them. If they are absent - default constants
8
// ATLAS magnetic field (1.996 tesla) is used
9
//
10
// Single object myMagFld of vkalMagFld type is created in CFit.cxx
11
//-------------------------------------------------------------------------
12
#include "
TrkVKalVrtCore/VKalVrtBMag.h
"
13
14
#include <iostream>
15
16
#include "
TrkVKalVrtCore/TrkVKalVrtCore.h
"
17
18
namespace
{
19
constexpr
double
s_cnstBMAG = 1.997;
// Tesla
20
}
21
22
namespace
Trk
{
23
24
void
vkalMagFld::getMagFld
(
const
double
X,
const
double
Y,
const
double
Z,
25
double
& bx,
double
& by,
double
& bz,
26
const
VKalVrtControlBase
* FitControl =
nullptr
) {
27
bx = by = 0.;
28
if
(FitControl ==
nullptr
|| (FitControl->vk_funcMagFld ==
nullptr
&&
29
FitControl->vk_objMagFld ==
nullptr
)) {
30
bz = s_cnstBMAG;
31
return
;
32
}
33
if
(FitControl->vk_funcMagFld) {
34
FitControl->vk_funcMagFld(X, Y, Z, bx, by, bz);
35
}
else
if
(FitControl->vk_objMagFld) {
36
FitControl->vk_objMagFld->getMagFld(X, Y, Z, bx, by, bz);
37
}
38
}
39
40
double
vkalMagFld::getMagFld
(
41
const
double
xyz
[3],
const
VKalVrtControlBase
* FitControl =
nullptr
) {
42
double
bx = 0., by = 0., bz = 0.;
43
if
(FitControl ==
nullptr
|| (FitControl->vk_funcMagFld ==
nullptr
&&
44
FitControl->vk_objMagFld ==
nullptr
)) {
45
bz = s_cnstBMAG;
46
return
bz;
47
}
48
if
(FitControl->vk_funcMagFld) {
49
FitControl->vk_funcMagFld(
xyz
[0],
xyz
[1],
xyz
[2], bx, by, bz);
50
}
else
if
(FitControl->vk_objMagFld) {
51
FitControl->vk_objMagFld->getMagFld(
xyz
[0],
xyz
[1],
xyz
[2], bx, by, bz);
52
}
53
return
bz;
54
}
55
56
}
// namespace Trk
57
TrkVKalVrtCore.h
VKalVrtBMag.h
xyz
#define xyz
Trk::VKalVrtControlBase
Definition
TrkVKalVrtCore.h:26
Trk::vkalMagFld::getMagFld
static void getMagFld(const double, const double, const double, double &, double &, double &, const VKalVrtControlBase *)
Definition
VKalVrtBMag.cxx:24
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition
FakeTrackBuilder.h:9
Generated on
for ATLAS Offline Software by
1.17.0