CMS 3D CMS Logo

EcalPreshowerTopology.h
Go to the documentation of this file.
1 #ifndef GEOMETRY_CALOTOPOLOGY_ECALPRESHOWERTOPOLOGY_H
2 #define GEOMETRY_CALOTOPOLOGY_ECALPRESHOWERTOPOLOGY_H 1
3 
8 #include <utility>
9 #include <vector>
10 #include <iostream>
11 
13 public:
15  EcalPreshowerTopology() = default;
16 
18  ~EcalPreshowerTopology() override {}
19 
21  DetId goNorth(const DetId& id) const override { return incrementIy(ESDetId(id)); }
22  std::vector<DetId> north(const DetId& id) const override {
23  ESDetId nextId = goNorth(id);
24  std::vector<DetId> vNeighborsDetId;
25  if (!(nextId == ESDetId(0)))
26  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
27  return vNeighborsDetId;
28  }
29 
31  DetId goSouth(const DetId& id) const override { return decrementIy(ESDetId(id)); }
32  std::vector<DetId> south(const DetId& id) const override {
33  ESDetId nextId = goSouth(id);
34  std::vector<DetId> vNeighborsDetId;
35  if (!(nextId == ESDetId(0)))
36  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
37  return vNeighborsDetId;
38  }
39 
41  DetId goEast(const DetId& id) const override { return incrementIx(ESDetId(id)); }
42  std::vector<DetId> east(const DetId& id) const override {
43  ESDetId nextId = goEast(id);
44  std::vector<DetId> vNeighborsDetId;
45  if (!(nextId == ESDetId(0)))
46  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
47  return vNeighborsDetId;
48  }
49 
51  DetId goWest(const DetId& id) const override { return decrementIx(ESDetId(id)); }
52  std::vector<DetId> west(const DetId& id) const override {
53  ESDetId nextId = goWest(id);
54  std::vector<DetId> vNeighborsDetId;
55  if (!(nextId == ESDetId(0)))
56  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
57  return vNeighborsDetId;
58  }
59 
60  DetId goUp(const DetId& id) const override { return incrementIz(ESDetId(id)); }
61  std::vector<DetId> up(const DetId& id) const override {
62  ESDetId nextId = goUp(id);
63  std::vector<DetId> vNeighborsDetId;
64  if (!(nextId == ESDetId(0)))
65  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
66  return vNeighborsDetId;
67  }
68 
69  DetId goDown(const DetId& id) const override { return decrementIz(ESDetId(id)); }
70  std::vector<DetId> down(const DetId& id) const override {
71  ESDetId nextId = goDown(id);
72  std::vector<DetId> vNeighborsDetId;
73  if (!(nextId == ESDetId(0)))
74  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
75  return vNeighborsDetId;
76  }
77 
78 private:
80  ESDetId incrementIx(const ESDetId& id) const;
81 
83  ESDetId decrementIx(const ESDetId& id) const;
84 
86  ESDetId incrementIy(const ESDetId& id) const;
87 
89  ESDetId decrementIy(const ESDetId& id) const;
90 
92  ESDetId incrementIz(const ESDetId& id) const;
93 
95  ESDetId decrementIz(const ESDetId& id) const;
96 };
97 
98 #endif
EcalPreshowerTopology::south
std::vector< DetId > south(const DetId &id) const override
Definition: EcalPreshowerTopology.h:32
EcalPreshowerTopology::east
std::vector< DetId > east(const DetId &id) const override
Definition: EcalPreshowerTopology.h:42
EcalPreshowerTopology::decrementIy
ESDetId decrementIy(const ESDetId &id) const
move the nagivator to smaller iy
Definition: EcalPreshowerTopology.cc:32
EcalPreshowerTopology::~EcalPreshowerTopology
~EcalPreshowerTopology() override
virtual destructor
Definition: EcalPreshowerTopology.h:18
EcalPreshowerTopology::goWest
DetId goWest(const DetId &id) const override
move the Topology west (negative ix)
Definition: EcalPreshowerTopology.h:51
ESHandle.h
EcalPreshowerTopology::goSouth
DetId goSouth(const DetId &id) const override
move the Topology south (decrement iy)
Definition: EcalPreshowerTopology.h:31
EcalPreshowerTopology::north
std::vector< DetId > north(const DetId &id) const override
Definition: EcalPreshowerTopology.h:22
EcalPreshowerTopology::down
std::vector< DetId > down(const DetId &id) const override
Definition: EcalPreshowerTopology.h:70
EcalPreshowerTopology::EcalPreshowerTopology
EcalPreshowerTopology()=default
create a new Topology
EcalPreshowerTopology::decrementIz
ESDetId decrementIz(const ESDetId &id) const
move the nagivator to smaller iz
Definition: EcalPreshowerTopology.cc:122
EcalPreshowerTopology::goDown
DetId goDown(const DetId &id) const override
Definition: EcalPreshowerTopology.h:69
EcalPreshowerTopology::incrementIx
ESDetId incrementIx(const ESDetId &id) const
move the nagivator to larger ix
Definition: EcalPreshowerTopology.cc:58
EcalPreshowerTopology::incrementIy
ESDetId incrementIy(const ESDetId &id) const
move the nagivator to larger iy
Definition: EcalPreshowerTopology.cc:5
ESDetId
Definition: ESDetId.h:15
ESDetId.h
DetId
Definition: DetId.h:17
EcalPreshowerTopology::west
std::vector< DetId > west(const DetId &id) const override
Definition: EcalPreshowerTopology.h:52
EcalPreshowerTopology::goUp
DetId goUp(const DetId &id) const override
Definition: EcalPreshowerTopology.h:60
CaloSubdetectorTopology
Definition: CaloSubdetectorTopology.h:17
CaloSubdetectorTopology.h
EcalPreshowerTopology::up
std::vector< DetId > up(const DetId &id) const override
Definition: EcalPreshowerTopology.h:61
EcalPreshowerTopology::goNorth
DetId goNorth(const DetId &id) const override
move the Topology north (increment iy)
Definition: EcalPreshowerTopology.h:21
EcalPreshowerTopology::goEast
DetId goEast(const DetId &id) const override
move the Topology east (positive ix)
Definition: EcalPreshowerTopology.h:41
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
EcalPreshowerTopology::decrementIx
ESDetId decrementIx(const ESDetId &id) const
move the nagivator to smaller ix
Definition: EcalPreshowerTopology.cc:85
EcalPreshowerTopology
Definition: EcalPreshowerTopology.h:12
CaloGeometry.h
EcalPreshowerTopology::incrementIz
ESDetId incrementIz(const ESDetId &id) const
move the nagivator to larger iz
Definition: EcalPreshowerTopology.cc:111