36 cout <<
"WARNING: TrapezoidalCartesianMFGrid: unexpected orientation: x: " << localXDir <<
" y: " << localYDir
41 inFile >> n1 >> n2 >> n3;
42 double xref, yref, zref;
43 inFile >> xref >> yref >> zref;
44 double step1, step2, step3;
45 inFile >> step1 >> step2 >> step3;
47 double BasicDistance1[3][3];
48 double BasicDistance2[3][3];
49 bool easya, easyb, easyc;
51 inFile >> BasicDistance1[0][0] >> BasicDistance1[1][0] >> BasicDistance1[2][0];
52 inFile >> BasicDistance1[0][1] >> BasicDistance1[1][1] >> BasicDistance1[2][1];
53 inFile >> BasicDistance1[0][2] >> BasicDistance1[1][2] >> BasicDistance1[2][2];
54 inFile >> BasicDistance2[0][0] >> BasicDistance2[1][0] >> BasicDistance2[2][0];
55 inFile >> BasicDistance2[0][1] >> BasicDistance2[1][1] >> BasicDistance2[2][1];
56 inFile >> BasicDistance2[0][2] >> BasicDistance2[1][2] >> BasicDistance2[2][2];
57 inFile >> easya >> easyb >> easyc;
59 vector<BVector> fieldValues;
62 fieldValues.reserve(
nLines);
63 for (
int iLine = 0; iLine <
nLines; ++iLine) {
64 inFile >> Bx >> By >> Bz;
68 fieldValues.push_back(
BVector(lB.
x(), lB.
y(), lB.
z()));
71 fieldValues.push_back(
BVector(Bx, By, Bz));
77 if (lastEntry !=
"complete") {
78 cout <<
"ERROR during file reading: file is not complete" << endl;
87 double stepx, stepy, stepz;
89 if (!easya && easyb && easyc) {
97 dstep = BasicDistance1[0][1];
98 offset = BasicDistance2[0][1];
99 }
else if (easya && !easyb && easyc) {
107 dstep = BasicDistance1[1][0];
108 offset = BasicDistance2[1][0];
112 throw MagGeometryError(
"TrapezoidalCartesianMFGrid only implemented for first or second coordinate");
115 double a = stepx * (nx - 1);
116 double b =
a + dstep * (ny - 1) * (nx - 1);
117 double h = stepy * (ny - 1);
119 double baMinus1 = dstep * (ny - 1) / stepx;
124 if (fabs(baMinus1) > 0.000001) {
125 double b_over_a = 1 + baMinus1;
126 double a1 =
delta / baMinus1;
129 cout <<
"Trapeze size (a,b,h) = " <<
a <<
"," <<
b <<
"," <<
h << endl;
130 cout <<
"Global origin " << grefp << endl;
131 cout <<
"Local origin " << lrefp << endl;
132 cout <<
"a1 = " << a1 << endl;
137 double x0 = lrefp.x() + a1;
138 double y0 = lrefp.y() +
h / 2.;
148 Grid1D gridX(xrec, xrec + (
a +
b) / 2., nx);
149 Grid1D gridY(yrec, yrec +
h, ny);
150 Grid1D gridZ(lrefp.z(), lrefp.z() + stepz * (n3 - 1), n3);
153 cout <<
" GRID X range: local " << gridX.
lower() <<
" - " << gridX.
upper()
157 cout <<
" GRID Y range: local " << gridY.
lower() <<
" - " << gridY.
upper()
161 cout <<
" GRID Z range: local " << gridZ.
lower() <<
" - " << gridZ.
upper()
182 cout << endl <<
"Dump of TrapezoidalCartesianMFGrid" << endl;
198 cout <<
"Dumping " <<
grid_.
data().size() <<
" field values " << endl;
GlobalPoint toGlobal(const LocalPoint &lp) const
const Container & data() const
void trapezoid(double xrec, double yrec, double &xtrap, double &ytrap) const
const Grid1D & grida() const
GloballyPositioned< float >::GlobalVector GlobalVector
GloballyPositioned< float >::LocalPoint LocalPoint
ReturnType interpolate(Scalar a, Scalar b, Scalar c)
LocalPoint toLocal(const GlobalPoint &gp) const
void dump() const override
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Trapezoid2RectangleMappingX mapping_
const GloballyPositioned< float > & frame() const
Local reference frame.
void rectangle(double xtrap, double ytrap, double &xrec, double &yrec) const
GloballyPositioned< float >::GlobalPoint GlobalPoint
LocalPoint fromGridFrame(double a, double b, double c) const override
find grid coordinates for point. For debugging and validation only.
const Grid1D & gridb() const
const Grid1D & gridc() const
GloballyPositioned< float >::LocalVector LocalVector
void toGridFrame(const LocalPoint &p, double &a, double &b, double &c) const override
find grid coordinates for point. For debugging and validation only.
TrapezoidalCartesianMFGrid(binary_ifstream &istr, const GloballyPositioned< float > &vol)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
LocalVector uncheckedValueInTesla(const LocalPoint &p) const override
Interpolated field value at given point; does not check for exceptions.