CMS 3D CMS Logo

EcalBarrelTopology.h
Go to the documentation of this file.
1 #ifndef GEOMETRY_CALOTOPOLOGY_ECALBARRELTOPOLOGY_H
2 #define GEOMETRY_CALOTOPOLOGY_ECALBARRELTOPOLOGY_H 1
3 
4 #include <utility>
5 #include <vector>
6 #include <iostream>
12 
14 public:
16  EcalBarrelTopology() : theGeom_(nullptr){};
17 
19  ~EcalBarrelTopology() override {}
20 
22  EcalBarrelTopology(CaloGeometry const& theGeom) {
24  }
25 
27  DetId goNorth(const DetId& id) const override { return incrementIphi(EBDetId(id)); }
28  std::vector<DetId> north(const DetId& id) const override {
29  EBDetId nextId = goNorth(id);
30  std::vector<DetId> vNeighborsDetId;
31  if (!(nextId == EBDetId(0)))
32  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
33  return vNeighborsDetId;
34  }
35 
37  DetId goSouth(const DetId& id) const override { return decrementIphi(EBDetId(id)); }
38  std::vector<DetId> south(const DetId& id) const override {
39  EBDetId nextId = goSouth(id);
40  std::vector<DetId> vNeighborsDetId;
41  if (!(nextId == EBDetId(0)))
42  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
43  return vNeighborsDetId;
44  }
45 
47  DetId goEast(const DetId& id) const override { return decrementIeta(EBDetId(id)); }
48  std::vector<DetId> east(const DetId& id) const override {
49  EBDetId nextId = goEast(id);
50  std::vector<DetId> vNeighborsDetId;
51  if (!(nextId == EBDetId(0)))
52  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
53  return vNeighborsDetId;
54  }
55 
57  DetId goWest(const DetId& id) const override { return incrementIeta(EBDetId(id)); }
58  std::vector<DetId> west(const DetId& id) const override {
59  EBDetId nextId = goWest(id);
60  std::vector<DetId> vNeighborsDetId;
61  if (!(nextId == EBDetId(0)))
62  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
63  return vNeighborsDetId;
64  }
65 
66  std::vector<DetId> up(const DetId& /*id*/) const override {
67  edm::LogVerbatim("CaloTopology") << "EcalBarrelTopology::up() not yet implemented";
68  std::vector<DetId> vNeighborsDetId;
69  return vNeighborsDetId;
70  }
71 
72  std::vector<DetId> down(const DetId& /*id*/) const override {
73  edm::LogVerbatim("CaloTopology") << "EcalBarrelTopology::down() not yet implemented";
74  std::vector<DetId> vNeighborsDetId;
75  return vNeighborsDetId;
76  }
77 
78 private:
80  EBDetId incrementIeta(const EBDetId&) const;
81 
83  EBDetId decrementIeta(const EBDetId&) const;
84 
86  EBDetId incrementIphi(const EBDetId&) const;
87 
89  EBDetId decrementIphi(const EBDetId&) const;
90 
92 };
93 
94 #endif
EBDetId incrementIeta(const EBDetId &) const
move the nagivator to larger ieta (more positive z) (stops at end of barrel and returns null) ...
Log< level::Info, true > LogVerbatim
DetId goEast(const DetId &id) const override
move the Topology east (negative ieta)
DetId goWest(const DetId &id) const override
move the Topology west (positive ieta)
std::vector< DetId > south(const DetId &id) const override
std::vector< DetId > up(const DetId &) const override
DetId goSouth(const DetId &id) const override
move the Topology south (decrement iphi)
~EcalBarrelTopology() override
virtual destructor
std::vector< DetId > down(const DetId &) const override
const CaloSubdetectorGeometry * theGeom_
std::vector< DetId > east(const DetId &id) const override
Definition: DetId.h:17
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
std::vector< DetId > west(const DetId &id) const override
EBDetId decrementIphi(const EBDetId &) const
move the nagivator to smaller iphi (wraps around the barrel)
EBDetId decrementIeta(const EBDetId &) const
move the nagivator to smaller ieta (more negative z) (stops at end of barrel and returns null) ...
EcalBarrelTopology(CaloGeometry const &theGeom)
create a new Topology from geometry
std::vector< DetId > north(const DetId &id) const override
EBDetId incrementIphi(const EBDetId &) const
move the nagivator to larger iphi (wraps around the barrel)
DetId goNorth(const DetId &id) const override
move the Topology north (increment iphi)
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
EcalBarrelTopology()
create a new Topology