ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Acts::NullBField Class Referencefinal

Null bfield which returns 0 always. More...

#include <Acts/MagneticField/NullBField.hpp>

Inheritance diagram for Acts::NullBField:
[legend]
Collaboration diagram for Acts::NullBField:
[legend]

Classes

struct  Cache
 Cache object for the null magnetic field provider. More...

Public Member Functions

 NullBField ()=default
 Default constructor.
Result< Vector3 > getField (const Vector3 &position, MagneticFieldProvider::Cache &cache) const override
 Retrieve magnetic field value at a given location.
Result< FieldAndGradient > getFieldAndGradient (const Vector3 &position, MagneticFieldProvider::Cache &cache) const override
 Retrieve the magnetic field and its spatial gradient at a given location.
bool isInside (const Vector3 &) const
 check whether given 3D position is inside look-up domain
Acts::MagneticFieldProvider::Cache makeCache (const Acts::MagneticFieldContext &mctx) const override
 Make an opaque cache for the magnetic field.
bool providesFieldGradient () const override
 Check if getFieldAndGradient is implemented by this provider.

Additional Inherited Members

Public Types inherited from Acts::MagneticFieldProvider
using Cache = Acts::AnyBase<sizeof(char) * 512>
 Opaque cache type that can store arbitrary implementation specific cache data.

Detailed Description

Null bfield which returns 0 always.

Member Function Documentation

◆ getField()

Result< Vector3 > Acts::NullBField::getField ( const Vector3 & position,
MagneticFieldProvider::Cache & cache ) const
overridevirtual

Retrieve magnetic field value at a given location.

Requires an instance of Acts::MagneticFieldProvider::Cache created through makeCache.

Parameters
[in]positionglobal 3D position for the lookup
[in,out]cacheField provider specific cache object
Returns
magnetic field vector at given position
Note
The position is ignored and only kept as argument to provide a consistent interface with other magnetic field services.

Implements Acts::MagneticFieldProvider.

◆ getFieldAndGradient()

Result< FieldAndGradient > Acts::NullBField::getFieldAndGradient ( const Vector3 & position,
MagneticFieldProvider::Cache & cache ) const
overridevirtual

Retrieve the magnetic field and its spatial gradient at a given location.

Parameters
[in]positionglobal 3D position for the lookup
[in,out]cacheField provider specific cache object
Returns
field and gradient at the given position, or MagneticFieldError::NotImplemented if providesFieldGradient is false
Note
The field and its gradient are zero.

Reimplemented from Acts::MagneticFieldProvider.

◆ isInside()

bool Acts::NullBField::isInside ( const Vector3 & ) const

check whether given 3D position is inside look-up domain

Returns
true if position is inside the defined look-up grid, otherwise false
Note
The method will always return true for the null B-Field

◆ makeCache()

Acts::MagneticFieldProvider::Cache Acts::NullBField::makeCache ( const Acts::MagneticFieldContext & mctx) const
overridevirtual

Make an opaque cache for the magnetic field.

Instructs the specific implementation to generate a Acts::MagneticFieldProvider::Cache instance for magnetic field lookup.

Parameters
mctxThe magnetic field context to generate cache for
Returns
Cache The opaque cache object

Implements Acts::MagneticFieldProvider.

◆ providesFieldGradient()

bool Acts::NullBField::providesFieldGradient ( ) const
overridevirtual

Check if getFieldAndGradient is implemented by this provider.

If it is false, the caller has to compute the gradient in a different way, for example with finite differences of getField.

Returns
true if the provider implements the field gradient

Reimplemented from Acts::MagneticFieldProvider.