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
CSCWireTopology Class Reference

#include <CSCWireTopology.h>

Inheritance diagram for CSCWireTopology:
WireTopology Topology

Public Member Functions

virtual int channel (const LocalPoint &p) const
 
 CSCWireTopology (const CSCWireGroupPackage &wg, double yOfFirstWire, float wireAngleInDegrees)
 
 CSCWireTopology (const CSCWireTopology &)
 
std::pair< float, float > equationOfWire (float wire) const
 
double extentOfWirePlane () const
 
bool insideYOfWirePlane (float y) const
 
double lengthOfPlane () const
 
virtual LocalError localError (const MeasurementPoint &, const MeasurementError &) const
 
virtual LocalPoint localPosition (const MeasurementPoint &) const
 
virtual MeasurementError measurementError (const LocalPoint &, const LocalError &) const
 
virtual MeasurementPoint measurementPosition (const LocalPoint &) const
 
float middleWireOfGroup (int wireGroup) const
 
double narrowWidthOfPlane () const
 
int nearestWire (const LocalPoint &lp) const
 
int numberOfWireGroups () const
 
int numberOfWires () const
 
int numberOfWiresPerGroup (int wireGroup) const
 
CSCWireTopologyoperator= (const CSCWireTopology &)
 
float restrictToYOfWirePlane (float y) const
 
double wideWidthOfPlane () const
 
float wireAngle () const
 
std::pair< LocalPoint, LocalPointwireEnds (float wire) const
 
int wireGroup (int wire) const
 
float wirePitch () const
 
double wireSpacing () const
 
std::vector< float > wireValues (float wire) const
 
float yOfWire (float wire, float x=0.) const
 
float yOfWireGroup (int wireGroup, float x=0.) const
 
float yResolution (int wireGroup=1) const
 
virtual ~CSCWireTopology ()
 
- Public Member Functions inherited from WireTopology
virtual ~WireTopology ()
 
- Public Member Functions inherited from Topology
virtual int channel (const LocalPoint &lp, const LocalTrackAngles &) const
 conversion taking also the angle from the track state More...
 
virtual LocalError localError (const MeasurementPoint &mp, const MeasurementError &me, const LocalTrackPred &) const
 conversion taking also the angle from the predicted track state More...
 
virtual LocalPoint localPosition (const MeasurementPoint &mp, const LocalTrackPred &) const
 conversion taking also the angle from the predicted track state More...
 
virtual MeasurementError measurementError (const LocalPoint &lp, const LocalError &le, const LocalTrackAngles &) const
 conversion taking also the angle from the track state More...
 
virtual MeasurementPoint measurementPosition (const LocalPoint &lp, const LocalTrackAngles &) const
 conversion taking also the angle from the track state More...
 
virtual ~Topology ()
 

Private Attributes

double theAlignmentPinToFirstWire
 
CSCWireGeometrytheWireGeometry
 
CSCWireGroupingtheWireGrouping
 

Additional Inherited Members

- Public Types inherited from Topology
typedef Point2DBase< double,
LocalTag
Local2DPoint
 
typedef Vector2D::MathVector MathVector2D
 
typedef Basic2DVector< double > Vector2D
 

Detailed Description

A concrete class derived from WireTopology, to handle wire (group) geometry functionality for endcap muon CSCs.

Author
Tim Cox

Definition at line 18 of file CSCWireTopology.h.

Constructor & Destructor Documentation

CSCWireTopology::~CSCWireTopology ( )
virtual

Definition at line 13 of file CSCWireTopology.cc.

References theWireGeometry, and theWireGrouping.

13  {
14  delete theWireGrouping;
15  delete theWireGeometry;
16 }
CSCWireGrouping * theWireGrouping
CSCWireGeometry * theWireGeometry
CSCWireTopology::CSCWireTopology ( const CSCWireGroupPackage wg,
double  yOfFirstWire,
float  wireAngleInDegrees 
)

Constructor from endcap muon CSC wire geometry specs

Definition at line 18 of file CSCWireTopology.cc.

References CSCWireGroupPackage::consecutiveGroups, CSCWireGroupPackage::lengthOfWirePlane, LogTrace, CSCWireGroupPackage::narrowWidthOfWirePlane, CSCWireGroupPackage::numberOfGroups, theWireGeometry, theWireGrouping, CSCWireGroupPackage::wideWidthOfWirePlane, CSCWireGroupPackage::wiresInEachGroup, CSCWireGroupPackage::wireSpacing, and wireSpacing().

21  :
24 
25  // Pass consecutiveGroups and wiresInConsecutiveGroups
26  // directly on to theWireGrouping ctor. These vectors
27  // are transient info and can go once ctor is complete.
28 
31 
32  const float zeroprecision = 1.E-06; // blur zero a bit, for comparisons
33 
34  float wireAngleInRadians = wireAngleInDegrees*degree;
35 
36  //@@ Conversion from mm to cm
37  float wireSpacing = wg.wireSpacing / 10.; // in cm
38  float nw = wg.narrowWidthOfWirePlane / 10.; // in cm
39  float ww = wg.wideWidthOfWirePlane / 10.; // in cm
40  float lw = wg.lengthOfWirePlane / 10.; // in cm
41 
42  LogTrace("CSCWireTopology|CSC") <<
43  "CSCWireTopology constructing CSCWireGeometry with:\n" <<
44  " wireSpacing = " << wireSpacing*10. << " (mm) " <<
45  ", yOfFirstWire = " << yOfFirstWire << " (cm) " <<
46  ", wireAngle = " << wireAngleInDegrees << " (deg) = " << wireAngleInRadians << " (rads)" <<
47  ", extent: n, w, l = " << nw << ", " << ww << ", " << lw << " (cm)";
48 
49  if ( fabs(wireAngleInDegrees) > zeroprecision ) {
50  theWireGeometry = new CSCSlantedWireGeometry( wireSpacing, yOfFirstWire, nw, ww, lw, wireAngleInRadians );
51  }
52  else {
53  theWireGeometry = new CSCNonslantedWireGeometry( wireSpacing, yOfFirstWire, nw, ww, lw );
54  }
55 }
double theAlignmentPinToFirstWire
CSCWireGrouping * theWireGrouping
double wireSpacing() const
#define LogTrace(id)
CSCWireGeometry * theWireGeometry
CSCWireTopology::CSCWireTopology ( const CSCWireTopology mewt)

Copy constructor

Definition at line 57 of file CSCWireTopology.cc.

References CSCWireGrouping::clone(), CSCWireGeometry::clone(), theWireGeometry, and theWireGrouping.

57  :
60  else theWireGrouping = 0;
62  else theWireGeometry = 0;
63 
64 }
virtual CSCWireGeometry * clone() const =0
double theAlignmentPinToFirstWire
CSCWireGrouping * theWireGrouping
virtual CSCWireGrouping * clone() const =0
CSCWireGeometry * theWireGeometry

Member Function Documentation

int CSCWireTopology::channel ( const LocalPoint p) const
virtual

'channel' is wire group number from 1 to no. of groups. Return 0 if out-of-range or in a dead region

Implements Topology.

Definition at line 109 of file CSCWireTopology.cc.

References watchdog::group, CSCWireGeometry::nearestWire(), theWireGeometry, theWireGrouping, and CSCWireGrouping::wireGroup().

109  {
110  int wire = theWireGeometry->nearestWire( p );
111  int group = theWireGrouping->wireGroup( wire );
112  return group; // 0 means out of range or dead region
113 }
virtual int wireGroup(int wire) const =0
CSCWireGrouping * theWireGrouping
virtual int nearestWire(const LocalPoint &lp) const =0
tuple group
Definition: watchdog.py:82
CSCWireGeometry * theWireGeometry
std::pair< float, float > CSCWireTopology::equationOfWire ( float  wire) const

Return slope and intercept of straight line representing a wire in 2-dim local coordinates.

The return value is a pair p with p.first = m, p.second = c, where y=mx+c.

Definition at line 132 of file CSCWireTopology.cc.

References CSCWireGeometry::equationOfWire(), and theWireGeometry.

Referenced by CSCLayerGeometry::intersectionOfStripAndWire().

132  {
133  return theWireGeometry->equationOfWire( wire );
134 }
std::pair< float, float > equationOfWire(float wire) const
CSCWireGeometry * theWireGeometry
double CSCWireTopology::extentOfWirePlane ( ) const
inline

Extent of wire plane (width normal to wire direction).
Note that for ME11 this distance is not along local y!
cf. lengthOfPlane() which should be the same for all chambers but ME11.

Definition at line 173 of file CSCWireTopology.h.

References numberOfWires(), and wireSpacing().

173  {
174  return wireSpacing() * (numberOfWires() - 1) ; }
double wireSpacing() const
int numberOfWires() const
bool CSCWireTopology::insideYOfWirePlane ( float  y) const

Returns true if arg falls within y limits of wire plane; false otherwise.

Definition at line 150 of file CSCWireTopology.cc.

References theWireGeometry, and CSCWireGeometry::yLimitsOfWirePlane().

Referenced by CSCLayerGeometry::intersectionOfStripAndWire().

150  {
151  // Returns true if arg falls within y limits of wire plane; false otherwise.
152 
153  std::pair<float, float> ylim = theWireGeometry->yLimitsOfWirePlane();
154 
155  if ( y < ylim.first ) {
156  return false;
157  }
158  else if ( y > ylim.second ) {
159  return false;
160  }
161  return true;
162 }
std::pair< float, float > yLimitsOfWirePlane() const
CSCWireGeometry * theWireGeometry
double CSCWireTopology::lengthOfPlane ( ) const
inline

Length/height of wire plane along long axis of trapezoid (local y direction)

Definition at line 107 of file CSCWireTopology.h.

References CSCWireGeometry::lengthOfPlane(), and theWireGeometry.

Referenced by TrackDetectorAssociator::getTAMuonChamberMatches().

107  {
108  return theWireGeometry->lengthOfPlane(); }
double lengthOfPlane() const
CSCWireGeometry * theWireGeometry
LocalError CSCWireTopology::localError ( const MeasurementPoint ,
const MeasurementError  
) const
virtual

Implements Topology.

Definition at line 91 of file CSCWireTopology.cc.

92  {
93  edm::LogWarning("CSC") << "CSCWireTopology: localError unimplemented. Don't use it." << "\n";
94  return LocalError();
95 }
LocalPoint CSCWireTopology::localPosition ( const MeasurementPoint ) const
virtual

Topology interface, but not implemented for CSCWireTopology (yet!)

Implements Topology.

Definition at line 86 of file CSCWireTopology.cc.

86  {
87  edm::LogWarning("CSC") << "CSCWireTopology: localPosition unimplemented. Don't use it." << "\n";
88  return LocalPoint();
89 }
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
MeasurementError CSCWireTopology::measurementError ( const LocalPoint ,
const LocalError  
) const
virtual

Implements Topology.

Definition at line 103 of file CSCWireTopology.cc.

104  {
105  edm::LogWarning("CSC") << "CSCWireTopology: measurementError unimplemented. Don't use it." << "\n";
106  return MeasurementError();
107 }
MeasurementPoint CSCWireTopology::measurementPosition ( const LocalPoint ) const
virtual

Implements Topology.

Definition at line 97 of file CSCWireTopology.cc.

98  {
99  edm::LogWarning("CSC") << "CSCWireTopology: measurementPosition unimplemented. Don't use it." << "\n";
100  return MeasurementPoint();
101 }
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
float CSCWireTopology::middleWireOfGroup ( int  wireGroup) const
inline

Middle of wire-group. This is the central wire no. for a group with an odd no. of wires. This is a pseudo-wire no. for a group with an even no. of wires. Accordingly, it is non-integer.

Definition at line 148 of file CSCWireTopology.h.

References CSCWireGrouping::middleWireOfGroup(), and theWireGrouping.

Referenced by CSCLayerGeometry::middleWireOfGroup(), and yOfWireGroup().

148  {
CSCWireGrouping * theWireGrouping
virtual float middleWireOfGroup(int wireGroup) const =0
int wireGroup(int wire) const
double CSCWireTopology::narrowWidthOfPlane ( ) const
inline

Width of wire plane at narrow end of trapezoid

Definition at line 95 of file CSCWireTopology.h.

References CSCWireGeometry::narrowWidthOfPlane(), and theWireGeometry.

Referenced by TrackDetectorAssociator::getTAMuonChamberMatches().

95  {
double narrowWidthOfPlane() const
CSCWireGeometry * theWireGeometry
int CSCWireTopology::nearestWire ( const LocalPoint lp) const
inlinevirtual

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

Implements WireTopology.

Definition at line 83 of file CSCWireTopology.h.

References CSCWireGeometry::nearestWire(), and theWireGeometry.

Referenced by CSCLayerGeometry::nearestWire().

83  {
84  return theWireGeometry->nearestWire( lp ); }
virtual int nearestWire(const LocalPoint &lp) const =0
CSCWireGeometry * theWireGeometry
int CSCWireTopology::numberOfWireGroups ( ) const
inline

How many wire groups

Definition at line 127 of file CSCWireTopology.h.

References CSCWireGrouping::numberOfWireGroups(), and theWireGrouping.

Referenced by CSCLayerGeometry::numberOfWireGroups().

127  {
CSCWireGrouping * theWireGrouping
virtual int numberOfWireGroups() const =0
int CSCWireTopology::numberOfWires ( ) const
inlinevirtual

Wire group interface Total number of (virtual) wires. Some wires may not be implemented in the hardware. This is the number which would fill the region covered by wires, assuming the constant wire spacing.

Implements WireTopology.

Definition at line 121 of file CSCWireTopology.h.

References CSCWireGrouping::numberOfWires(), and theWireGrouping.

Referenced by extentOfWirePlane(), and CSCLayerGeometry::numberOfWires().

121  {
122  return theWireGrouping->numberOfWires(); }
CSCWireGrouping * theWireGrouping
virtual int numberOfWires() const =0
int CSCWireTopology::numberOfWiresPerGroup ( int  wireGroup) const
inline

How many wires in a wiregroup

Definition at line 133 of file CSCWireTopology.h.

References CSCWireGrouping::numberOfWiresPerGroup(), and theWireGrouping.

Referenced by CSCLayerGeometry::numberOfWiresPerGroup().

133  {
virtual int numberOfWiresPerGroup(int wireGroup) const =0
CSCWireGrouping * theWireGrouping
int wireGroup(int wire) const
CSCWireTopology & CSCWireTopology::operator= ( const CSCWireTopology mewt)

Assignment op

Definition at line 66 of file CSCWireTopology.cc.

References CSCWireGrouping::clone(), CSCWireGeometry::clone(), theAlignmentPinToFirstWire, theWireGeometry, and theWireGrouping.

66  {
67  if ( &mewt != this ) {
68  delete theWireGrouping;
69  if ( mewt.theWireGrouping )
71  else
72  theWireGrouping = 0;
73 
74  delete theWireGeometry;
75  if ( mewt.theWireGeometry )
77  else
78  theWireGeometry = 0;
79 
81 
82  }
83  return *this;
84 }
virtual CSCWireGeometry * clone() const =0
double theAlignmentPinToFirstWire
CSCWireGrouping * theWireGrouping
virtual CSCWireGrouping * clone() const =0
CSCWireGeometry * theWireGeometry
float CSCWireTopology::restrictToYOfWirePlane ( float  y) const

Reset input y to lie within bounds of wire plane at top and bottom.

Definition at line 136 of file CSCWireTopology.cc.

References theWireGeometry, y, and CSCWireGeometry::yLimitsOfWirePlane().

Referenced by CSCLayerGeometry::intersectionOfStripAndWire().

136  {
137  // Reset y to lie within bounds of wire plane at top and bottom.
138 
139  std::pair<float, float> ylim = theWireGeometry->yLimitsOfWirePlane();
140 
141  if ( y < ylim.first ) {
142  y = ylim.first;
143  }
144  else if ( y > ylim.second ) {
145  y = ylim.second;
146  }
147  return y;
148 }
std::pair< float, float > yLimitsOfWirePlane() const
CSCWireGeometry * theWireGeometry
double CSCWireTopology::wideWidthOfPlane ( ) const
inline

Width of wire plane at wide end of trapezoid

Definition at line 101 of file CSCWireTopology.h.

References theWireGeometry, and CSCWireGeometry::wideWidthOfPlane().

Referenced by TrackDetectorAssociator::getTAMuonChamberMatches().

101  {
102  return theWireGeometry->wideWidthOfPlane(); }
double wideWidthOfPlane() const
CSCWireGeometry * theWireGeometry
float CSCWireTopology::wireAngle ( ) const
inlinevirtual

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

Implements WireTopology.

Definition at line 76 of file CSCWireTopology.h.

References theWireGeometry, and CSCWireGeometry::wireAngle().

Referenced by FWRecoGeometryESProducer::addCSCGeometry(), TrackDetectorAssociator::getTAMuonChamberMatches(), ValidateGeometry::validateCSCLayerGeometry(), and CSCLayerGeometry::wireAngle().

76  {
77  return theWireGeometry->wireAngle(); }
virtual float wireAngle() const =0
CSCWireGeometry * theWireGeometry
std::pair< LocalPoint, LocalPoint > CSCWireTopology::wireEnds ( float  wire) const
inline

Return local (x,y) coordinates of the two ends of a wire across the extent of the wire plane. The returned value is a pair of LocalPoints.

Definition at line 181 of file CSCWireTopology.h.

References theWireGeometry, and CSCWireGeometry::wireEnds().

181  {
182  return theWireGeometry->wireEnds( wire ); }
std::pair< LocalPoint, LocalPoint > wireEnds(float wire) const
CSCWireGeometry * theWireGeometry
int CSCWireTopology::wireGroup ( int  wire) const
inline

Wire group containing a given wire

Definition at line 139 of file CSCWireTopology.h.

References theWireGrouping, and CSCWireGrouping::wireGroup().

Referenced by CSCLayerGeometry::wireGroup().

139  {
140  return theWireGrouping->wireGroup( wire ); }
virtual int wireGroup(int wire) const =0
CSCWireGrouping * theWireGrouping
float CSCWireTopology::wirePitch ( ) const
inlinevirtual

The wire pitch. This is the wire spacing but old-timers like the word 'pitch'.

Implements WireTopology.

Definition at line 70 of file CSCWireTopology.h.

References wireSpacing().

Referenced by CSCLayerGeometry::wirePitch().

70  {
71  return static_cast<float>(wireSpacing()); }
double wireSpacing() const
double CSCWireTopology::wireSpacing ( ) const
inline
std::vector<float> CSCWireTopology::wireValues ( float  wire) const
inline

Return mid-point of a wire in local coordinates, and its length across the chamber volume, in a vector as x, y, length

Definition at line 187 of file CSCWireTopology.h.

References theWireGeometry, and CSCWireGeometry::wireValues().

Referenced by CSCLayerGeometry::lengthOfWireGroup(), and CSCLayerGeometry::localCenterOfWireGroup().

187  {
188  return theWireGeometry->wireValues( wire ); }
std::vector< float > wireValues(float wire) const
CSCWireGeometry * theWireGeometry
float CSCWireTopology::yOfWire ( float  wire,
float  x = 0. 
) const
inline

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

Definition at line 89 of file CSCWireTopology.h.

References theWireGeometry, x, and CSCWireGeometry::yOfWire().

Referenced by TrackDetectorAssociator::getTAMuonChamberMatches(), and CSCLayerGeometry::yOfWire().

89  {
90  return theWireGeometry->yOfWire(wire,x); }
virtual float yOfWire(float wire, float x=0.) const =0
CSCWireGeometry * theWireGeometry
float CSCWireTopology::yOfWireGroup ( int  wireGroup,
float  x = 0. 
) const

Extended interface which 'mixes' WireGrouping and WireGeometry info Local y of a given wire group at given x

Definition at line 115 of file CSCWireTopology.cc.

References middleWireOfGroup(), theWireGeometry, and CSCWireGeometry::yOfWire().

Referenced by CSCLayerGeometry::yOfWireGroup().

115  {
116  float wire = middleWireOfGroup( wireGroup );
117  return theWireGeometry->yOfWire( wire, x );
118 }
virtual float yOfWire(float wire, float x=0.) const =0
int wireGroup(int wire) const
float middleWireOfGroup(int wireGroup) const
CSCWireGeometry * theWireGeometry
float CSCWireTopology::yResolution ( int  wireGroup = 1) const

The measurement resolution from wire groups (in cm.) This approximates the measurement resolution in the local y direction but may be too small by a factor of up to 1.26 due to stripAngle contributions which are neglected here.

Definition at line 120 of file CSCWireTopology.cc.

References CSCWireGrouping::numberOfWiresPerGroup(), mathSSE::sqrt(), theWireGrouping, and wireSpacing().

Referenced by CSCLayerGeometry::yResolution().

120  {
121  // Return the resolution in the wire group measurement (in cm).
122  // To really be resolution in local y this should be scaled by Sin
123  // factors involving strip and wire angles, and also add a contribution
124  // from strip measurement (which is negligible w.r.t. wire resolution.)
125  // These factors can increase the number here by up to 1.26.
126 
127  // Should be improvable for smaller partial wire groups
128 
130 }
virtual int numberOfWiresPerGroup(int wireGroup) const =0
CSCWireGrouping * theWireGrouping
double wireSpacing() const
T sqrt(T t)
Definition: SSEVec.h:18
int wireGroup(int wire) const

Member Data Documentation

double CSCWireTopology::theAlignmentPinToFirstWire
private

Definition at line 212 of file CSCWireTopology.h.

Referenced by operator=().

CSCWireGeometry* CSCWireTopology::theWireGeometry
private
CSCWireGrouping* CSCWireTopology::theWireGrouping
private