11 #define ERFieldMap_H 1 15 #include "FairField.h" 29 ERFieldMap(
const char* mapName,
const char* fileType =
"R");
40 virtual Double_t
GetBx(Double_t x, Double_t y, Double_t z);
41 virtual Double_t GetBy(Double_t x, Double_t y, Double_t z);
42 virtual Double_t GetBz(Double_t x, Double_t y, Double_t z);
49 virtual Bool_t
IsInside(Double_t x, Double_t y, Double_t z,
50 Int_t& ix, Int_t& iy, Int_t& iz,
51 Double_t& dx, Double_t& dy, Double_t& dz);
57 void WriteRootFile(
const char* fileName,
const char* mapName);
59 virtual void SetPosition(Double_t x, Double_t y, Double_t z);
62 void SetVolume(TString localMagFieldVolName) {fLocalMagFieldVolName = localMagFieldVolName;}
67 Double_t GetYmin()
const {
return fYmin; }
68 Double_t GetZmin()
const {
return fZmin; }
69 Double_t GetXmax()
const {
return fXmax; }
70 Double_t GetYmax()
const {
return fYmax; }
71 Double_t GetZmax()
const {
return fZmax; }
72 Double_t GetXstep()
const {
return fXstep; }
73 Double_t GetYstep()
const {
return fYstep; }
74 Double_t GetZstep()
const {
return fZstep; }
75 Int_t GetNx()
const {
return fNx; }
76 Int_t GetNy()
const {
return fNy; }
77 Int_t GetNz()
const {
return fNz; }
80 Double_t GetPositionY()
const {
return fPosY; }
81 Double_t GetPositionZ()
const {
return fPosZ; }
86 TArrayF* GetBy()
const {
return fBy; }
87 TArrayF* GetBz()
const {
return fBz; }
91 virtual void Print(Option_t* =
"")
const;
100 void ReadRootFile(
const char* fileName,
const char* mapName);
106 Double_t
Interpolate(Double_t dx, Double_t dy, Double_t dz);
115 Double_t fYmin, fYmax, fYstep;
116 Double_t fZmin, fZmax, fZstep;
133 TString fLocalMagFieldVolName;
virtual Bool_t IsInside(Double_t x, Double_t y, Double_t z, Int_t &ix, Int_t &iy, Int_t &iz, Double_t &dx, Double_t &dy, Double_t &dz)
virtual void SetPosition(Double_t x, Double_t y, Double_t z)
Double_t GetPositionX() const
void ReadAsciiFile(const char *fileName)
TGeoNode * fLocalMagFieldNode
z-component of the field at the origin
Double_t fHb[2][2]
Field at corners of a grid cell.
Double_t fBzOrigin
y-component of the field at the origin
Double_t GetScale() const
virtual void SetScale(Double_t factor)
Double_t fHc[2]
Interpolated field (2-dim)
Double_t fBxOrigin
Interpolated field (1-dim)
void WriteRootFile(const char *fileName, const char *mapName)
void ReadRootFile(const char *fileName, const char *mapName)
void WriteAsciiFile(const char *fileName)
Double_t Interpolate(Double_t dx, Double_t dy, Double_t dz)
Double_t fByOrigin
x-component of the field at the origin
virtual void Print(Option_t *="") const
const char * GetFileName()