34 }
else if (localXDir.dot(
GlobalVector(0,1,0)) > 0.999999 &&
41 cout <<
"WARNING: TrapezoidalCartesianMFGrid: unexpected orientation: x: "
42 << localXDir <<
" y: " << localYDir << endl;
46 inFile >> n1 >> n2 >> n3;
47 double xref, yref, zref;
48 inFile >> xref >> yref >> zref;
49 double step1, step2, step3;
50 inFile >> step1 >> step2 >> step3;
52 double BasicDistance1[3][3];
53 double BasicDistance2[3][3];
54 bool easya, easyb, easyc;
56 inFile >> BasicDistance1[0][0] >> BasicDistance1[1][0] >> BasicDistance1[2][0];
57 inFile >> BasicDistance1[0][1] >> BasicDistance1[1][1] >> BasicDistance1[2][1];
58 inFile >> BasicDistance1[0][2] >> BasicDistance1[1][2] >> BasicDistance1[2][2];
59 inFile >> BasicDistance2[0][0] >> BasicDistance2[1][0] >> BasicDistance2[2][0];
60 inFile >> BasicDistance2[0][1] >> BasicDistance2[1][1] >> BasicDistance2[2][1];
61 inFile >> BasicDistance2[0][2] >> BasicDistance2[1][2] >> BasicDistance2[2][2];
62 inFile >> easya >> easyb >> easyc;
64 vector<BVector> fieldValues;
67 fieldValues.reserve(nLines);
68 for (
int iLine=0; iLine<
nLines; ++iLine){
69 inFile >> Bx >> By >> Bz;
73 fieldValues.push_back(
BVector(lB.
x(), lB.
y(), lB.
z()));
76 fieldValues.push_back(
BVector(Bx,By,Bz));
82 if (lastEntry !=
"complete") {
83 cout <<
"ERROR during file reading: file is not complete" << endl;
92 double stepx, stepy, stepz;
94 if (!easya && easyb && easyc) {
102 dstep = BasicDistance1[0][1];
103 offset = BasicDistance2[0][1];
104 }
else if (easya && !easyb && easyc) {
112 dstep = BasicDistance1[1][0];
113 offset = BasicDistance2[1][0];
117 throw MagGeometryError(
"TrapezoidalCartesianMFGrid only implemented for first or second coordinate");
120 double a = stepx * (nx -1);
121 double b = a + dstep * (ny-1) * (nx-1);
122 double h = stepy * (ny-1);
123 double delta = -offset * (ny-1);
124 double baMinus1 = dstep*(ny-1) / stepx;
129 if (fabs(baMinus1) > 0.000001) {
130 double b_over_a = 1 + baMinus1;
131 double a1 = delta/baMinus1;
134 cout <<
"Trapeze size (a,b,h) = " << a <<
"," << b <<
"," << h << endl;
135 cout <<
"Global origin " << grefp << endl;
136 cout <<
"Local origin " << lrefp << endl;
137 cout <<
"a1 = " << a1 << endl;
142 double x0 = lrefp.x() + a1;
143 double y0 = lrefp.y() + h/2.;
154 Grid1D gridX( xrec, xrec + (a+b)/2., nx);
155 Grid1D gridY( yrec, yrec + h, ny);
156 Grid1D gridZ( lrefp.z(), lrefp.z() + stepz*(n3-1), n3);
159 cout <<
" GRID X range: local " << gridX.
lower() <<
" - " << gridX.
upper()
163 cout <<
" GRID Y range: local " << gridY.
lower() <<
" - " << gridY.
upper()
167 cout <<
" GRID Z range: local " << gridZ.
lower() <<
" - " << gridZ.
upper()
191 cout << endl <<
"Dump of TrapezoidalCartesianMFGrid" << endl;
194 cout <<
"Number of points from Grid1D "
199 cout <<
"Reference Point from Grid1D "
204 cout <<
"Basic Distance from Grid1D "
208 cout <<
"Dumping " <<
grid_.
data().size() <<
" field values " << endl;
252 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_
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
const Container & data() const
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
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)
volatile std::atomic< bool > shutdown_flag false
const Grid1D & gridb() const