32 TGeoGlobalMagField *TGeoGlobalMagField::fgInstance = NULL;
37 TGeoGlobalMagField::TGeoGlobalMagField()
44 Fatal(
"TGeoGlobalMagField",
"A global field manager already existing and containing a field. \
45 \n If you want a new global field please set it via: \
46 \n TGeoGlobalMagField::Instance()->SetField(myField).");
48 Warning(
"TGeoGlobalMagField",
"A global field manager already existing. Please access via: \
49 \n TGeoGlobalMagField::Instance().");
52 gROOT->GetListOfGeometries()->Add(
this);
61 gROOT->GetListOfGeometries()->Remove(
this);
79 Error(
"SetField",
"Global field is already set to <%s> and locked",
fField->
GetName());
83 Info(
"SetField",
"Previous magnetic field <%s> will be deleted",
fField->
GetName());
115 Warning(
"Lock",
"Cannot lock global magnetic field since this was not set yet");
void Fatal(const char *location, const char *msgfmt,...)
static TGeoGlobalMagField * Instance()
Returns always a valid static pointer to the field manager.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual ~TGeoGlobalMagField()
Global field destructor.
virtual const char * GetName() const
Returns name of object.
static TGeoGlobalMagField * fgInstance
void Warning(const char *location, const char *msgfmt,...)
static TGeoGlobalMagField * GetInstance()
Static getter that does not create the object.
TVirtualMagField * fField
void Lock()
Locks the global magnetic field if this is set. Cannot be unlocked.
void SetField(TVirtualMagField *field)
Field setter. Deletes previous field if any. Acts only if fLock=kFALSE.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.