Project
Loading...
Searching...
No Matches
o2::acts::MagneticFieldAdapter Class Reference

#include <MagneticFieldAdapter.h>

Inherits Acts::MagneticFieldProvider.

Public Member Functions

 MagneticFieldAdapter ()
 
 MagneticFieldAdapter (o2::field::MagneticField *field)
 Use an explicitly provided field.
 
Cache makeCache (const Acts::MagneticFieldContext &mctx) const final
 
Acts::Result< Acts::Vector3 > getField (const Acts::Vector3 &position, Cache &cache) const final
 
const o2::field::MagneticField * getO2Field () const
 

Detailed Description

Exposes the O2 magnetic field to ACTS.

Holds no field of its own: it reads the process-global field that o2::base::Propagator::initFieldFromGRP() installs into TGeoGlobalMagField::Instance() from the GRPMagField CCDB object. The underlying object stays valid across field rescalings – GRPGeomHelper rescales the existing MagneticField in place rather than replacing it – so an adapter built once keeps returning up-to-date values.

Units: O2 works in kGauss and cm, ACTS in its native tesla/mm system, and the conversion is applied here.

Definition at line 42 of file MagneticFieldAdapter.h.

Constructor & Destructor Documentation

◆ MagneticFieldAdapter() [1/2]

o2::acts::MagneticFieldAdapter::MagneticFieldAdapter ( )

Use the field currently installed in TGeoGlobalMagField.

Exceptions
std::runtime_errorif no field has been initialised

Definition at line 36 of file MagneticFieldAdapter.cxx.

◆ MagneticFieldAdapter() [2/2]

o2::acts::MagneticFieldAdapter::MagneticFieldAdapter ( o2::field::MagneticField *  field)
explicit

Use an explicitly provided field.

Definition at line 41 of file MagneticFieldAdapter.cxx.

Member Function Documentation

◆ getField()

Acts::Result< Acts::Vector3 > o2::acts::MagneticFieldAdapter::getField ( const Acts::Vector3 &  position,
Cache &  cache 
) const
final

Definition at line 59 of file MagneticFieldAdapter.cxx.

◆ getO2Field()

const o2::field::MagneticField * o2::acts::MagneticFieldAdapter::getO2Field ( ) const
inline

Definition at line 56 of file MagneticFieldAdapter.h.

◆ makeCache()

Acts::MagneticFieldProvider::Cache o2::acts::MagneticFieldAdapter::makeCache ( const Acts::MagneticFieldContext &  mctx) const
final

Definition at line 52 of file MagneticFieldAdapter.cxx.


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