CMS 3D CMS Logo

Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes

MFGrid3D Class Reference

#include <MFGrid3D.h>

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

List of all members.

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.
virtual LocalVector nodeValue (int i, int j, int k) const
 Field value at node.
virtual LocalVector uncheckedValueInTesla (const LocalPoint &p) const =0
 Interpolated field value at given point; does not check for exceptions.
virtual LocalVector valueInTesla (const LocalPoint &p) const
 Interpolated field value at given point.

Protected Types

typedef Basic3DVector< float > BVector
typedef Grid3D GridType

Protected Member Functions

void setGrid (const GridType &grid)

Protected Attributes

GridType grid_

Detailed Description

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

Date:
2011/04/16 12:47:57
Revision:
1.1
Author:
T. Todorov

Definition at line 19 of file MFGrid3D.h.


Member Typedef Documentation

typedef Basic3DVector<float> MFGrid3D::BVector [protected]

Definition at line 61 of file MFGrid3D.h.

typedef Grid3D MFGrid3D::GridType [protected]

Definition at line 62 of file MFGrid3D.h.


Constructor & Destructor Documentation

MFGrid3D::MFGrid3D ( const GloballyPositioned< float > &  vol) [inline, explicit]

Definition at line 22 of file MFGrid3D.h.

: MFGrid(vol) {}

Member Function Documentation

virtual Dimensions MFGrid3D::dimensions ( void  ) const [inline, virtual]

Implements MFGrid.

Definition at line 25 of file MFGrid3D.h.

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

                                            {
    Dimensions tmp;
    tmp.w = grid_.grida().nodes();
    tmp.h = grid_.gridb().nodes();
    tmp.d = grid_.gridc().nodes();
    return tmp;
  }
virtual Indexes MFGrid3D::index ( const LocalPoint p) const [inline, virtual]

Reimplemented from MFGrid.

Definition at line 44 of file MFGrid3D.h.

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

                                                    {
    Indexes result;
    double a, b, c;
    toGridFrame( p, a, b, c);
    result.i = grid_.grida().index(a);
    result.j = grid_.gridb().index(b);
    result.k = grid_.gridc().index(c);
    return result;
  }
virtual LocalPoint MFGrid3D::nodePosition ( int  i,
int  j,
int  k 
) const [inline, virtual]

Position of node in local frame.

Implements MFGrid.

Definition at line 34 of file MFGrid3D.h.

References MFGrid::fromGridFrame().

                                                               {
    return fromGridFrame( grid_.grida().node(i), grid_.gridb().node(j), grid_.gridc().node(k));
  }
virtual LocalVector MFGrid3D::nodeValue ( int  i,
int  j,
int  k 
) const [inline, virtual]

Field value at node.

must check range here: FIX ME !!!!

Implements MFGrid.

Definition at line 39 of file MFGrid3D.h.

                                                            {
    return MFGrid::LocalVector(grid_( i, j, k));
  }
void MFGrid3D::setGrid ( const GridType grid) [inline, protected]

Definition at line 66 of file MFGrid3D.h.

                                      {
    grid_ = grid;
  }
virtual LocalVector MFGrid3D::uncheckedValueInTesla ( const LocalPoint p) const [pure virtual]

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

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

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(), and uncheckedValueInTesla().

{
  try {
    return uncheckedValueInTesla( p);
  }
  catch ( GridInterpolator3DException& outside) {
    double *limits = outside.limits();
    LocalPoint lower = fromGridFrame( limits[0], limits[1], limits[2]);
    LocalPoint upper = fromGridFrame( limits[3], limits[4], limits[5]);
    throw MagVolumeOutsideValidity( lower, upper);
  }

}

Member Data Documentation