CMS 3D CMS Logo

MTDTopology.h
Go to the documentation of this file.
1 #ifndef MTDTOPOLOGY_H
2 #define MTDTOPOLOGY_H
3 
9 
10 #include <vector>
11 #include <string>
12 
13 class MTDTopology {
14 public:
15  struct ETLfaceLayout {
16  uint32_t idDiscSide_; // disc face identifier
17  uint32_t idDetType1_; // module type id identifier for first row
18 
19  std::array<std::vector<int>, 2> start_copy_; // start copy per row, first of type idDetType1_
20  std::array<std::vector<int>, 2> offset_; // offset per row, first of type idDetType1_
21  };
22 
23  using ETLValues = std::vector<ETLfaceLayout>;
24 
25  MTDTopology(const int& topologyMode, const ETLValues& etl);
26 
27  int getMTDTopologyMode() const { return mtdTopologyMode_; }
28 
29  // ETL topology navigation is based on a predefined order of dets in sector
30 
31  static bool orderETLSector(const GeomDet*& gd1, const GeomDet*& gd2);
32 
33  // navigation methods in ETL topology, provide the index of the det next to DetId for
34  // horizontal and vertical shifts in both directions, assuming the predefined order in a sector
35 
36  size_t hshiftETL(const uint32_t detid, const int horizontalShift) const;
37  size_t vshiftETL(const uint32_t detid, const int verticalShift, size_t& closest) const;
38 
39 private:
40  const int mtdTopologyMode_;
41 
43 
44  static constexpr size_t failIndex_ =
45  std::numeric_limits<unsigned int>::max(); // return out-of-range value for any failure
46 };
47 
48 #endif
size_t hshiftETL(const uint32_t detid, const int horizontalShift) const
Definition: MTDTopology.cc:20
int getMTDTopologyMode() const
Definition: MTDTopology.h:27
int closest(std::vector< int > const &vec, int value)
std::vector< ETLfaceLayout > ETLValues
Definition: MTDTopology.h:23
const ETLValues etlVals_
Definition: MTDTopology.h:42
std::array< std::vector< int >, 2 > start_copy_
Definition: MTDTopology.h:19
std::array< std::vector< int >, 2 > offset_
Definition: MTDTopology.h:20
MTDTopology(const int &topologyMode, const ETLValues &etl)
Definition: MTDTopology.cc:4
static bool orderETLSector(const GeomDet *&gd1, const GeomDet *&gd2)
Definition: MTDTopology.cc:7
size_t vshiftETL(const uint32_t detid, const int verticalShift, size_t &closest) const
Definition: MTDTopology.cc:56
static constexpr size_t failIndex_
Definition: MTDTopology.h:44
const int mtdTopologyMode_
Definition: MTDTopology.h:40