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

Definition at line 17 of file CSCSlantedWireGeometry.h.

17 {}

◆ CSCSlantedWireGeometry()

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.

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 }

References funct::cos(), cosWireAngle, LogTrace, funct::sin(), sinWireAngle, theWireOffset, wireAngle(), CSCWireGeometry::wireSpacing(), and CSCWireGeometry::yOfFirstWire().

Referenced by clone().

Member Function Documentation

◆ clone()

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.

45 { return new CSCSlantedWireGeometry(*this); }

References CSCSlantedWireGeometry().

◆ nearestWire()

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.

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 }

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

◆ wireAngle()

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.

28 { return theWireAngle; }

References theWireAngle.

Referenced by CSCSlantedWireGeometry().

◆ yOfWire()

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.

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 }

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

Member Data Documentation

◆ cosWireAngle

float CSCSlantedWireGeometry::cosWireAngle
private

Definition at line 49 of file CSCSlantedWireGeometry.h.

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

◆ sinWireAngle

float CSCSlantedWireGeometry::sinWireAngle
private

Definition at line 50 of file CSCSlantedWireGeometry.h.

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

◆ theWireAngle

float CSCSlantedWireGeometry::theWireAngle
private

Definition at line 48 of file CSCSlantedWireGeometry.h.

Referenced by wireAngle().

◆ theWireOffset

float CSCSlantedWireGeometry::theWireOffset
private

Definition at line 51 of file CSCSlantedWireGeometry.h.

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

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
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::CSCSlantedWireGeometry
CSCSlantedWireGeometry(double wireSpacing, double yOfFirstWire, double narrow, double wide, double length, float wireAngle)
Definition: CSCSlantedWireGeometry.cc:8
CSCSlantedWireGeometry::theWireAngle
float theWireAngle
Definition: CSCSlantedWireGeometry.h:48
CSCWireGeometry::CSCWireGeometry
CSCWireGeometry(double wireSpacing, double yOfFirstWire, double narrowWidthOfPlane, double wideWidthOfPlane, double lengthOfPlane)
Definition: CSCWireGeometry.h:24
CSCSlantedWireGeometry::wireAngle
float wireAngle() const override
Definition: CSCSlantedWireGeometry.h:28
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
CSCSlantedWireGeometry::cosWireAngle
float cosWireAngle
Definition: CSCSlantedWireGeometry.h:49
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
CSCWireGeometry::yOfFirstWire
double yOfFirstWire() const
Definition: CSCWireGeometry.h:40
CSCSlantedWireGeometry::sinWireAngle
float sinWireAngle
Definition: CSCSlantedWireGeometry.h:50