CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 <vector>
5 #include <iostream>
10 
12 {
13 
14  public:
17 
19  virtual ~EcalBarrelTopology() { }
20 
23  {
24  }
25 
27  virtual DetId goNorth(const DetId& id) const {
28  return incrementIphi(EBDetId(id));
29  }
30  virtual std::vector<DetId> north(const DetId& id) const
31  {
32  EBDetId nextId=goNorth(id);
33  std::vector<DetId> vNeighborsDetId;
34  if (! (nextId==EBDetId(0)))
35  vNeighborsDetId.push_back(DetId(nextId.rawId()));
36  return vNeighborsDetId;
37  }
38 
40  virtual DetId goSouth(const DetId& id) const {
41  return decrementIphi(EBDetId(id));
42  }
43  virtual std::vector<DetId> south(const DetId& id) const
44  {
45  EBDetId nextId=goSouth(id);
46  std::vector<DetId> vNeighborsDetId;
47  if (! (nextId==EBDetId(0)))
48  vNeighborsDetId.push_back(DetId(nextId.rawId()));
49  return vNeighborsDetId;
50  }
51 
53  virtual DetId goEast(const DetId& id) const {
54  return decrementIeta(EBDetId(id));
55  }
56  virtual std::vector<DetId> east(const DetId& id) const
57  {
58  EBDetId nextId=goEast(id);
59  std::vector<DetId> vNeighborsDetId;
60  if (! (nextId==EBDetId(0)))
61  vNeighborsDetId.push_back(DetId(nextId.rawId()));
62  return vNeighborsDetId;
63  }
64 
66  virtual DetId goWest(const DetId& id) const {
67  return incrementIeta(EBDetId(id));
68  }
69  virtual std::vector<DetId> west(const DetId& id) const
70  {
71  EBDetId nextId=goWest(id);
72  std::vector<DetId> vNeighborsDetId;
73  if (! (nextId==EBDetId(0)))
74  vNeighborsDetId.push_back(DetId(nextId.rawId()));
75  return vNeighborsDetId;
76  }
77 
78 
79  virtual std::vector<DetId> up(const DetId& /*id*/) const
80  {
81  std::cout << "EcalBarrelTopology::up() not yet implemented" << std::endl;
82  std::vector<DetId> vNeighborsDetId;
83  return vNeighborsDetId;
84  }
85 
86  virtual std::vector<DetId> down(const DetId& /*id*/) const
87  {
88  std::cout << "EcalBarrelTopology::down() not yet implemented" << std::endl;
89  std::vector<DetId> vNeighborsDetId;
90  return vNeighborsDetId;
91  }
92 
93  private:
94 
96  EBDetId incrementIeta(const EBDetId&) const ;
97 
99  EBDetId decrementIeta(const EBDetId&) const ;
100 
102  EBDetId incrementIphi(const EBDetId&) const ;
103 
105  EBDetId decrementIphi(const EBDetId&) const;
106 
108 };
109 
110 #endif
virtual std::vector< DetId > west(const DetId &id) const
virtual std::vector< DetId > north(const DetId &id) const
virtual std::vector< DetId > east(const DetId &id) const
virtual DetId goEast(const DetId &id) const
move the Topology east (negative ieta)
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
virtual std::vector< DetId > down(const DetId &) const
virtual std::vector< DetId > south(const DetId &id) const
EcalBarrelTopology(edm::ESHandle< CaloGeometry > theGeom)
create a new Topology from geometry
virtual DetId goWest(const DetId &id) const
move the Topology west (positive ieta)
EBDetId decrementIeta(const EBDetId &) const
move the nagivator to smaller ieta (more negative z) (stops at end of barrel and returns null) ...
virtual DetId goSouth(const DetId &id) const
move the Topology south (decrement iphi)
Definition: DetId.h:18
edm::ESHandle< CaloGeometry > theGeom_
virtual DetId goNorth(const DetId &id) const
move the Topology north (increment iphi)
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)
tuple cout
Definition: gather_cfg.py:145
virtual ~EcalBarrelTopology()
virtual destructor
EBDetId incrementIeta(const EBDetId &) const
move the nagivator to larger ieta (more positive z) (stops at end of barrel and returns null) ...
virtual std::vector< DetId > up(const DetId &) const
EcalBarrelTopology()
create a new Topology