FairRoot/PandaRoot
PndFieldMap.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- PndFieldMap header file -----
3 // ----- Created 12/01/04 by M. Al/Turany -----
4 // -------------------------------------------------------------------------
5 
6 
13 #ifndef PNDFIELDMAP_H
14 #define PNDFIELDMAP_H 1
15 
16 #include "FairField.h"
17 
18 class TArrayF;
19 class PndFieldMapData;
20 class PndFieldPar;
21 
22 
23 class PndFieldMap : public FairField {
24 
25 
26 public:
27 
29  PndFieldMap();
30 
31 
36  PndFieldMap(const char* mapName, const char* fileType = "R");
37 
38 
41 
42 
44  virtual ~PndFieldMap();
45 
46 
48  virtual void Init();
49 
50 
56  virtual Double_t GetBy(Double_t x, Double_t y, Double_t z);
57  virtual Double_t GetBz(Double_t x, Double_t y, Double_t z);
58 
59 
66  virtual Bool_t IsInside(Double_t x, Double_t y, Double_t z,
67  Int_t& ix, Int_t& iy, Int_t& iz,
69 
70 
72  void WriteAsciiFile(const char* fileName);
73 
74 
76  void WriteRootFile(const char* fileName, const char* mapName);
77 
78 
80  void SetPosition(Double_t x, Double_t y, Double_t z);
81 
82 
84  void SetScale(Double_t factor) { fScale = factor; }
85 
86 
88  Double_t GetXmin() const { return fXmin; }
89  Double_t GetYmin() const { return fYmin; }
90  Double_t GetZmin() const { return fZmin; }
91  Double_t GetXmax() const { return fXmax; }
92  Double_t GetYmax() const { return fYmax; }
93  Double_t GetZmax() const { return fZmax; }
94  Double_t GetXstep() const { return fXstep; }
95  Double_t GetYstep() const { return fYstep; }
96  Double_t GetZstep() const { return fZstep; }
97  Int_t GetNx() const { return fNx; }
98  Int_t GetNy() const { return fNy; }
99  Int_t GetNz() const { return fNz; }
100 
101  Double_t GetUnit() const {return funit; }
102 
104  Double_t GetPositionX() const { return fPosX; }
105  Double_t GetPositionY() const { return fPosY; }
106  Double_t GetPositionZ() const { return fPosZ; }
107 
108 
110  Double_t GetScale() const { return fScale; }
111 
112 
114  TArrayF* GetBx() const { return fBx; }
115  TArrayF* GetBy() const { return fBy; }
116  TArrayF* GetBz() const { return fBz; }
117 
118 
120  const char* GetFileName() { return fFileName.Data(); }
121 
122 
124  virtual void Print();
125 
126 private:
127  PndFieldMap(const PndFieldMap& L);
128  PndFieldMap& operator= (const PndFieldMap&) {return *this;};
129 
130 
131  protected:
132 
133 
135  void Reset();
136 
137 
139  void ReadAsciiFile(const char* fileName);
140 
141 
143  void ReadRootFile(const char* fileName, const char* mapName);
144 
145 
147  void SetField(const PndFieldMapData* data);
148 
149 
154 
155 
158 
159 
162 
165 
166 
169 
170 
175 
176 
178  Int_t fNx, fNy, fNz;
179 
180 
182  TArrayF* fBx;
183  TArrayF* fBy;
184  TArrayF* fBz;
185 
186 
189  Double_t fHa[2][2][2];
190  Double_t fHb[2][2];
192 ClassDef(PndFieldMap,1)
193 
194 };
195 
196 
197 #endif
Double_t fHa[2][2][2]
Definition: PndFieldMap.h:189
Double_t GetZmin() const
Definition: PndFieldMap.h:90
Double_t funit
Definition: PndFieldMap.h:164
double dy
virtual void Init()
Double_t GetZstep() const
Definition: PndFieldMap.h:96
Double_t fYmin
Definition: PndFieldMap.h:173
void WriteAsciiFile(const char *fileName)
Double_t GetYmax() const
Definition: PndFieldMap.h:92
Double_t fHb[2][2]
Field at corners of a grid cell.
Definition: PndFieldMap.h:190
Double_t fZstep
Definition: PndFieldMap.h:174
void SetScale(Double_t factor)
Definition: PndFieldMap.h:84
Double_t GetPositionY() const
Definition: PndFieldMap.h:105
Double_t GetScale() const
Definition: PndFieldMap.h:110
void WriteRootFile(const char *fileName, const char *mapName)
Int_t GetNy() const
Definition: PndFieldMap.h:98
Double_t fZmin
Definition: PndFieldMap.h:174
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)
Double_t fYmax
Definition: PndFieldMap.h:173
TArrayF * fBz
Definition: PndFieldMap.h:184
Double_t fXstep
Definition: PndFieldMap.h:172
Double_t fXmax
Definition: PndFieldMap.h:172
TString fFileName
Definition: PndFieldMap.h:157
Double_t fHc[2]
Interpolated field (2-dim)
Definition: PndFieldMap.h:191
PndFieldMap & operator=(const PndFieldMap &)
Definition: PndFieldMap.h:128
Double_t GetPositionX() const
Definition: PndFieldMap.h:104
Double_t fPosZ
Definition: PndFieldMap.h:168
Double_t GetYstep() const
Definition: PndFieldMap.h:95
Double_t fScale
Definition: PndFieldMap.h:161
Double_t GetXstep() const
Definition: PndFieldMap.h:94
void SetPosition(Double_t x, Double_t y, Double_t z)
Double_t Interpolate(Double_t dx, Double_t dy, Double_t dz)
Double_t
TArrayF * GetBz() const
Definition: PndFieldMap.h:116
Double_t GetYmin() const
Definition: PndFieldMap.h:89
Double_t GetXmin() const
Definition: PndFieldMap.h:88
PndMultiFieldPar * fieldPar
Definition: sim_ftof.C:102
Int_t GetNx() const
Definition: PndFieldMap.h:97
TArrayF * GetBy() const
Definition: PndFieldMap.h:115
Double_t z
Double_t fPosY
Definition: PndFieldMap.h:168
TArrayF * fBy
Definition: PndFieldMap.h:183
const char * GetFileName()
Definition: PndFieldMap.h:120
virtual ~PndFieldMap()
double dx
void SetField(const PndFieldMapData *data)
TArrayF * fBx
Definition: PndFieldMap.h:182
Double_t fPosX
Definition: PndFieldMap.h:168
Double_t x
Double_t fYstep
Definition: PndFieldMap.h:173
Double_t GetUnit() const
Definition: PndFieldMap.h:101
Double_t GetPositionZ() const
Definition: PndFieldMap.h:106
Double_t GetXmax() const
Definition: PndFieldMap.h:91
Double_t fZmax
Definition: PndFieldMap.h:174
TArrayF * GetBx() const
Definition: PndFieldMap.h:114
Double_t y
Int_t GetNz() const
Definition: PndFieldMap.h:99
virtual void Print()
void ReadAsciiFile(const char *fileName)
void ReadRootFile(const char *fileName, const char *mapName)
Double_t GetZmax() const
Definition: PndFieldMap.h:93
Double_t fXmin
Definition: PndFieldMap.h:172