Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:13:32

0001 #ifndef L1Trigger_TrackerTFP_LayerEncoding_h
0002 #define L1Trigger_TrackerTFP_LayerEncoding_h
0003 
0004 #include "FWCore/Framework/interface/data_default_record_trait.h"
0005 #include "L1Trigger/TrackerTFP/interface/LayerEncodingRcd.h"
0006 #include "L1Trigger/TrackerTFP/interface/DataFormats.h"
0007 
0008 #include <vector>
0009 
0010 namespace trackerTFP {
0011 
0012   /*! \class  trackerTFP::LayerEncoding
0013    *  \brief  Class to encode layer ids for Kalman Filter
0014    *          Layers consitent with rough r-z track parameters are counted from 0 onwards.
0015    *  \author Thomas Schuh
0016    *  \date   2020, July
0017    */
0018   class LayerEncoding {
0019   public:
0020     LayerEncoding() {}
0021     LayerEncoding(const DataFormats* dataFormats);
0022     ~LayerEncoding() {}
0023     // Set of layers in each (zT,tanL) digi Bin of each eta sector numbered 0->N
0024     const std::vector<int>& layerEncoding(int binEta, int binZT, int binCot) const {
0025       return layerEncoding_.at(binEta).at(binZT).at(binCot);
0026     }
0027     // maybe layers for given ets sector, bin in zT and bin in cotThea
0028     const std::vector<int>& maybeLayer(int binEta, int binZT, int binCot) const {
0029       return maybeLayer_.at(binEta).at(binZT).at(binCot);
0030     }
0031     // encoded layer id for given eta sector, bin in zT, bin in cotThea and decoed layer id, returns -1 if layer incositent with track
0032     const int layerIdKF(int binEta, int binZT, int binCot, int layerId) const;
0033     // pattern of maybe layers for given eta sector, bin in zT and bin in cotThea
0034     TTBV maybePattern(int binEta, int binZT, int binCot) const;
0035 
0036   private:
0037     // helper class providing run-time constants
0038     const tt::Setup* setup_;
0039     // helper class providing dataformats
0040     const DataFormats* dataFormats_;
0041     // data foramt of variable zT
0042     const DataFormat* zT_;
0043     // data foramt of variable cotTheta
0044     const DataFormat* cot_;
0045     // outer to inner indices: eta sector, bin in zT, bin in cotTheta, layerId
0046     std::vector<std::vector<std::vector<std::vector<int>>>> layerEncoding_;
0047     // outer to inner indices: eta sector, bin in zT, bin in cotTheta, layerId of maybe layers
0048     std::vector<std::vector<std::vector<std::vector<int>>>> maybeLayer_;
0049   };
0050 
0051 }  // namespace trackerTFP
0052 
0053 EVENTSETUP_DATA_DEFAULT_RECORD(trackerTFP::LayerEncoding, trackerTFP::LayerEncodingRcd);
0054 
0055 #endif