CMS 3D CMS Logo

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

Dimensions dimensions () const override
 
void dump () const override
 
LocalPoint fromGridFrame (double a, double b, double c) const override
 find grid coordinates for point. For debugging and validation only. More...
 
 GlobalGridWrapper (const GloballyPositioned< float > &vol, const std::string &fileName)
 
LocalPoint nodePosition (int i, int j, int k) const override
 Position of node in local frame. More...
 
LocalVector nodeValue (int i, int j, int k) const override
 Field value at node. More...
 
void toGridFrame (const LocalPoint &p, double &a, double &b, double &c) const override
 find grid coordinates for point. For debugging and validation only. More...
 
LocalVector valueInTesla (const LocalPoint &p) const override
 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)
 
 ~MFGrid () override
 
- 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, GlobalTagGlobalPointType
 
typedef Vector3DBase< float, GlobalTagGlobalVectorType
 
typedef Point3DBase< float, LocalTagLocalPointType
 
typedef Vector3DBase< float, LocalTagLocalVectorType
 

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 19 of file GlobalGridWrapper.h.

Constructor & Destructor Documentation

◆ GlobalGridWrapper()

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

Definition at line 7 of file GlobalGridWrapper.cc.

References MillePedeFileConverter_cfg::fileName, MagneticFieldGrid::load(), and theRealOne.

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

Member Function Documentation

◆ dimensions()

Dimensions GlobalGridWrapper::dimensions ( void  ) const
overridevirtual

Implements MFGrid.

Definition at line 42 of file GlobalGridWrapper.cc.

42  {
43  throw MagLogicError("GlobalGridWrapper::dimensions not implemented yet");
44  return Dimensions();
45 }

◆ dump()

void GlobalGridWrapper::dump ( void  ) const
overridevirtual

Reimplemented from MFGrid.

Definition at line 31 of file GlobalGridWrapper.cc.

31 {}

◆ fromGridFrame()

MFGrid::LocalPoint GlobalGridWrapper::fromGridFrame ( double  a,
double  b,
double  c 
) const
overridevirtual

find grid coordinates for point. For debugging and validation only.

Implements MFGrid.

Definition at line 37 of file GlobalGridWrapper.cc.

37  {
38  throw MagLogicError("GlobalGridWrapper::fromGridFrame not implemented yet");
39  return LocalPoint(0, 0, 0);
40 }
GloballyPositioned< float >::LocalPoint LocalPoint
Definition: MFGrid.h:31

◆ nodePosition()

MFGrid::LocalPoint GlobalGridWrapper::nodePosition ( int  i,
int  j,
int  k 
) const
overridevirtual

Position of node in local frame.

Implements MFGrid.

Definition at line 47 of file GlobalGridWrapper.cc.

47  {
48  throw MagLogicError("GlobalGridWrapper::nodePosition not implemented yet");
49  return LocalPoint(0, 0, 0);
50 }
GloballyPositioned< float >::LocalPoint LocalPoint
Definition: MFGrid.h:31

◆ nodeValue()

MFGrid::LocalVector GlobalGridWrapper::nodeValue ( int  i,
int  j,
int  k 
) const
overridevirtual

Field value at node.

Implements MFGrid.

Definition at line 52 of file GlobalGridWrapper.cc.

52  {
53  throw MagLogicError("GlobalGridWrapper::nodeValue not implemented yet");
54  return LocalVector(0, 0, 0);
55 }
GloballyPositioned< float >::LocalVector LocalVector
Definition: MFGrid.h:32

◆ toGridFrame()

void GlobalGridWrapper::toGridFrame ( const LocalPoint p,
double &  a,
double &  b,
double &  c 
) const
overridevirtual

find grid coordinates for point. For debugging and validation only.

Implements MFGrid.

Definition at line 33 of file GlobalGridWrapper.cc.

33  {
34  throw MagLogicError("GlobalGridWrapper::toGridFrame not implemented yet");
35 }

◆ valueInTesla()

MFGrid::LocalVector GlobalGridWrapper::valueInTesla ( const LocalPoint p) const
overridevirtual

Interpolated field value at given point.

Implements MFGrid.

Definition at line 12 of file GlobalGridWrapper.cc.

References l1GtPatternGenerator_cfi::bx, MFGrid::frame(), runTauDisplay::gp, MagneticFieldGrid::gridType(), MagneticFieldGrid::interpolateAtPoint(), AlCaHLTBitMon_ParallelJobs::p, theRealOne, and GloballyPositioned< T >::toGlobal().

12  {
14  float bx, by, bz;
15 
16  int gridType = theRealOne->gridType();
17  if (gridType == 1 || gridType == 2) {
18  // x,y,z grid
19  theRealOne->interpolateAtPoint(gp.x(), gp.y(), gp.z(), bx, by, bz);
20  } else {
21  // r,phi,z grid
22  // cout << "calling interpolateAtPoint with args "
23  // << gp.perp() << " " << gp.phi() << " " << gp.z() << endl;
24  theRealOne->interpolateAtPoint(gp.perp(), gp.phi(), gp.z(), bx, by, bz);
25  // cout << "interpolateAtPoint returned "
26  // << bx << " " << by << " " << bz << endl;
27  }
28  return LocalVector(bx, by, bz);
29 }
GlobalPoint toGlobal(const LocalPoint &lp) const
int gridType()
returns value of GridType (and eventually prints the type + short description)
const GloballyPositioned< float > & frame() const
Local reference frame.
Definition: MFGrid.h:60
MagneticFieldGrid * theRealOne
GloballyPositioned< float >::LocalVector LocalVector
Definition: MFGrid.h:32
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

◆ theRealOne

MagneticFieldGrid* GlobalGridWrapper::theRealOne
private

Definition at line 38 of file GlobalGridWrapper.h.

Referenced by GlobalGridWrapper(), and valueInTesla().