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 public:
15  EcalEndcapTopology() : theGeom_(nullptr){};
16 
18  ~EcalEndcapTopology() override {}
19 
21  EcalEndcapTopology(CaloGeometry const& theGeom) {
23  }
24 
26  DetId goNorth(const DetId& id) const override { return incrementIy(EEDetId(id)); }
27  std::vector<DetId> north(const DetId& id) const override {
28  EEDetId nextId = goNorth(id);
29  std::vector<DetId> vNeighborsDetId;
30  if (!(nextId == EEDetId(0)))
31  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
32  return vNeighborsDetId;
33  }
34 
36  DetId goSouth(const DetId& id) const override { return decrementIy(EEDetId(id)); }
37  std::vector<DetId> south(const DetId& id) const override {
38  EEDetId nextId = goSouth(id);
39  std::vector<DetId> vNeighborsDetId;
40  if (!(nextId == EEDetId(0)))
41  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
42  return vNeighborsDetId;
43  }
44 
46  DetId goEast(const DetId& id) const override { return incrementIx(EEDetId(id)); }
47  std::vector<DetId> east(const DetId& id) const override {
48  EEDetId nextId = goEast(id);
49  std::vector<DetId> vNeighborsDetId;
50  if (!(nextId == EEDetId(0)))
51  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
52  return vNeighborsDetId;
53  }
54 
56  DetId goWest(const DetId& id) const override { return decrementIx(EEDetId(id)); }
57  std::vector<DetId> west(const DetId& id) const override {
58  EEDetId nextId = goWest(id);
59  std::vector<DetId> vNeighborsDetId;
60  if (!(nextId == EEDetId(0)))
61  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
62  return vNeighborsDetId;
63  }
64 
65  std::vector<DetId> up(const DetId& /*id*/) const override {
66  std::cout << "EcalBarrelTopology::up() not yet implemented" << std::endl;
67  std::vector<DetId> vNeighborsDetId;
68  return vNeighborsDetId;
69  }
70 
71  std::vector<DetId> down(const DetId& /*id*/) const override {
72  std::cout << "EcalBarrelTopology::down() not yet implemented" << std::endl;
73  std::vector<DetId> vNeighborsDetId;
74  return vNeighborsDetId;
75  }
76 
77 private:
79  EEDetId incrementIx(const EEDetId& id) const;
80 
82  EEDetId decrementIx(const EEDetId& id) const;
83 
85  EEDetId incrementIy(const EEDetId& id) const;
86 
88  EEDetId decrementIy(const EEDetId& id) const;
89 
91 };
92 
93 #endif
EcalEndcapTopology::goSouth
DetId goSouth(const DetId &id) const override
move the Topology south (decrement iy)
Definition: EcalEndcapTopology.h:36
EcalEndcapTopology
Definition: EcalEndcapTopology.h:12
gather_cfg.cout
cout
Definition: gather_cfg.py:144
EcalEndcapTopology::incrementIy
EEDetId incrementIy(const EEDetId &id) const
move the nagivator to larger iy
Definition: EcalEndcapTopology.cc:3
EEDetId.h
EcalEndcapTopology::EcalEndcapTopology
EcalEndcapTopology()
create a new Topology
Definition: EcalEndcapTopology.h:15
CaloGeometry::getSubdetectorGeometry
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
EcalEndcapTopology::theGeom_
const CaloSubdetectorGeometry * theGeom_
Definition: EcalEndcapTopology.h:90
EcalEndcapTopology::decrementIy
EEDetId decrementIy(const EEDetId &id) const
move the nagivator to smaller iy
Definition: EcalEndcapTopology.cc:19
DetId
Definition: DetId.h:17
CaloGeometry
Definition: CaloGeometry.h:21
EcalEndcapTopology::up
std::vector< DetId > up(const DetId &) const override
Definition: EcalEndcapTopology.h:65
EcalEndcapTopology::goNorth
DetId goNorth(const DetId &id) const override
move the Topology north (increment iy)
Definition: EcalEndcapTopology.h:26
EEDetId
Definition: EEDetId.h:14
EcalEndcapTopology::south
std::vector< DetId > south(const DetId &id) const override
Definition: EcalEndcapTopology.h:37
EcalEndcap
Definition: EcalSubdetector.h:10
CaloSubdetectorGeometry.h
EcalEndcapTopology::~EcalEndcapTopology
~EcalEndcapTopology() override
virtual destructor
Definition: EcalEndcapTopology.h:18
EcalEndcapTopology::goEast
DetId goEast(const DetId &id) const override
move the Topology east (positive ix)
Definition: EcalEndcapTopology.h:46
EcalEndcapTopology::east
std::vector< DetId > east(const DetId &id) const override
Definition: EcalEndcapTopology.h:47
EcalEndcapTopology::EcalEndcapTopology
EcalEndcapTopology(CaloGeometry const &theGeom)
create a new Topology from geometry
Definition: EcalEndcapTopology.h:21
CaloSubdetectorTopology
Definition: CaloSubdetectorTopology.h:17
DetId::Ecal
Definition: DetId.h:27
CaloSubdetectorTopology.h
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
EcalEndcapTopology::west
std::vector< DetId > west(const DetId &id) const override
Definition: EcalEndcapTopology.h:57
CaloGeometry.h
CaloSubdetectorGeometry
Definition: CaloSubdetectorGeometry.h:22
EcalEndcapTopology::goWest
DetId goWest(const DetId &id) const override
move the Topology west (negative ix)
Definition: EcalEndcapTopology.h:56
EcalEndcapTopology::down
std::vector< DetId > down(const DetId &) const override
Definition: EcalEndcapTopology.h:71
EcalEndcapTopology::incrementIx
EEDetId incrementIx(const EEDetId &id) const
move the nagivator to larger ix
Definition: EcalEndcapTopology.cc:35
EcalEndcapTopology::decrementIx
EEDetId decrementIx(const EEDetId &id) const
move the nagivator to smaller ix
Definition: EcalEndcapTopology.cc:52
EcalEndcapTopology::north
std::vector< DetId > north(const DetId &id) const override
Definition: EcalEndcapTopology.h:27