ATLAS Offline Software
Loading...
Searching...
No Matches
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
30#include "CLHEP/Units/SystemOfUnits.h"
31//-------------------------------------------------
32#include<iostream>
33
34namespace Trk{
35//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
36// ATLAS magnetic field access
39
41//
42// Setting of parameters
43//
47
48void VKalAtlasMagFld::setAtlasField(const double field) {
49 m_FIXED_ATLAS_FIELD = field;
50}
51
52void 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//
61void 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;
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.;
77 }
78}
79} // namespace Trk
Local cache for magnetic field (based on MagFieldServices/AtlasFieldSvcTLS.h)
MagField::AtlasFieldCache * m_VKalAthenaField
virtual void getMagFld(const double, const double, const double, double &, double &, double &) override
void setAtlasField(MagField::AtlasFieldCache *)
void setAtlasMagRefFrame(double, double, double)
Ensure that the ATLAS eigen extensions are properly loaded.
@ x
Definition ParamDefs.h:55
@ z
global position (cartesian)
Definition ParamDefs.h:57
@ y
Definition ParamDefs.h:56