CMS 3D CMS Logo

FastTimeTopology.h
Go to the documentation of this file.
1 #ifndef Geometry_CaloTopology_FastTimeTopology_h
2 #define Geometry_CaloTopology_FastTimeTopology_h 1
3 
8 #include <vector>
9 #include <iostream>
10 
12 
13 public:
16  ForwardSubdetector subdet, int type);
17 
19  ~FastTimeTopology() override { }
20 
22  DetId goNorth(const DetId& id) const override {
23  return offsetBy(id,0,+1);
24  }
25  std::vector<DetId> north(const DetId& id) const override {
26  DetId nextId= goNorth(id);
27  std::vector<DetId> vNeighborsDetId;
28  if (! (nextId==DetId(0)))
29  vNeighborsDetId.emplace_back(nextId);
30  return vNeighborsDetId;
31  }
32 
34  DetId goSouth(const DetId& id) const override {
35  return offsetBy(id,0,-1);
36  }
37  std::vector<DetId> south(const DetId& id) const override {
38  DetId nextId= goSouth(id);
39  std::vector<DetId> vNeighborsDetId;
40  if (! (nextId==DetId(0)))
41  vNeighborsDetId.emplace_back(nextId);
42  return vNeighborsDetId;
43  }
44 
46  DetId goEast(const DetId& id) const override {
47  return offsetBy(id,+1,0);
48  }
49  std::vector<DetId> east(const DetId& id) const override {
50  DetId nextId=goEast(id);
51  std::vector<DetId> vNeighborsDetId;
52  if (! (nextId==DetId(0)))
53  vNeighborsDetId.emplace_back(nextId);
54  return vNeighborsDetId;
55  }
56 
58  DetId goWest(const DetId& id) const override {
59  return offsetBy(id,-1,0);
60  }
61  std::vector<DetId> west(const DetId& id) const override {
62  DetId nextId=goWest(id);
63  std::vector<DetId> vNeighborsDetId;
64  if (! (nextId==DetId(0)))
65  vNeighborsDetId.emplace_back(nextId);
66  return vNeighborsDetId;
67  }
68 
69  std::vector<DetId> up(const DetId& id) const override {
70  std::vector<DetId> vNeighborsDetId;
71  return vNeighborsDetId;
72  }
73 
74  std::vector<DetId> down(const DetId& id) const override {
75  std::vector<DetId> vNeighborsDetId;
76  return vNeighborsDetId;
77  }
78 
80  uint32_t detId2denseId(const DetId& id) const override;
81  DetId denseId2detId(uint32_t denseId) const override;
82  virtual uint32_t detId2denseGeomId(const DetId& id) const;
83 
85  bool valid(const DetId& id) const override;
86  bool validHashIndex(uint32_t ix) const {return (ix < kSizeForDenseIndexing);}
87 
88  unsigned int totalModules() const {return kSizeForDenseIndexing;}
89  unsigned int totalGeomModules() const {return (unsigned int)(2*kHGeomHalf_);}
90  int numberCells() const {return kHGeomHalf_;}
91 
92  const FastTimeDDDConstants& dddConstants () const {return hdcons_;}
93 
94  DetId offsetBy(const DetId startId, int nrStepsX, int nrStepsY ) const;
95  DetId switchZSide(const DetId startId) const;
96 
97  struct DecodedDetId {
98  DecodedDetId() : iPhi(0), iEtaZ(0), zside(0), iType(0), subdet(0) {}
100  };
101 
102  DecodedDetId geomDenseId2decId(const uint32_t& hi) const;
103  DecodedDetId decode(const DetId& id) const ;
104  DetId encode(const DecodedDetId& id_) const ;
105 
107  int detectorType() const { return type_;}
108 private:
109 
111  DetId changeXY(const DetId& id, int nrStepsX, int nrStepsY) const ;
112 
116  unsigned int kSizeForDenseIndexing;
117 };
118 
119 #endif
type
Definition: HCALResponse.h:21
DecodedDetId decode(const DetId &id) const
unsigned int totalGeomModules() const
DetId goEast(const DetId &id) const override
move the Topology east (positive ix)
DetId goWest(const DetId &id) const override
move the Topology west (negative ix)
ForwardSubdetector subdet_
ForwardSubdetector subDetector() const
int numberCells() const
DetId switchZSide(const DetId startId) const
DetId denseId2detId(uint32_t denseId) const override
int detectorType() const
DetId changeXY(const DetId &id, int nrStepsX, int nrStepsY) const
move the nagivator along x, y
std::vector< DetId > west(const DetId &id) const override
ForwardSubdetector
DetId goNorth(const DetId &id) const override
move the Topology north (increment iy)
unsigned int kSizeForDenseIndexing
virtual uint32_t detId2denseGeomId(const DetId &id) const
std::vector< DetId > up(const DetId &id) const override
std::vector< DetId > down(const DetId &id) const override
DecodedDetId geomDenseId2decId(const uint32_t &hi) const
const FastTimeDDDConstants & hdcons_
Definition: DetId.h:18
std::vector< DetId > south(const DetId &id) const override
bool valid(const DetId &id) const override
Is this a valid cell id.
FastTimeTopology(const FastTimeDDDConstants &hdcons, ForwardSubdetector subdet, int type)
create a new Topology
~FastTimeTopology() override
virtual destructor
DetId encode(const DecodedDetId &id_) const
unsigned int totalModules() const
std::vector< DetId > east(const DetId &id) const override
bool validHashIndex(uint32_t ix) const
DetId goSouth(const DetId &id) const override
move the Topology south (decrement iy)
DetId offsetBy(const DetId startId, int nrStepsX, int nrStepsY) const
uint32_t detId2denseId(const DetId &id) const override
Dense indexing.
const FastTimeDDDConstants & dddConstants() const
std::vector< DetId > north(const DetId &id) const override