PandaRoot
GFFieldManager Class Reference

Singleton which provides access to magnetic field for track representations. More...

#include <GFFieldManager.h>

Public Member Functions

GFAbsBFieldgetField ()
 
void init (GFAbsBField *b)
 set the magntic field here. Magnetic field classes must be derived from GFAbsBField More...
 

Static Public Member Functions

static TVector3 getFieldVal (const TVector3 &x)
 
static GFFieldManagergetInstance ()
 

Detailed Description

Singleton which provides access to magnetic field for track representations.

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

Definition at line 36 of file GFFieldManager.h.

Member Function Documentation

◆ getField()

GFAbsBField* GFFieldManager::getField ( )
inline

Definition at line 43 of file GFFieldManager.h.

44  {
45  if (fField == nullptr) {
46  std::cerr << "Appareantly GFFieldManager hasnt been initialized with a correct GFAbsBField pointer -> abort" << std::endl;
47  throw;
48  }
49  return fField;
50  }

◆ getFieldVal()

static TVector3 GFFieldManager::getFieldVal ( const TVector3 &  x)
inlinestatic

Definition at line 52 of file GFFieldManager.h.

References GFAbsBField::get().

53  {
54  if (fInstance == nullptr) {
55  std::cerr << "Appareantly GFFieldManager hasnt been instantiated yet, call getInstance() and init() before getFieldVal() -> abort" << std::endl;
56  throw;
57  }
58  if (fField == nullptr) {
59  std::cerr << "Appareantly GFFieldManager hasnt been initialized with a correct GFAbsBField pointer -> abort" << std::endl;
60  throw;
61  }
62  return fField->get(x);
63  }
virtual TVector3 get(const TVector3 &) const =0
override this is you concrete implementation

◆ getInstance()

static GFFieldManager* GFFieldManager::getInstance ( )
inlinestatic

Definition at line 68 of file GFFieldManager.h.

69  {
70  if (fInstance == nullptr) {
71  fInstance = new GFFieldManager();
72  }
73  return fInstance;
74  }
Singleton which provides access to magnetic field for track representations.

◆ init()

void GFFieldManager::init ( GFAbsBField b)
inline

set the magntic field here. Magnetic field classes must be derived from GFAbsBField

Definition at line 66 of file GFFieldManager.h.

66 { fField = b; }

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