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
0012
0013
0014
0015
0016
0017
0018
0019
0020 class CaloGeometry {
0021 public:
0022 CaloGeometry();
0023
0024
0025 void setSubdetGeometry(DetId::Detector det, int subdet, const CaloSubdetectorGeometry* geom);
0026
0027
0028 GlobalPoint getPosition(const DetId& id) const;
0029
0030
0031 CaloCellGeometryMayOwnPtr getGeometry(const DetId& id) const;
0032
0033
0034 std::vector<DetId> getValidDetIds() const;
0035
0036
0037 const std::vector<DetId>& getValidDetIds(DetId::Detector det, int subdet) const;
0038
0039
0040 bool present(const DetId& id) const;
0041
0042
0043 const CaloSubdetectorGeometry* getSubdetectorGeometry(const DetId& id) const;
0044
0045
0046 const CaloSubdetectorGeometry* getSubdetectorGeometry(DetId::Detector det, int subdet) const;
0047
0048
0049
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