CMS 3D CMS Logo

MFGrid3D Class Reference

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

#include <MagneticField/Interpolation/interface/MFGrid3D.h>

Inheritance diagram for MFGrid3D:

MFGrid MagneticFieldProvider< float > RectangularCartesianMFGrid RectangularCylindricalMFGrid SpecialCylindricalMFGrid TrapezoidalCartesianMFGrid TrapezoidalCylindricalMFGrid

List of all members.

Public Member Functions

virtual std::vector< intdimensions () const
virtual std::vector< intindex (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< BVector, double > 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
2008/04/09 19:37:23
Revision
1.7
Author:
T. Todorov

Definition at line 18 of file MFGrid3D.h.


Member Typedef Documentation

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

Definition at line 60 of file MFGrid3D.h.

typedef Grid3D< BVector, double> MFGrid3D::GridType [protected]

Definition at line 61 of file MFGrid3D.h.


Constructor & Destructor Documentation

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

Definition at line 21 of file MFGrid3D.h.

00021 : MFGrid(vol) {}


Member Function Documentation

virtual std::vector<int> MFGrid3D::dimensions (  )  const [inline, virtual]

Implements MFGrid.

Definition at line 24 of file MFGrid3D.h.

References grid_, Grid3D< Value, T >::grida(), Grid3D< Value, T >::gridb(), Grid3D< Value, T >::gridc(), and HLT_VtxMuL3::result.

00024                                             {
00025     std::vector<int> result(3);
00026     result[0] = grid_.grida().nodes();
00027     result[1] = grid_.gridb().nodes();
00028     result[2] = grid_.gridc().nodes();
00029     return result;
00030   }

virtual std::vector<int> MFGrid3D::index ( const LocalPoint p  )  const [inline, virtual]

Reimplemented from MFGrid.

Definition at line 43 of file MFGrid3D.h.

References a, b, c, grid_, Grid3D< Value, T >::grida(), Grid3D< Value, T >::gridb(), Grid3D< Value, T >::gridc(), HLT_VtxMuL3::result, and MFGrid::toGridFrame().

00043                                                            {
00044     std::vector<int> result(3);
00045     double a, b, c;
00046     toGridFrame( p, a, b, c);
00047     result[0] = grid_.grida().index(a);
00048     result[1] = grid_.gridb().index(b);
00049     result[2] = grid_.gridc().index(c);
00050     return result;
00051   }

virtual LocalPoint MFGrid3D::nodePosition ( int  i,
int  j,
int  k 
) const [inline, virtual]

Position of node in local frame.

Implements MFGrid.

Definition at line 33 of file MFGrid3D.h.

References MFGrid::fromGridFrame(), grid_, Grid3D< Value, T >::grida(), Grid3D< Value, T >::gridb(), and Grid3D< Value, T >::gridc().

00033                                                                {
00034     return fromGridFrame( grid_.grida().node(i), grid_.gridb().node(j), grid_.gridc().node(k));
00035   }

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 38 of file MFGrid3D.h.

References grid_.

00038                                                             {
00040     return MFGrid::LocalVector(grid_( i, j, k));
00041   }

void MFGrid3D::setGrid ( const GridType grid  )  [inline, protected]

Definition at line 65 of file MFGrid3D.h.

References grid_.

00065                                       {
00066     grid_ = grid;
00067   }

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 GridInterpolator3DException::a1_, GridInterpolator3DException::a2_, GridInterpolator3DException::b1_, GridInterpolator3DException::b2_, GridInterpolator3DException::c1_, GridInterpolator3DException::c2_, MFGrid::fromGridFrame(), and uncheckedValueInTesla().

00006 {
00007   try {
00008     return uncheckedValueInTesla( p);
00009   }
00010   catch ( GridInterpolator3DException& outside) {
00011     LocalPoint lower = fromGridFrame( outside.a1_, outside.b1_, outside.c1_);
00012     LocalPoint upper = fromGridFrame( outside.a2_, outside.b2_, outside.c2_);
00013     throw MagVolumeOutsideValidity( lower, upper);
00014   }
00015 
00016 }


Member Data Documentation

GridType MFGrid3D::grid_ [protected]

Definition at line 63 of file MFGrid3D.h.

Referenced by dimensions(), RectangularCylindricalMFGrid::dump(), TrapezoidalCartesianMFGrid::dump(), RectangularCartesianMFGrid::dump(), index(), nodePosition(), nodeValue(), RectangularCartesianMFGrid::RectangularCartesianMFGrid(), RectangularCylindricalMFGrid::RectangularCylindricalMFGrid(), setGrid(), SpecialCylindricalMFGrid::SpecialCylindricalMFGrid(), TrapezoidalCartesianMFGrid::TrapezoidalCartesianMFGrid(), TrapezoidalCylindricalMFGrid::TrapezoidalCylindricalMFGrid(), TrapezoidalCylindricalMFGrid::uncheckedValueInTesla(), TrapezoidalCartesianMFGrid::uncheckedValueInTesla(), RectangularCylindricalMFGrid::uncheckedValueInTesla(), SpecialCylindricalMFGrid::uncheckedValueInTesla(), and RectangularCartesianMFGrid::uncheckedValueInTesla().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:28:14 2009 for CMSSW by  doxygen 1.5.4