00001 #ifndef CSC_WIRE_TOPOLOGY_H 00002 #define CSC_WIRE_TOPOLOGY_H 00003 00012 #include "Geometry/CSCGeometry/interface/WireTopology.h" 00013 #include "Geometry/CSCGeometry/interface/CSCWireGeometry.h" 00014 #include "Geometry/CSCGeometry/src/CSCWireGrouping.h" 00015 #include "Geometry/CSCGeometry/src/CSCWireGroupPackage.h" 00016 #include <utility> // for std::pair 00017 00018 class CSCWireTopology : public WireTopology { 00019 00020 public: 00021 00022 virtual ~CSCWireTopology(); 00023 00028 CSCWireTopology( const CSCWireGroupPackage& wg, 00029 double yOfFirstWire, 00030 float wireAngleInDegrees ); 00034 CSCWireTopology( const CSCWireTopology& ); 00035 00039 CSCWireTopology& operator=( const CSCWireTopology& ); 00040 00045 virtual LocalPoint localPosition( const MeasurementPoint& ) const; 00046 virtual LocalError localError( const MeasurementPoint&, const MeasurementError& ) const; 00047 virtual MeasurementPoint measurementPosition( const LocalPoint&) const; 00048 virtual MeasurementError measurementError( const LocalPoint&, const LocalError& ) const; 00049 00054 virtual int channel( const LocalPoint& p) const; 00055 00063 double wireSpacing() const { 00064 return theWireGeometry->wireSpacing(); } 00065 00070 float wirePitch() const { 00071 return static_cast<float>(wireSpacing()); } 00072 00076 float wireAngle() const { 00077 return theWireGeometry->wireAngle(); } 00078 00083 int nearestWire(const LocalPoint& lp) const { 00084 return theWireGeometry->nearestWire( lp ); } 00085 00089 float yOfWire(float wire, float x=0.) const { 00090 return theWireGeometry->yOfWire(wire,x); } 00091 00095 double narrowWidthOfPlane() const { 00096 return theWireGeometry->narrowWidthOfPlane(); } 00097 00101 double wideWidthOfPlane() const { 00102 return theWireGeometry->wideWidthOfPlane(); } 00103 00107 double lengthOfPlane() const { 00108 return theWireGeometry->lengthOfPlane(); } 00109 00110 00121 int numberOfWires() const { 00122 return theWireGrouping->numberOfWires(); } 00123 00127 int numberOfWireGroups() const { 00128 return theWireGrouping->numberOfWireGroups(); } 00129 00133 int numberOfWiresPerGroup( int wireGroup ) const { 00134 return theWireGrouping->numberOfWiresPerGroup( wireGroup ); } 00135 00139 int wireGroup(int wire) const { 00140 return theWireGrouping->wireGroup( wire ); } 00141 00148 float middleWireOfGroup( int wireGroup ) const { 00149 return theWireGrouping->middleWireOfGroup( wireGroup ); } 00150 00158 float yOfWireGroup(int wireGroup, float x=0.) const; 00159 00166 float yResolution( int wireGroup=1 ) const; 00167 00173 double extentOfWirePlane() const { 00174 return wireSpacing() * (numberOfWires() - 1) ; } 00175 00181 std::pair< LocalPoint, LocalPoint > wireEnds( float wire ) const { 00182 return theWireGeometry->wireEnds( wire ); } 00183 00187 std::vector<float> wireValues( float wire ) const { 00188 return theWireGeometry->wireValues( wire ); } 00189 00195 std::pair<float, float> equationOfWire( float wire ) const; 00196 00200 float restrictToYOfWirePlane( float y ) const; 00201 00205 bool insideYOfWirePlane( float y ) const; 00206 00207 private: 00208 00209 CSCWireGrouping* theWireGrouping; // handles grouping of wires for read out 00210 CSCWireGeometry* theWireGeometry; // handles non-zero angle w.r.t x axis 00211 00212 double theAlignmentPinToFirstWire; //@@ Not sure this is actually required! 00213 00214 }; 00215 00216 #endif