Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:15:16

0001 #ifndef MTDTOPOLOGY_H
0002 #define MTDTOPOLOGY_H
0003 
0004 #include "DataFormats/DetId/interface/DetId.h"
0005 #include "DataFormats/ForwardDetId/interface/ForwardSubdetector.h"
0006 #include "DataFormats/ForwardDetId/interface/MTDDetId.h"
0007 #include "DataFormats/ForwardDetId/interface/ETLDetId.h"
0008 #include <Geometry/CommonDetUnit/interface/GeomDet.h>
0009 
0010 #include <vector>
0011 #include <string>
0012 
0013 class MTDTopology {
0014 public:
0015   struct ETLfaceLayout {
0016     uint32_t idDiscSide_;  // disc face identifier
0017     uint32_t idDetType1_;  // module type id identifier for first row
0018 
0019     std::array<std::vector<int>, 2> start_copy_;  // start copy per row, first of type idDetType1_
0020     std::array<std::vector<int>, 2> offset_;      // offset per row, first of type idDetType1_
0021   };
0022 
0023   using ETLValues = std::vector<ETLfaceLayout>;
0024 
0025   MTDTopology(const int& topologyMode, const ETLValues& etl);
0026 
0027   int getMTDTopologyMode() const { return mtdTopologyMode_; }
0028 
0029   // ETL topology navigation is based on a predefined order of dets in sector
0030 
0031   static bool orderETLSector(const GeomDet*& gd1, const GeomDet*& gd2);
0032 
0033   // navigation methods in ETL topology, provide the index of the det next to DetId for
0034   // horizontal and vertical shifts in both directions, assuming the predefined order in a sector
0035 
0036   size_t hshiftETL(const uint32_t detid, const int horizontalShift) const;
0037   size_t vshiftETL(const uint32_t detid, const int verticalShift, size_t& closest) const;
0038 
0039 private:
0040   const int mtdTopologyMode_;
0041 
0042   const ETLValues etlVals_;
0043 
0044   static constexpr size_t failIndex_ =
0045       std::numeric_limits<unsigned int>::max();  // return out-of-range value for any failure
0046 };
0047 
0048 #endif