CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 }
MessageLogger.h
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
CSCSlantedWireGeometry::theWireOffset
float theWireOffset
Definition: CSCSlantedWireGeometry.h:51
CSCWireGeometry::wireSpacing
double wireSpacing() const
Definition: CSCWireGeometry.h:35
nint.h
DDAxes::x
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
nint
int nint(float a)
Return the nearest integer - analogous to the FORTRAN intrinsic NINT.
Definition: nint.h:8
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
CSCSlantedWireGeometry::yOfWire
float yOfWire(float wire, float x=0.) const override
Definition: CSCSlantedWireGeometry.cc:32
CSCSlantedWireGeometry::CSCSlantedWireGeometry
CSCSlantedWireGeometry(double wireSpacing, double yOfFirstWire, double narrow, double wide, double length, float wireAngle)
Definition: CSCSlantedWireGeometry.cc:8
Point3DBase< float, LocalTag >
CSCWireGeometry
Definition: CSCWireGeometry.h:17
CSCSlantedWireGeometry::nearestWire
int nearestWire(const LocalPoint &lp) const override
Definition: CSCSlantedWireGeometry.cc:21
CSCSlantedWireGeometry::wireAngle
float wireAngle() const override
Definition: CSCSlantedWireGeometry.h:28
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
CSCSlantedWireGeometry.h
genVertex_cff.x
x
Definition: genVertex_cff.py:12
CSCSlantedWireGeometry::cosWireAngle
float cosWireAngle
Definition: CSCSlantedWireGeometry.h:49
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
CSCWireGeometry::yOfFirstWire
double yOfFirstWire() const
Definition: CSCWireGeometry.h:40
CSCSlantedWireGeometry::sinWireAngle
float sinWireAngle
Definition: CSCSlantedWireGeometry.h:50