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 
7 #include <utility>
8 #include <vector>
9 #include <iostream>
10 
12 public:
14  EcalPreshowerTopology() = default;
15 
17  ~EcalPreshowerTopology() override {}
18 
20  DetId goNorth(const DetId& id) const override { return incrementIy(ESDetId(id)); }
21  std::vector<DetId> north(const DetId& id) const override {
22  ESDetId nextId = goNorth(id);
23  std::vector<DetId> vNeighborsDetId;
24  if (!(nextId == ESDetId(0)))
25  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
26  return vNeighborsDetId;
27  }
28 
30  DetId goSouth(const DetId& id) const override { return decrementIy(ESDetId(id)); }
31  std::vector<DetId> south(const DetId& id) const override {
32  ESDetId nextId = goSouth(id);
33  std::vector<DetId> vNeighborsDetId;
34  if (!(nextId == ESDetId(0)))
35  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
36  return vNeighborsDetId;
37  }
38 
40  DetId goEast(const DetId& id) const override { return incrementIx(ESDetId(id)); }
41  std::vector<DetId> east(const DetId& id) const override {
42  ESDetId nextId = goEast(id);
43  std::vector<DetId> vNeighborsDetId;
44  if (!(nextId == ESDetId(0)))
45  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
46  return vNeighborsDetId;
47  }
48 
50  DetId goWest(const DetId& id) const override { return decrementIx(ESDetId(id)); }
51  std::vector<DetId> west(const DetId& id) const override {
52  ESDetId nextId = goWest(id);
53  std::vector<DetId> vNeighborsDetId;
54  if (!(nextId == ESDetId(0)))
55  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
56  return vNeighborsDetId;
57  }
58 
59  DetId goUp(const DetId& id) const override { return incrementIz(ESDetId(id)); }
60  std::vector<DetId> up(const DetId& id) const override {
61  ESDetId nextId = goUp(id);
62  std::vector<DetId> vNeighborsDetId;
63  if (!(nextId == ESDetId(0)))
64  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
65  return vNeighborsDetId;
66  }
67 
68  DetId goDown(const DetId& id) const override { return decrementIz(ESDetId(id)); }
69  std::vector<DetId> down(const DetId& id) const override {
70  ESDetId nextId = goDown(id);
71  std::vector<DetId> vNeighborsDetId;
72  if (!(nextId == ESDetId(0)))
73  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
74  return vNeighborsDetId;
75  }
76 
77 private:
79  ESDetId incrementIx(const ESDetId& id) const;
80 
82  ESDetId decrementIx(const ESDetId& id) const;
83 
85  ESDetId incrementIy(const ESDetId& id) const;
86 
88  ESDetId decrementIy(const ESDetId& id) const;
89 
91  ESDetId incrementIz(const ESDetId& id) const;
92 
94  ESDetId decrementIz(const ESDetId& id) const;
95 };
96 
97 #endif
EcalPreshowerTopology::south
std::vector< DetId > south(const DetId &id) const override
Definition: EcalPreshowerTopology.h:31
EcalPreshowerTopology::east
std::vector< DetId > east(const DetId &id) const override
Definition: EcalPreshowerTopology.h:41
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:17
EcalPreshowerTopology::goWest
DetId goWest(const DetId &id) const override
move the Topology west (negative ix)
Definition: EcalPreshowerTopology.h:50
EcalPreshowerTopology::goSouth
DetId goSouth(const DetId &id) const override
move the Topology south (decrement iy)
Definition: EcalPreshowerTopology.h:30
EcalPreshowerTopology::north
std::vector< DetId > north(const DetId &id) const override
Definition: EcalPreshowerTopology.h:21
EcalPreshowerTopology::down
std::vector< DetId > down(const DetId &id) const override
Definition: EcalPreshowerTopology.h:69
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:68
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:51
EcalPreshowerTopology::goUp
DetId goUp(const DetId &id) const override
Definition: EcalPreshowerTopology.h:59
CaloSubdetectorTopology
Definition: CaloSubdetectorTopology.h:17
CaloSubdetectorTopology.h
EcalPreshowerTopology::up
std::vector< DetId > up(const DetId &id) const override
Definition: EcalPreshowerTopology.h:60
EcalPreshowerTopology::goNorth
DetId goNorth(const DetId &id) const override
move the Topology north (increment iy)
Definition: EcalPreshowerTopology.h:20
EcalPreshowerTopology::goEast
DetId goEast(const DetId &id) const override
move the Topology east (positive ix)
Definition: EcalPreshowerTopology.h:40
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:11
CaloGeometry.h
EcalPreshowerTopology::incrementIz
ESDetId incrementIz(const ESDetId &id) const
move the nagivator to larger iz
Definition: EcalPreshowerTopology.cc:111