Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:14:24

0001 #ifndef Geometry_CSCGeometry_CSCLayer_H
0002 #define Geometry_CSCGeometry_CSCLayer_H
0003 
0004 /** \class CSCLayer
0005  *
0006  * Describes the geometry of the lowest-level detector unit 
0007  * modelled by a C++ object in the endcap muon CSC system.
0008  *
0009  * \author Tim Cox
0010  */
0011 
0012 #include <DataFormats/MuonDetId/interface/CSCDetId.h>
0013 
0014 #include <Geometry/CommonDetUnit/interface/GeomDet.h>
0015 #include <Geometry/CommonDetUnit/interface/GeomDetType.h>
0016 #include <Geometry/CSCGeometry/interface/CSCLayerGeometry.h>
0017 #include <Geometry/CSCGeometry/interface/CSCChamber.h>
0018 #include <DataFormats/GeometryVector/interface/GlobalPoint.h>
0019 #include <DataFormats/GeometrySurface/interface/BoundPlane.h>
0020 
0021 //>
0022 //typedef std::shared_ptr<CSCChamber> Pointer2Chamber;
0023 
0024 class CSCLayer : public GeomDetUnit {
0025 public:
0026   CSCLayer(const BoundPlane::BoundPlanePointer& sp, CSCDetId id, const CSCChamber* ch, const CSCLayerGeometry* geo)
0027       : GeomDetUnit(sp), theId(id), theChamber(ch), theGeometry(geo) {
0028     setDetId(id);
0029   }
0030 
0031   const GeomDetType& type() const override { return chamber()->type(); }
0032 
0033   const Topology& topology() const override { return *(geometry()->topology()); }
0034 
0035   /**
0036    * Get the (concrete) DetId
0037    */
0038 
0039   CSCDetId id() const { return theId; }
0040 
0041   /**
0042    * Access to object handling layer geomerty
0043    */
0044   const CSCLayerGeometry* geometry() const { return theGeometry; }
0045 
0046   /**
0047    * Access to parent chamber
0048    */
0049   const CSCChamber* chamber() const { return theChamber; }
0050 
0051   /**
0052    * Global point at center of the given strip,
0053    * Must be in CSCLayer so it can return global coordinates.
0054    */
0055   GlobalPoint centerOfStrip(int strip) const;
0056 
0057   /** 
0058    * Global point at centre of the given wire group.
0059    * Must be in CSCLayer so it can return global coordinates.
0060    */
0061   GlobalPoint centerOfWireGroup(int wireGroup) const;
0062 
0063 private:
0064   CSCDetId theId;
0065 
0066   const CSCChamber* theChamber;  // NOT owned
0067   // Pointer2Chamber theChamber; // use a smart pointer instead
0068 
0069   // Local geometry is handled by the LayerGeometry
0070   // but only the Layer itself knows how to transform to the
0071   // global frame so global calculations are handled by the
0072   // Layer not the LayerGeometry.
0073   const CSCLayerGeometry* theGeometry;  // must have topology()
0074 };
0075 
0076 #endif  // Geometry_CSCGeometry_CSCLayer_H