File indexing completed on 2024-07-16 02:43:03
0001 #ifndef L1Trigger_Phase2L1GMT_TrackConverter_h
0002 #define L1Trigger_Phase2L1GMT_TrackConverter_h
0003
0004 #include "L1Trigger/Phase2L1GMT/interface/ConvertedTTTrack.h"
0005 #include "L1Trigger/Phase2L1GMT/interface/TPSLUTs.h"
0006 #include "DataFormats/L1TMuonPhase2/interface/TrackerMuon.h"
0007 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0008
0009 namespace Phase2L1GMT {
0010
0011 class TrackConverter {
0012 public:
0013 TrackConverter(const edm::ParameterSet& iConfig);
0014 ~TrackConverter() = default;
0015
0016 std::vector<ConvertedTTTrack> convertTracks(const std::vector<edm::Ptr<l1t::TrackerMuon::L1TTTrackType> >& tracks);
0017
0018 private:
0019 int verbose_;
0020 typedef ap_uint<96> wordtype;
0021
0022 uint generateQuality(const edm::Ptr<TTTrack<Ref_Phase2TrackerDigi_> >& track) { return 1; }
0023
0024 uint ptLookup(uint absCurv) {
0025 for (auto i : ptShifts) {
0026 if (absCurv >= uint(i[0]) && absCurv < uint(i[1])) {
0027 if (i[2] < 0)
0028 return i[4];
0029 else
0030 return (absCurv >> i[2]) + i[3];
0031 }
0032 }
0033 return 0;
0034 }
0035
0036 uint etaLookup(uint absTanL) {
0037 for (auto i : etaShifts) {
0038 if (absTanL >= uint(i[0]) && absTanL < uint(i[1])) {
0039 if (i[2] < 0)
0040 return i[4];
0041 else
0042 return (absTanL >> i[2]) + i[3];
0043 }
0044 }
0045 return 0;
0046 }
0047
0048 ConvertedTTTrack convert(const edm::Ptr<TTTrack<Ref_Phase2TrackerDigi_> >& track);
0049 };
0050 }
0051
0052 #endif