CMS 3D CMS Logo

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  Dimensions dimensions(void) const override {
25  tmp.w = grid_.grida().nodes();
26  tmp.h = grid_.gridb().nodes();
27  tmp.d = grid_.gridc().nodes();
28  return tmp;
29  }
30 
32  LocalPoint nodePosition( int i, int j, int k) const override {
33  return fromGridFrame( grid_.grida().node(i), grid_.gridb().node(j), grid_.gridc().node(k));
34  }
35 
37  LocalVector nodeValue( int i, int j, int k) const override {
39  return MFGrid::LocalVector(grid_( i, j, k));
40  }
41 
42  Indexes index( const LocalPoint& p) const override {
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  LocalVector valueInTesla( const LocalPoint& p) const override;
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
Dimensions dimensions(void) const override
Definition: MFGrid3D.h:23
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
int k
Definition: MFGrid.h:26
int w
Definition: MFGrid.h:17
LocalVector valueInTesla(const LocalPoint &p) const override=0
Interpolated field value at given point.
Definition: Grid3D.h:28
int k[5][pyjets_maxn]
GridType grid_
Definition: MFGrid3D.h:62
Indexes index(const LocalPoint &p) const override
Definition: MFGrid3D.h:42
LocalVector nodeValue(int i, int j, int k) const override
Field value at node.
Definition: MFGrid3D.h:37
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
LocalPoint nodePosition(int i, int j, int k) const override
Position of node in local frame.
Definition: MFGrid3D.h:32
double a
Definition: hdecay.h:121
virtual LocalPoint fromGridFrame(double a, double b, double c) const =0
find grid coordinates for point. For debugging and validation only.
void setGrid(const GridType &grid)
Definition: MFGrid3D.h:64
virtual void toGridFrame(const LocalPoint &p, double &a, double &b, double &c) const =0
find grid coordinates for point. For debugging and validation only.