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