LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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 37 of file GFFieldManager.h.

Constructor & Destructor Documentation

genf::GFFieldManager::GFFieldManager ( )
inlineprivate

Definition at line 39 of file GFFieldManager.h.

Referenced by getInstance().

39 {}

Member Function Documentation

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

Definition at line 44 of file GFFieldManager.h.

References fField.

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

Definition at line 55 of file GFFieldManager.h.

References genf::GFAbsBField::get().

Referenced by genf::RKTrackRep::RKutta().

56  {
57  if (fInstance == NULL) {
58  std::cerr << "Appareantly GFFieldManager hasnt been instantiated yet, call getInstance() "
59  "and init() before getFieldVal() -> abort"
60  << std::endl;
61  throw;
62  }
63  if (fField == NULL) {
64  std::cerr << "Appareantly GFFieldManager hasnt been initialized with a correct GFAbsBField "
65  "pointer -> abort"
66  << std::endl;
67  throw;
68  }
69  return fField->get(x);
70  }
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 75 of file GFFieldManager.h.

References fInstance, and GFFieldManager().

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

76  {
77  if (fInstance == NULL) { fInstance = new GFFieldManager(); }
78  return fInstance;
79  }
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 73 of file GFFieldManager.h.

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

73 { fField = b; }
static GFAbsBField * fField

Member Data Documentation

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

Definition at line 41 of file GFFieldManager.h.

Referenced by getField().

genf::GFFieldManager * genf::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: