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>
8 
10 {
11 
12  public:
15 
17 
19  DetId goNorth(const DetId& id) const override {
20  return incrementIphi(EBDetId(id));
21  }
22  std::vector<DetId> north(const DetId& id) const override
23  {
24  EBDetId nextId=goNorth(id);
25  std::vector<DetId> vNeighborsDetId;
26  if (! (nextId==EBDetId(0)))
27  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
28  return vNeighborsDetId;
29  }
30 
32  DetId goSouth(const DetId& id) const override {
33  return decrementIphi(EBDetId(id));
34  }
35  std::vector<DetId> south(const DetId& id) const override
36  {
37  EBDetId nextId=goSouth(id);
38  std::vector<DetId> vNeighborsDetId;
39  if (! (nextId==EBDetId(0)))
40  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
41  return vNeighborsDetId;
42  }
43 
45  DetId goEast(const DetId& id) const override {
46  return decrementIeta(EBDetId(id));
47  }
48  std::vector<DetId> east(const DetId& id) const override
49  {
50  EBDetId nextId=goEast(id);
51  std::vector<DetId> vNeighborsDetId;
52  if (! (nextId==EBDetId(0)))
53  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
54  return vNeighborsDetId;
55  }
56 
58  DetId goWest(const DetId& id) const override {
59  return incrementIeta(EBDetId(id));
60  }
61  std::vector<DetId> west(const DetId& id) const override
62  {
63  EBDetId nextId=goWest(id);
64  std::vector<DetId> vNeighborsDetId;
65  if (! (nextId==EBDetId(0)))
66  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
67  return vNeighborsDetId;
68  }
69 
70  std::vector<DetId> up(const DetId& /*id*/) const override
71  {
72  std::cout << "EcalBarrelHardcodedTopology::up() not yet implemented" << std::endl;
73  std::vector<DetId> vNeighborsDetId;
74  return vNeighborsDetId;
75  }
76 
77  std::vector<DetId> down(const DetId& /*id*/) const override
78  {
79  std::cout << "EcalBarrelHardcodedTopology::down() not yet implemented" << std::endl;
80  std::vector<DetId> vNeighborsDetId;
81  return vNeighborsDetId;
82  }
83 
84  private:
85 
87  EBDetId incrementIeta(const EBDetId&) const ;
88 
90  EBDetId decrementIeta(const EBDetId&) const ;
91 
93  EBDetId incrementIphi(const EBDetId&) const ;
94 
96  EBDetId decrementIphi(const EBDetId&) const;
97 
98 };
99 
100 #endif
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)
DetId goEast(const DetId &id) const override
move the Topology east (negative ieta)
std::vector< DetId > up(const DetId &) const override
std::vector< DetId > south(const DetId &id) const override
std::vector< DetId > east(const DetId &id) const override
EBDetId incrementIphi(const EBDetId &) const
move the nagivator to larger iphi (wraps around the barrel)
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
std::vector< DetId > north(const DetId &id) const override
EBDetId decrementIphi(const EBDetId &) const
move the nagivator to smaller iphi (wraps around the barrel)
std::vector< DetId > west(const DetId &id) const override
DetId goWest(const DetId &id) const override
move the Topology west (positive ieta)
Definition: DetId.h:18
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 > down(const DetId &) const override
EcalBarrelHardcodedTopology()
create a new Topology
EBDetId decrementIeta(const EBDetId &) const
move the nagivator to smaller ieta (more negative z) (stops at end of barrel and returns null) ...