LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
genf::GFFieldManager Class Reference

#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

Definition at line 38 of file GFFieldManager.h.

Constructor & Destructor Documentation

genf::GFFieldManager::GFFieldManager ( )
inlineprivate

Definition at line 40 of file GFFieldManager.h.

Referenced by getInstance().

40 {}

Member Function Documentation

GFAbsBField* genf::GFFieldManager::getField ( )
inline

Definition at line 45 of file GFFieldManager.h.

References fField.

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

Definition at line 53 of file GFFieldManager.h.

References genf::GFAbsBField::get().

Referenced by genf::GeaneMCApplication::Field(), and genf::RKTrackRep::RKutta().

53  {
54  if(fInstance==NULL){
55  std::cerr << "Appareantly GFFieldManager hasnt been instantiated yet, call getInstance() and init() before getFieldVal() -> abort" << std::endl;
56  throw;
57  }
58  if(fField==NULL){
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  }
Float_t x
Definition: compare.C:6
static GFFieldManager * fInstance
virtual TVector3 get(const TVector3 &) const =0
override this is you concrete implementation
static GFAbsBField * fField
static GFFieldManager* genf::GFFieldManager::getInstance ( )
inlinestatic

Definition at line 70 of file GFFieldManager.h.

References fInstance, and GFFieldManager().

Referenced by trkf::Track3DKalman::produce(), and trkf::Track3DKalmanSPS::produce().

70  {
71  if(fInstance==NULL) {
72  fInstance = new GFFieldManager();
73  }
74  return fInstance;
75  }
static GFFieldManager * fInstance
void genf::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.

Referenced by trkf::Track3DKalman::produce(), and trkf::Track3DKalmanSPS::produce().

66  {
67  fField=b;
68  }
static GFAbsBField * fField

Member Data Documentation

genf::GFAbsBField * genf::GFFieldManager::fField = NULL
staticprivate

Definition at line 42 of file GFFieldManager.h.

Referenced by getField().

genf::GFFieldManager * genf::GFFieldManager::fInstance = NULL
staticprivate

Definition at line 41 of file GFFieldManager.h.

Referenced by getInstance().


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