11 float x = (c2 -
c1) / (m1 -
m2);
12 float y = (m1 * c2 -
m2 *
c1) / (m1 -
m2);
22 std::vector<float>
buf(3);
24 buf[0] = (ends.first.x() + ends.second.x()) / 2.;
25 buf[1] = (ends.first.y() + ends.second.y()) / 2.;
26 float d2 = (ends.first.x() - ends.second.x()) * (ends.first.x() - ends.second.x()) +
27 (ends.first.y() - ends.second.y()) * (ends.first.y() - ends.second.y());
36 const float fprec = 1.E-06;
41 if (fabs(wangle) > fprec)
47 LogTrace(
"CSCWireGeometry|CSC") <<
"CSCWireGeometry: wire=" <<
wire <<
", wire angle = " << wangle
48 <<
", intercept on y axis=" << cw;
56 float m1 = 2. * len / (
ww - nw);
58 if (fabs(wangle) < fprec) {
61 c1 = -len / 2. - nw * len / (
ww - nw);
79 LogTrace(
"CSCWireGeometry|CSC") <<
"CSCWireGeometry: wire intersects edges of plane at " 80 <<
"\n x1=" <<
x1 <<
" y1=" <<
y1 <<
" x2=" <<
x2 <<
" y2=" <<
y2;
84 if (fabs(wangle) < fprec) {
85 LogTrace(
"CSCWireGeometry|CSC") <<
"CSCWireGeometry: wires are not tilted ";
99 LogTrace(
"CSCWireGeometry|CSC") <<
"CSCWireGeometry: slopes & intercepts " 100 <<
"\n mt=" <<
mt <<
" ct=" <<
ct <<
" mb=" << mb <<
" cb=" << cb <<
"\n m1=" << m1
101 <<
" c1=" <<
c1 <<
" m2=" <<
m2 <<
" c2=" << c2 <<
"\n mw=" << mw <<
" cw=" << cw;
115 LogTrace(
"CSCWireGeometry|CSC") <<
"CSCWireGeometry: wire intersects top & bottom of wire plane at " 116 <<
"\n xt=" << xt <<
" yt=" << yt <<
" xb=" << xb <<
" yb=" << yb;
118 float xWireEnd[4], yWireEnd[4];
121 if (fabs(
x1) >=
hb && fabs(
x1) <= ht) {
127 if (fabs(xb) <=
hb) {
133 if (fabs(
x2) >=
hb && fabs(
x2) <= ht) {
139 if (fabs(xt) <= ht) {
149 LogTrace(
"CSCWireGeometry|CSC") <<
"CSCWireGeometry: wire does not intersect wire plane!!";
156 LogTrace(
"CSCWireGeometry|CSC") <<
"CSCWireGeometry: ME11 wire ends ";
157 for (
int j = 0;
j <
i;
j++) {
158 LogTrace(
"CSCWireGeometry|CSC") <<
" x = " << xWireEnd[
j] <<
" y = " << yWireEnd[
j];
161 return std::pair<LocalPoint, LocalPoint>(
LocalPoint(xWireEnd[0], yWireEnd[0]),
LocalPoint(xWireEnd[1], yWireEnd[1]));
167 const float fprec = 1.E-06;
172 if (fabs(wangle) > fprec)
178 LogTrace(
"CSCWireGeometry|CSC") <<
"CSCWireGeometry: wire=" <<
wire <<
", wire angle = " << wangle
179 <<
", intercept on y axis=" << cw;
181 return std::pair<float, float>(mw, cw);
187 const float fprec = 0.1;
190 if (fabs(wangle) > fprec) {
195 return std::pair<float, float>(ylow, yhigh);
Point3DBase< Scalar, LocalTag > LocalPoint
double narrowWidthOfPlane() const
double lengthOfPlane() const
std::vector< float > wireValues(float wire) const
std::pair< float, float > yLimitsOfWirePlane() const
LocalPoint intersection(float m1, float c1, float m2, float c2) const
virtual float yOfWire(float wire, float x=0.) const =0
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
double wideWidthOfPlane() const
double yOfFirstWire() const
std::pair< float, float > equationOfWire(float wire) const
std::pair< LocalPoint, LocalPoint > wireEnds(float wire) const
virtual float wireAngle() const =0