55 Fatal(
"TGeoGlobalMagField",
"A global field manager already existing and containing a field. \ 56 \n If you want a new global field please set it via: \ 57 \n TGeoGlobalMagField::Instance()->SetField(myField).");
59 Warning(
"TGeoGlobalMagField",
"A global field manager already existing. Please access via: \ 60 \n TGeoGlobalMagField::Instance().");
63 gROOT->GetListOfGeometries()->Add(
this);
72 gROOT->GetListOfGeometries()->Remove(
this);
90 Error(
"SetField",
"Global field is already set to <%s> and locked",
fField->
GetName());
94 Info(
"SetField",
"Previous magnetic field <%s> will be deleted",
fField->
GetName());
126 Warning(
"Lock",
"Cannot lock global magnetic field since this was not set yet");
virtual const char * GetName() const
Returns name of object.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
TVirtualMagField * GetField() const
static TGeoGlobalMagField * Instance()
Returns always a valid static pointer to the field manager.
TGeoGlobalMagField()
Global field default constructor.
virtual ~TGeoGlobalMagField()
Global field destructor.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Global magnetic field manager.
static TGeoGlobalMagField * GetInstance()
Static getter that does not create the object.
static TGeoGlobalMagField * fgInstance
Abstract class for magnetic field.
TVirtualMagField * fField
void Lock()
Locks the global magnetic field if this is set. Cannot be unlocked.
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
void SetField(TVirtualMagField *field)
Field setter. Deletes previous field if any. Acts only if fLock=kFALSE.