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::~CSCWireTopology ( )
override

Definition at line 16 of file CSCWireTopology.cc.

16  {
17  delete theWireGrouping;
18  delete theWireGeometry;
19 }
CSCWireGrouping * theWireGrouping
CSCWireGeometry * theWireGeometry

◆ CSCWireTopology() [1/2]

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, angle_units::operators::convertDegToRad(), angle_units::operators::convertMmToCm(), CSCWireGroupPackage::lengthOfWirePlane, LogTrace, CSCWireGroupPackage::narrowWidthOfWirePlane, CSCWireGroupPackage::numberOfGroups, theWireGeometry, theWireGrouping, CSCWireGroupPackage::wideWidthOfWirePlane, CSCWireGroupPackage::wiresInEachGroup, CSCWireGroupPackage::wireSpacing, and wireSpacing().

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

◆ CSCWireTopology() [2/2]

CSCWireTopology::CSCWireTopology ( const CSCWireTopology mewt)

Copy constructor

Definition at line 53 of file CSCWireTopology.cc.

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

55  if (mewt.theWireGrouping)
57  else
58  theWireGrouping = nullptr;
59  if (mewt.theWireGeometry)
61  else
62  theWireGeometry = nullptr;
63 }
virtual CSCWireGeometry * clone() const =0
double theAlignmentPinToFirstWire
CSCWireGrouping * theWireGrouping
virtual CSCWireGrouping * clone() const =0
CSCWireGeometry * theWireGeometry

Member Function Documentation

◆ channel()

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

References watchdog::group, CSCWireGeometry::nearestWire(), AlCaHLTBitMon_ParallelJobs::p, theWireGeometry, theWireGrouping, nano_mu_digi_cff::wire, and CSCWireGrouping::wireGroup().

108  {
111  return group; // 0 means out of range or dead region
112 }
virtual int wireGroup(int wire) const =0
CSCWireGrouping * theWireGrouping
virtual int nearestWire(const LocalPoint &lp) const =0
CSCWireGeometry * theWireGeometry

◆ equationOfWire()

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

References CSCWireGeometry::equationOfWire(), theWireGeometry, and nano_mu_digi_cff::wire.

Referenced by CSCLayerGeometry::intersectionOfStripAndWire().

131  {
133 }
std::pair< float, float > equationOfWire(float wire) const
CSCWireGeometry * theWireGeometry

◆ extentOfWirePlane()

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 155 of file CSCWireTopology.h.

References numberOfWires(), and wireSpacing().

155 { return wireSpacing() * (numberOfWires() - 1); }
double wireSpacing() const
int numberOfWires() const override

◆ insideYOfWirePlane()

bool CSCWireTopology::insideYOfWirePlane ( float  y) const

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

Definition at line 148 of file CSCWireTopology.cc.

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

Referenced by CSCLayerGeometry::intersectionOfStripAndWire().

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

◆ lengthOfPlane()

double CSCWireTopology::lengthOfPlane ( ) const
inline

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

Definition at line 96 of file CSCWireTopology.h.

References CSCWireGeometry::lengthOfPlane(), and theWireGeometry.

Referenced by MuCSCTnPFlatTableProducer::GetEdgeAndDistToGap(), and TrackDetectorAssociator::getTAMuonChamberMatches().

96 { return theWireGeometry->lengthOfPlane(); }
double lengthOfPlane() const
CSCWireGeometry * theWireGeometry

◆ localError()

LocalError CSCWireTopology::localError ( const MeasurementPoint ,
const MeasurementError  
) const
overridevirtual

Implements Topology.

Definition at line 90 of file CSCWireTopology.cc.

90  {
91  edm::LogWarning("CSC") << "CSCWireTopology: localError unimplemented. Don't use it."
92  << "\n";
93  return LocalError();
94 }
Log< level::Warning, false > LogWarning

◆ localPosition()

LocalPoint CSCWireTopology::localPosition ( const MeasurementPoint ) const
overridevirtual

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

Implements Topology.

Definition at line 84 of file CSCWireTopology.cc.

84  {
85  edm::LogWarning("CSC") << "CSCWireTopology: localPosition unimplemented. Don't use it."
86  << "\n";
87  return LocalPoint();
88 }
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
Log< level::Warning, false > LogWarning

◆ measurementError()

MeasurementError CSCWireTopology::measurementError ( const LocalPoint ,
const LocalError  
) const
overridevirtual

Implements Topology.

Definition at line 102 of file CSCWireTopology.cc.

102  {
103  edm::LogWarning("CSC") << "CSCWireTopology: measurementError unimplemented. Don't use it."
104  << "\n";
105  return MeasurementError();
106 }
Log< level::Warning, false > LogWarning

◆ measurementPosition()

MeasurementPoint CSCWireTopology::measurementPosition ( const LocalPoint ) const
overridevirtual

Implements Topology.

Definition at line 96 of file CSCWireTopology.cc.

96  {
97  edm::LogWarning("CSC") << "CSCWireTopology: measurementPosition unimplemented. Don't use it."
98  << "\n";
99  return MeasurementPoint();
100 }
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
Log< level::Warning, false > LogWarning

◆ middleWireOfGroup()

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 131 of file CSCWireTopology.h.

References CSCWireGrouping::middleWireOfGroup(), theWireGrouping, and wireGroup().

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

CSCWireGrouping * theWireGrouping
virtual float middleWireOfGroup(int wireGroup) const =0
int wireGroup(int wire) const

◆ narrowWidthOfPlane()

double CSCWireTopology::narrowWidthOfPlane ( ) const
inline

Width of wire plane at narrow end of trapezoid

Definition at line 86 of file CSCWireTopology.h.

References CSCWireGeometry::narrowWidthOfPlane(), and theWireGeometry.

Referenced by MuCSCTnPFlatTableProducer::GetEdgeAndDistToGap(), and TrackDetectorAssociator::getTAMuonChamberMatches().

double narrowWidthOfPlane() const
CSCWireGeometry * theWireGeometry

◆ nearestWire()

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 76 of file CSCWireTopology.h.

References CSCWireGeometry::nearestWire(), and theWireGeometry.

Referenced by CSCLayerGeometry::nearestWire().

76 { return theWireGeometry->nearestWire(lp); }
virtual int nearestWire(const LocalPoint &lp) const =0
CSCWireGeometry * theWireGeometry

◆ numberOfWireGroups()

int CSCWireTopology::numberOfWireGroups ( ) const
inline

How many wire groups

Definition at line 113 of file CSCWireTopology.h.

References CSCWireGrouping::numberOfWireGroups(), and theWireGrouping.

Referenced by CSCLayerGeometry::numberOfWireGroups().

113 { return theWireGrouping->numberOfWireGroups(); }
CSCWireGrouping * theWireGrouping
virtual int numberOfWireGroups() const =0

◆ numberOfWires()

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 108 of file CSCWireTopology.h.

References CSCWireGrouping::numberOfWires(), and theWireGrouping.

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

108 { return theWireGrouping->numberOfWires(); }
CSCWireGrouping * theWireGrouping
virtual int numberOfWires() const =0

◆ numberOfWiresPerGroup()

int CSCWireTopology::numberOfWiresPerGroup ( int  wireGroup) const
inline

How many wires in a wiregroup

Definition at line 118 of file CSCWireTopology.h.

References CSCWireGrouping::numberOfWiresPerGroup(), theWireGrouping, and wireGroup().

Referenced by CSCLayerGeometry::numberOfWiresPerGroup().

virtual int numberOfWiresPerGroup(int wireGroup) const =0
CSCWireGrouping * theWireGrouping
int wireGroup(int wire) const

◆ operator=()

CSCWireTopology & CSCWireTopology::operator= ( const CSCWireTopology mewt)

Assignment op

Definition at line 65 of file CSCWireTopology.cc.

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

65  {
66  if (&mewt != this) {
67  delete theWireGrouping;
68  if (mewt.theWireGrouping)
70  else
71  theWireGrouping = nullptr;
72 
73  delete theWireGeometry;
74  if (mewt.theWireGeometry)
76  else
77  theWireGeometry = nullptr;
78 
80  }
81  return *this;
82 }
virtual CSCWireGeometry * clone() const =0
double theAlignmentPinToFirstWire
CSCWireGrouping * theWireGrouping
virtual CSCWireGrouping * clone() const =0
CSCWireGeometry * theWireGeometry

◆ restrictToYOfWirePlane()

float CSCWireTopology::restrictToYOfWirePlane ( float  y) const

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

Definition at line 135 of file CSCWireTopology.cc.

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

Referenced by CSCLayerGeometry::intersectionOfStripAndWire().

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

◆ wideWidthOfPlane()

double CSCWireTopology::wideWidthOfPlane ( ) const
inline

Width of wire plane at wide end of trapezoid

Definition at line 91 of file CSCWireTopology.h.

References theWireGeometry, and CSCWireGeometry::wideWidthOfPlane().

Referenced by MuCSCTnPFlatTableProducer::GetEdgeAndDistToGap(), and TrackDetectorAssociator::getTAMuonChamberMatches().

91 { return theWireGeometry->wideWidthOfPlane(); }
double wideWidthOfPlane() const
CSCWireGeometry * theWireGeometry

◆ wireAngle()

float CSCWireTopology::wireAngle ( ) const
inlineoverridevirtual

◆ wireEnds()

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 162 of file CSCWireTopology.h.

References theWireGeometry, nano_mu_digi_cff::wire, and CSCWireGeometry::wireEnds().

162 { return theWireGeometry->wireEnds(wire); }
std::pair< LocalPoint, LocalPoint > wireEnds(float wire) const
CSCWireGeometry * theWireGeometry

◆ wireGroup()

int CSCWireTopology::wireGroup ( int  wire) const
inline

Wire group containing a given wire

Definition at line 123 of file CSCWireTopology.h.

References theWireGrouping, nano_mu_digi_cff::wire, and CSCWireGrouping::wireGroup().

Referenced by middleWireOfGroup(), numberOfWiresPerGroup(), CSCLayerGeometry::wireGroup(), yOfWireGroup(), and yResolution().

123 { return theWireGrouping->wireGroup(wire); }
virtual int wireGroup(int wire) const =0
CSCWireGrouping * theWireGrouping

◆ wirePitch()

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 65 of file CSCWireTopology.h.

References wireSpacing().

Referenced by CSCLayerGeometry::wirePitch().

65 { return static_cast<float>(wireSpacing()); }
double wireSpacing() const

◆ wireSpacing()

double CSCWireTopology::wireSpacing ( ) const
inline

◆ wireValues()

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 167 of file CSCWireTopology.h.

References theWireGeometry, nano_mu_digi_cff::wire, and CSCWireGeometry::wireValues().

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

167 { return theWireGeometry->wireValues(wire); }
std::vector< float > wireValues(float wire) const
CSCWireGeometry * theWireGeometry

◆ yOfWire()

float CSCWireTopology::yOfWire ( float  wire,
float  x = 0. 
) const
inline

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

Definition at line 81 of file CSCWireTopology.h.

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

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

81 { return theWireGeometry->yOfWire(wire, x); }
virtual float yOfWire(float wire, float x=0.) const =0
CSCWireGeometry * theWireGeometry

◆ yOfWireGroup()

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

References middleWireOfGroup(), theWireGeometry, nano_mu_digi_cff::wire, wireGroup(), x, and CSCWireGeometry::yOfWire().

Referenced by CSCLayerGeometry::yOfWireGroup().

114  {
116  return theWireGeometry->yOfWire(wire, x);
117 }
float middleWireOfGroup(int wireGroup) const
virtual float yOfWire(float wire, float x=0.) const =0
int wireGroup(int wire) const
CSCWireGeometry * theWireGeometry

◆ yResolution()

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

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

Referenced by CSCLayerGeometry::yResolution().

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

Member Data Documentation

◆ theAlignmentPinToFirstWire

double CSCWireTopology::theAlignmentPinToFirstWire
private

Definition at line 190 of file CSCWireTopology.h.

Referenced by operator=().

◆ theWireGeometry

CSCWireGeometry* CSCWireTopology::theWireGeometry
private

◆ theWireGrouping

CSCWireGrouping* CSCWireTopology::theWireGrouping
private