CMS 3D CMS Logo

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

#include <CSCWireTopology.h>

Inheritance diagram for CSCWireTopology:
WireTopology Topology

Public Member Functions

int channel (const LocalPoint &p) const override
 
 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
 
LocalError localError (const MeasurementPoint &, const MeasurementError &) const override
 
LocalPoint localPosition (const MeasurementPoint &) const override
 
MeasurementError measurementError (const LocalPoint &, const LocalError &) const override
 
MeasurementPoint measurementPosition (const LocalPoint &) const override
 
float middleWireOfGroup (int wireGroup) const
 
double narrowWidthOfPlane () const
 
int nearestWire (const LocalPoint &lp) const override
 
int numberOfWireGroups () const
 
int numberOfWires () const override
 
int numberOfWiresPerGroup (int wireGroup) const
 
CSCWireTopologyoperator= (const CSCWireTopology &)
 
float restrictToYOfWirePlane (float y) const
 
double wideWidthOfPlane () const
 
float wireAngle () const override
 
std::pair< LocalPoint, LocalPointwireEnds (float wire) const
 
int wireGroup (int wire) const
 
float wirePitch () const override
 
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
 
 ~CSCWireTopology () override
 
- Public Member Functions inherited from WireTopology
 ~WireTopology () override
 
- 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, LocalTagLocal2DPoint
 
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 ( )
override

Definition at line 16 of file CSCWireTopology.cc.

16  {
17  delete theWireGrouping;
18  delete theWireGeometry;
19 }
CSCWireGrouping * theWireGrouping
CSCWireGeometry * theWireGeometry
CSCWireTopology::CSCWireTopology ( const CSCWireGroupPackage wg,
double  yOfFirstWire,
float  wireAngleInDegrees 
)

Constructor from endcap muon CSC wire geometry specs

Definition at line 21 of file CSCWireTopology.cc.

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

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

Copy constructor

Definition at line 60 of file CSCWireTopology.cc.

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

60  :
63  else theWireGrouping = nullptr;
65  else theWireGeometry = nullptr;
66 
67 }
double theAlignmentPinToFirstWire
CSCWireGrouping * theWireGrouping
virtual CSCWireGeometry * clone() const =0
virtual CSCWireGrouping * clone() const =0
CSCWireGeometry * theWireGeometry

Member Function Documentation

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

'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 112 of file CSCWireTopology.cc.

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

112  {
113  int wire = theWireGeometry->nearestWire( p );
114  int group = theWireGrouping->wireGroup( wire );
115  return group; // 0 means out of range or dead region
116 }
CSCWireGrouping * theWireGrouping
virtual int wireGroup(int wire) const =0
CSCWireGeometry * theWireGeometry
virtual int nearestWire(const LocalPoint &lp) const =0
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 135 of file CSCWireTopology.cc.

References CSCWireGeometry::equationOfWire(), and theWireGeometry.

Referenced by CSCLayerGeometry::intersectionOfStripAndWire(), and wireValues().

135  {
136  return theWireGeometry->equationOfWire( wire );
137 }
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 override
bool CSCWireTopology::insideYOfWirePlane ( float  y) const

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

Definition at line 153 of file CSCWireTopology.cc.

References theWireGeometry, and CSCWireGeometry::yLimitsOfWirePlane().

Referenced by CSCLayerGeometry::intersectionOfStripAndWire(), and wireValues().

153  {
154  // Returns true if arg falls within y limits of wire plane; false otherwise.
155 
156  std::pair<float, float> ylim = theWireGeometry->yLimitsOfWirePlane();
157 
158  if ( y < ylim.first ) {
159  return false;
160  }
161  else if ( y > ylim.second ) {
162  return false;
163  }
164  return true;
165 }
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
overridevirtual

Implements Topology.

Definition at line 94 of file CSCWireTopology.cc.

95  {
96  edm::LogWarning("CSC") << "CSCWireTopology: localError unimplemented. Don't use it." << "\n";
97  return LocalError();
98 }
LocalPoint CSCWireTopology::localPosition ( const MeasurementPoint ) const
overridevirtual

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

Implements Topology.

Definition at line 89 of file CSCWireTopology.cc.

89  {
90  edm::LogWarning("CSC") << "CSCWireTopology: localPosition unimplemented. Don't use it." << "\n";
91  return LocalPoint();
92 }
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:32
MeasurementError CSCWireTopology::measurementError ( const LocalPoint ,
const LocalError  
) const
overridevirtual

Implements Topology.

Definition at line 106 of file CSCWireTopology.cc.

107  {
108  edm::LogWarning("CSC") << "CSCWireTopology: measurementError unimplemented. Don't use it." << "\n";
109  return MeasurementError();
110 }
MeasurementPoint CSCWireTopology::measurementPosition ( const LocalPoint ) const
overridevirtual

Implements Topology.

Definition at line 100 of file CSCWireTopology.cc.

101  {
102  edm::LogWarning("CSC") << "CSCWireTopology: measurementPosition unimplemented. Don't use it." << "\n";
103  return MeasurementPoint();
104 }
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(), theWireGrouping, wireGroup(), x, yOfWireGroup(), and yResolution().

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

148  {
CSCWireGrouping * theWireGrouping
int wireGroup(int wire) const
virtual float middleWireOfGroup(int wireGroup) const =0
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
inlineoverridevirtual

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 ); }
CSCWireGeometry * theWireGeometry
virtual int nearestWire(const LocalPoint &lp) const =0
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
inlineoverridevirtual

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  {
CSCWireGrouping * theWireGrouping
int wireGroup(int wire) const
virtual int numberOfWiresPerGroup(int wireGroup) const =0
CSCWireTopology & CSCWireTopology::operator= ( const CSCWireTopology mewt)

Assignment op

Definition at line 69 of file CSCWireTopology.cc.

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

69  {
70  if ( &mewt != this ) {
71  delete theWireGrouping;
72  if ( mewt.theWireGrouping )
74  else
75  theWireGrouping = nullptr;
76 
77  delete theWireGeometry;
78  if ( mewt.theWireGeometry )
80  else
81  theWireGeometry = nullptr;
82 
84 
85  }
86  return *this;
87 }
double theAlignmentPinToFirstWire
CSCWireGrouping * theWireGrouping
virtual CSCWireGeometry * clone() const =0
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 139 of file CSCWireTopology.cc.

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

Referenced by CSCLayerGeometry::intersectionOfStripAndWire(), and wireValues().

139  {
140  // Reset y to lie within bounds of wire plane at top and bottom.
141 
142  std::pair<float, float> ylim = theWireGeometry->yLimitsOfWirePlane();
143 
144  if ( y < ylim.first ) {
145  y = ylim.first;
146  }
147  else if ( y > ylim.second ) {
148  y = ylim.second;
149  }
150  return y;
151 }
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
inlineoverridevirtual

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 middleWireOfGroup(), and CSCLayerGeometry::wireGroup().

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

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 equationOfWire(), insideYOfWirePlane(), restrictToYOfWirePlane(), theWireGeometry, CSCWireGeometry::wireValues(), and y.

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 118 of file CSCWireTopology.cc.

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

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

118  {
119  float wire = middleWireOfGroup( wireGroup );
120  return theWireGeometry->yOfWire( wire, x );
121 }
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 123 of file CSCWireTopology.cc.

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

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

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

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