CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
EcalEndcapTopology.h
Go to the documentation of this file.
1 #ifndef GEOMETRY_CALOTOPOLOGY_ECALENDCAPTOPOLOGY_H
2 #define GEOMETRY_CALOTOPOLOGY_ECALENDCAPTOPOLOGY_H 1
3 
8 #include <utility>
9 #include <vector>
10 #include <iostream>
11 
13 public:
15  EcalEndcapTopology() : theGeom_(nullptr){};
16 
18  ~EcalEndcapTopology() override {}
19 
21  EcalEndcapTopology(CaloGeometry const& theGeom) {
23  }
24 
26  DetId goNorth(const DetId& id) const override { return incrementIy(EEDetId(id)); }
27  std::vector<DetId> north(const DetId& id) const override {
28  EEDetId nextId = goNorth(id);
29  std::vector<DetId> vNeighborsDetId;
30  if (!(nextId == EEDetId(0)))
31  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
32  return vNeighborsDetId;
33  }
34 
36  DetId goSouth(const DetId& id) const override { return decrementIy(EEDetId(id)); }
37  std::vector<DetId> south(const DetId& id) const override {
38  EEDetId nextId = goSouth(id);
39  std::vector<DetId> vNeighborsDetId;
40  if (!(nextId == EEDetId(0)))
41  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
42  return vNeighborsDetId;
43  }
44 
46  DetId goEast(const DetId& id) const override { return incrementIx(EEDetId(id)); }
47  std::vector<DetId> east(const DetId& id) const override {
48  EEDetId nextId = goEast(id);
49  std::vector<DetId> vNeighborsDetId;
50  if (!(nextId == EEDetId(0)))
51  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
52  return vNeighborsDetId;
53  }
54 
56  DetId goWest(const DetId& id) const override { return decrementIx(EEDetId(id)); }
57  std::vector<DetId> west(const DetId& id) const override {
58  EEDetId nextId = goWest(id);
59  std::vector<DetId> vNeighborsDetId;
60  if (!(nextId == EEDetId(0)))
61  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
62  return vNeighborsDetId;
63  }
64 
65  std::vector<DetId> up(const DetId& /*id*/) const override {
66  std::cout << "EcalBarrelTopology::up() not yet implemented" << std::endl;
67  std::vector<DetId> vNeighborsDetId;
68  return vNeighborsDetId;
69  }
70 
71  std::vector<DetId> down(const DetId& /*id*/) const override {
72  std::cout << "EcalBarrelTopology::down() not yet implemented" << std::endl;
73  std::vector<DetId> vNeighborsDetId;
74  return vNeighborsDetId;
75  }
76 
77 private:
79  EEDetId incrementIx(const EEDetId& id) const;
80 
82  EEDetId decrementIx(const EEDetId& id) const;
83 
85  EEDetId incrementIy(const EEDetId& id) const;
86 
88  EEDetId decrementIy(const EEDetId& id) const;
89 
91 };
92 
93 #endif
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
std::vector< DetId > north(const DetId &id) const override
DetId goSouth(const DetId &id) const override
move the Topology south (decrement iy)
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
EEDetId incrementIy(const EEDetId &id) const
move the nagivator to larger iy
std::vector< DetId > south(const DetId &id) const override
EEDetId decrementIx(const EEDetId &id) const
move the nagivator to smaller ix
DetId goEast(const DetId &id) const override
move the Topology east (positive ix)
std::vector< DetId > east(const DetId &id) const override
EcalEndcapTopology(CaloGeometry const &theGeom)
create a new Topology from geometry
EEDetId decrementIy(const EEDetId &id) const
move the nagivator to smaller iy
std::vector< DetId > west(const DetId &id) const override
EEDetId incrementIx(const EEDetId &id) const
move the nagivator to larger ix
DetId goWest(const DetId &id) const override
move the Topology west (negative ix)
DetId goNorth(const DetId &id) const override
move the Topology north (increment iy)
Definition: DetId.h:17
std::vector< DetId > up(const DetId &) const override
~EcalEndcapTopology() override
virtual destructor
tuple cout
Definition: gather_cfg.py:144
EcalEndcapTopology()
create a new Topology
const CaloSubdetectorGeometry * theGeom_
std::vector< DetId > down(const DetId &) const override