#include <CSCWireTopology.h>
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 |
CSCWireTopology & | operator= (const CSCWireTopology &) |
float | restrictToYOfWirePlane (float y) const |
double | wideWidthOfPlane () const |
float | wireAngle () const |
std::pair< LocalPoint, LocalPoint > | wireEnds (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 () |
Private Attributes | |
double | theAlignmentPinToFirstWire |
CSCWireGeometry * | theWireGeometry |
CSCWireGrouping * | theWireGrouping |
A concrete class derived from WireTopology, to handle wire (group) geometry functionality for endcap muon CSCs.
Definition at line 18 of file CSCWireTopology.h.
CSCWireTopology::~CSCWireTopology | ( | ) | [virtual] |
Definition at line 13 of file CSCWireTopology.cc.
References theWireGeometry, and theWireGrouping.
{ delete theWireGrouping; delete 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().
: theWireGrouping( 0 ), theWireGeometry( 0 ), theAlignmentPinToFirstWire( wg.alignmentPinToFirstWire / 10. ) { // Pass consecutiveGroups and wiresInConsecutiveGroups // directly on to theWireGrouping ctor. These vectors // are transient info and can go once ctor is complete. theWireGrouping = new CSCGangedWireGrouping( wg.consecutiveGroups, wg.wiresInEachGroup, wg.numberOfGroups ); const float zeroprecision = 1.E-06; // blur zero a bit, for comparisons float wireAngleInRadians = wireAngleInDegrees*degree; //@@ Conversion from mm to cm float wireSpacing = wg.wireSpacing / 10.; // in cm float nw = wg.narrowWidthOfWirePlane / 10.; // in cm float ww = wg.wideWidthOfWirePlane / 10.; // in cm float lw = wg.lengthOfWirePlane / 10.; // in cm LogTrace("CSCWireTopology|CSC") << "CSCWireTopology constructing CSCWireGeometry with:\n" << " wireSpacing = " << wireSpacing*10. << " (mm) " << ", yOfFirstWire = " << yOfFirstWire << " (cm) " << ", wireAngle = " << wireAngleInDegrees << " (deg) = " << wireAngleInRadians << " (rads)" << ", extent: n, w, l = " << nw << ", " << ww << ", " << lw << " (cm)"; if ( fabs(wireAngleInDegrees) > zeroprecision ) { theWireGeometry = new CSCSlantedWireGeometry( wireSpacing, yOfFirstWire, nw, ww, lw, wireAngleInRadians ); } else { theWireGeometry = new CSCNonslantedWireGeometry( wireSpacing, yOfFirstWire, nw, ww, lw ); } }
CSCWireTopology::CSCWireTopology | ( | const CSCWireTopology & | mewt | ) |
Copy constructor
Definition at line 57 of file CSCWireTopology.cc.
References CSCWireGrouping::clone(), CSCWireGeometry::clone(), theWireGeometry, and theWireGrouping.
: theAlignmentPinToFirstWire(mewt.theAlignmentPinToFirstWire) { if (mewt.theWireGrouping) theWireGrouping = mewt.theWireGrouping->clone(); else theWireGrouping = 0; if (mewt.theWireGeometry) theWireGeometry = mewt.theWireGeometry->clone(); else theWireGeometry = 0; }
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 CSCWireGeometry::nearestWire(), theWireGeometry, theWireGrouping, and CSCWireGrouping::wireGroup().
{ int wire = theWireGeometry->nearestWire( p ); int group = theWireGrouping->wireGroup( wire ); return group; // 0 means out of range or dead region }
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().
{ return theWireGeometry->equationOfWire( wire ); }
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().
{ return wireSpacing() * (numberOfWires() - 1) ; }
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().
{ // Returns true if arg falls within y limits of wire plane; false otherwise. std::pair<float, float> ylim = theWireGeometry->yLimitsOfWirePlane(); if ( y < ylim.first ) { return false; } else if ( y > ylim.second ) { return false; } return true; }
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().
{ return theWireGeometry->lengthOfPlane(); }
LocalError CSCWireTopology::localError | ( | const MeasurementPoint & | , |
const MeasurementError & | |||
) | const [virtual] |
Implements Topology.
Definition at line 91 of file CSCWireTopology.cc.
{ edm::LogWarning("CSC") << "CSCWireTopology: localError unimplemented. Don't use it." << "\n"; return LocalError(); }
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.
{ edm::LogWarning("CSC") << "CSCWireTopology: localPosition unimplemented. Don't use it." << "\n"; return LocalPoint(); }
MeasurementError CSCWireTopology::measurementError | ( | const LocalPoint & | , |
const LocalError & | |||
) | const [virtual] |
Implements Topology.
Definition at line 103 of file CSCWireTopology.cc.
{ edm::LogWarning("CSC") << "CSCWireTopology: measurementError unimplemented. Don't use it." << "\n"; return MeasurementError(); }
MeasurementPoint CSCWireTopology::measurementPosition | ( | const LocalPoint & | ) | const [virtual] |
Implements Topology.
Definition at line 97 of file CSCWireTopology.cc.
{ edm::LogWarning("CSC") << "CSCWireTopology: measurementPosition unimplemented. Don't use it." << "\n"; return MeasurementPoint(); }
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().
{ return theWireGrouping->middleWireOfGroup( wireGroup ); }
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().
{ return theWireGeometry->narrowWidthOfPlane(); }
int CSCWireTopology::nearestWire | ( | const LocalPoint & | lp | ) | const [inline, virtual] |
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().
{ return theWireGeometry->nearestWire( lp ); }
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().
{ return theWireGrouping->numberOfWireGroups(); }
int CSCWireTopology::numberOfWires | ( | ) | const [inline, virtual] |
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().
{ return theWireGrouping->numberOfWires(); }
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().
{ return theWireGrouping->numberOfWiresPerGroup( wireGroup ); }
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.
{ if ( &mewt != this ) { delete theWireGrouping; if ( mewt.theWireGrouping ) theWireGrouping = mewt.theWireGrouping->clone(); else theWireGrouping = 0; delete theWireGeometry; if ( mewt.theWireGeometry ) theWireGeometry = mewt.theWireGeometry->clone(); else theWireGeometry = 0; theAlignmentPinToFirstWire = mewt.theAlignmentPinToFirstWire; } return *this; }
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, detailsBasic3DVector::y, and CSCWireGeometry::yLimitsOfWirePlane().
Referenced by CSCLayerGeometry::intersectionOfStripAndWire().
{ // Reset y to lie within bounds of wire plane at top and bottom. std::pair<float, float> ylim = theWireGeometry->yLimitsOfWirePlane(); if ( y < ylim.first ) { y = ylim.first; } else if ( y > ylim.second ) { y = ylim.second; } return y; }
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().
{ return theWireGeometry->wideWidthOfPlane(); }
float CSCWireTopology::wireAngle | ( | ) | const [inline, virtual] |
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(), FWTGeoRecoGeometryESProducer::addCSCGeometry(), TrackDetectorAssociator::getTAMuonChamberMatches(), ValidateGeometry::validateCSCLayerGeometry(), and CSCLayerGeometry::wireAngle().
{ return theWireGeometry->wireAngle(); }
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().
{ return theWireGeometry->wireEnds( wire ); }
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().
{ return theWireGrouping->wireGroup( wire ); }
float CSCWireTopology::wirePitch | ( | ) | const [inline, virtual] |
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().
{ return static_cast<float>(wireSpacing()); }
double CSCWireTopology::wireSpacing | ( | ) | const [inline] |
WireTopology interface The wire spacing (in cm)
Definition at line 63 of file CSCWireTopology.h.
References theWireGeometry, and CSCWireGeometry::wireSpacing().
Referenced by FWRecoGeometryESProducer::addCSCGeometry(), FWTGeoRecoGeometryESProducer::addCSCGeometry(), CSCWireTopology(), extentOfWirePlane(), ValidateGeometry::validateCSCLayerGeometry(), wirePitch(), and yResolution().
{ return theWireGeometry->wireSpacing(); }
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().
{ return theWireGeometry->wireValues( wire ); }
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().
{ return theWireGeometry->yOfWire(wire,x); }
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().
{ float wire = middleWireOfGroup( wireGroup ); return theWireGeometry->yOfWire( wire, x ); }
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().
{ // Return the resolution in the wire group measurement (in cm). // To really be resolution in local y this should be scaled by Sin // factors involving strip and wire angles, and also add a contribution // from strip measurement (which is negligible w.r.t. wire resolution.) // These factors can increase the number here by up to 1.26. // Should be improvable for smaller partial wire groups return wireSpacing() * theWireGrouping->numberOfWiresPerGroup( wireGroup ) / sqrt(12.); }
double CSCWireTopology::theAlignmentPinToFirstWire [private] |
Definition at line 212 of file CSCWireTopology.h.
Referenced by operator=().
CSCWireGeometry* CSCWireTopology::theWireGeometry [private] |
Definition at line 210 of file CSCWireTopology.h.
Referenced by channel(), CSCWireTopology(), equationOfWire(), insideYOfWirePlane(), lengthOfPlane(), narrowWidthOfPlane(), nearestWire(), operator=(), restrictToYOfWirePlane(), wideWidthOfPlane(), wireAngle(), wireEnds(), wireSpacing(), wireValues(), yOfWire(), yOfWireGroup(), and ~CSCWireTopology().
CSCWireGrouping* CSCWireTopology::theWireGrouping [private] |
Definition at line 209 of file CSCWireTopology.h.
Referenced by channel(), CSCWireTopology(), middleWireOfGroup(), numberOfWireGroups(), numberOfWires(), numberOfWiresPerGroup(), operator=(), wireGroup(), yResolution(), and ~CSCWireTopology().