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 {
14 
15  public:
18 
20  ~EcalBarrelTopology() override { }
21 
24  {
25  }
26 
28  DetId goNorth(const DetId& id) const override {
29  return incrementIphi(EBDetId(id));
30  }
31  std::vector<DetId> north(const DetId& id) const override
32  {
33  EBDetId nextId=goNorth(id);
34  std::vector<DetId> vNeighborsDetId;
35  if (! (nextId==EBDetId(0)))
36  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
37  return vNeighborsDetId;
38  }
39 
41  DetId goSouth(const DetId& id) const override {
42  return decrementIphi(EBDetId(id));
43  }
44  std::vector<DetId> south(const DetId& id) const override
45  {
46  EBDetId nextId=goSouth(id);
47  std::vector<DetId> vNeighborsDetId;
48  if (! (nextId==EBDetId(0)))
49  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
50  return vNeighborsDetId;
51  }
52 
54  DetId goEast(const DetId& id) const override {
55  return decrementIeta(EBDetId(id));
56  }
57  std::vector<DetId> east(const DetId& id) const override
58  {
59  EBDetId nextId=goEast(id);
60  std::vector<DetId> vNeighborsDetId;
61  if (! (nextId==EBDetId(0)))
62  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
63  return vNeighborsDetId;
64  }
65 
67  DetId goWest(const DetId& id) const override {
68  return incrementIeta(EBDetId(id));
69  }
70  std::vector<DetId> west(const DetId& id) const override
71  {
72  EBDetId nextId=goWest(id);
73  std::vector<DetId> vNeighborsDetId;
74  if (! (nextId==EBDetId(0)))
75  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
76  return vNeighborsDetId;
77  }
78 
79 
80  std::vector<DetId> up(const DetId& /*id*/) const override
81  {
82  std::cout << "EcalBarrelTopology::up() not yet implemented" << std::endl;
83  std::vector<DetId> vNeighborsDetId;
84  return vNeighborsDetId;
85  }
86 
87  std::vector<DetId> down(const DetId& /*id*/) const override
88  {
89  std::cout << "EcalBarrelTopology::down() not yet implemented" << std::endl;
90  std::vector<DetId> vNeighborsDetId;
91  return vNeighborsDetId;
92  }
93 
94  private:
95 
97  EBDetId incrementIeta(const EBDetId&) const ;
98 
100  EBDetId decrementIeta(const EBDetId&) const ;
101 
103  EBDetId incrementIphi(const EBDetId&) const ;
104 
106  EBDetId decrementIphi(const EBDetId&) const;
107 
109 };
110 
111 #endif
DetId goNorth(const DetId &id) const override
move the Topology north (increment iphi)
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
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
edm::ESHandle< CaloGeometry > theGeom_
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) ...
def move(src, dest)
Definition: eostools.py:510
EcalBarrelTopology()
create a new Topology