CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 <vector>
8 
10 
19 class CaloTopology {
20 public:
21 
22  typedef std::map<int, const CaloSubdetectorTopology*> TopMap ;
23 
24  CaloTopology();
25 
26  ~CaloTopology();
28  void setSubdetTopology(DetId::Detector det, int subdet, const CaloSubdetectorTopology* geom);
34  bool valid(const DetId& id) const;
35 
37  std::vector<DetId> east(const DetId& id) const;
39  std::vector<DetId> west(const DetId& id) const;
41  std::vector<DetId> north(const DetId& id) const;
43  std::vector<DetId> south(const DetId& id) const;
45  std::vector<DetId> up(const DetId& id) const;
47  std::vector<DetId> down(const DetId& id) const;
49  std::vector<DetId> getNeighbours(const DetId& id, const CaloDirection& dir) const;
51  std::vector<DetId> getWindow(const DetId& id, const int& northSouthSize, const int& eastWestSize) const;
53  std::vector<DetId> getAllNeighbours(const DetId& id) const;
54 
55 private:
57  int makeIndex(DetId::Detector det, int subdet) const;
58 };
59 
60 
61 
62 #endif
std::map< int, const CaloSubdetectorTopology * > TopMap
Definition: CaloTopology.h:22
std::vector< DetId > down(const DetId &id) const
Get the neighbors of the given cell in down direction (inward)
Definition: CaloTopology.cc:63
std::vector< DetId > getAllNeighbours(const DetId &id) const
Get all the neighbors of the given cell.
Definition: CaloTopology.cc:78
std::vector< DetId > up(const DetId &id) const
Get the neighbors of the given cell in up direction (outward)
Definition: CaloTopology.cc:58
TopMap theTopologies_
Definition: CaloTopology.h:56
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:73
int makeIndex(DetId::Detector det, int subdet) const
Definition: CaloTopology.cc:17
std::vector< DetId > east(const DetId &id) const
Get the neighbors of the given cell in east direction.
Definition: CaloTopology.cc:38
std::vector< DetId > north(const DetId &id) const
Get the neighbors of the given cell in north direction.
Definition: CaloTopology.cc:48
void setSubdetTopology(DetId::Detector det, int subdet, const CaloSubdetectorTopology *geom)
Register a subdetector Topology.
Definition: CaloTopology.cc:21
Definition: DetId.h:20
bool valid(const DetId &id) const
Is this a valid cell id?
Definition: CaloTopology.cc:83
std::vector< DetId > west(const DetId &id) const
Get the neighbors of the given cell in west direction.
Definition: CaloTopology.cc:43
Detector
Definition: DetId.h:26
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:26
dbl *** dir
Definition: mlp_gen.cc:35
CaloDirection
Codes the local directions in the cell lattice.
Definition: CaloDirection.h:9
std::vector< DetId > getNeighbours(const DetId &id, const CaloDirection &dir) const
Get the neighbors of the given cell given direction.
Definition: CaloTopology.cc:68
std::vector< DetId > south(const DetId &id) const
Get the neighbors of the given cell in south direction.
Definition: CaloTopology.cc:53