File indexing completed on 2024-04-06 12:14:17
0001 #ifndef GEOMETRY_CALOTOPOLOGY_CALOTOPOLOGY_H
0002 #define GEOMETRY_CALOTOPOLOGY_CALOTOPOLOGY_H 1
0003
0004 #include "DataFormats/DetId/interface/DetId.h"
0005 #include "Geometry/CaloTopology/interface/CaloDirection.h"
0006 #include <map>
0007 #include <memory>
0008 #include <vector>
0009
0010 class CaloSubdetectorTopology;
0011
0012
0013
0014
0015
0016
0017
0018
0019 class CaloTopology {
0020 public:
0021 typedef std::map<int, std::unique_ptr<const CaloSubdetectorTopology>> TopMap;
0022
0023 CaloTopology();
0024
0025 ~CaloTopology();
0026
0027 void setSubdetTopology(DetId::Detector det, int subdet, std::unique_ptr<const CaloSubdetectorTopology> geom);
0028
0029 const CaloSubdetectorTopology* getSubdetectorTopology(const DetId& id) const;
0030
0031 const CaloSubdetectorTopology* getSubdetectorTopology(DetId::Detector det, int subdet) const;
0032
0033 bool valid(const DetId& id) const;
0034
0035
0036 std::vector<DetId> east(const DetId& id) const;
0037
0038 std::vector<DetId> west(const DetId& id) const;
0039
0040 std::vector<DetId> north(const DetId& id) const;
0041
0042 std::vector<DetId> south(const DetId& id) const;
0043
0044 std::vector<DetId> up(const DetId& id) const;
0045
0046 std::vector<DetId> down(const DetId& id) const;
0047
0048 std::vector<DetId> getNeighbours(const DetId& id, const CaloDirection& dir) const;
0049
0050 std::vector<DetId> getWindow(const DetId& id, const int& northSouthSize, const int& eastWestSize) const;
0051
0052 std::vector<DetId> getAllNeighbours(const DetId& id) const;
0053
0054 private:
0055 TopMap theTopologies_;
0056 int makeIndex(DetId::Detector det, int subdet) const;
0057 };
0058
0059 #endif