00001 #ifndef Geometry_CSCGeometry_CSCLayer_H 00002 #define Geometry_CSCGeometry_CSCLayer_H 00003 00012 #include <DataFormats/MuonDetId/interface/CSCDetId.h> 00013 00014 #include <Geometry/CommonDetUnit/interface/GeomDetUnit.h> 00015 #include <Geometry/CommonDetUnit/interface/GeomDetType.h> 00016 #include <Geometry/CSCGeometry/interface/CSCLayerGeometry.h> 00017 #include <Geometry/CSCGeometry/interface/CSCChamber.h> 00018 #include <DataFormats/GeometryVector/interface/GlobalPoint.h> 00019 #include <DataFormats/GeometrySurface/interface/BoundPlane.h> 00020 00021 //#include <boost/shared_ptr.hpp> 00022 //typedef boost::shared_ptr<CSCChamber> Pointer2Chamber; 00023 00024 class CSCLayer : public GeomDetUnit { 00025 00026 public: 00027 00028 CSCLayer( const BoundPlane::BoundPlanePointer sp, CSCDetId id, const CSCChamber* ch, const CSCLayerGeometry* geo ) : 00029 GeomDetUnit( sp ), theId( id ), theChamber( ch ), theGeometry( geo ) { 00030 setDetId(id); 00031 } 00032 00033 const GeomDetType& type() const { return chamber()->type(); } 00034 00035 const Topology& topology() const { return *(geometry()->topology()); } 00036 00037 00042 CSCDetId id() const { return theId; } 00043 00047 const CSCLayerGeometry* geometry() const { return theGeometry; } 00048 00052 const CSCChamber* chamber() const { return theChamber; } 00053 00058 GlobalPoint centerOfStrip(int strip) const; 00059 00064 GlobalPoint centerOfWireGroup(int wireGroup) const; 00065 00066 private: 00067 00068 CSCDetId theId; 00069 00070 const CSCChamber* theChamber; // NOT owned 00071 // Pointer2Chamber theChamber; // use a smart pointer instead 00072 00073 // Local geometry is handled by the LayerGeometry 00074 // but only the Layer itself knows how to transform to the 00075 // global frame so global calculations are handled by the 00076 // Layer not the LayerGeometry. 00077 const CSCLayerGeometry* theGeometry; // must have topology() 00078 }; 00079 00080 #endif // Geometry_CSCGeometry_CSCLayer_H