CMS 3D CMS Logo

EcalBarrelHardcodedTopology.h
Go to the documentation of this file.
1 #ifndef GEOMETRY_CALOTOPOLOGY_ECALBARRELHARDCODEDTOPOLOGY_H
2 #define GEOMETRY_CALOTOPOLOGY_ECALBARRELHARDCODEDTOPOLOGY_H 1
3 
4 #include <vector>
5 #include <iostream>
8 
10 {
11 
12  public:
15 
17 
19  virtual DetId goNorth(const DetId& id) const {
20  return incrementIphi(EBDetId(id));
21  }
22  virtual std::vector<DetId> north(const DetId& id) const
23  {
24  EBDetId nextId=goNorth(id);
25  std::vector<DetId> vNeighborsDetId;
26  if (! (nextId==EBDetId(0)))
27  vNeighborsDetId.push_back(DetId(nextId.rawId()));
28  return vNeighborsDetId;
29  }
30 
32  virtual DetId goSouth(const DetId& id) const {
33  return decrementIphi(EBDetId(id));
34  }
35  virtual std::vector<DetId> south(const DetId& id) const
36  {
37  EBDetId nextId=goSouth(id);
38  std::vector<DetId> vNeighborsDetId;
39  if (! (nextId==EBDetId(0)))
40  vNeighborsDetId.push_back(DetId(nextId.rawId()));
41  return vNeighborsDetId;
42  }
43 
45  virtual DetId goEast(const DetId& id) const {
46  return decrementIeta(EBDetId(id));
47  }
48  virtual std::vector<DetId> east(const DetId& id) const
49  {
50  EBDetId nextId=goEast(id);
51  std::vector<DetId> vNeighborsDetId;
52  if (! (nextId==EBDetId(0)))
53  vNeighborsDetId.push_back(DetId(nextId.rawId()));
54  return vNeighborsDetId;
55  }
56 
58  virtual DetId goWest(const DetId& id) const {
59  return incrementIeta(EBDetId(id));
60  }
61  virtual std::vector<DetId> west(const DetId& id) const
62  {
63  EBDetId nextId=goWest(id);
64  std::vector<DetId> vNeighborsDetId;
65  if (! (nextId==EBDetId(0)))
66  vNeighborsDetId.push_back(DetId(nextId.rawId()));
67  return vNeighborsDetId;
68  }
69 
70  virtual std::vector<DetId> up(const DetId& /*id*/) const
71  {
72  std::cout << "EcalBarrelHardcodedTopology::up() not yet implemented" << std::endl;
73  std::vector<DetId> vNeighborsDetId;
74  return vNeighborsDetId;
75  }
76 
77  virtual std::vector<DetId> down(const DetId& /*id*/) const
78  {
79  std::cout << "EcalBarrelHardcodedTopology::down() not yet implemented" << std::endl;
80  std::vector<DetId> vNeighborsDetId;
81  return vNeighborsDetId;
82  }
83 
84  private:
85 
87  EBDetId incrementIeta(const EBDetId&) const ;
88 
90  EBDetId decrementIeta(const EBDetId&) const ;
91 
93  EBDetId incrementIphi(const EBDetId&) const ;
94 
96  EBDetId decrementIphi(const EBDetId&) const;
97 
98 };
99 
100 #endif
virtual DetId goEast(const DetId &id) const
move the Topology east (negative ieta)
EBDetId incrementIphi(const EBDetId &) const
move the nagivator to larger iphi (wraps around the barrel)
virtual DetId goNorth(const DetId &id) const
move the Topology north (increment iphi)
virtual std::vector< DetId > east(const DetId &id) const
EBDetId decrementIphi(const EBDetId &) const
move the nagivator to smaller iphi (wraps around the barrel)
virtual DetId goSouth(const DetId &id) const
move the Topology south (decrement iphi)
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
virtual std::vector< DetId > south(const DetId &id) const
Definition: DetId.h:18
virtual std::vector< DetId > up(const DetId &) const
virtual std::vector< DetId > down(const DetId &) const
virtual std::vector< DetId > west(const DetId &id) const
EBDetId incrementIeta(const EBDetId &) const
move the nagivator to larger ieta (more positive z) (stops at end of barrel and returns null) ...
virtual DetId goWest(const DetId &id) const
move the Topology west (positive ieta)
virtual std::vector< DetId > north(const DetId &id) const
EcalBarrelHardcodedTopology()
create a new Topology
EBDetId decrementIeta(const EBDetId &) const
move the nagivator to smaller ieta (more negative z) (stops at end of barrel and returns null) ...