CMS 3D CMS Logo

GlobalGridWrapper.cc
Go to the documentation of this file.
1 #include "GlobalGridWrapper.h"
2 #include "MagneticFieldGrid.h"
4 
5 using namespace std;
6 
10 }
11 
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 }
30 
31 void GlobalGridWrapper::dump() const {}
32 
33 void GlobalGridWrapper::toGridFrame(const LocalPoint& p, double& a, double& b, double& c) const {
34  throw MagLogicError("GlobalGridWrapper::toGridFrame not implemented yet");
35 }
36 
37 MFGrid::LocalPoint GlobalGridWrapper::fromGridFrame(double a, double b, double c) const {
38  throw MagLogicError("GlobalGridWrapper::fromGridFrame not implemented yet");
39  return LocalPoint(0, 0, 0);
40 }
41 
43  throw MagLogicError("GlobalGridWrapper::dimensions not implemented yet");
44  return Dimensions();
45 }
46 
48  throw MagLogicError("GlobalGridWrapper::nodePosition not implemented yet");
49  return LocalPoint(0, 0, 0);
50 }
51 
53  throw MagLogicError("GlobalGridWrapper::nodeValue not implemented yet");
54  return LocalVector(0, 0, 0);
55 }
GloballyPositioned< float >
MagneticFieldGrid::gridType
int gridType()
returns value of GridType (and eventually prints the type + short description)
Definition: MagneticFieldGrid.cc:77
GlobalGridWrapper::valueInTesla
LocalVector valueInTesla(const LocalPoint &p) const override
Interpolated field value at given point.
Definition: GlobalGridWrapper.cc:12
GlobalGridWrapper::nodePosition
LocalPoint nodePosition(int i, int j, int k) const override
Position of node in local frame.
Definition: GlobalGridWrapper.cc:47
mps_fire.i
i
Definition: mps_fire.py:428
MFGrid
Definition: MFGrid.h:27
GlobalGridWrapper::GlobalGridWrapper
GlobalGridWrapper(const GloballyPositioned< float > &vol, const std::string &fileName)
Definition: GlobalGridWrapper.cc:7
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
MFGrid::LocalVector
GloballyPositioned< float >::LocalVector LocalVector
Definition: MFGrid.h:32
MagExceptions.h
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
GlobalGridWrapper::dimensions
Dimensions dimensions() const override
Definition: GlobalGridWrapper.cc:42
MagLogicError
Definition: MagExceptions.h:25
MFGrid::frame
const GloballyPositioned< float > & frame() const
Local reference frame.
Definition: MFGrid.h:60
MagneticFieldGrid
Definition: MagneticFieldGrid.h:32
GlobalGridWrapper::dump
void dump() const override
Definition: GlobalGridWrapper.cc:31
MFGrid::LocalPoint
GloballyPositioned< float >::LocalPoint LocalPoint
Definition: MFGrid.h:31
dqmdumpme.k
k
Definition: dqmdumpme.py:60
b
double b
Definition: hdecay.h:118
runTauDisplay.gp
gp
Definition: runTauDisplay.py:431
GlobalGridWrapper::nodeValue
LocalVector nodeValue(int i, int j, int k) const override
Field value at node.
Definition: GlobalGridWrapper.cc:52
a
double a
Definition: hdecay.h:119
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
MagneticFieldGrid.h
GlobalGridWrapper::fromGridFrame
LocalPoint fromGridFrame(double a, double b, double c) const override
find grid coordinates for point. For debugging and validation only.
Definition: GlobalGridWrapper.cc:37
GlobalGridWrapper::toGridFrame
void toGridFrame(const LocalPoint &p, double &a, double &b, double &c) const override
find grid coordinates for point. For debugging and validation only.
Definition: GlobalGridWrapper.cc:33
std
Definition: JetResolutionObject.h:76
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
GlobalGridWrapper.h
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
GloballyPositioned::toGlobal
GlobalPoint toGlobal(const LocalPoint &lp) const
Definition: GloballyPositioned.h:66
MFGrid::GlobalPoint
GloballyPositioned< float >::GlobalPoint GlobalPoint
Definition: MFGrid.h:29
Dimensions
Definition: MFGrid.h:15