test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MFGrid3D.h
Go to the documentation of this file.
1 #ifndef MFGrid3D_h
2 #define MFGrid3D_h
3 
13 #include "Grid1D.h"
14 #include "Grid3D.h"
16 
17 class dso_internal MFGrid3D : public MFGrid {
18 public:
19 
20  explicit MFGrid3D( const GloballyPositioned<float>& vol) : MFGrid(vol) {}
21 
22 
23  virtual Dimensions dimensions(void) const {
25  tmp.w = grid_.grida().nodes();
26  tmp.h = grid_.gridb().nodes();
27  tmp.d = grid_.gridc().nodes();
28  return tmp;
29  }
30 
32  virtual LocalPoint nodePosition( int i, int j, int k) const {
33  return fromGridFrame( grid_.grida().node(i), grid_.gridb().node(j), grid_.gridc().node(k));
34  }
35 
37  virtual LocalVector nodeValue( int i, int j, int k) const {
39  return MFGrid::LocalVector(grid_( i, j, k));
40  }
41 
42  virtual Indexes index( const LocalPoint& p) const {
44  double a, b, c;
45  toGridFrame( p, a, b, c);
46  result.i = grid_.grida().index(a);
47  result.j = grid_.gridb().index(b);
48  result.k = grid_.gridc().index(c);
49  return result;
50  }
51 
52  virtual LocalVector valueInTesla( const LocalPoint& p) const;
53 
55  virtual LocalVector uncheckedValueInTesla( const LocalPoint& p) const = 0;
56 
57 protected:
58 
59  using GridType = Grid3D;
61 
62  GridType grid_; // should become private...
63 
64  void setGrid( const GridType& grid) {
65  grid_ = grid;
66  }
67 
68 };
69 
70 #endif
int i
Definition: DBlmapReader.cc:9
virtual Indexes index(const LocalPoint &p) const
Definition: MFGrid3D.h:42
MFGrid3D(const GloballyPositioned< float > &vol)
Definition: MFGrid3D.h:20
int j
Definition: MFGrid.h:25
int i
Definition: MFGrid.h:24
Definition: MFGrid.h:22
GloballyPositioned< float >::LocalPoint LocalPoint
Definition: MFGrid.h:34
virtual LocalVector nodeValue(int i, int j, int k) const
Field value at node.
Definition: MFGrid3D.h:37
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:26
int w
Definition: MFGrid.h:17
tuple result
Definition: mps_fire.py:83
virtual LocalPoint nodePosition(int i, int j, int k) const
Position of node in local frame.
Definition: MFGrid3D.h:32
int j
Definition: DBlmapReader.cc:9
Definition: Grid3D.h:28
virtual LocalPoint fromGridFrame(double a, double b, double c) const =0
find grid coordinates for point. For debugging and validation only.
virtual LocalVector valueInTesla(const LocalPoint &p) const =0
Interpolated field value at given point.
virtual Dimensions dimensions(void) const
Definition: MFGrid3D.h:23
GridType grid_
Definition: MFGrid3D.h:62
double b
Definition: hdecay.h:120
Definition: MFGrid.h:29
int d
Definition: MFGrid.h:19
int h
Definition: MFGrid.h:18
GloballyPositioned< float >::LocalVector LocalVector
Definition: MFGrid.h:35
BStorageArray BVector
Definition: Grid3D.h:36
#define dso_internal
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
double a
Definition: hdecay.h:121
void setGrid(const GridType &grid)
Definition: MFGrid3D.h:64