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 
15 #include "Grid1D.h"
16 #include "Grid3D.h"
18 
19 class dso_internal MFGrid3D : public MFGrid {
20 public:
21 
22  explicit MFGrid3D( const GloballyPositioned<float>& vol) : MFGrid(vol) {}
23 
24 
25  virtual Dimensions dimensions(void) const {
27  tmp.w = grid_.grida().nodes();
28  tmp.h = grid_.gridb().nodes();
29  tmp.d = grid_.gridc().nodes();
30  return tmp;
31  }
32 
34  virtual LocalPoint nodePosition( int i, int j, int k) const {
35  return fromGridFrame( grid_.grida().node(i), grid_.gridb().node(j), grid_.gridc().node(k));
36  }
37 
39  virtual LocalVector nodeValue( int i, int j, int k) const {
41  return MFGrid::LocalVector(grid_( i, j, k));
42  }
43 
44  virtual Indexes index( const LocalPoint& p) const {
46  double a, b, c;
47  toGridFrame( p, a, b, c);
48  result.i = grid_.grida().index(a);
49  result.j = grid_.gridb().index(b);
50  result.k = grid_.gridc().index(c);
51  return result;
52  }
53 
54  virtual LocalVector valueInTesla( const LocalPoint& p) const;
55 
57  virtual LocalVector uncheckedValueInTesla( const LocalPoint& p) const = 0;
58 
59 protected:
60 
62  typedef Grid3D GridType;
63 
64  GridType grid_; // should become private...
65 
66  void setGrid( const GridType& grid) {
67  grid_ = grid;
68  }
69 
70 };
71 
72 #endif
int i
Definition: DBlmapReader.cc:9
virtual Indexes index(const LocalPoint &p) const
Definition: MFGrid3D.h:44
MFGrid3D(const GloballyPositioned< float > &vol)
Definition: MFGrid3D.h:22
int j
Definition: MFGrid.h:27
int i
Definition: MFGrid.h:26
Definition: MFGrid.h:24
GloballyPositioned< float >::LocalPoint LocalPoint
Definition: MFGrid.h:36
virtual LocalVector nodeValue(int i, int j, int k) const
Field value at node.
Definition: MFGrid3D.h:39
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:28
int w
Definition: MFGrid.h:19
tuple result
Definition: query.py:137
virtual LocalPoint nodePosition(int i, int j, int k) const
Position of node in local frame.
Definition: MFGrid3D.h:34
int j
Definition: DBlmapReader.cc:9
#define dso_internal
Definition: Visibility.h:13
Definition: Grid3D.h:17
virtual LocalPoint fromGridFrame(double a, double b, double c) const =0
find grid coordinates for point. For debugging and validation only.
int k[5][pyjets_maxn]
virtual LocalVector valueInTesla(const LocalPoint &p) const =0
Interpolated field value at given point.
virtual Dimensions dimensions(void) const
Definition: MFGrid3D.h:25
GridType grid_
Definition: MFGrid3D.h:64
Grid3D GridType
Definition: MFGrid3D.h:62
Basic3DVector< float > BVector
Definition: MFGrid3D.h:61
double b
Definition: hdecay.h:120
Definition: MFGrid.h:31
int d
Definition: MFGrid.h:21
int h
Definition: MFGrid.h:20
GloballyPositioned< float >::LocalVector LocalVector
Definition: MFGrid.h:37
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
double a
Definition: hdecay.h:121
void setGrid(const GridType &grid)
Definition: MFGrid3D.h:66