CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CSCSlantedWireGeometry Class Reference

#include <CSCSlantedWireGeometry.h>

Inheritance diagram for CSCSlantedWireGeometry:
CSCWireGeometry

Public Member Functions

CSCWireGeometryclone () const override
 
 CSCSlantedWireGeometry (double wireSpacing, double yOfFirstWire, double narrow, double wide, double length, float wireAngle)
 
int nearestWire (const LocalPoint &lp) const override
 
float wireAngle () const override
 
float yOfWire (float wire, float x=0.) const override
 
 ~CSCSlantedWireGeometry () override
 
- Public Member Functions inherited from CSCWireGeometry
 CSCWireGeometry (double wireSpacing, double yOfFirstWire, double narrowWidthOfPlane, double wideWidthOfPlane, double lengthOfPlane)
 
std::pair< float, float > equationOfWire (float wire) const
 
LocalPoint intersection (float m1, float c1, float m2, float c2) const
 
double lengthOfPlane () const
 
double narrowWidthOfPlane () const
 
double wideWidthOfPlane () const
 
std::pair< LocalPoint, LocalPointwireEnds (float wire) const
 
double wireSpacing () const
 
std::vector< float > wireValues (float wire) const
 
std::pair< float, float > yLimitsOfWirePlane () const
 
double yOfFirstWire () const
 
virtual ~CSCWireGeometry ()
 

Private Attributes

float cosWireAngle
 
float sinWireAngle
 
float theWireAngle
 
float theWireOffset
 

Detailed Description

A concrete CSCWireGeometry in which wires are slanted, i.e. they have a fixed, non-zero angle w.r.t. local x axis.

Author
Tim Cox

Definition at line 15 of file CSCSlantedWireGeometry.h.

Constructor & Destructor Documentation

CSCSlantedWireGeometry::~CSCSlantedWireGeometry ( )
inlineoverride
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(), and ~CSCSlantedWireGeometry().

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 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double wireSpacing() const
float wireAngle() const override
#define LogTrace(id)
double yOfFirstWire() const
CSCWireGeometry(double wireSpacing, double yOfFirstWire, double narrowWidthOfPlane, double wideWidthOfPlane, double lengthOfPlane)

Member Function Documentation

CSCWireGeometry* CSCSlantedWireGeometry::clone ( void  ) const
inlineoverridevirtual

Clone to handle correct copy of component objects referenced by base class pointer.

Implements CSCWireGeometry.

Definition at line 45 of file CSCSlantedWireGeometry.h.

References CSCSlantedWireGeometry().

45 { return new CSCSlantedWireGeometry(*this); }
CSCSlantedWireGeometry(double wireSpacing, double yOfFirstWire, double narrow, double wide, double length, float wireAngle)
int CSCSlantedWireGeometry::nearestWire ( const LocalPoint lp) const
overridevirtual

The nearest (virtual) wire to a given LocalPoint. Beware that this wire might not exist or be read out!

Implements CSCWireGeometry.

Definition at line 21 of file CSCSlantedWireGeometry.cc.

References cosWireAngle, nint(), sinWireAngle, theWireOffset, CSCWireGeometry::wireSpacing(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by wireAngle().

21  {
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 }
T y() const
Definition: PV3DBase.h:60
double wireSpacing() const
int nint(float a)
Return the nearest integer - analogous to the FORTRAN intrinsic NINT.
Definition: nint.h:8
T x() const
Definition: PV3DBase.h:59
float CSCSlantedWireGeometry::wireAngle ( ) const
inlineoverridevirtual

The angle of the wires w.r.t local x axis (in radians)

Implements CSCWireGeometry.

Definition at line 28 of file CSCSlantedWireGeometry.h.

References nearestWire(), theWireAngle, x, and yOfWire().

Referenced by ~CSCSlantedWireGeometry().

float CSCSlantedWireGeometry::yOfWire ( float  wire,
float  x = 0. 
) const
overridevirtual

Local y of a given wire 'number' (float) at given x

Implements CSCWireGeometry.

Definition at line 32 of file CSCSlantedWireGeometry.cc.

References cosWireAngle, sinWireAngle, theWireOffset, and CSCWireGeometry::wireSpacing().

Referenced by wireAngle().

32  {
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 }
double wireSpacing() const

Member Data Documentation

float CSCSlantedWireGeometry::cosWireAngle
private

Definition at line 49 of file CSCSlantedWireGeometry.h.

Referenced by CSCSlantedWireGeometry(), nearestWire(), and yOfWire().

float CSCSlantedWireGeometry::sinWireAngle
private

Definition at line 50 of file CSCSlantedWireGeometry.h.

Referenced by CSCSlantedWireGeometry(), nearestWire(), and yOfWire().

float CSCSlantedWireGeometry::theWireAngle
private

Definition at line 48 of file CSCSlantedWireGeometry.h.

Referenced by wireAngle().

float CSCSlantedWireGeometry::theWireOffset
private

Definition at line 51 of file CSCSlantedWireGeometry.h.

Referenced by CSCSlantedWireGeometry(), nearestWire(), and yOfWire().