ATLAS Offline Software
Tracking
TrkVertexFitter
TrkVKalVrtFitter
src
VKalAtlasMagFld.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
// AtlasMagFld object inherits from Trk::baseMagFld. So pointer
6
// AtlasMagFld* is transferred to VKalVrtCore through VKalVrtControlBase object
7
// Then this field is used in CORE for fitting
8
//
9
//
10
// MAGNETIC FIELD IS ALWAYS GIVEN AT GLOBAL REFERENCE FRAME !!!
11
// ref.frame origin (state.m_refFrameX, state.m_refFrameY, state.m_refFrameZ) is always added to coordinates
12
// supplied to getMagFld().
13
// default of ref.frame origin is (0,0,0) but may be changed if input tracks have different frame.
14
//
15
//
16
// ATHENA object "m_fitField" of AtlasMagFld type is created in VKalVrtFitter during init.
17
// By default it gives constant magnetic field value of which may be changed through
18
// jobOption "baseMagneticField" during initialization.
19
// Magnetic field at (0,0,0)
20
// before 13.1.0 - 2.084 tesla
21
// after 13.1.0 - 1.964 tesla
22
// after 15.1.0 - 1.997 tesla
23
//
24
// Currently works with both TrackingMagField and AtlasMagField
25
//
26
//-----------------------------------------------------------------------------------------------
27
28
// Header include
29
#include "
TrkVKalVrtFitter/VKalAtlasMagFld.h
"
30
#include "CLHEP/Units/SystemOfUnits.h"
31
//-------------------------------------------------
32
#include<iostream>
33
34
namespace
Trk
{
35
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
36
// ATLAS magnetic field access
37
VKalAtlasMagFld::VKalAtlasMagFld
()
38
: m_magFrameX(0.), m_magFrameY(0.), m_magFrameZ(0.) {}
39
40
VKalAtlasMagFld::~VKalAtlasMagFld
() =
default
;
41
//
42
// Setting of parameters
43
//
44
void
VKalAtlasMagFld::setAtlasField
(
MagField::AtlasFieldCache
*pnt) {
45
m_VKalAthenaField
= pnt;
46
}
47
48
void
VKalAtlasMagFld::setAtlasField
(
const
double
field
) {
49
m_FIXED_ATLAS_FIELD
=
field
;
50
}
51
52
void
VKalAtlasMagFld::setAtlasMagRefFrame
(
double
x
,
double
y
,
double
z
) {
53
m_magFrameX
=
x
;
54
m_magFrameY
=
y
;
55
m_magFrameZ
=
z
;
56
}
57
58
//
59
// Coordinates here are in mm. - default for TrkVKalVrtCore
60
//
61
void
VKalAtlasMagFld::getMagFld
(
const
double
x
,
const
double
y
,
const
double
z
,
62
double
&
bx
,
double
&
by
,
double
&
bz
) {
63
double
fieldXYZ[3];
64
double
BField[3];
65
fieldXYZ[0] = (
x
+
m_magFrameX
) *
CLHEP::mm
;
66
fieldXYZ[1] = (
y
+
m_magFrameY
) *
CLHEP::mm
;
67
fieldXYZ[2] = (
z
+
m_magFrameZ
) *
CLHEP::mm
;
68
if
(
m_VKalAthenaField
) {
69
m_VKalAthenaField
->
getField
(fieldXYZ, BField);
70
bx
= BField[0] /
CLHEP::tesla
;
71
by
= BField[1] /
CLHEP::tesla
;
// Field in TESLA!!!!
72
bz
= BField[2] /
CLHEP::tesla
;
73
}
else
{
74
bx
= 0.;
75
by
= 0.;
76
bz
=
m_FIXED_ATLAS_FIELD
;
77
}
78
}
79
}
// namespace Trk
Trk::VKalAtlasMagFld::~VKalAtlasMagFld
~VKalAtlasMagFld()
Trk::y
@ y
Definition:
ParamDefs.h:56
Trk::z
@ z
global position (cartesian)
Definition:
ParamDefs.h:57
Trk::VKalAtlasMagFld::m_FIXED_ATLAS_FIELD
double m_FIXED_ATLAS_FIELD
Definition:
VKalAtlasMagFld.h:29
Trk::VKalAtlasMagFld::getMagFld
virtual void getMagFld(const double, const double, const double, double &, double &, double &) override
Definition:
VKalAtlasMagFld.cxx:61
Trk::VKalAtlasMagFld::setAtlasField
void setAtlasField(MagField::AtlasFieldCache *)
Definition:
VKalAtlasMagFld.cxx:44
ReadOfcFromCool.field
field
Definition:
ReadOfcFromCool.py:48
Trk::VKalAtlasMagFld::m_magFrameX
double m_magFrameX
Definition:
VKalAtlasMagFld.h:30
Trk::VKalAtlasMagFld::m_magFrameY
double m_magFrameY
Definition:
VKalAtlasMagFld.h:30
Trk::VKalAtlasMagFld::VKalAtlasMagFld
VKalAtlasMagFld()
Definition:
VKalAtlasMagFld.cxx:37
fitman.bz
bz
Definition:
fitman.py:412
fitman.bx
bx
Definition:
fitman.py:410
fitman.by
by
Definition:
fitman.py:411
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition:
FakeTrackBuilder.h:9
Trk::VKalAtlasMagFld::m_VKalAthenaField
MagField::AtlasFieldCache * m_VKalAthenaField
Definition:
VKalAtlasMagFld.h:28
python.SystemOfUnits.tesla
int tesla
Definition:
SystemOfUnits.py:228
Trk::VKalAtlasMagFld::setAtlasMagRefFrame
void setAtlasMagRefFrame(double, double, double)
Definition:
VKalAtlasMagFld.cxx:52
python.SystemOfUnits.mm
int mm
Definition:
SystemOfUnits.py:83
VKalAtlasMagFld.h
MagField::AtlasFieldCache
Local cache for magnetic field (based on MagFieldServices/AtlasFieldSvcTLS.h)
Definition:
AtlasFieldCache.h:43
MagField::AtlasFieldCache::getField
void getField(const double *ATH_RESTRICT xyz, double *ATH_RESTRICT bxyz, double *ATH_RESTRICT deriv=nullptr)
get B field value at given position xyz[3] is in mm, bxyz[3] is in kT if deriv[9] is given,...
Definition:
AtlasFieldCache.cxx:42
Trk::x
@ x
Definition:
ParamDefs.h:55
Trk::VKalAtlasMagFld::m_magFrameZ
double m_magFrameZ
Definition:
VKalAtlasMagFld.h:30
Generated on Fri Jan 10 2025 21:21:30 for ATLAS Offline Software by
1.8.18