CMS 3D CMS Logo

MFGrid.h
Go to the documentation of this file.
1 #ifndef MFGrid_h
2 #define MFGrid_h
3 
14 
15 struct Dimensions {
16  int w;
17  int h;
18  int d;
19 };
20 
21 struct Indexes {
22  int i;
23  int j;
24  int k;
25 };
26 
27 class MFGrid : public MagProviderInterpol {
28 public:
33 
34  explicit MFGrid(const GloballyPositioned<float>& vol) : frame_(vol) {}
35 
36  ~MFGrid() override {}
37 
39  LocalVector valueInTesla(const LocalPoint& p) const override = 0;
40 
41  virtual void dump() const {}
42 
44  virtual void toGridFrame(const LocalPoint& p, double& a, double& b, double& c) const = 0;
45 
47  virtual LocalPoint fromGridFrame(double a, double b, double c) const = 0;
48 
49  virtual Dimensions dimensions() const = 0;
50 
52  virtual LocalPoint nodePosition(int i, int j, int k) const = 0;
53 
55  virtual LocalVector nodeValue(int i, int j, int k) const = 0;
56 
57  virtual Indexes index(const LocalPoint& p) const { return Indexes(); }
58 
60  const GloballyPositioned<float>& frame() const { return frame_; }
61 
62 private:
64 };
65 
66 #endif
int j
Definition: MFGrid.h:23
int i
Definition: MFGrid.h:22
virtual Indexes index(const LocalPoint &p) const
Definition: MFGrid.h:57
Definition: MFGrid.h:21
GloballyPositioned< float >::GlobalVector GlobalVector
Definition: MFGrid.h:30
~MFGrid() override
Definition: MFGrid.h:36
GloballyPositioned< float >::LocalPoint LocalPoint
Definition: MFGrid.h:31
virtual void toGridFrame(const LocalPoint &p, double &a, double &b, double &c) const =0
find grid coordinates for point. For debugging and validation only.
int k
Definition: MFGrid.h:24
int w
Definition: MFGrid.h:16
virtual LocalVector nodeValue(int i, int j, int k) const =0
Field value at node.
virtual LocalPoint nodePosition(int i, int j, int k) const =0
Position of node in local frame.
GloballyPositioned< float > frame_
Definition: MFGrid.h:63
virtual Dimensions dimensions() const =0
const GloballyPositioned< float > & frame() const
Local reference frame.
Definition: MFGrid.h:60
virtual void dump() const
Definition: MFGrid.h:41
virtual LocalPoint fromGridFrame(double a, double b, double c) const =0
find grid coordinates for point. For debugging and validation only.
GloballyPositioned< float >::GlobalPoint GlobalPoint
Definition: MFGrid.h:29
MFGrid(const GloballyPositioned< float > &vol)
Definition: MFGrid.h:34
double b
Definition: hdecay.h:120
Definition: MFGrid.h:27
int d
Definition: MFGrid.h:18
int h
Definition: MFGrid.h:17
LocalVector valueInTesla(const LocalPoint &p) const override=0
Interpolated field value at given point.
GloballyPositioned< float >::LocalVector LocalVector
Definition: MFGrid.h:32
double a
Definition: hdecay.h:121