ATLAS Offline Software
Classes | Public Member Functions | Private Attributes | List of all members
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
 
Acts::Result< Acts::Vector3 > getFieldGradient (const Acts::Vector3 &position, Acts::ActsMatrix< 3, 3 > &gradient, 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  }

◆ getFieldGradient()

Acts::Result<Acts::Vector3> ATLASMagneticFieldWrapper::getFieldGradient ( const Acts::Vector3 &  position,
Acts::ActsMatrix< 3, 3 > &  gradient,
Acts::MagneticFieldProvider::Cache &  gcache 
) const
inlineoverride

Definition at line 58 of file ATLASMagneticFieldWrapper.h.

61  {
62  Cache& cache = gcache.as<Cache>();
63  double posXYZ[3];
64  posXYZ[0] = position.x();
65  posXYZ[1] = position.y();
66  posXYZ[2] = position.z();
67  double BField[3];
68  double grad[9];
69 
70  cache.fieldCache.getField(posXYZ, BField, grad);
71 
72  // Magnetic field
73  Acts::Vector3 bfield{BField[0], BField[1],BField[2]};
74  Acts::ActsMatrix<3, 3> tempGrad;
75  tempGrad << grad[0], grad[1], grad[2], grad[3], grad[4], grad[5], grad[6], grad[7], grad[8];
76  gradient = tempGrad;
77 
78 
79  bfield *= m_bFieldUnit; // kT -> T;
80  gradient *= m_bFieldUnit;
81 
82  return Acts::Result<Acts::Vector3>::success(bfield);
83  }

◆ 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 86 of file ATLASMagneticFieldWrapper.h.


The documentation for this class was generated from the following file:
ATLASMagneticFieldWrapper::m_bFieldUnit
const double m_bFieldUnit
Definition: ATLASMagneticFieldWrapper.h:86