test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
GlobalGridWrapper Class Reference

#include <GlobalGridWrapper.h>

Inheritance diagram for GlobalGridWrapper:
MFGrid MagneticFieldProvider< float >

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. More...
 
 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. More...
 
virtual LocalVector nodeValue (int i, int j, int k) const
 Field value at node. More...
 
virtual void toGridFrame (const LocalPoint &p, double &a, double &b, double &c) const
 find grid coordinates for point. For debugging and validation only. More...
 
virtual LocalVector valueInTesla (const LocalPoint &p) const
 Interpolated field value at given point. More...
 
- Public Member Functions inherited from MFGrid
const GloballyPositioned< float > & frame () const
 Local reference frame. More...
 
virtual Indexes index (const LocalPoint &p) const
 
 MFGrid (const GloballyPositioned< float > &vol)
 
virtual ~MFGrid ()
 
- 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 ()
 

Private Attributes

MagneticFieldGridtheRealOne
 

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,
GlobalTag
GlobalPointType
 
typedef Vector3DBase< float,
GlobalTag
GlobalVectorType
 
typedef Point3DBase< float,
LocalTag
LocalPointType
 
typedef Vector3DBase< float,
LocalTag
LocalVectorType
 

Detailed Description

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

Author
T. Todorov

Definition at line 21 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.

9  : MFGrid(vol)
10 {
13 }
void load(const std::string &name)
load grid binary file
MagneticFieldGrid * theRealOne
MFGrid(const GloballyPositioned< float > &vol)
Definition: MFGrid.h:37

Member Function Documentation

Dimensions GlobalGridWrapper::dimensions ( void  ) const
virtual

Implements MFGrid.

Definition at line 51 of file GlobalGridWrapper.cc.

52 {
53  throw MagLogicError ("GlobalGridWrapper::dimensions not implemented yet");
54  return Dimensions();
55 }
void GlobalGridWrapper::dump ( void  ) const
virtual

Reimplemented from MFGrid.

Definition at line 37 of file GlobalGridWrapper.cc.

37 {}
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.

46 {
47  throw MagLogicError ("GlobalGridWrapper::fromGridFrame not implemented yet");
48  return LocalPoint( 0, 0, 0);
49 }
GloballyPositioned< float >::LocalPoint LocalPoint
Definition: MFGrid.h:34
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.

58 {
59  throw MagLogicError ("GlobalGridWrapper::nodePosition not implemented yet");
60  return LocalPoint( 0, 0, 0);
61 }
GloballyPositioned< float >::LocalPoint LocalPoint
Definition: MFGrid.h:34
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.

64 {
65  throw MagLogicError ("GlobalGridWrapper::nodeValue not implemented yet");
66  return LocalVector( 0, 0, 0);
67 }
GloballyPositioned< float >::LocalVector LocalVector
Definition: MFGrid.h:35
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.

41 {
42  throw MagLogicError ("GlobalGridWrapper::toGridFrame not implemented yet");
43 }
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().

16 {
17 
18  GlobalPoint gp = frame().toGlobal(p);
19  float bx, by, bz;
20 
21  int gridType = theRealOne->gridType();
22  if ( gridType == 1 || gridType == 2) {
23  // x,y,z grid
24  theRealOne->interpolateAtPoint( gp.x(), gp.y(), gp.z(), bx, by, bz);
25  }
26  else {
27  // r,phi,z grid
28 // cout << "calling interpolateAtPoint with args "
29 // << gp.perp() << " " << gp.phi() << " " << gp.z() << endl;
30  theRealOne->interpolateAtPoint( gp.perp(), gp.phi(), gp.z(), bx, by, bz);
31 // cout << "interpolateAtPoint returned "
32 // << bx << " " << by << " " << bz << endl;
33  }
34  return LocalVector( bx, by, bz);
35 }
T perp() const
Definition: PV3DBase.h:72
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
T y() const
Definition: PV3DBase.h:63
int gridType()
returns value of GridType (and eventually prints the type + short description)
T z() const
Definition: PV3DBase.h:64
MagneticFieldGrid * theRealOne
GlobalPoint toGlobal(const LocalPoint &lp) const
GloballyPositioned< float >::LocalVector LocalVector
Definition: MFGrid.h:35
const GloballyPositioned< float > & frame() const
Local reference frame.
Definition: MFGrid.h:63
T x() const
Definition: PV3DBase.h:62
void interpolateAtPoint(double X1, double X2, double X3, float &Bx, float &By, float &Bz)
interpolates the magnetic field at input coordinate point and returns field values ...

Member Data Documentation

MagneticFieldGrid* GlobalGridWrapper::theRealOne
private

Definition at line 43 of file GlobalGridWrapper.h.

Referenced by GlobalGridWrapper(), and valueInTesla().