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 00031 const GeomDetType& type() const { return chamber()->type(); } 00032 00033 const Topology& topology() const { return *(geometry()->topology()); } 00034 00035 DetId geographicalId() const { return theId; } 00036 00041 CSCDetId id() const { return theId; } 00042 00046 const CSCLayerGeometry* geometry() const { return theGeometry; } 00047 00051 const CSCChamber* chamber() const { return theChamber; } 00052 00057 GlobalPoint centerOfStrip(int strip) const; 00058 00063 GlobalPoint centerOfWireGroup(int wireGroup) const; 00064 00065 private: 00066 00067 CSCDetId theId; 00068 00069 const CSCChamber* theChamber; // NOT owned 00070 // Pointer2Chamber theChamber; // use a smart pointer instead 00071 00072 // Local geometry is handled by the LayerGeometry 00073 // but only the Layer itself knows how to transform to the 00074 // global frame so global calculations are handled by the 00075 // Layer not the LayerGeometry. 00076 const CSCLayerGeometry* theGeometry; // must have topology() 00077 }; 00078 00079 #endif // Geometry_CSCGeometry_CSCLayer_H