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 
10 #include <vector>
11 #include <iostream>
12 
14 
15 public:
18  ForwardSubdetector subdet, int type);
19 
21  ~FastTimeTopology() override { }
22 
24  DetId goNorth(const DetId& id) const override {
25  return offsetBy(id,0,+1);
26  }
27  std::vector<DetId> north(const DetId& id) const override {
28  DetId nextId= goNorth(id);
29  std::vector<DetId> vNeighborsDetId;
30  if (! (nextId==DetId(0)))
31  vNeighborsDetId.emplace_back(nextId);
32  return vNeighborsDetId;
33  }
34 
36  DetId goSouth(const DetId& id) const override {
37  return offsetBy(id,0,-1);
38  }
39  std::vector<DetId> south(const DetId& id) const override {
40  DetId nextId= goSouth(id);
41  std::vector<DetId> vNeighborsDetId;
42  if (! (nextId==DetId(0)))
43  vNeighborsDetId.emplace_back(nextId);
44  return vNeighborsDetId;
45  }
46 
48  DetId goEast(const DetId& id) const override {
49  return offsetBy(id,+1,0);
50  }
51  std::vector<DetId> east(const DetId& id) const override {
52  DetId nextId=goEast(id);
53  std::vector<DetId> vNeighborsDetId;
54  if (! (nextId==DetId(0)))
55  vNeighborsDetId.emplace_back(nextId);
56  return vNeighborsDetId;
57  }
58 
60  DetId goWest(const DetId& id) const override {
61  return offsetBy(id,-1,0);
62  }
63  std::vector<DetId> west(const DetId& id) const override {
64  DetId nextId=goWest(id);
65  std::vector<DetId> vNeighborsDetId;
66  if (! (nextId==DetId(0)))
67  vNeighborsDetId.emplace_back(nextId);
68  return vNeighborsDetId;
69  }
70 
71  std::vector<DetId> up(const DetId& id) const override {
72  std::vector<DetId> vNeighborsDetId;
73  return vNeighborsDetId;
74  }
75 
76  std::vector<DetId> down(const DetId& id) const override {
77  std::vector<DetId> vNeighborsDetId;
78  return vNeighborsDetId;
79  }
80 
82  uint32_t detId2denseId(const DetId& id) const override;
83  DetId denseId2detId(uint32_t denseId) const override;
84  virtual uint32_t detId2denseGeomId(const DetId& id) const;
85 
87  bool valid(const DetId& id) const override;
88  bool validHashIndex(uint32_t ix) const {return (ix < kSizeForDenseIndexing);}
89 
90  unsigned int totalModules() const {return kSizeForDenseIndexing;}
91  unsigned int totalGeomModules() const {return (unsigned int)(2*kHGeomHalf_);}
92  int numberCells() const {return kHGeomHalf_;}
93 
94  const FastTimeDDDConstants& dddConstants () const {return hdcons_;}
95 
96  DetId offsetBy(const DetId startId, int nrStepsX, int nrStepsY ) const;
97  DetId switchZSide(const DetId startId) const;
98 
99  struct DecodedDetId {
100  DecodedDetId() : iPhi(0), iEtaZ(0), zside(0), iType(0), subdet(0) {}
102  };
103 
104  DecodedDetId geomDenseId2decId(const uint32_t& hi) const;
105  DecodedDetId decode(const DetId& id) const ;
106  DetId encode(const DecodedDetId& id_) const ;
107 
109  int detectorType() const { return type_;}
110 private:
111 
113  DetId changeXY(const DetId& id, int nrStepsX, int nrStepsY) const ;
114 
118  unsigned int kSizeForDenseIndexing;
119 };
120 
121 #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