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 
22  typedef std::map<int, std::unique_ptr<const CaloSubdetectorTopology>> TopMap ;
23 
24  CaloTopology();
25 
26  ~CaloTopology();
28  void setSubdetTopology(DetId::Detector det, int subdet, std::unique_ptr<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, std::unique_ptr< 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:57
std::vector< DetId > getAllNeighbours(const DetId &id) const
Get all the neighbors of the given cell.
Definition: CaloTopology.cc:72
std::vector< DetId > up(const DetId &id) const
Get the neighbors of the given cell in up direction (outward)
Definition: CaloTopology.cc:52
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:67
int makeIndex(DetId::Detector det, int subdet) const
Definition: CaloTopology.cc:11
std::vector< DetId > east(const DetId &id) const
Get the neighbors of the given cell in east direction.
Definition: CaloTopology.cc:32
std::vector< DetId > north(const DetId &id) const
Get the neighbors of the given cell in north direction.
Definition: CaloTopology.cc:42
Definition: DetId.h:18
bool valid(const DetId &id) const
Is this a valid cell id?
Definition: CaloTopology.cc:77
std::vector< DetId > west(const DetId &id) const
Get the neighbors of the given cell in west direction.
Definition: CaloTopology.cc:37
Detector
Definition: DetId.h:26
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:20
void setSubdetTopology(DetId::Detector det, int subdet, std::unique_ptr< const CaloSubdetectorTopology > geom)
Register a subdetector Topology.
Definition: CaloTopology.cc:15
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:62
std::vector< DetId > south(const DetId &id) const
Get the neighbors of the given cell in south direction.
Definition: CaloTopology.cc:47