SHiP Field Service
Framework-agnostic C++20 library exposing SHiP magnetic field maps.
Loading...
Searching...
No Matches
SHiP::ActsFieldAdapter Class Referencefinal

Acts::MagneticFieldProvider wrapping an IFieldEvaluator, the ACTS counterpart of G4MagFieldAdapter. More...

#include <ActsFieldAdapter.h>

Inheritance diagram for SHiP::ActsFieldAdapter:
[legend]
Collaboration diagram for SHiP::ActsFieldAdapter:
[legend]

Public Types

using ErrorHandler = std::function< void(std::string_view)>
 

Public Member Functions

 ActsFieldAdapter (std::shared_ptr< IFieldEvaluator > eval, ErrorHandler on_error={})
 
Cache makeCache (Acts::MagneticFieldContext const &) const override
 
Acts::Result< Acts::Vector3 > getField (Acts::Vector3 const &position, Cache &) const override
 

Detailed Description

Acts::MagneticFieldProvider wrapping an IFieldEvaluator, the ACTS counterpart of G4MagFieldAdapter.

Positions go to the evaluator as they come, so pass one in the global frame: wrap map evaluators in translated, and in zeroOutside if lookups past the grid should see no field.

A non-finite position, a non-finite field or an exception from the evaluator fails the lookup with MagneticFieldError::OutOfBounds, so the propagator aborts instead of carrying on with a wrong field. The first such failure is reported to on_error, if given.

Member Typedef Documentation

◆ ErrorHandler

using SHiP::ActsFieldAdapter::ErrorHandler = std::function<void(std::string_view)>

Constructor & Destructor Documentation

◆ ActsFieldAdapter()

SHiP::ActsFieldAdapter::ActsFieldAdapter ( std::shared_ptr< IFieldEvaluator >  eval,
ErrorHandler  on_error = {} 
)
inlineexplicit

Member Function Documentation

◆ getField()

Acts::Result< Acts::Vector3 > SHiP::ActsFieldAdapter::getField ( Acts::Vector3 const &  position,
Cache &   
) const
inlineoverride

◆ makeCache()

Cache SHiP::ActsFieldAdapter::makeCache ( Acts::MagneticFieldContext const &  ) const
inlineoverride

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