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

Constructor & Destructor Documentation

◆ GlobalGridWrapper()

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

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 }

◆ 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 }

◆ 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 }

◆ 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.

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 }

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

Member Data Documentation

◆ theRealOne

MagneticFieldGrid* GlobalGridWrapper::theRealOne
private

Definition at line 39 of file GlobalGridWrapper.h.

Referenced by GlobalGridWrapper(), and valueInTesla().

MagneticFieldGrid::gridType
int gridType()
returns value of GridType (and eventually prints the type + short description)
Definition: MagneticFieldGrid.cc:77
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
MFGrid::LocalVector
GloballyPositioned< float >::LocalVector LocalVector
Definition: MFGrid.h:32
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
MagLogicError
Definition: MagExceptions.h:25
MFGrid::frame
const GloballyPositioned< float > & frame() const
Local reference frame.
Definition: MFGrid.h:60
MagneticFieldGrid
Definition: MagneticFieldGrid.h:32
MFGrid::LocalPoint
GloballyPositioned< float >::LocalPoint LocalPoint
Definition: MFGrid.h:31
Point3DBase< float, GlobalTag >
runTauDisplay.gp
gp
Definition: runTauDisplay.py:431
MFGrid::MFGrid
MFGrid(const GloballyPositioned< float > &vol)
Definition: MFGrid.h:34
MagneticFieldGrid::load
void load(const std::string &name)
load grid binary file
Definition: MagneticFieldGrid.cc:7
GlobalGridWrapper::theRealOne
MagneticFieldGrid * theRealOne
Definition: GlobalGridWrapper.h:39
MagneticFieldGrid::interpolateAtPoint
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
Definition: MagneticFieldGrid.cc:97
GloballyPositioned::toGlobal
GlobalPoint toGlobal(const LocalPoint &lp) const
Definition: GloballyPositioned.h:66
Dimensions
Definition: MFGrid.h:15