CMS 3D CMS Logo

EcalEndcapHardcodedTopology.h
Go to the documentation of this file.
1 #ifndef GEOMETRY_CALOTOPOLOGY_ECALENDCAPHARDCODEDTOPOLOGY_H
2 #define GEOMETRY_CALOTOPOLOGY_ECALENDCAPHARDCODEDTOPOLOGY_H 1
3 
4 #include <vector>
5 #include <iostream>
8 
10 public:
13 
15 
17  DetId goNorth(const DetId& id) const override { return incrementIy(EEDetId(id)); }
18  std::vector<DetId> north(const DetId& id) const override {
19  EEDetId nextId = goNorth(id);
20  std::vector<DetId> vNeighborsDetId;
21  if (!(nextId == EEDetId(0)))
22  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
23  return vNeighborsDetId;
24  }
25 
27  DetId goSouth(const DetId& id) const override { return decrementIy(EEDetId(id)); }
28  std::vector<DetId> south(const DetId& id) const override {
29  EEDetId nextId = goSouth(id);
30  std::vector<DetId> vNeighborsDetId;
31  if (!(nextId == EEDetId(0)))
32  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
33  return vNeighborsDetId;
34  }
35 
37  DetId goEast(const DetId& id) const override { return incrementIx(EEDetId(id)); }
38  std::vector<DetId> east(const DetId& id) const override {
39  EEDetId nextId = goEast(id);
40  std::vector<DetId> vNeighborsDetId;
41  if (!(nextId == EEDetId(0)))
42  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
43  return vNeighborsDetId;
44  }
45 
47  DetId goWest(const DetId& id) const override { return decrementIx(EEDetId(id)); }
48  std::vector<DetId> west(const DetId& id) const override {
49  EEDetId nextId = goWest(id);
50  std::vector<DetId> vNeighborsDetId;
51  if (!(nextId == EEDetId(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 << "EcalEndcapHardcodedTopology::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 << "EcalEndcapHardcodedTopology::down() not yet implemented" << std::endl;
64  std::vector<DetId> vNeighborsDetId;
65  return vNeighborsDetId;
66  }
67 
68 private:
70  EEDetId incrementIx(const EEDetId&) const;
71 
73  EEDetId decrementIx(const EEDetId&) const;
74 
76  EEDetId incrementIy(const EEDetId&) const;
77 
79  EEDetId decrementIy(const EEDetId&) const;
80 };
81 
82 #endif
EcalEndcapHardcodedTopology::up
std::vector< DetId > up(const DetId &) const override
Definition: EcalEndcapHardcodedTopology.h:56
gather_cfg.cout
cout
Definition: gather_cfg.py:144
EEDetId.h
EcalEndcapHardcodedTopology::west
std::vector< DetId > west(const DetId &id) const override
Definition: EcalEndcapHardcodedTopology.h:48
EcalEndcapHardcodedTopology::down
std::vector< DetId > down(const DetId &) const override
Definition: EcalEndcapHardcodedTopology.h:62
EcalEndcapHardcodedTopology::goNorth
DetId goNorth(const DetId &id) const override
move the Topology north (increment iy)
Definition: EcalEndcapHardcodedTopology.h:17
DetId
Definition: DetId.h:17
EcalEndcapHardcodedTopology::north
std::vector< DetId > north(const DetId &id) const override
Definition: EcalEndcapHardcodedTopology.h:18
EcalEndcapHardcodedTopology::decrementIx
EEDetId decrementIx(const EEDetId &) const
move the nagivator to smaller ix
Definition: EcalEndcapHardcodedTopology.cc:10
EcalEndcapHardcodedTopology::decrementIy
EEDetId decrementIy(const EEDetId &) const
move the nagivator to smaller iy
Definition: EcalEndcapHardcodedTopology.cc:24
EcalEndcapHardcodedTopology::goSouth
DetId goSouth(const DetId &id) const override
move the Topology south (decrement iy)
Definition: EcalEndcapHardcodedTopology.h:27
EEDetId
Definition: EEDetId.h:14
EcalEndcapHardcodedTopology::EcalEndcapHardcodedTopology
EcalEndcapHardcodedTopology()
create a new Topology
Definition: EcalEndcapHardcodedTopology.h:12
EcalEndcapHardcodedTopology::goWest
DetId goWest(const DetId &id) const override
move the Topology west (negative ix)
Definition: EcalEndcapHardcodedTopology.h:47
CaloSubdetectorTopology
Definition: CaloSubdetectorTopology.h:17
EcalEndcapHardcodedTopology::incrementIy
EEDetId incrementIy(const EEDetId &) const
move the nagivator to larger iy
Definition: EcalEndcapHardcodedTopology.cc:17
EcalEndcapHardcodedTopology::east
std::vector< DetId > east(const DetId &id) const override
Definition: EcalEndcapHardcodedTopology.h:38
EcalEndcapHardcodedTopology::goEast
DetId goEast(const DetId &id) const override
move the Topology east (positive ix)
Definition: EcalEndcapHardcodedTopology.h:37
CaloSubdetectorTopology.h
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
EcalEndcapHardcodedTopology::south
std::vector< DetId > south(const DetId &id) const override
Definition: EcalEndcapHardcodedTopology.h:28
EcalEndcapHardcodedTopology::incrementIx
EEDetId incrementIx(const EEDetId &) const
move the nagivator to larger ix
Definition: EcalEndcapHardcodedTopology.cc:3
EcalEndcapHardcodedTopology::~EcalEndcapHardcodedTopology
~EcalEndcapHardcodedTopology() override
Definition: EcalEndcapHardcodedTopology.h:14
EcalEndcapHardcodedTopology
Definition: EcalEndcapHardcodedTopology.h:9