CMS 3D CMS Logo

CSCSlantedWireGeometry.cc
Go to the documentation of this file.
3 
5 
6 #include <cmath>
7 
9  double wireSpacing, double yOfFirstWire, double narrow, double wide, double length, float wireAngle)
10  : CSCWireGeometry(wireSpacing, yOfFirstWire, narrow, wide, length), theWireAngle(wireAngle) {
14  LogTrace("CSCWireGeometry|CSC") << "CSCSlantedWireGeometry: constructed:\n"
15  << " wireSpacing = " << wireSpacing << ", y1 = " << yOfFirstWire
16  << ", narrow_width = " << narrow << ", wide_width = " << wide
17  << ", length = " << length << ", wireAngle = " << wireAngle
18  << ", theWireOffset = " << theWireOffset;
19 }
20 
22  // Return nearest wire number to input LocalPoint.
23  // Beware this may not exist or be read out!
24 
25  // rotate point to an axis perp. to wires
26  float yprime = lp.y() * cosWireAngle - lp.x() * sinWireAngle;
27 
28  // climb the ladder
29  return 1 + nint((yprime - theWireOffset) / wireSpacing());
30 }
31 
32 float CSCSlantedWireGeometry::yOfWire(float wire, float x) const {
33  // Return local y of given wire, at given x
34 
35  // y in rotated frame with y axis perpendicular to wires...
36  float yprime = theWireOffset + (wire - 1.) * wireSpacing();
37  // then y in usual (unrotated!) local xy frame...
38  return (yprime + x * sinWireAngle) / cosWireAngle;
39 }
float wireAngle() const override
int nearestWire(const LocalPoint &lp) const override
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
#define LogTrace(id)
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
int nint(float a)
Return the nearest integer - analogous to the FORTRAN intrinsic NINT.
Definition: nint.h:8
double yOfFirstWire() const
float yOfWire(float wire, float x=0.) const override
float x
double wireSpacing() const
CSCSlantedWireGeometry(double wireSpacing, double yOfFirstWire, double narrow, double wide, double length, float wireAngle)