File indexing completed on 2024-06-07 02:29:37
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 <memory>
0007 #include <vector>
0008
0009 class CaloSubdetectorGeometry;
0010 class CaloCellGeometry;
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 class CaloGeometry {
0022 public:
0023 CaloGeometry();
0024
0025
0026 void setSubdetGeometry(DetId::Detector det, int subdet, const CaloSubdetectorGeometry* geom);
0027
0028
0029 GlobalPoint getPosition(const DetId& id) const;
0030
0031
0032 std::shared_ptr<const CaloCellGeometry> getGeometry(const DetId& id) const;
0033
0034
0035 std::vector<DetId> getValidDetIds() const;
0036
0037
0038 const std::vector<DetId>& getValidDetIds(DetId::Detector det, int subdet) const;
0039
0040
0041 bool present(const DetId& id) const;
0042
0043
0044 const CaloSubdetectorGeometry* getSubdetectorGeometry(const DetId& id) const;
0045
0046
0047 const CaloSubdetectorGeometry* getSubdetectorGeometry(DetId::Detector det, int subdet) const;
0048
0049
0050
0051
0052 private:
0053 static const std::vector<DetId> k_emptyVec;
0054
0055 std::vector<const CaloSubdetectorGeometry*> m_geos;
0056
0057 unsigned int makeIndex(DetId::Detector det, int subdet, bool& ok) const;
0058
0059 static constexpr int kMaxDet = 10, kMinDet = 3, kNDets = kMaxDet - kMinDet + 1, kMaxSub = 6, kNSubDets = kMaxSub + 1,
0060 kLength = kNDets * kNSubDets;
0061 };
0062
0063 #endif