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 48 of file GFFieldManager.h.

Member Function Documentation

◆ getField()

GFAbsBField* GFFieldManager::getField ( )
inline

Definition at line 55 of file GFFieldManager.h.

56  {
57  if (fField == nullptr) {
58  std::cerr << "Appareantly GFFieldManager hasnt been initialized with a correct GFAbsBField pointer -> abort" << std::endl;
59  throw;
60  }
61  return fField;
62  }

◆ getFieldVal()

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

Definition at line 64 of file GFFieldManager.h.

References GFAbsBField::get().

65  {
66  if (fInstance == nullptr) {
67  std::cerr << "Appareantly GFFieldManager hasnt been instantiated yet, call getInstance() and init() before getFieldVal() -> abort" << std::endl;
68  throw;
69  }
70  if (fField == nullptr) {
71  std::cerr << "Appareantly GFFieldManager hasnt been initialized with a correct GFAbsBField pointer -> abort" << std::endl;
72  throw;
73  }
74  return fField->get(x);
75  }
virtual TVector3 get(const TVector3 &) const =0
override this is you concrete implementation

◆ getInstance()

static GFFieldManager* GFFieldManager::getInstance ( )
inlinestatic

Definition at line 80 of file GFFieldManager.h.

81  {
82  if (fInstance == nullptr) {
83  fInstance = new GFFieldManager();
84  }
85  return fInstance;
86  }
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 78 of file GFFieldManager.h.

78 { fField = b; }

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