|
ACTS
Experiment-independent tracking
|
Base class for all magnetic field providers. More...
#include <Acts/MagneticField/MagneticFieldProvider.hpp>
Public Types | |
| using | Cache = Acts::AnyBase<sizeof(char) * 512> |
| Opaque cache type that can store arbitrary implementation specific cache data. | |
Public Member Functions | |
| virtual | ~MagneticFieldProvider ()=default |
| virtual Result< Vector3 > | getField (const Vector3 &position, Cache &cache) const =0 |
| Retrieve magnetic field value at a given location. | |
| virtual Cache | makeCache (const MagneticFieldContext &mctx) const =0 |
| Make an opaque cache for the magnetic field. | |
Base class for all magnetic field providers.
All magnetic field implementations inherit and implement from this interface.
It provides a generic interface over different implementations. To speed up magnetic field lookup, each implementation can have a cache object. The cache object can for example be used to store a local interpolation domain, to speed up nearby field lookups. The client is expected to pass into lookup calls an instance of Acts::MagneticFieldProvider::Cache.
The implementation is then free to use and update this cache instance as needed. Before a client can issue field lookup calls, it needs to obtain an initialized instance of this cache object. This can be achieved generically for all implementations by using Acts::MagneticFieldProvider::makeCache. This function accepts an instance of Acts::MagneticFieldContext.
The main lookup method of Acts::MagneticFieldProvider is Acts::MagneticFieldProvider::getField
Aside from the lookup position as a global position vector, it accepts an instance of the opaque cache object mentioned before. The return value is a Acts::Result object. It either contains the field value at the requested location, or an Acts::MagneticFieldError in case of a lookup failure, like an out-of-bounds lookup position.
Below is an example of how a client can interact with an instance of Acts::MagneticFieldProvider.
| using Acts::MagneticFieldProvider::Cache = Acts::AnyBase<sizeof(char) * 512> |
Opaque cache type that can store arbitrary implementation specific cache data.
Examples are an interpolation cell, or an experiment specific conditions data handle.
The cache is always creaded through makeCache.
|
virtualdefault |
|
pure virtual |
Retrieve magnetic field value at a given location.
Requires an instance of Acts::MagneticFieldProvider::Cache created through makeCache.
| [in] | position | global 3D position for the lookup |
| [in,out] | cache | Field provider specific cache object |
Implemented in Acts::ConstantBField, Acts::InterpolatedBFieldMap< grid_t >, Acts::MultiRangeBField, Acts::NullBField, Acts::SolenoidBField, Acts::ToroidField, and ActsPlugins::DD4hepFieldAdapter.
|
pure virtual |
Make an opaque cache for the magnetic field.
Instructs the specific implementation to generate a Acts::MagneticFieldProvider::Cache instance for magnetic field lookup.
| mctx | The magnetic field context to generate cache for |
Implemented in Acts::ConstantBField, Acts::InterpolatedBFieldMap< grid_t >, Acts::MultiRangeBField, Acts::NullBField, Acts::SolenoidBField, Acts::ToroidField, and ActsPlugins::DD4hepFieldAdapter.