CMS 3D CMS Logo

EcalBarrelHardcodedTopology.h
Go to the documentation of this file.
1 #ifndef GEOMETRY_CALOTOPOLOGY_ECALBARRELHARDCODEDTOPOLOGY_H
2 #define GEOMETRY_CALOTOPOLOGY_ECALBARRELHARDCODEDTOPOLOGY_H 1
3 
4 #include <vector>
5 #include <iostream>
9 
11 public:
14 
16 
18  DetId goNorth(const DetId& id) const override { return incrementIphi(EBDetId(id)); }
19  std::vector<DetId> north(const DetId& id) const override {
20  EBDetId nextId = goNorth(id);
21  std::vector<DetId> vNeighborsDetId;
22  if (!(nextId == EBDetId(0)))
23  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
24  return vNeighborsDetId;
25  }
26 
28  DetId goSouth(const DetId& id) const override { return decrementIphi(EBDetId(id)); }
29  std::vector<DetId> south(const DetId& id) const override {
30  EBDetId nextId = goSouth(id);
31  std::vector<DetId> vNeighborsDetId;
32  if (!(nextId == EBDetId(0)))
33  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
34  return vNeighborsDetId;
35  }
36 
38  DetId goEast(const DetId& id) const override { return decrementIeta(EBDetId(id)); }
39  std::vector<DetId> east(const DetId& id) const override {
40  EBDetId nextId = goEast(id);
41  std::vector<DetId> vNeighborsDetId;
42  if (!(nextId == EBDetId(0)))
43  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
44  return vNeighborsDetId;
45  }
46 
48  DetId goWest(const DetId& id) const override { return incrementIeta(EBDetId(id)); }
49  std::vector<DetId> west(const DetId& id) const override {
50  EBDetId nextId = goWest(id);
51  std::vector<DetId> vNeighborsDetId;
52  if (!(nextId == EBDetId(0)))
53  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
54  return vNeighborsDetId;
55  }
56 
57  std::vector<DetId> up(const DetId& /*id*/) const override {
58  edm::LogVerbatim("CaloTopology") << "EcalBarrelHardcodedTopology::up() not yet implemented";
59  std::vector<DetId> vNeighborsDetId;
60  return vNeighborsDetId;
61  }
62 
63  std::vector<DetId> down(const DetId& /*id*/) const override {
64  edm::LogVerbatim("CaloTopology") << "EcalBarrelHardcodedTopology::down() not yet implemented";
65  std::vector<DetId> vNeighborsDetId;
66  return vNeighborsDetId;
67  }
68 
69 private:
71  EBDetId incrementIeta(const EBDetId&) const;
72 
74  EBDetId decrementIeta(const EBDetId&) const;
75 
77  EBDetId incrementIphi(const EBDetId&) const;
78 
80  EBDetId decrementIphi(const EBDetId&) const;
81 };
82 
83 #endif
Log< level::Info, true > LogVerbatim
EBDetId incrementIphi(const EBDetId &) const
move the nagivator to larger iphi (wraps around the barrel)
std::vector< DetId > north(const DetId &id) const override
std::vector< DetId > west(const DetId &id) const override
DetId goSouth(const DetId &id) const override
move the Topology south (decrement iphi)
DetId goNorth(const DetId &id) const override
move the Topology north (increment iphi)
std::vector< DetId > east(const DetId &id) const override
EBDetId incrementIeta(const EBDetId &) const
move the nagivator to larger ieta (more positive z) (stops at end of barrel and returns null) ...
std::vector< DetId > south(const DetId &id) const override
std::vector< DetId > down(const DetId &) const override
Definition: DetId.h:17
EBDetId decrementIeta(const EBDetId &) const
move the nagivator to smaller ieta (more negative z) (stops at end of barrel and returns null) ...
EBDetId decrementIphi(const EBDetId &) const
move the nagivator to smaller iphi (wraps around the barrel)
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
DetId goEast(const DetId &id) const override
move the Topology east (negative ieta)
std::vector< DetId > up(const DetId &) const override
DetId goWest(const DetId &id) const override
move the Topology west (positive ieta)
EcalBarrelHardcodedTopology()
create a new Topology