CMS 3D CMS Logo

CaloTopology.cc
Go to the documentation of this file.
3 
5 
7 
8 int CaloTopology::makeIndex(DetId::Detector det, int subdet) const { return (int(det) << 4) | (subdet & 0xF); }
9 
11  int subdet,
12  std::unique_ptr<const CaloSubdetectorTopology> geom) {
13  int index = makeIndex(det, subdet);
15 }
16 
18  auto i = theTopologies_.find(makeIndex(id.det(), id.subdetId()));
19  return (i == theTopologies_.end()) ? (nullptr) : (i->second.get());
20 }
21 
23  auto i = theTopologies_.find(makeIndex(det, subdet));
24  return (i == theTopologies_.end()) ? (nullptr) : (i->second.get());
25 }
26 
27 static const std::vector<DetId> emptyDetIdVector;
28 
29 std::vector<DetId> CaloTopology::east(const DetId& id) const {
31  return (topology == nullptr) ? (emptyDetIdVector) : (topology->east(id));
32 }
33 
34 std::vector<DetId> CaloTopology::west(const DetId& id) const {
36  return (topology == nullptr) ? (emptyDetIdVector) : (topology->west(id));
37 }
38 
39 std::vector<DetId> CaloTopology::north(const DetId& id) const {
41  return (topology == nullptr) ? (emptyDetIdVector) : (topology->north(id));
42 }
43 
44 std::vector<DetId> CaloTopology::south(const DetId& id) const {
46  return (topology == nullptr) ? (emptyDetIdVector) : (topology->south(id));
47 }
48 
49 std::vector<DetId> CaloTopology::up(const DetId& id) const {
51  return (topology == nullptr) ? (emptyDetIdVector) : (topology->up(id));
52 }
53 
54 std::vector<DetId> CaloTopology::down(const DetId& id) const {
56  return (topology == nullptr) ? (emptyDetIdVector) : (topology->down(id));
57 }
58 
59 std::vector<DetId> CaloTopology::getNeighbours(const DetId& id, const CaloDirection& dir) const {
61  return (topology == nullptr) ? (emptyDetIdVector) : (topology->getNeighbours(id, dir));
62 }
63 
64 std::vector<DetId> CaloTopology::getWindow(const DetId& id, const int& northSouthSize, const int& eastWestSize) const {
66  return (topology == nullptr) ? (emptyDetIdVector) : (topology->getWindow(id, northSouthSize, eastWestSize));
67 }
68 
69 std::vector<DetId> CaloTopology::getAllNeighbours(const DetId& id) const {
71  return (topology == nullptr) ? (emptyDetIdVector) : (topology->getAllNeighbours(id));
72 }
73 
74 bool CaloTopology::valid(const DetId& id) const {
76  return (geom == nullptr) ? (false) : (geom->valid(id));
77 }
CaloDirection
CaloDirection
Codes the local directions in the cell lattice.
Definition: CaloDirection.h:9
mps_fire.i
i
Definition: mps_fire.py:355
CaloTopology::down
std::vector< DetId > down(const DetId &id) const
Get the neighbors of the given cell in down direction (inward)
Definition: CaloTopology.cc:54
CaloTopology::makeIndex
int makeIndex(DetId::Detector det, int subdet) const
Definition: CaloTopology.cc:8
CaloTopology::south
std::vector< DetId > south(const DetId &id) const
Get the neighbors of the given cell in south direction.
Definition: CaloTopology.cc:44
CaloTopology::getWindow
std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
Get the neighbors of the given cell in a window of given size.
Definition: CaloTopology.cc:64
CaloTopology::setSubdetTopology
void setSubdetTopology(DetId::Detector det, int subdet, std::unique_ptr< const CaloSubdetectorTopology > geom)
Register a subdetector Topology.
Definition: CaloTopology.cc:10
CaloTopology::north
std::vector< DetId > north(const DetId &id) const
Get the neighbors of the given cell in north direction.
Definition: CaloTopology.cc:39
CaloTopology::getNeighbours
std::vector< DetId > getNeighbours(const DetId &id, const CaloDirection &dir) const
Get the neighbors of the given cell given direction.
Definition: CaloTopology.cc:59
CaloTopology::up
std::vector< DetId > up(const DetId &id) const
Get the neighbors of the given cell in up direction (outward)
Definition: CaloTopology.cc:49
DetId
Definition: DetId.h:17
CaloTopology::~CaloTopology
~CaloTopology()
ecaldqm::topology
const CaloTopology * topology(nullptr)
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
CaloTopology::east
std::vector< DetId > east(const DetId &id) const
Get the neighbors of the given cell in east direction.
Definition: CaloTopology.cc:29
CaloTopology::getSubdetectorTopology
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:17
CaloTopology::getAllNeighbours
std::vector< DetId > getAllNeighbours(const DetId &id) const
Get all the neighbors of the given cell.
Definition: CaloTopology.cc:69
DetId::Detector
Detector
Definition: DetId.h:24
CaloSubdetectorTopology
Definition: CaloSubdetectorTopology.h:17
CaloTopology.h
CaloSubdetectorTopology.h
CaloTopology::CaloTopology
CaloTopology()
Definition: CaloTopology.cc:4
eostools.move
def move(src, dest)
Definition: eostools.py:511
CaloTopology::valid
bool valid(const DetId &id) const
Is this a valid cell id?
Definition: CaloTopology.cc:74
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
CaloTopology::theTopologies_
TopMap theTopologies_
Definition: CaloTopology.h:55
CaloTopology::west
std::vector< DetId > west(const DetId &id) const
Get the neighbors of the given cell in west direction.
Definition: CaloTopology.cc:34
emptyDetIdVector
static const std::vector< DetId > emptyDetIdVector
Definition: CaloTopology.cc:27
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23