FairRoot/PandaRoot
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Attributes | List of all members
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 ()
 

Private Member Functions

 GFFieldManager ()
 

Static Private Attributes

static GFFieldManagerfInstance = NULL
 
static GFAbsBFieldfField = NULL
 

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

Constructor & Destructor Documentation

GFFieldManager::GFFieldManager ( )
inlineprivate

Definition at line 39 of file GFFieldManager.h.

Referenced by getInstance().

39 {}

Member Function Documentation

GFAbsBField* GFFieldManager::getField ( )
inline

Definition at line 44 of file GFFieldManager.h.

References fField.

44  {
45  if(fField==NULL){
46  std::cerr << "Appareantly GFFieldManager hasnt been initialized with a correct GFAbsBField pointer -> abort" << std::endl;
47  throw;
48  }
49  return fField;
50  }
static GFAbsBField * fField
static TVector3 GFFieldManager::getFieldVal ( const TVector3 &  x)
inlinestatic

Definition at line 52 of file GFFieldManager.h.

References GFAbsBField::get().

Referenced by RKTrackRep::RKutta().

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

Definition at line 69 of file GFFieldManager.h.

References fInstance, and GFFieldManager().

Referenced by PndLmdBPRungeKuttaTask::Init(), PndRecoDafFit::Init(), PndRecoKalmanFit::Init(), PndLmdPerformanceTask::Init(), and PndLmdKalmanTask::Init().

69  {
70  if(fInstance==NULL) {
71  fInstance = new GFFieldManager();
72  }
73  return fInstance;
74  }
static GFFieldManager * fInstance
void GFFieldManager::init ( GFAbsBField b)
inline

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

Definition at line 65 of file GFFieldManager.h.

References b.

Referenced by PndLmdBPRungeKuttaTask::Init(), PndRecoDafFit::Init(), PndRecoKalmanFit::Init(), PndLmdPerformanceTask::Init(), and PndLmdKalmanTask::Init().

65  {
66  fField=b;
67  }
TTree * b
static GFAbsBField * fField

Member Data Documentation

GFAbsBField * GFFieldManager::fField = NULL
staticprivate

Definition at line 41 of file GFFieldManager.h.

Referenced by getField().

GFFieldManager * GFFieldManager::fInstance = NULL
staticprivate

Definition at line 40 of file GFFieldManager.h.

Referenced by getInstance().


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