Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-10-25 23:57:04

0001 #ifndef GEOMETRY_CALOGEOMETRY_CALOGEOMETRY_H
0002 #define GEOMETRY_CALOGEOMETRY_CALOGEOMETRY_H 1
0003 
0004 #include "DataFormats/DetId/interface/DetId.h"
0005 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0006 #include "Geometry/CaloGeometry/interface/CaloCellGeometryMayOwnPtr.h"
0007 #include <vector>
0008 
0009 class CaloSubdetectorGeometry;
0010 
0011 /** \class CaloGeometry
0012       
0013 Interface class to the geometry information for all calorimetry 
0014 subdetectors.
0015 
0016 $Revision: 1.7 $
0017 \author J. Mans and P. Meridiani
0018 */
0019 
0020 class CaloGeometry {
0021 public:
0022   CaloGeometry();
0023 
0024   /// Register a subdetector geometry
0025   void setSubdetGeometry(DetId::Detector det, int subdet, const CaloSubdetectorGeometry* geom);
0026 
0027   /// Get the position of a given detector id
0028   GlobalPoint getPosition(const DetId& id) const;
0029 
0030   /// Get the cell geometry of a given detector id
0031   CaloCellGeometryMayOwnPtr getGeometry(const DetId& id) const;
0032 
0033   /// Get the list of all valid detector ids
0034   std::vector<DetId> getValidDetIds() const;
0035 
0036   /// Get the list of valid detector ids for the given subdetector
0037   const std::vector<DetId>& getValidDetIds(DetId::Detector det, int subdet) const;
0038 
0039   /// is this detid present in the geometry?
0040   bool present(const DetId& id) const;
0041 
0042   /// access the subdetector geometry for the given subdetector directly
0043   const CaloSubdetectorGeometry* getSubdetectorGeometry(const DetId& id) const;
0044 
0045   /// access the subdetector geometry for the given subdetector directly
0046   const CaloSubdetectorGeometry* getSubdetectorGeometry(DetId::Detector det, int subdet) const;
0047 
0048   // Get closest cell, etc...
0049   //not implemented      const DetId getClosestCell( const GlobalPoint& r ) const ;
0050 
0051 private:
0052   static const std::vector<DetId> k_emptyVec;
0053 
0054   std::vector<const CaloSubdetectorGeometry*> m_geos;
0055 
0056   unsigned int makeIndex(DetId::Detector det, int subdet, bool& ok) const;
0057 
0058   static constexpr int kMaxDet = 10, kMinDet = 3, kNDets = kMaxDet - kMinDet + 1, kMaxSub = 6, kNSubDets = kMaxSub + 1,
0059                        kLength = kNDets * kNSubDets;
0060 };
0061 
0062 #endif