Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-02-08 06:28:04

0001 #ifndef RegionalMuonRawDigiTranslator_h
0002 #define RegionalMuonRawDigiTranslator_h
0003 
0004 #include "DataFormats/L1TMuon/interface/RegionalMuonCand.h"
0005 #include "DataFormats/L1TMuon/interface/RegionalMuonShower.h"
0006 
0007 namespace l1t {
0008   class RegionalMuonRawDigiTranslator {
0009   public:
0010     static void fillRegionalMuonCand(RegionalMuonCand& mu,
0011                                      uint32_t raw_data_00_31,
0012                                      uint32_t raw_data_32_63,
0013                                      int proc,
0014                                      tftype tf,
0015                                      bool isKbmtf,
0016                                      bool useEmtfDisplacementInfo);
0017     static void fillRegionalMuonCand(
0018         RegionalMuonCand& mu, uint64_t dataword, int proc, tftype tf, bool isKbmtf, bool useEmtfDisplacementInfo);
0019     static bool fillRegionalMuonShower(
0020         RegionalMuonShower& muShower, std::vector<uint32_t> bxPayload, int proc, tftype tf, bool useEmtfShowers);
0021     static void generatePackedDataWords(const RegionalMuonCand& mu,
0022                                         uint32_t& raw_data_00_31,
0023                                         uint32_t& raw_data_32_63,
0024                                         bool isKbmtf,
0025                                         bool useEmtfDisplacementInfo);
0026     static void generatePackedShowerPayload(const RegionalMuonShower& shower,
0027                                             std::array<uint32_t, 6>& payload,
0028                                             bool useEmtfShowers);
0029     static uint64_t generate64bitDataWord(const RegionalMuonCand& mu, bool isKbmtf, bool useEmtfDisplacementInfo);
0030     static int generateRawTrkAddress(const RegionalMuonCand&, bool isKalman);
0031 
0032     static constexpr unsigned ptMask_ = 0x1FF;
0033     static constexpr unsigned ptShift_ = 0;
0034     static constexpr unsigned qualMask_ = 0xF;
0035     static constexpr unsigned qualShift_ = 9;
0036     static constexpr unsigned absEtaMask_ = 0xFF;
0037     static constexpr unsigned absEtaShift_ = 13;
0038     static constexpr unsigned etaSignShift_ = 21;
0039     static constexpr unsigned hfMask_ = 0x1;
0040     static constexpr unsigned hfShift_ = 22;
0041     static constexpr unsigned absPhiMask_ = 0x7F;
0042     static constexpr unsigned absPhiShift_ = 23;
0043     static constexpr unsigned phiSignShift_ = 30;
0044     static constexpr unsigned signShift_ = 0;
0045     static constexpr unsigned signValidShift_ = 1;
0046     static constexpr unsigned dxyMask_ = 0x3;
0047     static constexpr unsigned bmtfDxyShift_ = 2;
0048     static constexpr unsigned emtfDxyShift_ = 29;
0049     static constexpr unsigned ptUnconstrainedMask_ = 0xFF;
0050     static constexpr unsigned bmtfPtUnconstrainedShift_ = 23;
0051     static constexpr unsigned emtfPtUnconstrainedShift_ = 20;
0052     static constexpr unsigned trackAddressMask_ = 0x1FFFFFFF;
0053     static constexpr unsigned trackAddressShift_ = 2;
0054     static constexpr unsigned emtfShowerMask_ = 0x1;
0055     static constexpr unsigned emtfShowerInTimeFrame_ = 1;
0056     static constexpr unsigned emtfShowerOOTFrame_ = 3;
0057     static constexpr unsigned emtfShowerOneNominalShift_ = 18;
0058     static constexpr unsigned emtfShowerOneTightShift_ = 19;
0059 
0060     // relative shifts within track address
0061     static constexpr unsigned bmtfTrAddrSegSelMask_ = 0xF;
0062     static constexpr unsigned bmtfTrAddrSegSelShift_ = 21;
0063     static constexpr unsigned bmtfTrAddrDetSideShift_ = 20;
0064     static constexpr unsigned bmtfTrAddrWheelMask_ = 0x3;
0065     static constexpr unsigned bmtfTrAddrWheelShift_ = 18;
0066     static constexpr unsigned bmtfTrAddrStat1Mask_ = 0x3;
0067     static constexpr unsigned bmtfTrAddrStat1Shift_ = 14;
0068     static constexpr unsigned bmtfTrAddrStat2Mask_ = 0xF;
0069     static constexpr unsigned bmtfTrAddrStat2Shift_ = 10;
0070     static constexpr unsigned bmtfTrAddrStat3Mask_ = 0xF;
0071     static constexpr unsigned bmtfTrAddrStat3Shift_ = 6;
0072     static constexpr unsigned bmtfTrAddrStat4Mask_ = 0xF;
0073     static constexpr unsigned bmtfTrAddrStat4Shift_ = 2;
0074 
0075     static constexpr unsigned emtfTrAddrMe1SegShift_ = 0;
0076     static constexpr unsigned emtfTrAddrMe1ChShift_ = 1;
0077     static constexpr unsigned emtfTrAddrMe1ChMask_ = 0x7;
0078     static constexpr unsigned emtfTrAddrMe2SegShift_ = 4;
0079     static constexpr unsigned emtfTrAddrMe2ChShift_ = 5;
0080     static constexpr unsigned emtfTrAddrMe2ChMask_ = 0x7;
0081     static constexpr unsigned emtfTrAddrMe3SegShift_ = 8;
0082     static constexpr unsigned emtfTrAddrMe3ChShift_ = 9;
0083     static constexpr unsigned emtfTrAddrMe3ChMask_ = 0x7;
0084     static constexpr unsigned emtfTrAddrMe4SegShift_ = 12;
0085     static constexpr unsigned emtfTrAddrMe4ChShift_ = 13;
0086     static constexpr unsigned emtfTrAddrMe4ChMask_ = 0x7;
0087     static constexpr unsigned emtfTrAddrTrkNumShift_ = 16;
0088     static constexpr unsigned emtfTrAddrTrkNumMask_ = 0x3;
0089     static constexpr unsigned emtfTrAddrBxShift_ = 18;
0090     static constexpr unsigned emtfTrAddrBxMask_ = 0x7FF;
0091 
0092     static constexpr unsigned omtfTrAddrLayersShift_ = 0;
0093     static constexpr unsigned omtfTrAddrLayersMask_ = 0x3FFFF;
0094     static constexpr unsigned omtfTrAddrWeightShift_ = 18;
0095     static constexpr unsigned omtfTrAddrWeightMask_ = 0x1F;
0096   };
0097 }  // namespace l1t
0098 
0099 #endif