21#include <TGeoGlobalMagField.h>
23#include "Acts/Definitions/Units.hpp"
33constexpr double kGaussToActs = 0.1 * Acts::UnitConstants::T;
43 if (mField ==
nullptr) {
44 throw std::runtime_error(
45 "o2::acts::MagneticFieldAdapter: no O2 magnetic field available. Request GRPMagField in the "
46 "GRPGeomRequest of the workflow, or initialise the field explicitly with "
47 "o2::base::Propagator::initFieldFromGRP().");
49 LOG(info) <<
"ACTS magnetic field adapter bound to O2 field '" << mField->GetName() <<
"'";
56 return Acts::MagneticFieldProvider::Cache(std::in_place_type<CacheImpl>);
62 const double xyz[3] = {
position[0] / Acts::UnitConstants::cm,
63 position[1] / Acts::UnitConstants::cm,
64 position[2] / Acts::UnitConstants::cm};
65 double bxyz[3] = {0., 0., 0.};
66 mField->
Field(xyz, bxyz);
68 return Acts::Result<Acts::Vector3>::success(
69 Acts::Vector3{bxyz[0] * kGaussToActs, bxyz[1] * kGaussToActs, bxyz[2] * kGaussToActs});
Acts::MagneticFieldProvider backed by the O2 field.
Definition of the MagF class.
Cache makeCache(const Acts::MagneticFieldContext &mctx) const final
Acts::Result< Acts::Vector3 > getField(const Acts::Vector3 &position, Cache &cache) const final
void Field(const Double_t *__restrict__ point, Double_t *__restrict__ bField) override
std::vector< Entry > Cache
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"