ATLAS Offline Software
Loading...
Searching...
No Matches
VKalVrtBMag.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4/* General magnetic field in any point access */
5/* If external magnetic field handler is provided as */
6/* either an object inherited from the baseMagFld class */
7/* or a function addrMagHandler - the vkalMagFld class */
8/* will use it, otherwise the vkalMagFld returns */
9/* the constant magnetic field. */
10/* */
11/* Thread-safe implementation */
12/*---------------------------------------------------------*/
13#ifndef TRKVKALVRTCORE_VKALVRTBMAG_H
14#define TRKVKALVRTCORE_VKALVRTBMAG_H
15
17#include <cmath>
18
19namespace Trk {
20
22
23typedef void (*addrMagHandler)(double, double, double, double&, double&,
24 double&);
25
26//
27// Base class for concrete magnetic field implementations (e.g. Athena tool) to
28// be called by vkalMagFld
29//
31 public:
32 baseMagFld() = default;
33 virtual ~baseMagFld() = default;
34 virtual void getMagFld(const double, const double, const double, double&,
35 double&, double&) = 0;
36//
37// Function returns effective field for Perigee track parameters.
38// Motion equation remains the same in any field.
39// Phi and Theta are particle momentum angles at Perigee
40//
41 inline double getEffField(double bx, double by, double bz, double phi, double theta){
42 return bz-(by*std::sin(phi)+bx*std::cos(phi))/std::tan(theta);
43 };
44
45};
46
47//
48// Main magnetic field implememtation in VKalVrtCore package.
49// Depending on VKalVrtControlBase it either calls external magnetic field
50// or uses default fixed magnetic field.
51//
53 public:
54 static void getMagFld(const double, const double, const double, double&,
55 double&, double&, const VKalVrtControlBase*);
56 static double getMagFld(const double xyz[3],
57 const VKalVrtControlBase* FitControl);
58 /* Converstion for MeV and mm and Tesla*/
59 inline static double getCnvCst() { return vkalMagCnvCst; }
60 inline static double getEffField(double bx, double by, double bz, double phi, double theta){
61 return bz-(by*std::sin(phi)+bx*std::cos(phi))/std::tan(theta);
62 };
63
64};
65
66} // namespace Trk
67#endif
#define vkalMagCnvCst
Definition CommonPars.h:23
#define xyz
baseMagFld()=default
double getEffField(double bx, double by, double bz, double phi, double theta)
Definition VKalVrtBMag.h:41
virtual void getMagFld(const double, const double, const double, double &, double &, double &)=0
virtual ~baseMagFld()=default
static void getMagFld(const double, const double, const double, double &, double &, double &, const VKalVrtControlBase *)
static double getEffField(double bx, double by, double bz, double phi, double theta)
Definition VKalVrtBMag.h:60
static double getCnvCst()
Definition VKalVrtBMag.h:59
Ensure that the ATLAS eigen extensions are properly loaded.
void(* addrMagHandler)(double, double, double, double &, double &, double &)
Definition VKalVrtBMag.h:23
@ theta
Definition ParamDefs.h:66
@ phi
Definition ParamDefs.h:75