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 std::vector<DetId> north(const DetId& id) const
28  {
29  EBDetId nextId(incrementIphi(EBDetId(id)));
30  std::vector<DetId> vNeighborsDetId;
31  if (! (nextId==EBDetId(0)))
32  vNeighborsDetId.push_back(DetId(nextId.rawId()));
33  return vNeighborsDetId;
34  }
35 
37  virtual std::vector<DetId> south(const DetId& id) const
38  {
39  EBDetId nextId(decrementIphi(EBDetId(id)));
40  std::vector<DetId> vNeighborsDetId;
41  if (! (nextId==EBDetId(0)))
42  vNeighborsDetId.push_back(DetId(nextId.rawId()));
43  return vNeighborsDetId;
44  }
45 
47  virtual std::vector<DetId> east(const DetId& id) const
48  {
49  EBDetId nextId(decrementIeta(EBDetId(id)));
50  std::vector<DetId> vNeighborsDetId;
51  if (! (nextId==EBDetId(0)))
52  vNeighborsDetId.push_back(DetId(nextId.rawId()));
53  return vNeighborsDetId;
54  }
55 
57  virtual std::vector<DetId> west(const DetId& id) const
58  {
59  EBDetId nextId(incrementIeta(EBDetId(id)));
60  std::vector<DetId> vNeighborsDetId;
61  if (! (nextId==EBDetId(0)))
62  vNeighborsDetId.push_back(DetId(nextId.rawId()));
63  return vNeighborsDetId;
64  }
65 
66  virtual std::vector<DetId> up(const DetId& /*id*/) const
67  {
68  std::cout << "EcalBarrelTopology::up() not yet implemented" << std::endl;
69  std::vector<DetId> vNeighborsDetId;
70  return vNeighborsDetId;
71  }
72 
73  virtual std::vector<DetId> down(const DetId& /*id*/) const
74  {
75  std::cout << "EcalBarrelTopology::down() not yet implemented" << std::endl;
76  std::vector<DetId> vNeighborsDetId;
77  return vNeighborsDetId;
78  }
79 
80  private:
81 
83  EBDetId incrementIeta(const EBDetId&) const ;
84 
86  EBDetId decrementIeta(const EBDetId&) const ;
87 
89  EBDetId incrementIphi(const EBDetId&) const ;
90 
92  EBDetId decrementIphi(const EBDetId&) const;
93 
95 };
96 
97 #endif
virtual std::vector< DetId > west(const DetId &id) const
move the Topology west (positive ieta)
virtual std::vector< DetId > north(const DetId &id) const
move the Topology north (increment iphi)
virtual std::vector< DetId > east(const DetId &id) const
move the Topology east (negative ieta)
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
virtual std::vector< DetId > down(const DetId &) const
virtual std::vector< DetId > south(const DetId &id) const
move the Topology south (decrement iphi)
EcalBarrelTopology(edm::ESHandle< CaloGeometry > theGeom)
create a new Topology from geometry
EBDetId decrementIeta(const EBDetId &) const
move the nagivator to smaller ieta (more negative z) (stops at end of barrel and returns null) ...
Definition: DetId.h:20
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)
tuple cout
Definition: gather_cfg.py:121
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