16 }
else if (gridType == 6 ) {
19 cout <<
"ERROR wrong SpecialCylindricalMFGrid type " << gridType << endl;
24 inFile >> n1 >> n2 >> n3;
26 cout <<
"n1 " << n1 <<
" n2 " << n2 <<
" n3 " << n3 << endl;
28 double xref, yref, zref;
29 inFile >> xref >> yref >> zref;
30 double stepx, stepy, stepz;
31 inFile >> stepx >> stepy >> stepz;
33 double RParAsFunOfPhi[4];
34 inFile >> RParAsFunOfPhi[0] >> RParAsFunOfPhi[1] >> RParAsFunOfPhi[2] >> RParAsFunOfPhi[3];
36 vector<BVector> fieldValues;
39 fieldValues.reserve(nLines);
40 for (
int iLine=0; iLine<
nLines; ++iLine){
41 inFile >> Bx >> By >> Bz;
49 fieldValues.push_back(
BVector(lB.
x(), lB.
y(), lB.
z()));
54 if (lastEntry !=
"complete"){
55 cout <<
"ERROR during file reading: file is not complete" << endl;
62 cout <<
"Grid reference point in grid system: " << xref <<
"," << yref <<
"," << zref << endl;
63 cout <<
"Grid reference point in global x,y,z: " << grefp << endl;
64 cout <<
"Grid reference point in local x,y,z: " << lrefp << endl;
65 cout <<
"steps " << stepx <<
"," << stepy <<
"," << stepz << endl;
66 cout <<
"RParAsFunOfPhi[0...4] = ";
67 for (
int i=0;
i<4; ++
i)
cout << RParAsFunOfPhi[
i] <<
" ";
cout << endl;
70 Grid1D gridX( 0, n1-1, n1);
71 Grid1D gridY( yref, yref + stepy*(n2-1), n2);
72 Grid1D gridZ( grefp.z(), grefp.z() + stepz*(n3-1), n3);
77 stepPhiTerm_ = (RParAsFunOfPhi[1] - RParAsFunOfPhi[3]) / (n1-1);
121 double&
a,
double&
b,
double&
c)
const
126 sinPhi =
cos(gp.phi());
128 sinPhi =
sin(gp.phi());
138 cout <<
"toGridFrame: sinPhi " ;
140 cout <<
"toGridFrame: cosPhi " ;
142 cout << sinPhi <<
" LocalPoint " << p
143 <<
" GlobalPoint " << gp << endl
144 <<
" a " << a <<
" b " << b <<
" c " << c << endl;
Sin< T >::type sin(const T &t)
virtual void toGridFrame(const LocalPoint &p, double &a, double &b, double &c) const
find grid coordinates for point. For debugging and validation only.
double startingPoint(double sinPhi) const
GloballyPositioned< float >::LocalPoint LocalPoint
ReturnType interpolate(Scalar a, Scalar b, Scalar c)
virtual void dump() const
LocalPoint toLocal(const GlobalPoint &gp) const
Cos< T >::type cos(const T &t)
SpecialCylindricalMFGrid(binary_ifstream &istr, const GloballyPositioned< float > &vol, int gridType)
virtual LocalVector uncheckedValueInTesla(const LocalPoint &p) const
Interpolated field value at given point; does not check for exceptions.
GlobalPoint toGlobal(const LocalPoint &lp) const
GloballyPositioned< float >::GlobalPoint GlobalPoint
double stepSize(double sinPhi) const
GloballyPositioned< float >::LocalVector LocalVector
const GloballyPositioned< float > & frame() const
Local reference frame.
virtual LocalPoint fromGridFrame(double a, double b, double c) const
find grid coordinates for point. For debugging and validation only.