CMS 3D CMS Logo

EcalEndcapTopology.h
Go to the documentation of this file.
1 #ifndef GEOMETRY_CALOTOPOLOGY_ECALENDCAPTOPOLOGY_H
2 #define GEOMETRY_CALOTOPOLOGY_ECALENDCAPTOPOLOGY_H 1
3 
8 #include <utility>
9 #include <vector>
10 #include <iostream>
11 
13 
14  public:
17 
19  ~EcalEndcapTopology() override { }
20 
23  {
24  }
25 
27  DetId goNorth(const DetId& id) const override {
28  return incrementIy(EEDetId(id));
29  }
30  std::vector<DetId> north(const DetId& id) const override
31  {
32  EEDetId nextId= goNorth(id);
33  std::vector<DetId> vNeighborsDetId;
34  if (! (nextId==EEDetId(0)))
35  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
36  return vNeighborsDetId;
37  }
38 
40  DetId goSouth(const DetId& id) const override {
41  return decrementIy(EEDetId(id));
42  }
43  std::vector<DetId> south(const DetId& id) const override
44  {
45  EEDetId nextId= goSouth(id);
46  std::vector<DetId> vNeighborsDetId;
47  if (! (nextId==EEDetId(0)))
48  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
49  return vNeighborsDetId;
50  }
51 
53  DetId goEast(const DetId& id) const override {
54  return incrementIx(EEDetId(id));
55  }
56  std::vector<DetId> east(const DetId& id) const override
57  {
58  EEDetId nextId=goEast(id);
59  std::vector<DetId> vNeighborsDetId;
60  if (! (nextId==EEDetId(0)))
61  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
62  return vNeighborsDetId;
63  }
64 
66  DetId goWest(const DetId& id) const override {
67  return decrementIx(EEDetId(id));
68  }
69  std::vector<DetId> west(const DetId& id) const override
70  {
71  EEDetId nextId=goWest(id);
72  std::vector<DetId> vNeighborsDetId;
73  if (! (nextId==EEDetId(0)))
74  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
75  return vNeighborsDetId;
76  }
77 
78  std::vector<DetId> up(const DetId& /*id*/) const override
79  {
80  std::cout << "EcalBarrelTopology::up() not yet implemented" << std::endl;
81  std::vector<DetId> vNeighborsDetId;
82  return vNeighborsDetId;
83  }
84 
85  std::vector<DetId> down(const DetId& /*id*/) const override
86  {
87  std::cout << "EcalBarrelTopology::down() not yet implemented" << std::endl;
88  std::vector<DetId> vNeighborsDetId;
89  return vNeighborsDetId;
90  }
91 
92  private:
93 
95  EEDetId incrementIx(const EEDetId& id) const ;
96 
98  EEDetId decrementIx(const EEDetId& id) const ;
99 
101  EEDetId incrementIy(const EEDetId& id) const ;
102 
104  EEDetId decrementIy(const EEDetId& id) const;
105 
107 };
108 
109 #endif
edm::ESHandle< CaloGeometry > theGeom_
std::vector< DetId > north(const DetId &id) const override
DetId goSouth(const DetId &id) const override
move the Topology south (decrement iy)
EEDetId incrementIy(const EEDetId &id) const
move the nagivator to larger iy
#define nullptr
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
EEDetId decrementIx(const EEDetId &id) const
move the nagivator to smaller ix
EEDetId decrementIy(const EEDetId &id) const
move the nagivator to smaller iy
std::vector< DetId > west(const DetId &id) const override
EEDetId incrementIx(const EEDetId &id) const
move the nagivator to larger ix
std::vector< DetId > up(const DetId &) const override
Definition: DetId.h:18
DetId goWest(const DetId &id) const override
move the Topology west (negative ix)
DetId goEast(const DetId &id) const override
move the Topology east (positive ix)
std::vector< DetId > down(const DetId &) const override
EcalEndcapTopology(edm::ESHandle< CaloGeometry > theGeom)
create a new Topology from geometry
~EcalEndcapTopology() override
virtual destructor
std::vector< DetId > south(const DetId &id) const override
std::vector< DetId > east(const DetId &id) const override
DetId goNorth(const DetId &id) const override
move the Topology north (increment iy)
def move(src, dest)
Definition: eostools.py:510
EcalEndcapTopology()
create a new Topology