00001 #ifndef Geometry_CSCGeometry_CSCLayerGeometry_H
00002 #define Geometry_CSCGeometry_CSCLayerGeometry_H
00003
00014 #include <Geometry/CSCGeometry/interface/CSCStripTopology.h>
00015 #include <Geometry/CSCGeometry/interface/CSCWireTopology.h>
00016 #include <DataFormats/GeometrySurface/interface/TrapezoidalPlaneBounds.h>
00017 #include <DataFormats/GeometryVector/interface/LocalPoint.h>
00018 #include <DataFormats/GeometrySurface/interface/LocalError.h>
00019
00020 #include <utility>
00021
00022 class CSCGeometry;
00023 class CSCWireGroupPackage;
00024
00025 class CSCLayerGeometry : public TrapezoidalPlaneBounds {
00026
00027 public:
00028
00044 CSCLayerGeometry( const CSCGeometry* geom, int iChamberType,
00045 const TrapezoidalPlaneBounds& bounds,
00046 int nstrips, float stripOffset, float stripPhiPitch,
00047 float whereStripsMeet, float extentOfStripPlane, float yCentreOfStripPlane,
00048 const CSCWireGroupPackage& wg, float wireAngleInDegrees, double yOfFirstWire );
00049
00050 CSCLayerGeometry(const CSCLayerGeometry& );
00051
00052 CSCLayerGeometry& operator=( const CSCLayerGeometry& );
00053
00054 virtual ~CSCLayerGeometry();
00055
00059 int numberOfStrips() const {
00060 return theStripTopology->nstrips(); }
00061
00065 int numberOfWires() const {
00066 return theWireTopology->numberOfWires(); }
00067
00071 int numberOfWireGroups() const {
00072 return theWireTopology->numberOfWireGroups(); }
00073
00077 int numberOfWiresPerGroup( int wireGroup ) const {
00078 return theWireTopology->numberOfWiresPerGroup( wireGroup ); }
00079
00083 LocalPoint stripWireIntersection( int strip, float wire) const;
00084
00088 LocalPoint stripWireGroupIntersection( int strip, int wireGroup) const;
00089
00093 int nearestStrip(const LocalPoint & lp) const {
00094 return theStripTopology->nearestStrip(lp);
00095 }
00096
00100 int nearestWire(const LocalPoint & lp) const {
00101 return theWireTopology->nearestWire( lp ); }
00102
00106 int wireGroup(int wire) const {
00107 return theWireTopology->wireGroup( wire );
00108 }
00109
00114 int channel(int strip) const {
00115 return theStripTopology->channel(strip);
00116 }
00117
00122 float stripOffset( void ) const {return theStripTopology->stripOffset();}
00123
00128 int stagger() const { return static_cast<int>( 4.1*stripOffset() ); }
00129
00133 float stripAngle(int strip) const;
00134
00138 float wireAngle() const {
00139 return theWireTopology->wireAngle(); }
00140
00144 float wirePitch() const {
00145 return theWireTopology->wirePitch(); }
00146
00158 float yResolution( int wireGroup = 1 ) const {
00159 return theWireTopology->yResolution( wireGroup ); }
00160
00164 float stripPhiPitch() const {
00165 return theStripTopology->phiPitch(); }
00166
00170 float stripPitch() const {
00171
00172 return stripPitch( LocalPoint(0.,0.) ); }
00173
00177 float stripPitch(const LocalPoint & lp) const {
00178 return theStripTopology->localPitch(lp); }
00179
00183 float xOfStrip(int strip, float y=0.) const {
00184 return theStripTopology->xOfStrip(strip, y); }
00185
00192 float strip(const LocalPoint& lp) const { return theStripTopology->strip(lp); }
00193
00200 float middleWireOfGroup( int wireGroup ) const {
00201 return theWireTopology->middleWireOfGroup( wireGroup ); }
00202
00206 float yOfWire(float wire, float x=0.) const {
00207 return theWireTopology->yOfWire( wire, x ); }
00208
00212 float yOfWireGroup(int wireGroup, float x=0.) const {
00213 return theWireTopology->yOfWireGroup( wireGroup, x ); }
00214
00220 LocalPoint localCenterOfWireGroup( int wireGroup ) const;
00221
00225 float lengthOfWireGroup( int wireGroup ) const;
00226
00230 std::pair<float, float> yLimitsOfStripPlane() const {
00231 return theStripTopology->yLimitsOfStripPlane();
00232 }
00233
00245 std::pair<LocalPoint, float> possibleRecHitPosition( float s, int w1, int w2 ) const;
00246
00254 LocalPoint intersectionOfStripAndWire( float s, int w) const;
00255
00262 LocalPoint intersectionOfTwoLines( std::pair<float, float> p1, std::pair<float, float> p2 ) const;
00263
00269 LocalError localError( int strip, float sigmaStrip, float sigmaWire ) const;
00270
00274 const CSCStripTopology* topology() const {
00275 return theStripTopology;
00276 }
00277
00281 void setTopology( CSCStripTopology * topology );
00282
00286 const CSCWireTopology* wireTopology() const {
00287 return theWireTopology;
00288 }
00289
00293 virtual Bounds* clone() const {
00294 return new CSCLayerGeometry(*this);
00295 }
00296
00300 friend std::ostream & operator<<(std::ostream &, const CSCLayerGeometry &);
00301
00302 private:
00303
00304
00305
00306
00307
00308 CSCWireTopology* theWireTopology;
00309
00310
00311
00312
00313
00314 CSCStripTopology* theStripTopology;
00315
00316
00317
00318
00319 float hBottomEdge;
00320 float hTopEdge;
00321 float apothem;
00322
00323 const std::string myName;
00324 int chamberType;
00325 };
00326 #endif