8 float m2,
float c2 )
const {
13 float x = (c2-
c1)/(m1-m2);
14 float y = (m1*c2-m2*
c1)/(m1-m2);
23 std::pair< LocalPoint, LocalPoint > ends =
wireEnds( wire );
25 std::vector<float> buf(3);
27 buf[0] = (ends.first.x() + ends.second.x())/2.;
28 buf[1] = (ends.first.y() + ends.second.y())/2.;
29 float d2 = (ends.first.x() - ends.second.x()) * (ends.first.x() - ends.second.x()) +
30 (ends.first.y() - ends.second.y()) * (ends.first.y() - ends.second.y());
40 const float fprec = 1.E-06;
50 LogTrace(
"CSCWireGeometry|CSC") <<
"CSCWireGeometry: wire=" << wire <<
51 ", wire angle = " << wangle <<
52 ", intercept on y axis=" << cw;
60 float m1 = 2.*len/(ww-nw);
62 if ( fabs(wangle) < fprec ) {
66 c1 = -len/2. - nw*len/(ww-nw);
84 LogTrace(
"CSCWireGeometry|CSC") <<
"CSCWireGeometry: wire intersects edges of plane at " <<
85 "\n x1=" << x1 <<
" y1=" << y1 <<
86 " x2=" << x2 <<
" y2=" << y2;
90 if ( fabs(wangle) < fprec ) {
92 LogTrace(
"CSCWireGeometry|CSC") <<
"CSCWireGeometry: wires are not tilted ";
106 LogTrace(
"CSCWireGeometry|CSC") <<
"CSCWireGeometry: slopes & intercepts " <<
107 "\n mt=" << mt <<
" ct=" << ct <<
" mb=" << mb <<
" cb=" << cb <<
108 "\n m1=" << m1 <<
" c1=" << c1 <<
" m2=" << m2 <<
" c2=" << c2 <<
109 "\n mw=" << mw <<
" cw=" << cw;
123 LogTrace(
"CSCWireGeometry|CSC") <<
"CSCWireGeometry: wire intersects top & bottom of wire plane at " <<
124 "\n xt=" << xt <<
" yt=" << yt <<
125 " xb=" << xb <<
" yb=" << yb ;
127 float xWireEnd[4], yWireEnd[4];
130 if ( fabs(x1) >= hb && fabs(x1) <= ht ) {
136 if ( fabs(xb) <= hb ) {
142 if ( fabs(x2) >= hb && fabs(x2) <= ht ) {
148 if ( fabs(xt) <= ht ) {
158 LogTrace(
"CSCWireGeometry|CSC") <<
"CSCWireGeometry: wire does not intersect wire plane!!";
165 LogTrace(
"CSCWireGeometry|CSC") <<
"CSCWireGeometry: ME11 wire ends ";
166 for (
int j = 0;
j<
i;
j++ ) {
167 LogTrace(
"CSCWireGeometry|CSC") <<
" x = " << xWireEnd[
j] <<
" y = " << yWireEnd[
j];
170 return std::pair< LocalPoint, LocalPoint >
178 const float fprec = 1.E-06;
183 if ( fabs(wangle) > fprec ) mw =
tan( wangle );
188 LogTrace(
"CSCWireGeometry|CSC") <<
"CSCWireGeometry: wire=" << wire <<
189 ", wire angle = " << wangle <<
190 ", intercept on y axis=" << cw;
192 return std::pair<float,float>(mw, cw);
199 const float fprec = 0.1;
202 if ( fabs(wangle) > fprec ) {
207 return std::pair<float, float>(ylow, yhigh);
double narrowWidthOfPlane() const
double wideWidthOfPlane() const
std::vector< float > wireValues(float wire) const
virtual float yOfWire(float wire, float x=0.) const =0
std::pair< float, float > yLimitsOfWirePlane() const
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
std::pair< LocalPoint, LocalPoint > wireEnds(float wire) const
double lengthOfPlane() const
LocalPoint intersection(float m1, float c1, float m2, float c2) const
double yOfFirstWire() const
std::pair< float, float > equationOfWire(float wire) const
virtual float wireAngle() const =0