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

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

Dimensions MFGrid3D::dimensions ( void  ) const
inlineoverridevirtual

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
Indexes MFGrid3D::index ( const LocalPoint p) const
inlineoverridevirtual

Reimplemented from MFGrid.

Definition at line 42 of file MFGrid3D.h.

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

Referenced by BeautifulSoup.PageElement::insert().

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
int k
Definition: MFGrid.h:26
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 void toGridFrame(const LocalPoint &p, double &a, double &b, double &c) const =0
find grid coordinates for point. For debugging and validation only.
LocalPoint MFGrid3D::nodePosition ( int  i,
int  j,
int  k 
) const
inlineoverridevirtual

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  }
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 k[5][pyjets_maxn]
GridType grid_
Definition: MFGrid3D.h:62
virtual LocalPoint fromGridFrame(double a, double b, double c) const =0
find grid coordinates for point. For debugging and validation only.
const Grid1D & gridb() const
Definition: Grid3D.h:68
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 37 of file MFGrid3D.h.

37  {
39  return MFGrid::LocalVector(grid_( i, j, k));
40  }
int k[5][pyjets_maxn]
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 listHistos::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
overridevirtual

Interpolated field value at given point.

Implements MFGrid.

Definition at line 5 of file MFGrid3D.cc.

References MFGrid::fromGridFrame(), GridInterpolator3DException::limits(), uncheckedValueInTesla(), and pfDeepBoostedJetPreprocessParams_cfi::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