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

The simplest magnetic field implementation is a constant field, which returns the same field values at every queried location. More...

#include <Acts/MagneticField/ConstantBField.hpp>

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

Classes

struct  Cache
 Cache object for constant magnetic field. More...

Public Member Functions

 ConstantBField (Vector3 B)
 Construct constant magnetic field from field vector.
Vector3 getField () const
 Get the B field at a position.
Result< Vector3getField (const Vector3 &position, MagneticFieldProvider::Cache &cache) const override
 Retrieve magnetic field value 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.
void setField (const Vector3 &B)
 update magnetic field vector
Public Member Functions inherited from Acts::MagneticFieldProvider
virtual ~MagneticFieldProvider ()=default

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

The simplest magnetic field implementation is a constant field, which returns the same field values at every queried location.

Constructor & Destructor Documentation

◆ ConstantBField()

Acts::ConstantBField::ConstantBField ( Vector3 B)
explicit

Construct constant magnetic field from field vector.

Parameters
[in]Bmagnetic field vector in global coordinate system

Member Function Documentation

◆ getField() [1/2]

Vector3 Acts::ConstantBField::getField ( ) const

Get the B field at a position.

Returns
The constant magnetic field vector

◆ getField() [2/2]

Result< Vector3 > Acts::ConstantBField::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.

◆ isInside()

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

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

Returns
Always true for constant magnetic field

◆ makeCache()

Acts::MagneticFieldProvider::Cache Acts::ConstantBField::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.

◆ setField()

void Acts::ConstantBField::setField ( const Vector3 & B)

update magnetic field vector

Parameters
[in]Bmagnetic field vector in global coordinate system