LDMX Software
tracking::sim::ZeroOutsideBField Class Referencefinal

Field map that returns zero outside its grid instead of an error, so a propagation leaving the map does not abort the whole track. More...

#include <ZeroOutsideBField.h>

Public Member Functions

 ZeroOutsideBField (std::shared_ptr< const InterpolatedMagneticField3 > map)
 
Cache makeCache (const Acts::MagneticFieldContext &mctx) const override
 
Acts::Result< Acts::Vector3 > getField (const Acts::Vector3 &position, Cache &cache) const override
 

Private Attributes

std::shared_ptr< const InterpolatedMagneticField3 > map_
 

Detailed Description

Field map that returns zero outside its grid instead of an error, so a propagation leaving the map does not abort the whole track.

Definition at line 12 of file ZeroOutsideBField.h.

Constructor & Destructor Documentation

◆ ZeroOutsideBField()

tracking::sim::ZeroOutsideBField::ZeroOutsideBField ( std::shared_ptr< const InterpolatedMagneticField3 > map)
inlineexplicit

Definition at line 14 of file ZeroOutsideBField.h.

16 : map_(std::move(map)) {}

Member Function Documentation

◆ getField()

Acts::Result< Acts::Vector3 > tracking::sim::ZeroOutsideBField::getField ( const Acts::Vector3 & position,
Cache & cache ) const
inlineoverride

Definition at line 22 of file ZeroOutsideBField.h.

23 {
24 if (!map_->isInside(position)) {
25 return Acts::Result<Acts::Vector3>::success(Acts::Vector3::Zero());
26 }
27 return map_->getField(position, cache);
28 }

◆ makeCache()

Cache tracking::sim::ZeroOutsideBField::makeCache ( const Acts::MagneticFieldContext & mctx) const
inlineoverride

Definition at line 18 of file ZeroOutsideBField.h.

18 {
19 return map_->makeCache(mctx);
20 }

Member Data Documentation

◆ map_

std::shared_ptr<const InterpolatedMagneticField3> tracking::sim::ZeroOutsideBField::map_
private

Definition at line 31 of file ZeroOutsideBField.h.


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