#include <Geometry/CSCGeometry/src/CSCSlantedWireGeometry.h>
Public Member Functions | |
CSCWireGeometry * | clone () const |
Clone to handle correct copy of component objects referenced by base class pointer. | |
CSCSlantedWireGeometry (double wireSpacing, double yOfFirstWire, double narrow, double wide, double length, float wireAngle) | |
Constructor from wire spacing and wire angle. | |
int | nearestWire (const LocalPoint &lp) const |
The nearest (virtual) wire to a given LocalPoint. | |
float | wireAngle () const |
The angle of the wires w.r.t local x axis (in radians). | |
float | yOfWire (float wire, float x=0.) const |
Local y of a given wire 'number' (float) at given x. | |
virtual | ~CSCSlantedWireGeometry () |
Private Attributes | |
float | cosWireAngle |
float | sinWireAngle |
float | theWireAngle |
float | theWireOffset |
they have a fixed, non-zero angle w.r.t. local x axis.
Definition at line 15 of file CSCSlantedWireGeometry.h.
virtual CSCSlantedWireGeometry::~CSCSlantedWireGeometry | ( | ) | [inline, virtual] |
CSCSlantedWireGeometry::CSCSlantedWireGeometry | ( | double | wireSpacing, | |
double | yOfFirstWire, | |||
double | narrow, | |||
double | wide, | |||
double | length, | |||
float | wireAngle | |||
) |
Constructor from wire spacing and wire angle.
Definition at line 8 of file CSCSlantedWireGeometry.cc.
References funct::cos(), cosWireAngle, LogTrace, funct::sin(), sinWireAngle, and theWireOffset.
Referenced by clone().
00009 : 00010 CSCWireGeometry( wireSpacing, yOfFirstWire, narrow, wide, length ), theWireAngle( wireAngle ){ 00011 cosWireAngle = cos( wireAngle ); 00012 sinWireAngle = sin( wireAngle ); 00013 theWireOffset = yOfFirstWire * cosWireAngle; 00014 LogTrace("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 }
CSCWireGeometry* CSCSlantedWireGeometry::clone | ( | void | ) | const [inline, virtual] |
Clone to handle correct copy of component objects referenced by base class pointer.
Implements CSCWireGeometry.
Definition at line 46 of file CSCSlantedWireGeometry.h.
References CSCSlantedWireGeometry().
00046 { 00047 return new CSCSlantedWireGeometry(*this); 00048 }
int CSCSlantedWireGeometry::nearestWire | ( | const LocalPoint & | lp | ) | const [virtual] |
The nearest (virtual) wire to a given LocalPoint.
Beware that this wire might not exist or be read out!
Implements CSCWireGeometry.
Definition at line 25 of file CSCSlantedWireGeometry.cc.
References cosWireAngle, nint(), sinWireAngle, theWireOffset, CSCWireGeometry::wireSpacing(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().
00025 { 00026 // Return nearest wire number to input LocalPoint. 00027 // Beware this may not exist or be read out! 00028 00029 // rotate point to an axis perp. to wires 00030 float yprime = lp.y() * cosWireAngle - lp.x() * sinWireAngle; 00031 00032 // climb the ladder 00033 return 1 + nint( (yprime - theWireOffset) / wireSpacing() ); 00034 }
float CSCSlantedWireGeometry::wireAngle | ( | ) | const [inline, virtual] |
The angle of the wires w.r.t local x axis (in radians).
Implements CSCWireGeometry.
Definition at line 29 of file CSCSlantedWireGeometry.h.
References theWireAngle.
00029 { return theWireAngle; }
float CSCSlantedWireGeometry::yOfWire | ( | float | wire, | |
float | x = 0. | |||
) | const [virtual] |
Local y of a given wire 'number' (float) at given x.
Implements CSCWireGeometry.
Definition at line 37 of file CSCSlantedWireGeometry.cc.
References cosWireAngle, sinWireAngle, theWireOffset, and CSCWireGeometry::wireSpacing().
00037 { 00038 // Return local y of given wire, at given x 00039 00040 // y in rotated frame with y axis perpendicular to wires... 00041 float yprime = theWireOffset + (wire-1.) * wireSpacing(); 00042 // then y in usual (unrotated!) local xy frame... 00043 return ( yprime + x*sinWireAngle )/cosWireAngle; 00044 }
float CSCSlantedWireGeometry::cosWireAngle [private] |
Definition at line 52 of file CSCSlantedWireGeometry.h.
Referenced by CSCSlantedWireGeometry(), nearestWire(), and yOfWire().
float CSCSlantedWireGeometry::sinWireAngle [private] |
Definition at line 53 of file CSCSlantedWireGeometry.h.
Referenced by CSCSlantedWireGeometry(), nearestWire(), and yOfWire().
float CSCSlantedWireGeometry::theWireAngle [private] |
float CSCSlantedWireGeometry::theWireOffset [private] |
Definition at line 54 of file CSCSlantedWireGeometry.h.
Referenced by CSCSlantedWireGeometry(), nearestWire(), and yOfWire().