CMS 3D CMS Logo

Public Member Functions | Private Attributes

GlobalGridWrapper Class Reference

#include <GlobalGridWrapper.h>

Inheritance diagram for GlobalGridWrapper:
MFGrid MagneticFieldProvider< float >

List of all members.

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

MagneticFieldGridtheRealOne

Detailed Description

Generic interpolator that is a wrapper of MagneticFieldGrid, i.e. non-specialized/optimized for each kind of grid.

Date:
2009/08/11 07:16:33
Revision:
1.3
Author:
T. Todorov

Definition at line 22 of file GlobalGridWrapper.h.


Constructor & Destructor Documentation

GlobalGridWrapper::GlobalGridWrapper ( const GloballyPositioned< float > &  vol,
const std::string &  fileName 
)

Definition at line 7 of file GlobalGridWrapper.cc.

References MagneticFieldGrid::load(), and theRealOne.


Member Function Documentation

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]

Reimplemented from MFGrid.

Definition at line 37 of file GlobalGridWrapper.cc.

{}
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);
}

Member Data Documentation

Definition at line 44 of file GlobalGridWrapper.h.

Referenced by GlobalGridWrapper(), and valueInTesla().