CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
Grid3D Class Reference

#include <Grid3D.h>

Public Types

typedef ValueType ReturnType
 
typedef float Scalar
 
typedef Basic3DVector< ScalarValueType
 

Public Member Functions

const std::vector< ValueType > & data () const
 
void dump () const
 
 Grid3D ()
 
 Grid3D (const Grid1D &ga, const Grid1D &gb, const Grid1D &gc, std::vector< ValueType > &data)
 
const Grid1Dgrida () const
 
const Grid1Dgridb () const
 
const Grid1Dgridc () const
 
int index (int i, int j, int k) const
 
const ValueTypeoperator() (int i) const
 
ValueType const & operator() (int i, int j, int k) const
 
int stride1 () const
 
int stride2 () const
 
int stride3 () const
 

Private Attributes

std::vector< ValueTypedata_
 
Grid1D grida_
 
Grid1D gridb_
 
Grid1D gridc_
 
int stride1_
 
int stride2_
 

Detailed Description

Implementation of a 3D regular grid.

Author
T. Todorov

Definition at line 17 of file Grid3D.h.

Member Typedef Documentation

Definition at line 23 of file Grid3D.h.

typedef float Grid3D::Scalar

Definition at line 21 of file Grid3D.h.

Definition at line 22 of file Grid3D.h.

Constructor & Destructor Documentation

Grid3D::Grid3D ( )
inline

Definition at line 25 of file Grid3D.h.

25 {}
Grid3D::Grid3D ( const Grid1D ga,
const Grid1D gb,
const Grid1D gc,
std::vector< ValueType > &  data 
)
inline

Definition at line 27 of file Grid3D.h.

28  :
29  grida_(ga), gridb_(gb), gridc_(gc) {
30  data_.swap(data);
32  stride2_ = gridc_.nodes();
33  }
Grid1D gridb_
Definition: Grid3D.h:63
int stride2_
Definition: Grid3D.h:69
Grid1D grida_
Definition: Grid3D.h:62
std::vector< ValueType > data_
Definition: Grid3D.h:66
Grid1D gridc_
Definition: Grid3D.h:64
int nodes() const
Definition: Grid1D.h:24
int stride1_
Definition: Grid3D.h:68
const std::vector< ValueType > & data() const
Definition: Grid3D.h:56

Member Function Documentation

const std::vector<ValueType>& Grid3D::data ( ) const
inline

Definition at line 56 of file Grid3D.h.

Referenced by RectangularCartesianMFGrid::dump(), RectangularCylindricalMFGrid::dump(), and TrapezoidalCartesianMFGrid::dump().

56 {return data_;}
std::vector< ValueType > data_
Definition: Grid3D.h:66
void Grid3D::dump ( void  ) const

Definition at line 18 of file Grid3D.cc.

References gather_cfg::cout, grida(), gridb(), gridc(), i, j, gen::k, Grid1D::node(), Grid1D::nodes(), and operator()().

19 {
20  for (int j=0; j<gridb().nodes(); ++j) {
21  for (int k=0; k<gridc().nodes(); ++k) {
22  for (int i=0; i<grida().nodes(); ++i) {
23  std::cout << grida().node(i) << " " << gridb().node(j) << " " << gridc().node(k) << " "
24  << operator()(i,j,k) << std::endl;
25  }
26  }
27  }
28 }
int i
Definition: DBlmapReader.cc:9
const Grid1D & grida() const
Definition: Grid3D.h:52
Scalar node(int i) const
Definition: Grid1D.h:27
int nodes() const
Definition: Grid1D.h:24
const Grid1D & gridc() const
Definition: Grid3D.h:54
int j
Definition: DBlmapReader.cc:9
int k[5][pyjets_maxn]
const ValueType & operator()(int i) const
Definition: Grid3D.h:44
tuple cout
Definition: gather_cfg.py:121
const Grid1D & gridb() const
Definition: Grid3D.h:53
const Grid1D& Grid3D::grida ( ) const
inline
const Grid1D& Grid3D::gridb ( ) const
inline
const Grid1D& Grid3D::gridc ( ) const
inline
int Grid3D::index ( int  i,
int  j,
int  k 
) const
inline

Definition at line 40 of file Grid3D.h.

References gen::k.

Referenced by BeautifulSoup.PageElement::_invert(), and LinearGridInterpolator3D::interpolate().

40 {return i*stride1_ + j*stride2_ + k;}
int i
Definition: DBlmapReader.cc:9
int stride2_
Definition: Grid3D.h:69
int j
Definition: DBlmapReader.cc:9
int stride1_
Definition: Grid3D.h:68
int k[5][pyjets_maxn]
const ValueType& Grid3D::operator() ( int  i) const
inline

Definition at line 44 of file Grid3D.h.

References i.

Referenced by dump().

44  {
45  return data_[i];
46  }
int i
Definition: DBlmapReader.cc:9
std::vector< ValueType > data_
Definition: Grid3D.h:66
ValueType const& Grid3D::operator() ( int  i,
int  j,
int  k 
) const
inline

Definition at line 48 of file Grid3D.h.

References getHLTprescales::index.

48  {
49  return (*this)(index(i,j,k));
50  }
int i
Definition: DBlmapReader.cc:9
int index(int i, int j, int k) const
Definition: Grid3D.h:40
int j
Definition: DBlmapReader.cc:9
int k[5][pyjets_maxn]
int Grid3D::stride1 ( ) const
inline

Definition at line 41 of file Grid3D.h.

Referenced by LinearGridInterpolator3D::interpolate().

41 { return stride1_;}
int stride1_
Definition: Grid3D.h:68
int Grid3D::stride2 ( ) const
inline

Definition at line 42 of file Grid3D.h.

Referenced by LinearGridInterpolator3D::interpolate().

42 { return stride2_;}
int stride2_
Definition: Grid3D.h:69
int Grid3D::stride3 ( ) const
inline

Definition at line 43 of file Grid3D.h.

Referenced by LinearGridInterpolator3D::interpolate().

43 { return 1;}

Member Data Documentation

std::vector<ValueType> Grid3D::data_
private

Definition at line 66 of file Grid3D.h.

Grid1D Grid3D::grida_
private

Definition at line 62 of file Grid3D.h.

Grid1D Grid3D::gridb_
private

Definition at line 63 of file Grid3D.h.

Grid1D Grid3D::gridc_
private

Definition at line 64 of file Grid3D.h.

int Grid3D::stride1_
private

Definition at line 68 of file Grid3D.h.

int Grid3D::stride2_
private

Definition at line 69 of file Grid3D.h.