Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:21:42

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