CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
MFGrid3D Class Referenceabstract

#include <MFGrid3D.h>

Inheritance diagram for MFGrid3D:
MFGrid MagneticFieldProvider< float > RectangularCartesianMFGrid RectangularCylindricalMFGrid SpecialCylindricalMFGrid TrapezoidalCartesianMFGrid TrapezoidalCylindricalMFGrid

Public Member Functions

virtual Dimensions dimensions (void) const
 
virtual Indexes index (const LocalPoint &p) const
 
 MFGrid3D (const GloballyPositioned< float > &vol)
 
virtual LocalPoint nodePosition (int i, int j, int k) const
 Position of node in local frame. More...
 
virtual LocalVector nodeValue (int i, int j, int k) const
 Field value at node. More...
 
virtual LocalVector uncheckedValueInTesla (const LocalPoint &p) const =0
 Interpolated field value at given point; does not check for exceptions. More...
 
virtual LocalVector valueInTesla (const LocalPoint &p) const
 Interpolated field value at given point. More...
 
- Public Member Functions inherited from MFGrid
virtual void dump () const
 
const GloballyPositioned< float > & frame () const
 Local reference frame. More...
 
virtual LocalPoint fromGridFrame (double a, double b, double c) const =0
 find grid coordinates for point. For debugging and validation only. More...
 
 MFGrid (const GloballyPositioned< float > &vol)
 
virtual void toGridFrame (const LocalPoint &p, double &a, double &b, double &c) const =0
 find grid coordinates for point. For debugging and validation only. More...
 
virtual ~MFGrid ()
 
- Public Member Functions inherited from MagneticFieldProvider< float >
virtual LocalVectorType derivativeInTeslaPerMeter (const LocalPointType &p, int N) const
 
virtual int hasDerivatives () const
 
virtual LocalVectorType valueInTesla (const LocalPointType &p) const =0
 
virtual ~MagneticFieldProvider ()
 

Protected Types

using BVector = Grid3D::BVector
 
using GridType = Grid3D
 

Protected Member Functions

void setGrid (const GridType &grid)
 

Protected Attributes

GridType grid_
 

Additional Inherited Members

- Public Types inherited from MFGrid
typedef GloballyPositioned
< float >::GlobalPoint 
GlobalPoint
 
typedef GloballyPositioned
< float >::GlobalVector 
GlobalVector
 
typedef GloballyPositioned
< float >::LocalPoint 
LocalPoint
 
typedef GloballyPositioned
< float >::LocalVector 
LocalVector
 
- Public Types inherited from MagneticFieldProvider< float >
typedef Point3DBase< float,
GlobalTag
GlobalPointType
 
typedef Vector3DBase< float,
GlobalTag
GlobalVectorType
 
typedef Point3DBase< float,
LocalTag
LocalPointType
 
typedef Vector3DBase< float,
LocalTag
LocalVectorType
 

Detailed Description

Generic virtual implementation of a MFGrid for a 3D underlying regular grid.

Author
T. Todorov

Definition at line 17 of file MFGrid3D.h.

Member Typedef Documentation

Definition at line 60 of file MFGrid3D.h.

using MFGrid3D::GridType = Grid3D
protected

Definition at line 59 of file MFGrid3D.h.

Constructor & Destructor Documentation

MFGrid3D::MFGrid3D ( const GloballyPositioned< float > &  vol)
inlineexplicit

Definition at line 20 of file MFGrid3D.h.

20 : MFGrid(vol) {}
MFGrid(const GloballyPositioned< float > &vol)
Definition: MFGrid.h:37

Member Function Documentation

virtual Dimensions MFGrid3D::dimensions ( void  ) const
inlinevirtual

Implements MFGrid.

Definition at line 23 of file MFGrid3D.h.

References Dimensions::d, Dimensions::h, tmp, and Dimensions::w.

23  {
25  tmp.w = grid_.grida().nodes();
26  tmp.h = grid_.gridb().nodes();
27  tmp.d = grid_.gridc().nodes();
28  return tmp;
29  }
const Grid1D & grida() const
Definition: Grid3D.h:67
int w
Definition: MFGrid.h:17
int nodes() const
Definition: Grid1D.h:24
const Grid1D & gridc() const
Definition: Grid3D.h:69
GridType grid_
Definition: MFGrid3D.h:62
int d
Definition: MFGrid.h:19
int h
Definition: MFGrid.h:18
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
const Grid1D & gridb() const
Definition: Grid3D.h:68
virtual Indexes MFGrid3D::index ( const LocalPoint p) const
inlinevirtual

Reimplemented from MFGrid.

Definition at line 42 of file MFGrid3D.h.

References a, b, EnergyCorrector::c, Indexes::i, Indexes::j, Indexes::k, mps_fire::result, and MFGrid::toGridFrame().

Referenced by BeautifulSoup.PageElement::_invert().

42  {
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  }
const Grid1D & grida() const
Definition: Grid3D.h:67
int j
Definition: MFGrid.h:25
int i
Definition: MFGrid.h:24
Definition: MFGrid.h:22
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
tuple result
Definition: mps_fire.py:83
const Grid1D & gridc() const
Definition: Grid3D.h:69
GridType grid_
Definition: MFGrid3D.h:62
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
int index(Scalar a, Scalar &f) const
Definition: Grid1D.h:34
const Grid1D & gridb() const
Definition: Grid3D.h:68
virtual LocalPoint MFGrid3D::nodePosition ( int  i,
int  j,
int  k 
) const
inlinevirtual

Position of node in local frame.

Implements MFGrid.

Definition at line 32 of file MFGrid3D.h.

References MFGrid::fromGridFrame().

32  {
33  return fromGridFrame( grid_.grida().node(i), grid_.gridb().node(j), grid_.gridc().node(k));
34  }
int i
Definition: DBlmapReader.cc:9
const Grid1D & grida() const
Definition: Grid3D.h:67
Scalar node(int i) const
Definition: Grid1D.h:27
const Grid1D & gridc() const
Definition: Grid3D.h:69
int j
Definition: DBlmapReader.cc:9
virtual LocalPoint fromGridFrame(double a, double b, double c) const =0
find grid coordinates for point. For debugging and validation only.
GridType grid_
Definition: MFGrid3D.h:62
const Grid1D & gridb() const
Definition: Grid3D.h:68
virtual LocalVector MFGrid3D::nodeValue ( int  i,
int  j,
int  k 
) const
inlinevirtual

Field value at node.

must check range here: FIX ME !!!!

Implements MFGrid.

Definition at line 37 of file MFGrid3D.h.

37  {
39  return MFGrid::LocalVector(grid_( i, j, k));
40  }
int i
Definition: DBlmapReader.cc:9
int j
Definition: DBlmapReader.cc:9
GridType grid_
Definition: MFGrid3D.h:62
GloballyPositioned< float >::LocalVector LocalVector
Definition: MFGrid.h:35
void MFGrid3D::setGrid ( const GridType grid)
inlineprotected

Definition at line 64 of file MFGrid3D.h.

References getRunAppsInfo::grid.

64  {
65  grid_ = grid;
66  }
GridType grid_
Definition: MFGrid3D.h:62
virtual LocalVector MFGrid3D::uncheckedValueInTesla ( const LocalPoint p) const
pure virtual

Interpolated field value at given point; does not check for exceptions.

Implemented in SpecialCylindricalMFGrid, TrapezoidalCartesianMFGrid, TrapezoidalCylindricalMFGrid, RectangularCartesianMFGrid, and RectangularCylindricalMFGrid.

Referenced by valueInTesla().

MFGrid::LocalVector MFGrid3D::valueInTesla ( const LocalPoint p) const
virtual

Interpolated field value at given point.

Implements MFGrid.

Definition at line 5 of file MFGrid3D.cc.

References MFGrid::fromGridFrame(), GridInterpolator3DException::limits(), uncheckedValueInTesla(), and pileupCalc::upper.

6 {
7  try {
8  return uncheckedValueInTesla( p);
9  }
10  catch ( GridInterpolator3DException& outside) {
11  double *limits = outside.limits();
12  LocalPoint lower = fromGridFrame( limits[0], limits[1], limits[2]);
13  LocalPoint upper = fromGridFrame( limits[3], limits[4], limits[5]);
14  throw MagVolumeOutsideValidity( lower, upper);
15  }
16 
17 }
virtual LocalVector uncheckedValueInTesla(const LocalPoint &p) const =0
Interpolated field value at given point; does not check for exceptions.
virtual LocalPoint fromGridFrame(double a, double b, double c) const =0
find grid coordinates for point. For debugging and validation only.

Member Data Documentation

GridType MFGrid3D::grid_
protected