36 }
else if (localXDir.dot(
GlobalVector(0,1,0)) > 0.999999 &&
43 cout <<
"WARNING: TrapezoidalCartesianMFGrid: unexpected orientation: x: "
44 << localXDir <<
" y: " << localYDir << endl;
48 inFile >> n1 >> n2 >> n3;
49 double xref, yref, zref;
50 inFile >> xref >> yref >> zref;
52 inFile >> step1 >> step2 >>
step3;
54 double BasicDistance1[3][3];
55 double BasicDistance2[3][3];
56 bool easya, easyb, easyc;
58 inFile >> BasicDistance1[0][0] >> BasicDistance1[1][0] >> BasicDistance1[2][0];
59 inFile >> BasicDistance1[0][1] >> BasicDistance1[1][1] >> BasicDistance1[2][1];
60 inFile >> BasicDistance1[0][2] >> BasicDistance1[1][2] >> BasicDistance1[2][2];
61 inFile >> BasicDistance2[0][0] >> BasicDistance2[1][0] >> BasicDistance2[2][0];
62 inFile >> BasicDistance2[0][1] >> BasicDistance2[1][1] >> BasicDistance2[2][1];
63 inFile >> BasicDistance2[0][2] >> BasicDistance2[1][2] >> BasicDistance2[2][2];
64 inFile >> easya >> easyb >> easyc;
66 vector<BVector> fieldValues;
69 fieldValues.reserve(nLines);
70 for (
int iLine=0; iLine<
nLines; ++iLine){
71 inFile >> Bx >> By >> Bz;
75 fieldValues.push_back(
BVector(lB.
x(), lB.
y(), lB.
z()));
78 fieldValues.push_back(
BVector(Bx,By,Bz));
84 if (lastEntry !=
"complete") {
85 cout <<
"ERROR during file reading: file is not complete" << endl;
94 double stepx, stepy, stepz;
96 if (!easya && easyb && easyc) {
104 dstep = BasicDistance1[0][1];
105 offset = BasicDistance2[0][1];
106 }
else if (easya && !easyb && easyc) {
114 dstep = BasicDistance1[1][0];
115 offset = BasicDistance2[1][0];
119 throw MagGeometryError(
"TrapezoidalCartesianMFGrid only implemented for first or second coordinate");
122 double a = stepx * (nx -1);
123 double b = a + dstep * (ny-1) * (nx-1);
124 double h = stepy * (ny-1);
125 double delta = -offset * (ny-1);
126 double baMinus1 = dstep*(ny-1) / stepx;
131 if (fabs(baMinus1) > 0.000001) {
132 double b_over_a = 1 + baMinus1;
133 double a1 = delta/baMinus1;
136 cout <<
"Trapeze size (a,b,h) = " << a <<
"," << b <<
"," << h << endl;
137 cout <<
"Global origin " << grefp << endl;
138 cout <<
"Local origin " << lrefp << endl;
139 cout <<
"a1 = " << a1 << endl;
144 double x0 = lrefp.x() + a1;
145 double y0 = lrefp.y() + h/2.;
156 Grid1D gridX( xrec, xrec + (a+b)/2., nx);
157 Grid1D gridY( yrec, yrec + h, ny);
158 Grid1D gridZ( lrefp.z(), lrefp.z() + stepz*(n3-1), n3);
161 cout <<
" GRID X range: local " << gridX.
lower() <<
" - " << gridX.
upper()
165 cout <<
" GRID Y range: local " << gridY.
lower() <<
" - " << gridY.
upper()
169 cout <<
" GRID Z range: local " << gridZ.
lower() <<
" - " << gridZ.
upper()
193 cout << endl <<
"Dump of TrapezoidalCartesianMFGrid" << endl;
196 cout <<
"Number of points from Grid1D "
201 cout <<
"Reference Point from Grid1D "
206 cout <<
"Basic Distance from Grid1D "
210 cout <<
"Dumping " <<
grid_.
data().size() <<
" field values " << endl;
254 double&
a,
double&
b,
double&
c)
const
const Grid1D & grida() const
void trapezoid(double xrec, double yrec, double &xtrap, double &ytrap) const
GloballyPositioned< float >::GlobalVector GlobalVector
GloballyPositioned< float >::LocalPoint LocalPoint
ReturnType interpolate(Scalar a, Scalar b, Scalar c)
void rectangle(double xtrap, double ytrap, double &xrec, double &yrec) const
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
LocalPoint toLocal(const GlobalPoint &gp) const
const Grid1D & gridc() const
Trapezoid2RectangleMappingX mapping_
unsigned int offset(bool)
GlobalPoint toGlobal(const LocalPoint &lp) const
virtual LocalPoint fromGridFrame(double a, double b, double c) const
find grid coordinates for point. For debugging and validation only.
GloballyPositioned< float >::GlobalPoint GlobalPoint
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Basic3DVector< float > BVector
GloballyPositioned< float >::LocalVector LocalVector
virtual LocalVector uncheckedValueInTesla(const LocalPoint &p) const
Interpolated field value at given point; does not check for exceptions.
const GloballyPositioned< float > & frame() const
Local reference frame.
virtual void toGridFrame(const LocalPoint &p, double &a, double &b, double &c) const
find grid coordinates for point. For debugging and validation only.
TrapezoidalCartesianMFGrid(binary_ifstream &istr, const GloballyPositioned< float > &vol)
const Grid1D & gridb() const
const std::vector< ValueType > & data() const