CMS 3D CMS Logo

CSCWireTopology Class Reference

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

#include <Geometry/CSCGeometry/interface/CSCWireTopology.h>

Inheritance diagram for CSCWireTopology:

WireTopology Topology

List of all members.

Public Member Functions

virtual int channel (const LocalPoint &p) const
 'channel' is wire group number from 1 to no.
 CSCWireTopology (const CSCWireTopology &)
 Copy constructor.
 CSCWireTopology (const CSCWireGroupPackage &wg, double yOfFirstWire, float wireAngleInDegrees)
 Constructor from endcap muon CSC wire geometry specs.
std::pair< float, float > equationOfWire (float wire) const
 Return slope and intercept of straight line representing a wire in 2-dim local coordinates.
double extentOfWirePlane () const
 Extent of wire plane (width normal to wire direction).
bool insideYOfWirePlane (float y) const
 Returns true if arg falls within y limits of wire plane; false otherwise.
double lengthOfPlane () const
 Length/height of wire plane along long axis of trapezoid (local y direction).
virtual LocalError localError (const MeasurementPoint &, const MeasurementError &) const
virtual LocalPoint localPosition (const MeasurementPoint &) const
 Topology interface, but not implemented for CSCWireTopology (yet!).
virtual MeasurementError measurementError (const LocalPoint &, const LocalError &) const
virtual MeasurementPoint measurementPosition (const LocalPoint &) const
float middleWireOfGroup (int wireGroup) const
 Middle of wire-group.
double narrowWidthOfPlane () const
 Width of wire plane at narrow end of trapezoid.
int nearestWire (const LocalPoint &lp) const
 The nearest (virtual) wire to a given LocalPoint.
int numberOfWireGroups () const
 How many wire groups.
int numberOfWires () const
 Wire group interface.
int numberOfWiresPerGroup (int wireGroup) const
 How many wires in a wiregroup.
CSCWireTopologyoperator= (const CSCWireTopology &)
 Assignment op.
float restrictToYOfWirePlane (float y) const
 Reset input y to lie within bounds of wire plane at top and bottom.
double wideWidthOfPlane () const
 Width of wire plane at wide end of trapezoid.
float wireAngle () const
 The angle of the wires w.r.t local x axis (in radians).
std::pair< LocalPoint, LocalPointwireEnds (float wire) const
 Return local (x,y) coordinates of the two ends of a wire across the extent of the wire plane.
int wireGroup (int wire) const
 Wire group containing a given wire.
float wirePitch () const
 The wire pitch.
double wireSpacing () const
 WireTopology interface.
std::vector< float > wireValues (float wire) const
 Return mid-point of a wire in local coordinates, and its length across the chamber volume, in a vector as x, y, length.
float yOfWire (float wire, float x=0.) const
 Local y of a given wire 'number' (float) at given x.
float yOfWireGroup (int wireGroup, float x=0.) const
 Extended interface which 'mixes' WireGrouping and WireGeometry info.
float yResolution (int wireGroup=1) const
 The measurement resolution from wire groups (in cm.
virtual ~CSCWireTopology ()

Private Attributes

double theAlignmentPinToFirstWire
CSCWireGeometrytheWireGeometry
CSCWireGroupingtheWireGrouping


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.

00013                                   { 
00014   delete theWireGrouping;
00015   delete theWireGeometry; 
00016 }

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, wireSpacing(), and ww.

00021                                                 :
00022       theWireGrouping( 0 ), theWireGeometry( 0 ),
00023       theAlignmentPinToFirstWire( wg.alignmentPinToFirstWire / 10. ) {
00024 
00025      // Pass consecutiveGroups and wiresInConsecutiveGroups
00026      // directly on to theWireGrouping ctor. These vectors
00027      // are transient info and can go once ctor is complete.
00028          
00029   theWireGrouping = new CSCGangedWireGrouping( wg.consecutiveGroups,
00030                            wg.wiresInEachGroup, wg.numberOfGroups );
00031 
00032   const float zeroprecision = 1.E-06; // blur zero a bit, for comparisons
00033 
00034   float wireAngleInRadians = wireAngleInDegrees*degree;
00035 
00036   //@@ Conversion from mm to cm
00037   float wireSpacing = wg.wireSpacing   / 10.; // in cm
00038   float nw = wg.narrowWidthOfWirePlane / 10.; // in cm
00039   float ww = wg.wideWidthOfWirePlane   / 10.; // in cm
00040   float lw = wg.lengthOfWirePlane      / 10.; // in cm
00041 
00042    LogTrace("CSCWireTopology|CSC") <<  
00043        "CSCWireTopology constructing CSCWireGeometry with:\n" <<
00044        " wireSpacing = " << wireSpacing*10. << " (mm) " <<
00045        ", yOfFirstWire = " << yOfFirstWire << " (cm) " << 
00046      ", wireAngle = " << wireAngleInDegrees << " (deg) = " << wireAngleInRadians << " (rads)" <<
00047      ", extent: n, w, l = " << nw << ", " << ww << ", " << lw << " (cm)";
00048 
00049   if ( fabs(wireAngleInDegrees) > zeroprecision ) { 
00050     theWireGeometry = new CSCSlantedWireGeometry( wireSpacing, yOfFirstWire, nw, ww, lw, wireAngleInRadians );
00051   }
00052   else {
00053     theWireGeometry = new CSCNonslantedWireGeometry( wireSpacing, yOfFirstWire, nw, ww, lw );
00054   }
00055 }

CSCWireTopology::CSCWireTopology ( const CSCWireTopology mewt  ) 

Copy constructor.

Definition at line 57 of file CSCWireTopology.cc.

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


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

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

00107                                                         {
00108   int wire = theWireGeometry->nearestWire( p );
00109   int group = theWireGrouping->wireGroup( wire );
00110   return group; // 0 means out of range or dead region
00111 }

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

References CSCWireGeometry::equationOfWire(), and theWireGeometry.

Referenced by CSCLayerGeometry::intersectionOfStripAndWire().

00130                                                                         {
00131   return theWireGeometry->equationOfWire( wire );
00132 }

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

00173                                    {
00174     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 148 of file CSCWireTopology.cc.

References theWireGeometry, and CSCWireGeometry::yLimitsOfWirePlane().

Referenced by CSCLayerGeometry::intersectionOfStripAndWire().

00148                                                         {
00149   // Returns true if arg falls within y limits of wire plane; false otherwise.
00150       
00151   std::pair<float, float> ylim = theWireGeometry->yLimitsOfWirePlane();
00152 
00153   if ( y < ylim.first ) {
00154     return false;
00155   }
00156   else if ( y > ylim.second ) {
00157     return false;
00158   }
00159   return true;
00160 }

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

00107                                {
00108     return theWireGeometry->lengthOfPlane(); }

LocalError CSCWireTopology::localError ( const MeasurementPoint ,
const MeasurementError  
) const [virtual]

Implements Topology.

Definition at line 89 of file CSCWireTopology.cc.

00090                                                                           {
00091   edm::LogWarning("CSC") << "CSCWireTopology: localError unimplemented. Don't use it." << "\n";
00092   return LocalError();
00093 }

LocalPoint CSCWireTopology::localPosition ( const MeasurementPoint  )  const [virtual]

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

Implements Topology.

Definition at line 84 of file CSCWireTopology.cc.

00084                                                                          {
00085   edm::LogWarning("CSC") << "CSCWireTopology: localPosition unimplemented. Don't use it." << "\n";
00086   return LocalPoint();
00087 }

MeasurementError CSCWireTopology::measurementError ( const LocalPoint ,
const LocalError  
) const [virtual]

Implements Topology.

Definition at line 101 of file CSCWireTopology.cc.

00102                                                                      {
00103   edm::LogWarning("CSC") << "CSCWireTopology: measurementError unimplemented. Don't use it." << "\n";
00104   return MeasurementError();
00105 }

MeasurementPoint CSCWireTopology::measurementPosition ( const LocalPoint  )  const [virtual]

Implements Topology.

Definition at line 95 of file CSCWireTopology.cc.

00096                                                                  {
00097   edm::LogWarning("CSC") << "CSCWireTopology: measurementPosition unimplemented. Don't use it." << "\n";
00098   return MeasurementPoint();
00099 }

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

00148                                                  {
00149     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().

00095                                     {
00096     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().

00083                                               {
00084     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().

00127                                  {
00128     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().

00121                             {
00122     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().

00133                                                    {
00134     return theWireGrouping->numberOfWiresPerGroup( wireGroup ); }

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

Assignment op.

Definition at line 64 of file CSCWireTopology.cc.

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

00064                                                                          {
00065   if ( &mewt != this ) {
00066     delete theWireGrouping;
00067     if ( mewt.theWireGrouping ) 
00068       theWireGrouping = mewt.theWireGrouping->clone();
00069     else 
00070       theWireGrouping = 0;
00071     
00072     delete theWireGeometry;
00073     if ( mewt.theWireGeometry ) 
00074       theWireGeometry = mewt.theWireGeometry->clone();
00075     else 
00076       theWireGeometry = 0;
00077 
00078     theAlignmentPinToFirstWire = mewt.theAlignmentPinToFirstWire;
00079     
00080   }
00081   return *this;
00082 }

float CSCWireTopology::restrictToYOfWirePlane ( float  y  )  const

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

Definition at line 134 of file CSCWireTopology.cc.

References theWireGeometry, and CSCWireGeometry::yLimitsOfWirePlane().

Referenced by CSCLayerGeometry::intersectionOfStripAndWire().

00134                                                              {
00135   // Reset y to lie within bounds of wire plane at top and bottom.
00136   
00137   std::pair<float, float> ylim = theWireGeometry->yLimitsOfWirePlane();
00138 
00139   if ( y < ylim.first ) {
00140     y = ylim.first;
00141   }
00142   else if ( y > ylim.second ) {
00143     y = ylim.second;
00144   }
00145   return y;
00146 }

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

00101                                   {
00102     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 TrackDetectorAssociator::getTAMuonChamberMatches(), and CSCLayerGeometry::wireAngle().

00076                           { 
00077     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().

00181                                                                  {
00182     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().

00139                                 {
00140     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().

00070                           {
00071     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 CSCWireTopology(), extentOfWirePlane(), wirePitch(), and yResolution().

00063                              {
00064     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().

00187                                                   {
00188     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().

00089                                               {
00090     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 113 of file CSCWireTopology.cc.

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

Referenced by CSCLayerGeometry::yOfWireGroup().

00113                                                                 {
00114    float wire = middleWireOfGroup( wireGroup );
00115    return theWireGeometry->yOfWire( wire, x );
00116 }

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

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

Referenced by CSCLayerGeometry::yResolution().

00118                                                         {
00119   // Return the resolution in the wire group measurement (in cm).
00120   // To really be resolution in local y this should be scaled by Sin
00121   // factors involving strip and wire angles, and also add a contribution
00122   // from strip measurement (which is negligible w.r.t. wire resolution.)
00123   // These factors can increase the number here by up to 1.26.
00124 
00125   // Should be improvable for smaller partial wire groups
00126 
00127   return wireSpacing() * theWireGrouping->numberOfWiresPerGroup( wireGroup ) / sqrt(12.);
00128 }


Member Data Documentation

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


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:17:33 2009 for CMSSW by  doxygen 1.5.4