CMS 3D CMS Logo

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

Dimensions dimensions (void) const override
 
Indexes index (const LocalPoint &p) const override
 
 MFGrid3D (const GloballyPositioned< float > &vol)
 
LocalPoint nodePosition (int i, int j, int k) const override
 Position of node in local frame. More...
 
LocalVector nodeValue (int i, int j, int k) const override
 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...
 
LocalVector valueInTesla (const LocalPoint &p) const override
 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...
 
 ~MFGrid () override
 
- 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, GlobalTagGlobalPointType
 
typedef Vector3DBase< float, GlobalTagGlobalVectorType
 
typedef Point3DBase< float, LocalTagLocalPointType
 
typedef Vector3DBase< float, LocalTagLocalVectorType
 

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

◆ BVector

Definition at line 57 of file MFGrid3D.h.

◆ GridType

using MFGrid3D::GridType = Grid3D
protected

Definition at line 56 of file MFGrid3D.h.

Constructor & Destructor Documentation

◆ MFGrid3D()

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

Definition at line 19 of file MFGrid3D.h.

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

Member Function Documentation

◆ dimensions()

Dimensions MFGrid3D::dimensions ( void  ) const
inlineoverridevirtual

Implements MFGrid.

Definition at line 21 of file MFGrid3D.h.

References createJobs::tmp.

21  {
23  tmp.w = grid_.grida().nodes();
24  tmp.h = grid_.gridb().nodes();
25  tmp.d = grid_.gridc().nodes();
26  return tmp;
27  }
const Grid1D & grida() const
Definition: Grid3D.h:59
int nodes() const
Definition: Grid1D.h:21
GridType grid_
Definition: MFGrid3D.h:59
const Grid1D & gridb() const
Definition: Grid3D.h:60
const Grid1D & gridc() const
Definition: Grid3D.h:61
tmp
align.sh
Definition: createJobs.py:716

◆ index()

Indexes MFGrid3D::index ( const LocalPoint p) const
inlineoverridevirtual

Reimplemented from MFGrid.

Definition at line 40 of file MFGrid3D.h.

References a, b, c, AlCaHLTBitMon_ParallelJobs::p, mps_fire::result, and MFGrid::toGridFrame().

40  {
42  double a, b, c;
43  toGridFrame(p, a, b, c);
44  result.i = grid_.grida().index(a);
45  result.j = grid_.gridb().index(b);
46  result.k = grid_.gridc().index(c);
47  return result;
48  }
const Grid1D & grida() const
Definition: Grid3D.h:59
Definition: MFGrid.h:21
int index(Scalar a, Scalar &f) const
Definition: Grid1D.h:29
virtual void toGridFrame(const LocalPoint &p, double &a, double &b, double &c) const =0
find grid coordinates for point. For debugging and validation only.
GridType grid_
Definition: MFGrid3D.h:59
double b
Definition: hdecay.h:118
const Grid1D & gridb() const
Definition: Grid3D.h:60
const Grid1D & gridc() const
Definition: Grid3D.h:61
double a
Definition: hdecay.h:119

◆ nodePosition()

LocalPoint MFGrid3D::nodePosition ( int  i,
int  j,
int  k 
) const
inlineoverridevirtual

Position of node in local frame.

Implements MFGrid.

Definition at line 30 of file MFGrid3D.h.

References MFGrid::fromGridFrame(), mps_fire::i, dqmiolumiharvest::j, and dqmdumpme::k.

30  {
32  }
const Grid1D & grida() const
Definition: Grid3D.h:59
Scalar node(int i) const
Definition: Grid1D.h:24
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:59
const Grid1D & gridb() const
Definition: Grid3D.h:60
const Grid1D & gridc() const
Definition: Grid3D.h:61

◆ nodeValue()

LocalVector MFGrid3D::nodeValue ( int  i,
int  j,
int  k 
) const
inlineoverridevirtual

Field value at node.

must check range here: FIX ME !!!!

Implements MFGrid.

Definition at line 35 of file MFGrid3D.h.

References mps_fire::i, dqmiolumiharvest::j, and dqmdumpme::k.

35  {
37  return MFGrid::LocalVector(grid_(i, j, k));
38  }
GridType grid_
Definition: MFGrid3D.h:59
GloballyPositioned< float >::LocalVector LocalVector
Definition: MFGrid.h:32

◆ setGrid()

void MFGrid3D::setGrid ( const GridType grid)
inlineprotected

Definition at line 61 of file MFGrid3D.h.

References getRunAppsInfo::grid.

61 { grid_ = grid; }
GridType grid_
Definition: MFGrid3D.h:59

◆ uncheckedValueInTesla()

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().

◆ valueInTesla()

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

Interpolated field value at given point.

Implements MFGrid.

Definition at line 5 of file MFGrid3D.cc.

References MFGrid::fromGridFrame(), GridInterpolator3DException::limits(), TH2PolyOfflineMaps::limits, AlCaHLTBitMon_ParallelJobs::p, and uncheckedValueInTesla().

5  {
6  try {
7  return uncheckedValueInTesla(p);
8  } catch (GridInterpolator3DException& outside) {
9  double* limits = outside.limits();
10  LocalPoint lower = fromGridFrame(limits[0], limits[1], limits[2]);
11  LocalPoint upper = fromGridFrame(limits[3], limits[4], limits[5]);
12  throw MagVolumeOutsideValidity(lower, upper);
13  }
14 }
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

◆ grid_

GridType MFGrid3D::grid_
protected