GENFIT Rev: NoNumberAvailable
Loading...
Searching...
No Matches
genfit::FieldManager Class Reference

Singleton which provides access to magnetic field maps. More...

#include <FieldManager.h>

Collaboration diagram for genfit::FieldManager:
Collaboration graph

Public Member Functions

AbsBFieldgetField ()
 
TVector3 getFieldVal (const TVector3 &position)
 This does NOT use the cache!
 
void getFieldVal (const double &posX, const double &posY, const double &posZ, double &Bx, double &By, double &Bz)
 
void init (AbsBField *b)
 set the magnetic field here. Magnetic field classes must be derived from AbsBField.
 
void destruct ()
 
bool isInitialized ()
 
void checkInitialized ()
 
void useCache (bool opt=true, unsigned int nBuckets=8)
 Cache last lookup positions, and use stored field values if a lookup at (almost) the same position is done.
 

Static Public Member Functions

static void checkInstanciated ()
 
static FieldManagergetInstance ()
 Get singleton instance.
 

Private Member Functions

 FieldManager ()
 
 ~FieldManager ()
 

Static Private Attributes

static FieldManagerinstance_ = nullptr
 
static AbsBFieldfield_ = nullptr
 
static bool useCache_ = false
 
static unsigned int n_buckets_ = 8
 
static fieldCachecache_ = nullptr
 

Detailed Description

Singleton which provides access to magnetic field maps.

Author
Christian Höppner (Technische Universität München, original author)
Sebastian Neubert (Technische Universität München, original author)

Definition at line 53 of file FieldManager.h.

Constructor & Destructor Documentation

◆ FieldManager()

genfit::FieldManager::FieldManager ( )
inlineprivate

Definition at line 129 of file FieldManager.h.

Referenced by getInstance().

◆ ~FieldManager()

genfit::FieldManager::~FieldManager ( )
inlineprivate

Definition at line 131 of file FieldManager.h.

References cache_.

Member Function Documentation

◆ checkInitialized()

void genfit::FieldManager::checkInitialized ( )
inline

Definition at line 91 of file FieldManager.h.

References genfit::errorOut, and isInitialized().

Referenced by getField(), getFieldVal(), and getFieldVal().

◆ checkInstanciated()

static void genfit::FieldManager::checkInstanciated ( )
inlinestatic

Definition at line 100 of file FieldManager.h.

References genfit::errorOut, and instance_.

◆ destruct()

void genfit::FieldManager::destruct ( )
inline

Definition at line 82 of file FieldManager.h.

References instance_.

◆ getField()

AbsBField * genfit::FieldManager::getField ( )
inline

Definition at line 57 of file FieldManager.h.

References checkInitialized(), and field_.

◆ getFieldVal() [1/2]

void genfit::FieldManager::getFieldVal ( const double & posX,
const double & posY,
const double & posZ,
double & Bx,
double & By,
double & Bz )

Definition at line 38 of file FieldManager.cc.

References cache_, checkInitialized(), genfit::debugOut, field_, n_buckets_, and useCache_.

◆ getFieldVal() [2/2]

TVector3 genfit::FieldManager::getFieldVal ( const TVector3 & position)
inline

◆ getInstance()

◆ init()

void genfit::FieldManager::init ( AbsBField * b)
inline

set the magnetic field here. Magnetic field classes must be derived from AbsBField.

Definition at line 78 of file FieldManager.h.

References field_.

◆ isInitialized()

bool genfit::FieldManager::isInitialized ( )
inline

Definition at line 89 of file FieldManager.h.

References field_.

Referenced by checkInitialized().

◆ useCache()

void genfit::FieldManager::useCache ( bool opt = true,
unsigned int nBuckets = 8 )

Cache last lookup positions, and use stored field values if a lookup at (almost) the same position is done.

Definition at line 95 of file FieldManager.cc.

References cache_, n_buckets_, and useCache_.

Member Data Documentation

◆ cache_

fieldCache * genfit::FieldManager::cache_ = nullptr
staticprivate

Definition at line 141 of file FieldManager.h.

Referenced by getFieldVal(), useCache(), and ~FieldManager().

◆ field_

AbsBField * genfit::FieldManager::field_ = nullptr
staticprivate

Definition at line 136 of file FieldManager.h.

Referenced by getField(), getFieldVal(), getFieldVal(), init(), and isInitialized().

◆ instance_

FieldManager * genfit::FieldManager::instance_ = nullptr
staticprivate

Definition at line 135 of file FieldManager.h.

Referenced by checkInstanciated(), destruct(), and getInstance().

◆ n_buckets_

unsigned int genfit::FieldManager::n_buckets_ = 8
staticprivate

Definition at line 140 of file FieldManager.h.

Referenced by getFieldVal(), and useCache().

◆ useCache_

bool genfit::FieldManager::useCache_ = false
staticprivate

Definition at line 139 of file FieldManager.h.

Referenced by getFieldVal(), and useCache().


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