Warning, file /include/root/TGeoGlobalMagField.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef ROOT_TGeoGlobalMagField
0012 #define ROOT_TGeoGlobalMagField
0013
0014 #include "TObject.h"
0015
0016 #include "TVirtualMagField.h"
0017
0018 class TGeoGlobalMagField : public TObject {
0019 private:
0020 static TGeoGlobalMagField *fgInstance;
0021 TVirtualMagField *fField{nullptr};
0022 Bool_t fLock{kFALSE};
0023
0024 protected:
0025 TGeoGlobalMagField(const TGeoGlobalMagField &) = delete;
0026 TGeoGlobalMagField &operator=(const TGeoGlobalMagField &) = delete;
0027 void Unlock() { fLock = kFALSE; }
0028
0029 public:
0030 TGeoGlobalMagField();
0031 ~TGeoGlobalMagField() override;
0032
0033
0034 TVirtualMagField *GetField() const { return fField; }
0035 void SetField(TVirtualMagField *field);
0036 Bool_t IsLocked() { return fLock; }
0037 void Lock();
0038
0039
0040 static TGeoGlobalMagField *Instance();
0041 static TGeoGlobalMagField *GetInstance();
0042
0043
0044 void Field(const Double_t *x, Double_t *B)
0045 {
0046 if (fField)
0047 fField->Field(x, B);
0048 }
0049
0050 ClassDefOverride(TGeoGlobalMagField, 0)
0051 };
0052
0053 #endif