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
std::vector< DetId > up(const DetId &id) const
Get the neighbors of the given cell in up direction (outward)
Definition: CaloTopology.cc:49
bool valid(const DetId &id) const
Is this a valid cell id?
Definition: CaloTopology.cc:74
std::vector< DetId > down(const DetId &id) const
Get the neighbors of the given cell in down direction (inward)
Definition: CaloTopology.cc:54
std::map< int, std::unique_ptr< const CaloSubdetectorTopology > > TopMap
Definition: CaloTopology.h:21
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
TopMap theTopologies_
Definition: CaloTopology.h:55
std::vector< DetId > east(const DetId &id) const
Get the neighbors of the given cell in east direction.
Definition: CaloTopology.cc:29
std::vector< DetId > getAllNeighbours(const DetId &id) const
Get all the neighbors of the given cell.
Definition: CaloTopology.cc:69
Definition: DetId.h:17
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:17
std::vector< DetId > west(const DetId &id) const
Get the neighbors of the given cell in west direction.
Definition: CaloTopology.cc:34
Detector
Definition: DetId.h:24
std::vector< DetId > getNeighbours(const DetId &id, const CaloDirection &dir) const
Get the neighbors of the given cell given direction.
Definition: CaloTopology.cc:59
int makeIndex(DetId::Detector det, int subdet) const
Definition: CaloTopology.cc:8
void setSubdetTopology(DetId::Detector det, int subdet, std::unique_ptr< const CaloSubdetectorTopology > geom)
Register a subdetector Topology.
Definition: CaloTopology.cc:10
CaloDirection
Codes the local directions in the cell lattice.
Definition: CaloDirection.h:9
std::vector< DetId > south(const DetId &id) const
Get the neighbors of the given cell in south direction.
Definition: CaloTopology.cc:44
std::vector< DetId > north(const DetId &id) const
Get the neighbors of the given cell in north direction.
Definition: CaloTopology.cc:39