23 #ifndef genfit_FieldManager_h 24 #define genfit_FieldManager_h 68 return field_->get(position);
72 void getFieldVal(
const double &
posX,
const double &
posY,
const double &
posZ,
double &
Bx,
double &
By,
double &
Bz);
74 inline void getFieldVal(
const double &posX,
const double &posY,
const double &posZ,
double &Bx,
double &By,
double &Bz)
77 return field_->get(posX, posY, posZ, Bx, By, Bz);
88 if (!isInitialized()) {
89 std::cerr <<
"FieldManager hasn't been initialized with a correct AbsBField pointer!" << std::endl;
90 std::string msg(
"FieldManager hasn't been initialized with a correct AbsBField pointer!");
91 std::runtime_error err(msg);
98 if (instance_ ==
nullptr) {
99 std::cerr <<
"FieldManager hasn't been instantiated yet, call getInstance() and init() before getFieldVal()!" << std::endl;
100 std::string msg(
"FieldManager hasn't been instantiated yet, call getInstance() and init() before getFieldVal()!");
101 std::runtime_error err(msg);
107 void useCache(
bool opt =
true,
unsigned int nBuckets = 8);
110 void useCache(
bool opt =
true,
unsigned int nBuckets = 8)
112 std::cerr <<
"genfit::FieldManager::useCache() - FieldManager is compiled w/o CACHE, no caching will be done!" << std::endl;
119 if (instance_ ==
nullptr) {
136 static bool useCache_;
137 static unsigned int n_buckets_;
145 #endif // genfit_FieldManager_h static void checkInstanciated()
Abstract Interface to magnetic fields in GENFIT.
static FieldManager * getInstance()
Get singleton instance.
void init(AbsBField *b)
set the magnetic field here. Magnetic field classes must be derived from AbsBField.
Cache B field at a position. Used by FieldManager.
TVector3 getFieldVal(const TVector3 &position)
This does NOT use the cache!
Singleton which provides access to magnetic field maps.