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 <vector>
8 
10 
18 class CaloTopology {
19 public:
20 
21  typedef std::map<int, const CaloSubdetectorTopology*> TopMap ;
22 
23  CaloTopology();
24 
25  ~CaloTopology();
27  void setSubdetTopology(DetId::Detector det, int subdet, 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 
60 
61 #endif
std::map< int, const CaloSubdetectorTopology * > TopMap
Definition: CaloTopology.h:21
std::vector< DetId > down(const DetId &id) const
Get the neighbors of the given cell in down direction (inward)
Definition: CaloTopology.cc:62
std::vector< DetId > getAllNeighbours(const DetId &id) const
Get all the neighbors of the given cell.
Definition: CaloTopology.cc:77
std::vector< DetId > up(const DetId &id) const
Get the neighbors of the given cell in up direction (outward)
Definition: CaloTopology.cc:57
TopMap theTopologies_
Definition: CaloTopology.h:55
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:72
int makeIndex(DetId::Detector det, int subdet) const
Definition: CaloTopology.cc:16
std::vector< DetId > east(const DetId &id) const
Get the neighbors of the given cell in east direction.
Definition: CaloTopology.cc:37
std::vector< DetId > north(const DetId &id) const
Get the neighbors of the given cell in north direction.
Definition: CaloTopology.cc:47
void setSubdetTopology(DetId::Detector det, int subdet, const CaloSubdetectorTopology *geom)
Register a subdetector Topology.
Definition: CaloTopology.cc:20
Definition: DetId.h:18
bool valid(const DetId &id) const
Is this a valid cell id?
Definition: CaloTopology.cc:82
std::vector< DetId > west(const DetId &id) const
Get the neighbors of the given cell in west direction.
Definition: CaloTopology.cc:42
Detector
Definition: DetId.h:26
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:25
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:67
std::vector< DetId > south(const DetId &id) const
Get the neighbors of the given cell in south direction.
Definition: CaloTopology.cc:52