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>
12 
14 {
15 
16 public:
19 
21  ~EcalBarrelTopology() override { }
22 
26  }
27 
29  DetId goNorth(const DetId& id) const override {
30  return incrementIphi(EBDetId(id));
31  }
32  std::vector<DetId> north(const DetId& id) const override
33  {
34  EBDetId nextId=goNorth(id);
35  std::vector<DetId> vNeighborsDetId;
36  if (! (nextId==EBDetId(0)))
37  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
38  return vNeighborsDetId;
39  }
40 
42  DetId goSouth(const DetId& id) const override {
43  return decrementIphi(EBDetId(id));
44  }
45  std::vector<DetId> south(const DetId& id) const override
46  {
47  EBDetId nextId=goSouth(id);
48  std::vector<DetId> vNeighborsDetId;
49  if (! (nextId==EBDetId(0)))
50  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
51  return vNeighborsDetId;
52  }
53 
55  DetId goEast(const DetId& id) const override {
56  return decrementIeta(EBDetId(id));
57  }
58  std::vector<DetId> east(const DetId& id) const override
59  {
60  EBDetId nextId=goEast(id);
61  std::vector<DetId> vNeighborsDetId;
62  if (! (nextId==EBDetId(0)))
63  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
64  return vNeighborsDetId;
65  }
66 
68  DetId goWest(const DetId& id) const override {
69  return incrementIeta(EBDetId(id));
70  }
71  std::vector<DetId> west(const DetId& id) const override
72  {
73  EBDetId nextId=goWest(id);
74  std::vector<DetId> vNeighborsDetId;
75  if (! (nextId==EBDetId(0)))
76  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
77  return vNeighborsDetId;
78  }
79 
80 
81  std::vector<DetId> up(const DetId& /*id*/) const override
82  {
83  std::cout << "EcalBarrelTopology::up() not yet implemented" << std::endl;
84  std::vector<DetId> vNeighborsDetId;
85  return vNeighborsDetId;
86  }
87 
88  std::vector<DetId> down(const DetId& /*id*/) const override
89  {
90  std::cout << "EcalBarrelTopology::down() not yet implemented" << std::endl;
91  std::vector<DetId> vNeighborsDetId;
92  return vNeighborsDetId;
93  }
94 
95  private:
96 
98  EBDetId incrementIeta(const EBDetId&) const ;
99 
101  EBDetId decrementIeta(const EBDetId&) const ;
102 
104  EBDetId incrementIphi(const EBDetId&) const ;
105 
107  EBDetId decrementIphi(const EBDetId&) const;
108 
110 };
111 
112 #endif
DetId goNorth(const DetId &id) const override
move the Topology north (increment iphi)
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:44
std::vector< DetId > down(const DetId &) const override
std::vector< DetId > south(const DetId &id) const override
std::vector< DetId > up(const DetId &) const override
std::vector< DetId > north(const DetId &id) const override
#define nullptr
std::vector< DetId > west(const DetId &id) const override
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
~EcalBarrelTopology() override
virtual destructor
std::vector< DetId > east(const DetId &id) const override
EcalBarrelTopology(edm::ESHandle< CaloGeometry > theGeom)
create a new Topology from geometry
const CaloSubdetectorGeometry * theGeom_
DetId goWest(const DetId &id) const override
move the Topology west (positive ieta)
DetId goEast(const DetId &id) const override
move the Topology east (negative ieta)
EBDetId decrementIeta(const EBDetId &) const
move the nagivator to smaller ieta (more negative z) (stops at end of barrel and returns null) ...
DetId goSouth(const DetId &id) const override
move the Topology south (decrement iphi)
Definition: DetId.h:18
EBDetId decrementIphi(const EBDetId &) const
move the nagivator to smaller iphi (wraps around the barrel)
EBDetId incrementIphi(const EBDetId &) const
move the nagivator to larger iphi (wraps around the barrel)
EBDetId incrementIeta(const EBDetId &) const
move the nagivator to larger ieta (more positive z) (stops at end of barrel and returns null) ...
EcalBarrelTopology()
create a new Topology