Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:55:20

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(RegionalMuonShower& muShower,
0020                                        std::vector<uint32_t> bxPayload,
0021                                        int proc,
0022                                        tftype tf,
0023                                        bool useEmtfNominalTightShowers,
0024                                        bool useEmtfLooseShowers);
0025     static void generatePackedDataWords(const RegionalMuonCand& mu,
0026                                         uint32_t& raw_data_00_31,
0027                                         uint32_t& raw_data_32_63,
0028                                         bool isKbmtf,
0029                                         bool useEmtfDisplacementInfo);
0030     static void generatePackedShowerPayload(const RegionalMuonShower& shower,
0031                                             std::array<uint32_t, 6>& payload,
0032                                             bool useEmtfNominalTightShowers,
0033                                             bool useEmtfLooseShowers);
0034     static uint64_t generate64bitDataWord(const RegionalMuonCand& mu, bool isKbmtf, bool useEmtfDisplacementInfo);
0035     static int generateRawTrkAddress(const RegionalMuonCand&, bool isKalman);
0036 
0037     static constexpr unsigned ptMask_ = 0x1FF;
0038     static constexpr unsigned ptShift_ = 0;
0039     static constexpr unsigned qualMask_ = 0xF;
0040     static constexpr unsigned qualShift_ = 9;
0041     static constexpr unsigned absEtaMask_ = 0xFF;
0042     static constexpr unsigned absEtaShift_ = 13;
0043     static constexpr unsigned etaSignShift_ = 21;
0044     static constexpr unsigned hfMask_ = 0x1;
0045     static constexpr unsigned hfShift_ = 22;
0046     static constexpr unsigned absPhiMask_ = 0x7F;
0047     static constexpr unsigned absPhiShift_ = 23;
0048     static constexpr unsigned phiSignShift_ = 30;
0049     static constexpr unsigned signShift_ = 0;
0050     static constexpr unsigned signValidShift_ = 1;
0051     static constexpr unsigned dxyMask_ = 0x3;
0052     static constexpr unsigned bmtfDxyShift_ = 2;
0053     static constexpr unsigned emtfDxyShift_ = 29;
0054     static constexpr unsigned ptUnconstrainedMask_ = 0xFF;
0055     static constexpr unsigned bmtfPtUnconstrainedShift_ = 23;
0056     static constexpr unsigned emtfPtUnconstrainedShift_ = 20;
0057     static constexpr unsigned trackAddressMask_ = 0x1FFFFFFF;
0058     static constexpr unsigned trackAddressShift_ = 2;
0059     static constexpr unsigned kEmtfShowerMask = 0x1;
0060     static constexpr unsigned kEmtfShowerStandardFrame = 1;
0061     static constexpr unsigned kEmtfShowerExtendedFrame = 3;
0062     static constexpr unsigned kEmtfShowerOneNominalShift = 18;
0063     static constexpr unsigned kEmtfShowerOneLooseShift = kEmtfShowerOneNominalShift;
0064     static constexpr unsigned kEmtfShowerOneTightShift = 19;
0065 
0066     // relative shifts within track address
0067     static constexpr unsigned bmtfTrAddrSegSelMask_ = 0xF;
0068     static constexpr unsigned bmtfTrAddrSegSelShift_ = 21;
0069     static constexpr unsigned bmtfTrAddrDetSideShift_ = 20;
0070     static constexpr unsigned bmtfTrAddrWheelMask_ = 0x3;
0071     static constexpr unsigned bmtfTrAddrWheelShift_ = 18;
0072     static constexpr unsigned bmtfTrAddrStat1Mask_ = 0x3;
0073     static constexpr unsigned bmtfTrAddrStat1Shift_ = 14;
0074     static constexpr unsigned bmtfTrAddrStat2Mask_ = 0xF;
0075     static constexpr unsigned bmtfTrAddrStat2Shift_ = 10;
0076     static constexpr unsigned bmtfTrAddrStat3Mask_ = 0xF;
0077     static constexpr unsigned bmtfTrAddrStat3Shift_ = 6;
0078     static constexpr unsigned bmtfTrAddrStat4Mask_ = 0xF;
0079     static constexpr unsigned bmtfTrAddrStat4Shift_ = 2;
0080 
0081     static constexpr unsigned emtfTrAddrMe1SegShift_ = 0;
0082     static constexpr unsigned emtfTrAddrMe1ChShift_ = 1;
0083     static constexpr unsigned emtfTrAddrMe1ChMask_ = 0x7;
0084     static constexpr unsigned emtfTrAddrMe2SegShift_ = 4;
0085     static constexpr unsigned emtfTrAddrMe2ChShift_ = 5;
0086     static constexpr unsigned emtfTrAddrMe2ChMask_ = 0x7;
0087     static constexpr unsigned emtfTrAddrMe3SegShift_ = 8;
0088     static constexpr unsigned emtfTrAddrMe3ChShift_ = 9;
0089     static constexpr unsigned emtfTrAddrMe3ChMask_ = 0x7;
0090     static constexpr unsigned emtfTrAddrMe4SegShift_ = 12;
0091     static constexpr unsigned emtfTrAddrMe4ChShift_ = 13;
0092     static constexpr unsigned emtfTrAddrMe4ChMask_ = 0x7;
0093     static constexpr unsigned emtfTrAddrTrkNumShift_ = 16;
0094     static constexpr unsigned emtfTrAddrTrkNumMask_ = 0x3;
0095     static constexpr unsigned emtfTrAddrBxShift_ = 18;
0096     static constexpr unsigned emtfTrAddrBxMask_ = 0x7FF;
0097 
0098     static constexpr unsigned omtfTrAddrLayersShift_ = 0;
0099     static constexpr unsigned omtfTrAddrLayersMask_ = 0x3FFFF;
0100     static constexpr unsigned omtfTrAddrWeightShift_ = 18;
0101     static constexpr unsigned omtfTrAddrWeightMask_ = 0x1F;
0102   };
0103 }  // namespace l1t
0104 
0105 #endif