CMS 3D CMS Logo

CaloTopology.h
Go to the documentation of this file.
1 #ifndef GEOMETRY_CALOTOPOLOGY_CALOTOPOLOGY_H
2 #define GEOMETRY_CALOTOPOLOGY_CALOTOPOLOGY_H 1
3 
6 #include <map>
7 #include <memory>
8 #include <vector>
9 
11 
19 class CaloTopology {
20 public:
21  typedef std::map<int, std::unique_ptr<const CaloSubdetectorTopology>> TopMap;
22 
23  CaloTopology();
24 
25  ~CaloTopology();
27  void setSubdetTopology(DetId::Detector det, int subdet, std::unique_ptr<const CaloSubdetectorTopology> geom);
33  bool valid(const DetId& id) const;
34 
36  std::vector<DetId> east(const DetId& id) const;
38  std::vector<DetId> west(const DetId& id) const;
40  std::vector<DetId> north(const DetId& id) const;
42  std::vector<DetId> south(const DetId& id) const;
44  std::vector<DetId> up(const DetId& id) const;
46  std::vector<DetId> down(const DetId& id) const;
48  std::vector<DetId> getNeighbours(const DetId& id, const CaloDirection& dir) const;
50  std::vector<DetId> getWindow(const DetId& id, const int& northSouthSize, const int& eastWestSize) const;
52  std::vector<DetId> getAllNeighbours(const DetId& id) const;
53 
54 private:
56  int makeIndex(DetId::Detector det, int subdet) const;
57 };
58 
59 #endif
CaloDirection
CaloDirection
Codes the local directions in the cell lattice.
Definition: CaloDirection.h:9
CaloDirection.h
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
Definition: CaloTopology.h:19
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()
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::CaloTopology
CaloTopology()
Definition: CaloTopology.cc:4
CaloTopology::TopMap
std::map< int, std::unique_ptr< const CaloSubdetectorTopology > > TopMap
Definition: CaloTopology.h:21
CaloTopology::valid
bool valid(const DetId &id) const
Is this a valid cell id?
Definition: CaloTopology.cc:74
DetId.h
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
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23