5 #ifndef ACTSGEOMETRY_ATLASMAGNETICFIELDWRAPPER_H
6 #define ACTSGEOMETRY_ATLASMAGNETICFIELDWRAPPER_H
10 #include "Acts/Definitions/Algebra.hpp"
11 #include "Acts/Definitions/Units.hpp"
12 #include "Acts/MagneticField/MagneticFieldContext.hpp"
13 #include "Acts/MagneticField/MagneticFieldProvider.hpp"
21 Cache(
const Acts::MagneticFieldContext mctx) {
33 MagneticFieldProvider::Cache
34 makeCache(
const Acts::MagneticFieldContext& mctx)
const override {
35 return Acts::MagneticFieldProvider::Cache(std::in_place_type<Cache>, mctx);
38 Acts::Result<Acts::Vector3>
39 getField(
const Acts::Vector3& position, Acts::MagneticFieldProvider::Cache& gcache)
const override {
42 posXYZ[0] = position.x();
43 posXYZ[1] = position.y();
44 posXYZ[2] = position.z();
50 Acts::Vector3 bfield{BField[0],BField[1],BField[2]};
54 return Acts::Result<Acts::Vector3>::success(bfield);
57 Acts::Result<Acts::Vector3>
59 Acts::ActsMatrix<3, 3>& gradient,
60 Acts::MagneticFieldProvider::Cache& gcache)
const override
64 posXYZ[0] = position.x();
65 posXYZ[1] = position.y();
66 posXYZ[2] = position.z();
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];
82 return Acts::Result<Acts::Vector3>::success(bfield);