Go to the documentation of this file.00001 #include <Geometry/CSCGeometry/src/CSCSlantedWireGeometry.h>
00002 #include <Geometry/CSCGeometry/interface/nint.h>
00003
00004 #include <FWCore/MessageLogger/interface/MessageLogger.h>
00005
00006 #include <cmath>
00007
00008 CSCSlantedWireGeometry::CSCSlantedWireGeometry( double wireSpacing,
00009 double yOfFirstWire, double narrow, double wide, double length, float wireAngle ) :
00010 CSCWireGeometry( wireSpacing, yOfFirstWire, narrow, wide, length ), theWireAngle( wireAngle ){
00011 cosWireAngle = cos( wireAngle );
00012 sinWireAngle = sin( wireAngle );
00013 theWireOffset = yOfFirstWire * cosWireAngle;
00014 LogTrace("CSCWireGeometry|CSC") <<
00015 "CSCSlantedWireGeometry: constructed:\n" <<
00016 " wireSpacing = " << wireSpacing <<
00017 ", y1 = " << yOfFirstWire <<
00018 ", narrow_width = " << narrow <<
00019 ", wide_width = " << wide <<
00020 ", length = " << length <<
00021 ", wireAngle = " << wireAngle <<
00022 ", theWireOffset = " << theWireOffset;
00023 }
00024
00025 int CSCSlantedWireGeometry::nearestWire(const LocalPoint& lp) const {
00026
00027
00028
00029
00030 float yprime = lp.y() * cosWireAngle - lp.x() * sinWireAngle;
00031
00032
00033 return 1 + nint( (yprime - theWireOffset) / wireSpacing() );
00034 }
00035
00036
00037 float CSCSlantedWireGeometry::yOfWire(float wire, float x) const {
00038
00039
00040
00041 float yprime = theWireOffset + (wire-1.) * wireSpacing();
00042
00043 return ( yprime + x*sinWireAngle )/cosWireAngle;
00044 }