5 const uint32_t raw_data_00_31,
6 const uint32_t raw_data_32_63,
10 const bool useEmtfDisplacementInfo) {
79 if (useEmtfDisplacementInfo) {
96 std::map<int, int> trackAddr;
97 trackAddr[0] = rawTrackAddress;
98 mu.setTrackAddress(trackAddr);
101 mu.setTFIdentifiers(
proc, tf);
102 mu.setDataword(raw_data_32_63, raw_data_00_31);
110 const bool useEmtfDisplacementInfo) {
111 fillRegionalMuonCand(
mu,
112 (uint32_t)(dataword & 0xFFFFFFFF),
113 (uint32_t)((dataword >> 32) & 0xFFFFFFFF),
117 useEmtfDisplacementInfo);
125 muShower.
setOneNominalInTime(((bxPayload[emtfShowerInTimeFrame_] >> emtfShowerOneNominalShift_) & 1) == 1);
126 muShower.
setOneNominalOutOfTime(((bxPayload[emtfShowerOOTFrame_] >> emtfShowerOneNominalShift_) & 1) == 1);
127 muShower.
setOneTightInTime(((bxPayload[emtfShowerInTimeFrame_] >> emtfShowerOneTightShift_) & 1) == 1);
128 muShower.
setOneTightOutOfTime(((bxPayload[emtfShowerOOTFrame_] >> emtfShowerOneTightShift_) & 1) == 1);
137 std::array<uint32_t, 6>&
payload,
138 const bool useEmtfShowers) {
139 if (!useEmtfShowers || !shower.
isValid()) {
143 if ((((
payload.at(emtfShowerInTimeFrame_) >> emtfShowerOneNominalShift_) & emtfShowerMask_) != 0) ||
144 (((
payload.at(emtfShowerInTimeFrame_) >> emtfShowerOneTightShift_) & emtfShowerMask_) != 0) ||
145 (((
payload.at(emtfShowerOOTFrame_) >> emtfShowerOneNominalShift_) & emtfShowerMask_) != 0) ||
146 (((
payload.at(emtfShowerOOTFrame_) >> emtfShowerOneTightShift_) & emtfShowerMask_) != 0)) {
147 edm::LogError(
"L1T") <<
"Check constants for RegionalMuonShower fields! It looks like we're in danger of " 148 "overwriting muon data in the packer! InTimeFrame is " 149 <<
payload.at(emtfShowerInTimeFrame_) <<
", OOTFrame is " <<
payload.at(emtfShowerOOTFrame_);
159 uint32_t& raw_data_00_31,
160 uint32_t& raw_data_32_63,
162 const bool useEmtfDisplacementInfo) {
163 int abs_eta =
mu.hwEta();
165 abs_eta += (1 << (etaSignShift_ - absEtaShift_));
167 int abs_phi =
mu.hwPhi();
169 abs_phi += (1 << (phiSignShift_ - absPhiShift_));
171 raw_data_00_31 = (
mu.hwPt() & ptMask_) << ptShift_ | (
mu.hwQual() & qualMask_) << qualShift_ |
172 (abs_eta & absEtaMask_) << absEtaShift_ | (
mu.hwEta() < 0) << etaSignShift_ |
173 (
mu.hwHF() & hfMask_) << hfShift_ | (abs_phi & absPhiMask_) << absPhiShift_ |
174 (
mu.hwPhi() < 0) << phiSignShift_;
177 int rawTrkAddr = generateRawTrkAddress(
mu, isKbmtf);
179 raw_data_32_63 =
mu.hwSign() << signShift_ |
mu.hwSignValid() << signValidShift_ |
180 (rawTrkAddr & trackAddressMask_) << trackAddressShift_;
181 if (isKbmtf &&
mu.trackFinderType() ==
bmtf) {
182 raw_data_32_63 |= (
mu.hwPtUnconstrained() & ptUnconstrainedMask_) << bmtfPtUnconstrainedShift_ |
183 (
mu.hwDXY() & dxyMask_) << bmtfDxyShift_;
184 }
else if (useEmtfDisplacementInfo && (
mu.trackFinderType() ==
emtf_pos ||
mu.trackFinderType() ==
emtf_neg)) {
185 raw_data_32_63 |= (
mu.hwPtUnconstrained() & ptUnconstrainedMask_) << emtfPtUnconstrainedShift_ |
186 (
mu.hwDXY() & dxyMask_) << emtfDxyShift_;
192 const bool useEmtfDisplacementInfo) {
196 generatePackedDataWords(
mu, lsw, msw, isKbmtf, useEmtfDisplacementInfo);
197 return (((
uint64_t)msw) << 32) + lsw;
201 int tf =
mu.trackFinderType();
219 rawTrkAddr = (detSide & 0x1) << bmtfTrAddrDetSideShift_ |
220 (wheelNum & bmtfTrAddrWheelMask_) << bmtfTrAddrWheelShift_ |
221 (stat1 & bmtfTrAddrStat1Mask_) << bmtfTrAddrStat1Shift_ |
222 (stat2 & bmtfTrAddrStat2Mask_) << bmtfTrAddrStat2Shift_ |
223 (stat3 & bmtfTrAddrStat3Mask_) << bmtfTrAddrStat3Shift_ |
224 (stat4 & bmtfTrAddrStat4Mask_) << bmtfTrAddrStat4Shift_;
226 edm::LogWarning(
"L1T") <<
"BMTF muon track address map contains " <<
mu.trackAddress().size()
228 <<
" subaddresses. Check the data format. Setting track address to 0.";
244 edm::LogWarning(
"L1T") <<
"EMTF muon track address map contains " <<
mu.trackAddress().size()
246 <<
" subaddresses. Check the data format. Setting track address to 0.";
256 edm::LogWarning(
"L1T") <<
"OMTF muon track address map contains " <<
mu.trackAddress().size()
258 <<
" subaddresses. Check the data format. Setting track address to 0.";
262 rawTrkAddr =
mu.trackAddress().at(0);
void setOneTightInTime(const bool bit)
static constexpr unsigned emtfTrAddrMe4SegShift_
static constexpr unsigned trackAddressMask_
static constexpr unsigned bmtfTrAddrStat1Mask_
static constexpr unsigned etaSignShift_
void setOneTightOutOfTime(const bool bit)
static constexpr unsigned phiSignShift_
static constexpr unsigned trackAddressShift_
static constexpr unsigned absEtaMask_
static constexpr unsigned bmtfTrAddrStat2Shift_
static void generatePackedShowerPayload(const RegionalMuonShower &shower, std::array< uint32_t, 6 > &payload, bool useEmtfShowers)
static constexpr unsigned bmtfTrAddrStat3Mask_
static constexpr unsigned emtfTrAddrBxMask_
static constexpr unsigned signShift_
static constexpr unsigned emtfTrAddrMe2ChMask_
static constexpr unsigned bmtfTrAddrStat1Shift_
static constexpr unsigned bmtfTrAddrStat4Shift_
static constexpr unsigned emtfTrAddrMe3ChMask_
static constexpr unsigned dxyMask_
static constexpr unsigned emtfTrAddrMe3ChShift_
Log< level::Error, false > LogError
static constexpr unsigned emtfPtUnconstrainedShift_
static constexpr unsigned bmtfPtUnconstrainedShift_
static constexpr unsigned emtfTrAddrTrkNumMask_
static constexpr unsigned bmtfTrAddrWheelShift_
bool isOneTightOutOfTime() const
static void generatePackedDataWords(const RegionalMuonCand &mu, uint32_t &raw_data_00_31, uint32_t &raw_data_32_63, bool isKbmtf, bool useEmtfDisplacementInfo)
static constexpr unsigned emtfTrAddrMe1ChMask_
bool isOneTightInTime() const
static constexpr unsigned hfMask_
static constexpr unsigned emtfDxyShift_
static constexpr unsigned bmtfTrAddrStat2Mask_
static constexpr unsigned omtfTrAddrWeightShift_
static constexpr unsigned emtfTrAddrBxShift_
static constexpr unsigned bmtfTrAddrStat4Mask_
static constexpr unsigned ptShift_
bool isOneNominalInTime() const
static constexpr unsigned ptUnconstrainedMask_
static constexpr unsigned bmtfDxyShift_
static constexpr unsigned emtfTrAddrMe4ChMask_
static constexpr unsigned emtfTrAddrMe2ChShift_
static constexpr unsigned ptMask_
static constexpr unsigned emtfTrAddrMe2SegShift_
static constexpr unsigned bmtfTrAddrDetSideShift_
static constexpr unsigned bmtfTrAddrWheelMask_
void setOneNominalInTime(const bool bit)
unsigned long long uint64_t
static int generateRawTrkAddress(const RegionalMuonCand &, bool isKalman)
static bool fillRegionalMuonShower(RegionalMuonShower &muShower, std::vector< uint32_t > bxPayload, int proc, tftype tf, bool useEmtfShowers)
static constexpr unsigned absPhiShift_
static constexpr unsigned bmtfTrAddrStat3Shift_
bool isOneNominalOutOfTime() const
static constexpr unsigned signValidShift_
void setTFIdentifiers(int processor, tftype trackFinder)
Set the processor ID, track-finder type. From these two, the link is set.
static constexpr unsigned emtfTrAddrMe3SegShift_
static constexpr unsigned qualMask_
static constexpr unsigned omtfTrAddrLayersMask_
static uint64_t generate64bitDataWord(const RegionalMuonCand &mu, bool isKbmtf, bool useEmtfDisplacementInfo)
static constexpr unsigned emtfTrAddrMe1ChShift_
static constexpr unsigned hfShift_
static constexpr unsigned omtfTrAddrWeightMask_
Log< level::Warning, false > LogWarning
static constexpr unsigned qualShift_
static void fillRegionalMuonCand(RegionalMuonCand &mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63, int proc, tftype tf, bool isKbmtf, bool useEmtfDisplacementInfo)
static constexpr unsigned absEtaShift_
static constexpr unsigned omtfTrAddrLayersShift_
static constexpr unsigned emtfTrAddrMe4ChShift_
void setOneNominalOutOfTime(const bool bit)
static constexpr unsigned emtfTrAddrTrkNumShift_
static constexpr unsigned absPhiMask_
static constexpr unsigned emtfTrAddrMe1SegShift_