CMS 3D CMS Logo

Public Member Functions | Private Attributes

CSCSlantedWireGeometry Class Reference

#include <CSCSlantedWireGeometry.h>

Inheritance diagram for CSCSlantedWireGeometry:
CSCWireGeometry

List of all members.

Public Member Functions

CSCWireGeometryclone () const
 CSCSlantedWireGeometry (double wireSpacing, double yOfFirstWire, double narrow, double wide, double length, float wireAngle)
int nearestWire (const LocalPoint &lp) const
float wireAngle () const
float yOfWire (float wire, float x=0.) const
virtual ~CSCSlantedWireGeometry ()

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

virtual CSCSlantedWireGeometry::~CSCSlantedWireGeometry ( ) [inline, virtual]

Definition at line 17 of file CSCSlantedWireGeometry.h.

{}
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().

                                                                                               :
  CSCWireGeometry( wireSpacing, yOfFirstWire, narrow, wide, length ), theWireAngle( wireAngle ){
    cosWireAngle = cos( wireAngle );
    sinWireAngle = sin( wireAngle );
    theWireOffset = yOfFirstWire * cosWireAngle; 
    LogTrace("CSCWireGeometry|CSC") <<
      "CSCSlantedWireGeometry: constructed:\n" <<
      " wireSpacing = " << wireSpacing << 
      ", y1 = " << yOfFirstWire << 
      ", narrow_width = " << narrow << 
      ", wide_width = " << wide << 
      ", length = " << length << 
      ", wireAngle = " << wireAngle << 
      ", theWireOffset = " << theWireOffset;
}

Member Function Documentation

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().

                                 {
    return new CSCSlantedWireGeometry(*this);
  }
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().

                                                                  {
  // Return nearest wire number to input LocalPoint.
  // Beware this may not exist or be read out!

  // rotate point to an axis perp. to wires
  float yprime = lp.y() * cosWireAngle - lp.x() * sinWireAngle;

  // climb the ladder
  return 1 + nint( (yprime - theWireOffset) / wireSpacing() );
} 
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.

{ 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().

                                                               {
  // Return local y of given wire, at given x

  // y in rotated frame with y axis perpendicular to wires...
  float yprime = theWireOffset + (wire-1.) * wireSpacing();
  // then y in usual (unrotated!) local xy frame...
  return ( yprime + x*sinWireAngle )/cosWireAngle;
}

Member Data Documentation

Definition at line 52 of file CSCSlantedWireGeometry.h.

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

Definition at line 53 of file CSCSlantedWireGeometry.h.

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

Definition at line 51 of file CSCSlantedWireGeometry.h.

Referenced by wireAngle().

Definition at line 54 of file CSCSlantedWireGeometry.h.

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