ATLAS Offline Software
VKalVrtBMag.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 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 //-------------------------------------------------------------------------
13 
14 #include <iostream>
15 
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  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 
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 
Trk::vkalMagFld::getMagFld
static void getMagFld(const double, const double, const double, double &, double &, double &, VKalVrtControlBase *)
Definition: VKalVrtBMag.cxx:24
xyz
#define xyz
VKalVrtBMag.h
Monitored::X
@ X
Definition: HistogramFillerUtils.h:24
fitman.bz
bz
Definition: fitman.py:412
fitman.bx
bx
Definition: fitman.py:410
TrkVKalVrtCore.h
fitman.by
by
Definition: fitman.py:411
Monitored::Y
@ Y
Definition: HistogramFillerUtils.h:24
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::VKalVrtControlBase
Definition: TrkVKalVrtCore.h:26