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 }

◆ 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.

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 }

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

◆ CSCWireTopology() [2/2]

CSCWireTopology::CSCWireTopology ( const CSCWireTopology mewt)

Copy constructor

Definition at line 53 of file CSCWireTopology.cc.

55  if (mewt.theWireGrouping)
57  else
58  theWireGrouping = nullptr;
59  if (mewt.theWireGeometry)
61  else
62  theWireGeometry = nullptr;
63 }

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

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.

108  {
109  int wire = theWireGeometry->nearestWire(p);
110  int group = theWireGrouping->wireGroup(wire);
111  return group; // 0 means out of range or dead region
112 }

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

◆ 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.

131  {
132  return theWireGeometry->equationOfWire(wire);
133 }

References CSCWireGeometry::equationOfWire(), and theWireGeometry.

Referenced by CSCLayerGeometry::intersectionOfStripAndWire().

◆ 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.

155 { return wireSpacing() * (numberOfWires() - 1); }

References numberOfWires(), and wireSpacing().

◆ 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.

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 }

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

Referenced by CSCLayerGeometry::intersectionOfStripAndWire().

◆ 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.

96 { return theWireGeometry->lengthOfPlane(); }

References CSCWireGeometry::lengthOfPlane(), and theWireGeometry.

Referenced by TrackDetectorAssociator::getTAMuonChamberMatches().

◆ 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 }

◆ 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 }

◆ 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 }

◆ 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 }

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

◆ 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 TrackDetectorAssociator::getTAMuonChamberMatches().

◆ 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.

76 { return theWireGeometry->nearestWire(lp); }

References CSCWireGeometry::nearestWire(), and theWireGeometry.

Referenced by CSCLayerGeometry::nearestWire().

◆ numberOfWireGroups()

int CSCWireTopology::numberOfWireGroups ( ) const
inline

How many wire groups

Definition at line 113 of file CSCWireTopology.h.

113 { return theWireGrouping->numberOfWireGroups(); }

References CSCWireGrouping::numberOfWireGroups(), and theWireGrouping.

Referenced by CSCLayerGeometry::numberOfWireGroups().

◆ 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.

108 { return theWireGrouping->numberOfWires(); }

References CSCWireGrouping::numberOfWires(), and theWireGrouping.

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

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

◆ operator=()

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

Assignment op

Definition at line 65 of file CSCWireTopology.cc.

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 }

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

◆ 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.

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 }

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

Referenced by CSCLayerGeometry::intersectionOfStripAndWire().

◆ wideWidthOfPlane()

double CSCWireTopology::wideWidthOfPlane ( ) const
inline

Width of wire plane at wide end of trapezoid

Definition at line 91 of file CSCWireTopology.h.

91 { return theWireGeometry->wideWidthOfPlane(); }

References theWireGeometry, and CSCWireGeometry::wideWidthOfPlane().

Referenced by TrackDetectorAssociator::getTAMuonChamberMatches().

◆ 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.

162 { return theWireGeometry->wireEnds(wire); }

References theWireGeometry, and CSCWireGeometry::wireEnds().

◆ wireGroup()

int CSCWireTopology::wireGroup ( int  wire) const
inline

Wire group containing a given wire

Definition at line 123 of file CSCWireTopology.h.

123 { return theWireGrouping->wireGroup(wire); }

References theWireGrouping, and CSCWireGrouping::wireGroup().

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

◆ 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.

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

References wireSpacing().

Referenced by CSCLayerGeometry::wirePitch().

◆ 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.

167 { return theWireGeometry->wireValues(wire); }

References theWireGeometry, and CSCWireGeometry::wireValues().

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

◆ 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.

81 { return theWireGeometry->yOfWire(wire, x); }

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

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

◆ 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.

114  {
115  float wire = middleWireOfGroup(wireGroup);
116  return theWireGeometry->yOfWire(wire, x);
117 }

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

Referenced by CSCLayerGeometry::yOfWireGroup().

◆ 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.

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 }

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

Referenced by CSCLayerGeometry::yResolution().

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
DDAxes::y
CSCWireGroupPackage::lengthOfWirePlane
double lengthOfWirePlane
Definition: CSCWireGroupPackage.h:37
CSCNonslantedWireGeometry
Definition: CSCNonslantedWireGeometry.h:16
CSCWireTopology::theAlignmentPinToFirstWire
double theAlignmentPinToFirstWire
Definition: CSCWireTopology.h:190
CSCWireTopology::theWireGeometry
CSCWireGeometry * theWireGeometry
Definition: CSCWireTopology.h:188
CSCWireGeometry::clone
virtual CSCWireGeometry * clone() const =0
CSCWireGroupPackage::consecutiveGroups
Container consecutiveGroups
Definition: CSCWireGroupPackage.h:28
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
angle_units::operators::convertDegToRad
constexpr long double convertDegToRad(NumType degrees)
Definition: angle_units.h:27
CSCWireGeometry::wireSpacing
double wireSpacing() const
Definition: CSCWireGeometry.h:35
CSCWireGrouping::numberOfWireGroups
virtual int numberOfWireGroups() const =0
DDAxes::x
align::LocalPoint
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
CSCWireTopology::numberOfWires
int numberOfWires() const override
Definition: CSCWireTopology.h:108
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
CSCGangedWireGrouping
Definition: CSCGangedWireGrouping.h:18
CSCWireGeometry::yLimitsOfWirePlane
std::pair< float, float > yLimitsOfWirePlane() const
Definition: CSCWireGeometry.cc:186
CSCWireGrouping::middleWireOfGroup
virtual float middleWireOfGroup(int wireGroup) const =0
CSCWireGeometry::yOfWire
virtual float yOfWire(float wire, float x=0.) const =0
CSCWireTopology::middleWireOfGroup
float middleWireOfGroup(int wireGroup) const
Definition: CSCWireTopology.h:131
MeasurementError
Definition: MeasurementError.h:8
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
CSCWireGroupPackage::narrowWidthOfWirePlane
double narrowWidthOfWirePlane
Definition: CSCWireGroupPackage.h:35
CSCWireGroupPackage::wideWidthOfWirePlane
double wideWidthOfWirePlane
Definition: CSCWireGroupPackage.h:36
CSCSlantedWireGeometry
Definition: CSCSlantedWireGeometry.h:15
MeasurementPoint
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
Definition: MeasurementPoint.h:12
CSCWireGroupPackage::wireSpacing
double wireSpacing
Definition: CSCWireGroupPackage.h:33
LocalError
Definition: LocalError.h:12
CSCWireGroupPackage::wiresInEachGroup
Container wiresInEachGroup
Definition: CSCWireGroupPackage.h:31
CSCWireGeometry::narrowWidthOfPlane
double narrowWidthOfPlane() const
Definition: CSCWireGeometry.h:45
CSCWireGrouping::numberOfWires
virtual int numberOfWires() const =0
CSCWireGeometry::lengthOfPlane
double lengthOfPlane() const
Definition: CSCWireGeometry.h:55
CSCWireTopology::wireGroup
int wireGroup(int wire) const
Definition: CSCWireTopology.h:123
CSCWireGeometry::wireAngle
virtual float wireAngle() const =0
CSCWireGroupPackage::numberOfGroups
int numberOfGroups
Definition: CSCWireGroupPackage.h:32
CSCWireGrouping::clone
virtual CSCWireGrouping * clone() const =0
CSCWireGroupPackage::alignmentPinToFirstWire
double alignmentPinToFirstWire
Definition: CSCWireGroupPackage.h:34
CSCWireTopology::theWireGrouping
CSCWireGrouping * theWireGrouping
Definition: CSCWireTopology.h:187
CSCWireGeometry::wireEnds
std::pair< LocalPoint, LocalPoint > wireEnds(float wire) const
Definition: CSCWireGeometry.cc:32
geant_units::operators::convertMmToCm
constexpr NumType convertMmToCm(NumType millimeters)
Definition: GeantUnits.h:62
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
CSCWireGrouping::wireGroup
virtual int wireGroup(int wire) const =0
CSCWireGeometry::wideWidthOfPlane
double wideWidthOfPlane() const
Definition: CSCWireGeometry.h:50
CSCWireGrouping::numberOfWiresPerGroup
virtual int numberOfWiresPerGroup(int wireGroup) const =0
CSCWireGeometry::equationOfWire
std::pair< float, float > equationOfWire(float wire) const
Definition: CSCWireGeometry.cc:166
CSCWireTopology::wireSpacing
double wireSpacing() const
Definition: CSCWireTopology.h:59
CSCWireGeometry::nearestWire
virtual int nearestWire(const LocalPoint &lp) const =0
CSCWireGeometry::wireValues
std::vector< float > wireValues(float wire) const
Definition: CSCWireGeometry.cc:16
watchdog.group
group
Definition: watchdog.py:82