CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
 
 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 ()
 
- 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

virtual CSCSlantedWireGeometry::~CSCSlantedWireGeometry ( )
inlinevirtual

Definition at line 17 of file CSCSlantedWireGeometry.h.

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

9  :
10  CSCWireGeometry( wireSpacing, yOfFirstWire, narrow, wide, length ), theWireAngle( wireAngle ){
14  LogTrace("CSCWireGeometry|CSC") <<
15  "CSCSlantedWireGeometry: constructed:\n" <<
16  " wireSpacing = " << wireSpacing <<
17  ", y1 = " << yOfFirstWire <<
18  ", narrow_width = " << narrow <<
19  ", wide_width = " << wide <<
20  ", length = " << length <<
21  ", wireAngle = " << wireAngle <<
22  ", theWireOffset = " << theWireOffset;
23 }
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
#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
inlinevirtual

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

46  {
47  return new CSCSlantedWireGeometry(*this);
48  }
CSCSlantedWireGeometry(double wireSpacing, double yOfFirstWire, double narrow, double wide, double length, float wireAngle)
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().

25  {
26  // Return nearest wire number to input LocalPoint.
27  // Beware this may not exist or be read out!
28 
29  // rotate point to an axis perp. to wires
30  float yprime = lp.y() * cosWireAngle - lp.x() * sinWireAngle;
31 
32  // climb the ladder
33  return 1 + nint( (yprime - theWireOffset) / wireSpacing() );
34 }
T y() const
Definition: PV3DBase.h:63
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:62
float CSCSlantedWireGeometry::wireAngle ( ) const
inlinevirtual

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.

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

37  {
38  // Return local y of given wire, at given x
39 
40  // y in rotated frame with y axis perpendicular to wires...
41  float yprime = theWireOffset + (wire-1.) * wireSpacing();
42  // then y in usual (unrotated!) local xy frame...
43  return ( yprime + x*sinWireAngle )/cosWireAngle;
44 }
double wireSpacing() const
Definition: DDAxes.h:10

Member Data Documentation

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

Definition at line 51 of file CSCSlantedWireGeometry.h.

Referenced by wireAngle().

float CSCSlantedWireGeometry::theWireOffset
private

Definition at line 54 of file CSCSlantedWireGeometry.h.

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