#include <GlobalGridWrapper.h>
Public Member Functions | |
virtual Dimensions | dimensions () const |
void | dump () const |
virtual LocalPoint | fromGridFrame (double a, double b, double c) const |
find grid coordinates for point. For debugging and validation only. | |
GlobalGridWrapper (const GloballyPositioned< float > &vol, const std::string &fileName) | |
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 void | toGridFrame (const LocalPoint &p, double &a, double &b, double &c) const |
find grid coordinates for point. For debugging and validation only. | |
virtual LocalVector | valueInTesla (const LocalPoint &p) const |
Interpolated field value at given point. | |
Private Attributes | |
MagneticFieldGrid * | theRealOne |
Generic interpolator that is a wrapper of MagneticFieldGrid, i.e. non-specialized/optimized for each kind of grid.
Definition at line 23 of file GlobalGridWrapper.h.
GlobalGridWrapper::GlobalGridWrapper | ( | const GloballyPositioned< float > & | vol, |
const std::string & | fileName | ||
) |
Definition at line 7 of file GlobalGridWrapper.cc.
References MagneticFieldGrid::load(), and theRealOne.
: MFGrid(vol) { theRealOne = new MagneticFieldGrid; theRealOne->load(fileName); }
Dimensions GlobalGridWrapper::dimensions | ( | void | ) | const [virtual] |
Implements MFGrid.
Definition at line 51 of file GlobalGridWrapper.cc.
{ throw MagLogicError ("GlobalGridWrapper::dimensions not implemented yet"); return Dimensions(); }
void GlobalGridWrapper::dump | ( | void | ) | const [virtual] |
MFGrid::LocalPoint GlobalGridWrapper::fromGridFrame | ( | double | a, |
double | b, | ||
double | c | ||
) | const [virtual] |
find grid coordinates for point. For debugging and validation only.
Implements MFGrid.
Definition at line 45 of file GlobalGridWrapper.cc.
{ throw MagLogicError ("GlobalGridWrapper::fromGridFrame not implemented yet"); return LocalPoint( 0, 0, 0); }
MFGrid::LocalPoint GlobalGridWrapper::nodePosition | ( | int | i, |
int | j, | ||
int | k | ||
) | const [virtual] |
Position of node in local frame.
Implements MFGrid.
Definition at line 57 of file GlobalGridWrapper.cc.
{ throw MagLogicError ("GlobalGridWrapper::nodePosition not implemented yet"); return LocalPoint( 0, 0, 0); }
MFGrid::LocalVector GlobalGridWrapper::nodeValue | ( | int | i, |
int | j, | ||
int | k | ||
) | const [virtual] |
Field value at node.
Implements MFGrid.
Definition at line 63 of file GlobalGridWrapper.cc.
{ throw MagLogicError ("GlobalGridWrapper::nodeValue not implemented yet"); return LocalVector( 0, 0, 0); }
void GlobalGridWrapper::toGridFrame | ( | const LocalPoint & | p, |
double & | a, | ||
double & | b, | ||
double & | c | ||
) | const [virtual] |
find grid coordinates for point. For debugging and validation only.
Implements MFGrid.
Definition at line 39 of file GlobalGridWrapper.cc.
{ throw MagLogicError ("GlobalGridWrapper::toGridFrame not implemented yet"); }
MFGrid::LocalVector GlobalGridWrapper::valueInTesla | ( | const LocalPoint & | p | ) | const [virtual] |
Interpolated field value at given point.
Implements MFGrid.
Definition at line 15 of file GlobalGridWrapper.cc.
References MFGrid::frame(), MagneticFieldGrid::gridType(), MagneticFieldGrid::interpolateAtPoint(), theRealOne, and GloballyPositioned< T >::toGlobal().
{ GlobalPoint gp = frame().toGlobal(p); float bx, by, bz; int gridType = theRealOne->gridType(); if ( gridType == 1 || gridType == 2) { // x,y,z grid theRealOne->interpolateAtPoint( gp.x(), gp.y(), gp.z(), bx, by, bz); } else { // r,phi,z grid // cout << "calling interpolateAtPoint with args " // << gp.perp() << " " << gp.phi() << " " << gp.z() << endl; theRealOne->interpolateAtPoint( gp.perp(), gp.phi(), gp.z(), bx, by, bz); // cout << "interpolateAtPoint returned " // << bx << " " << by << " " << bz << endl; } return LocalVector( bx, by, bz); }
MagneticFieldGrid* GlobalGridWrapper::theRealOne [private] |
Definition at line 45 of file GlobalGridWrapper.h.
Referenced by GlobalGridWrapper(), and valueInTesla().