Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-06-03 00:12:12

0001 #ifndef L1Trigger_TrackerDTC_LayerEncoding_h
0002 #define L1Trigger_TrackerDTC_LayerEncoding_h
0003 
0004 #include "FWCore/Framework/interface/data_default_record_trait.h"
0005 #include "L1Trigger/TrackTrigger/interface/Setup.h"
0006 #include "L1Trigger/TrackTrigger/interface/SensorModule.h"
0007 
0008 #include <vector>
0009 
0010 namespace trackerDTC {
0011 
0012   /*! \class  trackerDTC::LayerEncoding
0013    *  \brief  Class to encode layer ids used between DTC and TFP in Hybrid
0014    *  \author Thomas Schuh
0015    *  \date   2021, April
0016    */
0017   class LayerEncoding {
0018   public:
0019     LayerEncoding() {}
0020     LayerEncoding(const tt::Setup* setup);
0021     ~LayerEncoding() = default;
0022     // decode layer id for given sensor module
0023     int decode(const tt::SensorModule* sm) const;
0024     // get encoded layers read by given DTC
0025     const std::vector<int>& layers(int dtcId) const { return encodingsLayerId_.at(dtcId % numDTCsPerRegion_); }
0026 
0027   private:
0028     // helper class to store configurations
0029     const tt::Setup* setup_;
0030     // No. of DTCs per detector phi nonant
0031     int numDTCsPerRegion_;
0032     // outer index = dtc id in region, inner index = encoded layerId, inner value = decoded layerId
0033     std::vector<std::vector<int>> encodingsLayerId_;
0034   };
0035 
0036 }  // namespace trackerDTC
0037 
0038 EVENTSETUP_DATA_DEFAULT_RECORD(trackerDTC::LayerEncoding, tt::SetupRcd);
0039 
0040 #endif