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 
9 #include <utility>
10 #include <vector>
11 #include <iostream>
12 
14 
15 public:
18 
20  ~EcalEndcapTopology() override { }
21 
23  EcalEndcapTopology(CaloGeometry const& theGeom) {
25  }
26 
28  DetId goNorth(const DetId& id) const override {
29  return incrementIy(EEDetId(id));
30  }
31  std::vector<DetId> north(const DetId& id) const override
32  {
33  EEDetId nextId= goNorth(id);
34  std::vector<DetId> vNeighborsDetId;
35  if (! (nextId==EEDetId(0)))
36  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
37  return vNeighborsDetId;
38  }
39 
41  DetId goSouth(const DetId& id) const override {
42  return decrementIy(EEDetId(id));
43  }
44  std::vector<DetId> south(const DetId& id) const override
45  {
46  EEDetId nextId= goSouth(id);
47  std::vector<DetId> vNeighborsDetId;
48  if (! (nextId==EEDetId(0)))
49  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
50  return vNeighborsDetId;
51  }
52 
54  DetId goEast(const DetId& id) const override {
55  return incrementIx(EEDetId(id));
56  }
57  std::vector<DetId> east(const DetId& id) const override
58  {
59  EEDetId nextId=goEast(id);
60  std::vector<DetId> vNeighborsDetId;
61  if (! (nextId==EEDetId(0)))
62  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
63  return vNeighborsDetId;
64  }
65 
67  DetId goWest(const DetId& id) const override {
68  return decrementIx(EEDetId(id));
69  }
70  std::vector<DetId> west(const DetId& id) const override
71  {
72  EEDetId nextId=goWest(id);
73  std::vector<DetId> vNeighborsDetId;
74  if (! (nextId==EEDetId(0)))
75  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
76  return vNeighborsDetId;
77  }
78 
79  std::vector<DetId> up(const DetId& /*id*/) const override
80  {
81  std::cout << "EcalBarrelTopology::up() not yet implemented" << std::endl;
82  std::vector<DetId> vNeighborsDetId;
83  return vNeighborsDetId;
84  }
85 
86  std::vector<DetId> down(const DetId& /*id*/) const override
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  EEDetId incrementIx(const EEDetId& id) const ;
97 
99  EEDetId decrementIx(const EEDetId& id) const ;
100 
102  EEDetId incrementIy(const EEDetId& id) const ;
103 
105  EEDetId decrementIy(const EEDetId& id) const;
106 
108 };
109 
110 #endif
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:49
std::vector< DetId > north(const DetId &id) const override
#define nullptr
DetId goSouth(const DetId &id) const override
move the Topology south (decrement iy)
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
EEDetId incrementIy(const EEDetId &id) const
move the nagivator to larger iy
EEDetId decrementIx(const EEDetId &id) const
move the nagivator to smaller ix
EcalEndcapTopology(CaloGeometry const &theGeom)
create a new Topology from geometry
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() 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)
EcalEndcapTopology()
create a new Topology
const CaloSubdetectorGeometry * theGeom_