24 #ifndef genfit_FieldManager_h 25 #define genfit_FieldManager_h 65 return field_->get(position);
69 void getFieldVal(
const double&
posX,
const double&
posY,
const double&
posZ,
double&
Bx,
double&
By,
double&
Bz);
71 inline void getFieldVal(
const double& posX,
const double& posY,
const double& posZ,
double& Bx,
double& By,
double& Bz) {
73 return field_->get(posX, posY, posZ, Bx, By, Bz);
85 if(! isInitialized()){
86 errorOut <<
"FieldManager hasn't been initialized with a correct AbsBField pointer!" << std::endl;
87 std::string msg(
"FieldManager hasn't been initialized with a correct AbsBField pointer!");
88 std::runtime_error err(msg);
95 errorOut <<
"FieldManager hasn't been instantiated yet, call getInstance() and init() before getFieldVal()!" << std::endl;
96 std::string msg(
"FieldManager hasn't been instantiated yet, call getInstance() and init() before getFieldVal()!");
97 std::runtime_error err(msg);
103 void useCache(
bool opt =
true,
unsigned int nBuckets = 8);
106 void useCache(
bool opt =
true,
unsigned int nBuckets = 8) {
107 std::cerr <<
"genfit::FieldManager::useCache() - FieldManager is compiled w/o CACHE, no caching will be done!" << std::endl;
113 if(instance_ == NULL) {
142 #endif // genfit_FieldManager_h static unsigned int n_buckets_
Abstract Interface to magnetic fields in GENFIT.
TVector3 getFieldVal(const TVector3 &position)
This does NOT use the cache!
static FieldManager * getInstance()
Get singleton instance.
Singleton which provides access to magnetic field maps.
Cache B field at a position. Used by FieldManager.
static void checkInstanciated()
void init(AbsBField *b)
set the magnetic field here. Magnetic field classes must be derived from AbsBField.
static fieldCache * cache_
static FieldManager * instance_
static AbsBField * field_
Defines for I/O streams used for error and debug printing.