CMS 3D CMS Logo

EcalBarrelTopology.h
Go to the documentation of this file.
1 #ifndef GEOMETRY_CALOTOPOLOGY_ECALBARRELTOPOLOGY_H
2 #define GEOMETRY_CALOTOPOLOGY_ECALBARRELTOPOLOGY_H 1
3 
4 #include <utility>
5 #include <vector>
6 #include <iostream>
11 
13 public:
15  EcalBarrelTopology() : theGeom_(nullptr){};
16 
18  ~EcalBarrelTopology() override {}
19 
21  EcalBarrelTopology(CaloGeometry const& theGeom) {
23  }
24 
26  DetId goNorth(const DetId& id) const override { return incrementIphi(EBDetId(id)); }
27  std::vector<DetId> north(const DetId& id) const override {
28  EBDetId nextId = goNorth(id);
29  std::vector<DetId> vNeighborsDetId;
30  if (!(nextId == EBDetId(0)))
31  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
32  return vNeighborsDetId;
33  }
34 
36  DetId goSouth(const DetId& id) const override { return decrementIphi(EBDetId(id)); }
37  std::vector<DetId> south(const DetId& id) const override {
38  EBDetId nextId = goSouth(id);
39  std::vector<DetId> vNeighborsDetId;
40  if (!(nextId == EBDetId(0)))
41  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
42  return vNeighborsDetId;
43  }
44 
46  DetId goEast(const DetId& id) const override { return decrementIeta(EBDetId(id)); }
47  std::vector<DetId> east(const DetId& id) const override {
48  EBDetId nextId = goEast(id);
49  std::vector<DetId> vNeighborsDetId;
50  if (!(nextId == EBDetId(0)))
51  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
52  return vNeighborsDetId;
53  }
54 
56  DetId goWest(const DetId& id) const override { return incrementIeta(EBDetId(id)); }
57  std::vector<DetId> west(const DetId& id) const override {
58  EBDetId nextId = goWest(id);
59  std::vector<DetId> vNeighborsDetId;
60  if (!(nextId == EBDetId(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  EBDetId incrementIeta(const EBDetId&) const;
80 
82  EBDetId decrementIeta(const EBDetId&) const;
83 
85  EBDetId incrementIphi(const EBDetId&) const;
86 
88  EBDetId decrementIphi(const EBDetId&) const;
89 
91 };
92 
93 #endif
EcalBarrelTopology::EcalBarrelTopology
EcalBarrelTopology(CaloGeometry const &theGeom)
create a new Topology from geometry
Definition: EcalBarrelTopology.h:21
EBDetId
Definition: EBDetId.h:17
EcalBarrelTopology::incrementIphi
EBDetId incrementIphi(const EBDetId &) const
move the nagivator to larger iphi (wraps around the barrel)
Definition: EcalBarrelTopology.cc:48
EcalBarrelTopology::goNorth
DetId goNorth(const DetId &id) const override
move the Topology north (increment iphi)
Definition: EcalBarrelTopology.h:26
EcalBarrelTopology::east
std::vector< DetId > east(const DetId &id) const override
Definition: EcalBarrelTopology.h:47
gather_cfg.cout
cout
Definition: gather_cfg.py:144
EBDetId.h
EcalBarrelTopology
Definition: EcalBarrelTopology.h:12
CaloGeometry::getSubdetectorGeometry
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
EcalBarrelTopology::goSouth
DetId goSouth(const DetId &id) const override
move the Topology south (decrement iphi)
Definition: EcalBarrelTopology.h:36
EcalBarrelTopology::EcalBarrelTopology
EcalBarrelTopology()
create a new Topology
Definition: EcalBarrelTopology.h:15
EcalBarrel
Definition: EcalSubdetector.h:10
EcalBarrelTopology::incrementIeta
EBDetId incrementIeta(const EBDetId &) const
move the nagivator to larger ieta (more positive z) (stops at end of barrel and returns null)
Definition: EcalBarrelTopology.cc:3
EcalBarrelTopology::~EcalBarrelTopology
~EcalBarrelTopology() override
virtual destructor
Definition: EcalBarrelTopology.h:18
DetId
Definition: DetId.h:17
CaloGeometry
Definition: CaloGeometry.h:21
EcalBarrelTopology::north
std::vector< DetId > north(const DetId &id) const override
Definition: EcalBarrelTopology.h:27
EcalBarrelTopology::decrementIphi
EBDetId decrementIphi(const EBDetId &) const
move the nagivator to smaller iphi (wraps around the barrel)
Definition: EcalBarrelTopology.cc:72
EcalBarrelTopology::decrementIeta
EBDetId decrementIeta(const EBDetId &) const
move the nagivator to smaller ieta (more negative z) (stops at end of barrel and returns null)
Definition: EcalBarrelTopology.cc:25
EcalBarrelTopology::south
std::vector< DetId > south(const DetId &id) const override
Definition: EcalBarrelTopology.h:37
EcalBarrelTopology::theGeom_
const CaloSubdetectorGeometry * theGeom_
Definition: EcalBarrelTopology.h:90
EcalBarrelTopology::down
std::vector< DetId > down(const DetId &) const override
Definition: EcalBarrelTopology.h:71
CaloSubdetectorGeometry.h
EcalBarrelTopology::west
std::vector< DetId > west(const DetId &id) const override
Definition: EcalBarrelTopology.h:57
CaloSubdetectorTopology
Definition: CaloSubdetectorTopology.h:17
DetId::Ecal
Definition: DetId.h:27
EcalBarrelTopology::goWest
DetId goWest(const DetId &id) const override
move the Topology west (positive ieta)
Definition: EcalBarrelTopology.h:56
CaloSubdetectorTopology.h
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
CaloGeometry.h
CaloSubdetectorGeometry
Definition: CaloSubdetectorGeometry.h:22
EcalBarrelTopology::up
std::vector< DetId > up(const DetId &) const override
Definition: EcalBarrelTopology.h:65
EcalBarrelTopology::goEast
DetId goEast(const DetId &id) const override
move the Topology east (negative ieta)
Definition: EcalBarrelTopology.h:46