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 
17 
18 class MFGrid3D : public MFGrid {
19 public:
20 
21  explicit MFGrid3D( const GloballyPositioned<float>& vol) : MFGrid(vol) {}
22 
23 
24  virtual Dimensions dimensions(void) const {
26  tmp.w = grid_.grida().nodes();
27  tmp.h = grid_.gridb().nodes();
28  tmp.d = grid_.gridc().nodes();
29  return tmp;
30  }
31 
33  virtual LocalPoint nodePosition( int i, int j, int k) const {
34  return fromGridFrame( grid_.grida().node(i), grid_.gridb().node(j), grid_.gridc().node(k));
35  }
36 
38  virtual LocalVector nodeValue( int i, int j, int k) const {
40  return MFGrid::LocalVector(grid_( i, j, k));
41  }
42 
43  virtual Indexes index( const LocalPoint& p) const {
45  double a, b, c;
46  toGridFrame( p, a, b, c);
47  result.i = grid_.grida().index(a);
48  result.j = grid_.gridb().index(b);
49  result.k = grid_.gridc().index(c);
50  return result;
51  }
52 
53  virtual LocalVector valueInTesla( const LocalPoint& p) const;
54 
56  virtual LocalVector uncheckedValueInTesla( const LocalPoint& p) const = 0;
57 
58 protected:
59 
61  typedef Grid3D GridType;
62 
63  GridType grid_; // should become private...
64 
65  void setGrid( const GridType& grid) {
66  grid_ = grid;
67  }
68 
69 };
70 
71 #endif
virtual LocalVector uncheckedValueInTesla(const LocalPoint &p) const =0
Interpolated field value at given point; does not check for exceptions.
int i
Definition: DBlmapReader.cc:9
virtual LocalVector valueInTesla(const LocalPoint &p) const
Interpolated field value at given point.
Definition: MFGrid3D.cc:5
virtual Indexes index(const LocalPoint &p) const
Definition: MFGrid3D.h:43
const Grid1D & grida() const
Definition: Grid3D.h:51
MFGrid3D(const GloballyPositioned< float > &vol)
Definition: MFGrid3D.h:21
int j
Definition: MFGrid.h:27
int i
Definition: MFGrid.h:26
Definition: MFGrid.h:24
GloballyPositioned< float >::LocalPoint LocalPoint
Definition: MFGrid.h:36
Scalar node(int i) const
Definition: Grid1D.h:26
virtual LocalVector nodeValue(int i, int j, int k) const
Field value at node.
Definition: MFGrid3D.h:38
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
int nodes() const
Definition: Grid1D.h:23
const Grid1D & gridc() const
Definition: Grid3D.h:53
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:33
int j
Definition: DBlmapReader.cc:9
Definition: Grid3D.h:16
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 Dimensions dimensions(void) const
Definition: MFGrid3D.h:24
GridType grid_
Definition: MFGrid3D.h:63
Grid3D GridType
Definition: MFGrid3D.h:61
Basic3DVector< float > BVector
Definition: MFGrid3D.h:60
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:65
int index(Scalar a, Scalar &f) const
Definition: Grid1D.h:33
const Grid1D & gridb() const
Definition: Grid3D.h:52