ATLAS Offline Software
Loading...
Searching...
No Matches
ATLASMagneticFieldWrapper Class Referencefinal

#include <ATLASMagneticFieldWrapper.h>

Inheritance diagram for ATLASMagneticFieldWrapper:
Collaboration diagram for ATLASMagneticFieldWrapper:

Classes

struct  Cache

Public Member Functions

 ATLASMagneticFieldWrapper ()=default
MagneticFieldProvider::Cache makeCache (const Acts::MagneticFieldContext &mctx) const override
Acts::Result< Acts::Vector3 > getField (const Acts::Vector3 &position, Acts::MagneticFieldProvider::Cache &gcache) const override

Private Attributes

const double m_bFieldUnit = 1000.*Acts::UnitConstants::T

Detailed Description

Definition at line 15 of file ATLASMagneticFieldWrapper.h.

Constructor & Destructor Documentation

◆ ATLASMagneticFieldWrapper()

ATLASMagneticFieldWrapper::ATLASMagneticFieldWrapper ( )
default

Member Function Documentation

◆ getField()

Acts::Result< Acts::Vector3 > ATLASMagneticFieldWrapper::getField ( const Acts::Vector3 & position,
Acts::MagneticFieldProvider::Cache & gcache ) const
inlineoverride

Definition at line 39 of file ATLASMagneticFieldWrapper.h.

39 {
40 Cache& cache = gcache.as<Cache>();
41 double posXYZ[3];
42 posXYZ[0] = position.x();
43 posXYZ[1] = position.y();
44 posXYZ[2] = position.z();
45 double BField[3];
46
47 cache.fieldCache.getField(posXYZ, BField);
48
49 // Magnetic field
50 Acts::Vector3 bfield{BField[0],BField[1],BField[2]};
51
52 bfield *= m_bFieldUnit; // kT -> T;
53
54 return Acts::Result<Acts::Vector3>::success(bfield);
55 }
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,...

◆ makeCache()

MagneticFieldProvider::Cache ATLASMagneticFieldWrapper::makeCache ( const Acts::MagneticFieldContext & mctx) const
inlineoverride

Definition at line 34 of file ATLASMagneticFieldWrapper.h.

34 {
35 return Acts::MagneticFieldProvider::Cache(std::in_place_type<Cache>, mctx);
36 }

Member Data Documentation

◆ m_bFieldUnit

const double ATLASMagneticFieldWrapper::m_bFieldUnit = 1000.*Acts::UnitConstants::T
private

Definition at line 58 of file ATLASMagneticFieldWrapper.h.


The documentation for this class was generated from the following file: