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 public:
13 
15 
17  DetId goNorth(const DetId& id) const override { return incrementIphi(EBDetId(id)); }
18  std::vector<DetId> north(const DetId& id) const override {
19  EBDetId nextId = goNorth(id);
20  std::vector<DetId> vNeighborsDetId;
21  if (!(nextId == EBDetId(0)))
22  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
23  return vNeighborsDetId;
24  }
25 
27  DetId goSouth(const DetId& id) const override { return decrementIphi(EBDetId(id)); }
28  std::vector<DetId> south(const DetId& id) const override {
29  EBDetId nextId = goSouth(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 goEast(const DetId& id) const override { return decrementIeta(EBDetId(id)); }
38  std::vector<DetId> east(const DetId& id) const override {
39  EBDetId nextId = goEast(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 goWest(const DetId& id) const override { return incrementIeta(EBDetId(id)); }
48  std::vector<DetId> west(const DetId& id) const override {
49  EBDetId nextId = goWest(id);
50  std::vector<DetId> vNeighborsDetId;
51  if (!(nextId == EBDetId(0)))
52  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
53  return vNeighborsDetId;
54  }
55 
56  std::vector<DetId> up(const DetId& /*id*/) const override {
57  std::cout << "EcalBarrelHardcodedTopology::up() not yet implemented" << std::endl;
58  std::vector<DetId> vNeighborsDetId;
59  return vNeighborsDetId;
60  }
61 
62  std::vector<DetId> down(const DetId& /*id*/) const override {
63  std::cout << "EcalBarrelHardcodedTopology::down() not yet implemented" << std::endl;
64  std::vector<DetId> vNeighborsDetId;
65  return vNeighborsDetId;
66  }
67 
68 private:
70  EBDetId incrementIeta(const EBDetId&) const;
71 
73  EBDetId decrementIeta(const EBDetId&) const;
74 
76  EBDetId incrementIphi(const EBDetId&) const;
77 
79  EBDetId decrementIphi(const EBDetId&) const;
80 };
81 
82 #endif
EcalBarrelHardcodedTopology::north
std::vector< DetId > north(const DetId &id) const override
Definition: EcalBarrelHardcodedTopology.h:18
EBDetId
Definition: EBDetId.h:17
EcalBarrelHardcodedTopology::incrementIphi
EBDetId incrementIphi(const EBDetId &) const
move the nagivator to larger iphi (wraps around the barrel)
Definition: EcalBarrelHardcodedTopology.cc:21
gather_cfg.cout
cout
Definition: gather_cfg.py:144
EBDetId.h
EcalBarrelHardcodedTopology::decrementIeta
EBDetId decrementIeta(const EBDetId &) const
move the nagivator to smaller ieta (more negative z) (stops at end of barrel and returns null)
Definition: EcalBarrelHardcodedTopology.cc:12
EcalBarrelHardcodedTopology::east
std::vector< DetId > east(const DetId &id) const override
Definition: EcalBarrelHardcodedTopology.h:38
DetId
Definition: DetId.h:17
EcalBarrelHardcodedTopology::decrementIphi
EBDetId decrementIphi(const EBDetId &) const
move the nagivator to smaller iphi (wraps around the barrel)
Definition: EcalBarrelHardcodedTopology.cc:28
EcalBarrelHardcodedTopology::up
std::vector< DetId > up(const DetId &) const override
Definition: EcalBarrelHardcodedTopology.h:56
EcalBarrelHardcodedTopology
Definition: EcalBarrelHardcodedTopology.h:9
EcalBarrelHardcodedTopology::west
std::vector< DetId > west(const DetId &id) const override
Definition: EcalBarrelHardcodedTopology.h:48
EcalBarrelHardcodedTopology::goSouth
DetId goSouth(const DetId &id) const override
move the Topology south (decrement iphi)
Definition: EcalBarrelHardcodedTopology.h:27
EcalBarrelHardcodedTopology::south
std::vector< DetId > south(const DetId &id) const override
Definition: EcalBarrelHardcodedTopology.h:28
EcalBarrelHardcodedTopology::goWest
DetId goWest(const DetId &id) const override
move the Topology west (positive ieta)
Definition: EcalBarrelHardcodedTopology.h:47
CaloSubdetectorTopology
Definition: CaloSubdetectorTopology.h:17
EcalBarrelHardcodedTopology::incrementIeta
EBDetId incrementIeta(const EBDetId &) const
move the nagivator to larger ieta (more positive z) (stops at end of barrel and returns null)
Definition: EcalBarrelHardcodedTopology.cc:3
EcalBarrelHardcodedTopology::goNorth
DetId goNorth(const DetId &id) const override
move the Topology north (increment iphi)
Definition: EcalBarrelHardcodedTopology.h:17
CaloSubdetectorTopology.h
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
EcalBarrelHardcodedTopology::~EcalBarrelHardcodedTopology
~EcalBarrelHardcodedTopology() override
Definition: EcalBarrelHardcodedTopology.h:14
EcalBarrelHardcodedTopology::down
std::vector< DetId > down(const DetId &) const override
Definition: EcalBarrelHardcodedTopology.h:62
EcalBarrelHardcodedTopology::goEast
DetId goEast(const DetId &id) const override
move the Topology east (negative ieta)
Definition: EcalBarrelHardcodedTopology.h:37
EcalBarrelHardcodedTopology::EcalBarrelHardcodedTopology
EcalBarrelHardcodedTopology()
create a new Topology
Definition: EcalBarrelHardcodedTopology.h:12