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);
121 const std::vector<uint32_t> bxPayload,
124 const bool useEmtfNominalTightShowers,
125 const bool useEmtfLooseShowers) {
127 bool showerValid{
false};
129 muShower.
setOneNominalInTime(((bxPayload[kEmtfShowerStandardFrame] >> kEmtfShowerOneNominalShift) & 1) == 1);
130 muShower.
setOneTightInTime(((bxPayload[kEmtfShowerStandardFrame] >> kEmtfShowerOneTightShift) & 1) == 1);
132 showerValid = muShower.
isValid();
135 muShower.
setOneLooseInTime(((bxPayload[kEmtfShowerExtendedFrame] >> kEmtfShowerOneLooseShift) & 1) == 1);
137 showerValid = muShower.
isValid();
143 std::array<uint32_t, 6>&
payload,
144 const bool useEmtfNominalTightShowers,
145 const bool useEmtfLooseShowers) {
146 if (!useEmtfNominalTightShowers || !useEmtfLooseShowers || !shower.
isValid()) {
150 if ((((
payload.at(kEmtfShowerStandardFrame) >> kEmtfShowerOneNominalShift) & kEmtfShowerMask) != 0) ||
151 (((
payload.at(kEmtfShowerStandardFrame) >> kEmtfShowerOneTightShift) & kEmtfShowerMask) != 0) ||
152 (((
payload.at(kEmtfShowerExtendedFrame) >> kEmtfShowerOneLooseShift) & kEmtfShowerMask) != 0)) {
153 edm::LogError(
"L1T") <<
"Check constants for RegionalMuonShower fields! It looks like we're in danger of " 154 "overwriting muon data in the packer! StandardFrame is " 155 <<
payload.at(kEmtfShowerStandardFrame) <<
", ExtendedFrame is " 156 <<
payload.at(kEmtfShowerExtendedFrame);
166 uint32_t& raw_data_00_31,
167 uint32_t& raw_data_32_63,
169 const bool useEmtfDisplacementInfo) {
170 int abs_eta =
mu.hwEta();
172 abs_eta += (1 << (etaSignShift_ - absEtaShift_));
174 int abs_phi =
mu.hwPhi();
176 abs_phi += (1 << (phiSignShift_ - absPhiShift_));
178 raw_data_00_31 = (
mu.hwPt() & ptMask_) << ptShift_ | (
mu.hwQual() & qualMask_) << qualShift_ |
179 (abs_eta & absEtaMask_) << absEtaShift_ | (
mu.hwEta() < 0) << etaSignShift_ |
180 (
mu.hwHF() & hfMask_) << hfShift_ | (abs_phi & absPhiMask_) << absPhiShift_ |
181 (
mu.hwPhi() < 0) << phiSignShift_;
184 int rawTrkAddr = generateRawTrkAddress(
mu, isKbmtf);
186 raw_data_32_63 =
mu.hwSign() << signShift_ |
mu.hwSignValid() << signValidShift_ |
187 (rawTrkAddr & trackAddressMask_) << trackAddressShift_;
188 if (isKbmtf &&
mu.trackFinderType() ==
bmtf) {
189 raw_data_32_63 |= (
mu.hwPtUnconstrained() & ptUnconstrainedMask_) << bmtfPtUnconstrainedShift_ |
190 (
mu.hwDXY() & dxyMask_) << bmtfDxyShift_;
191 }
else if (useEmtfDisplacementInfo && (
mu.trackFinderType() ==
emtf_pos ||
mu.trackFinderType() ==
emtf_neg)) {
192 raw_data_32_63 |= (
mu.hwPtUnconstrained() & ptUnconstrainedMask_) << emtfPtUnconstrainedShift_ |
193 (
mu.hwDXY() & dxyMask_) << emtfDxyShift_;
199 const bool useEmtfDisplacementInfo) {
203 generatePackedDataWords(
mu, lsw, msw, isKbmtf, useEmtfDisplacementInfo);
204 return (((
uint64_t)msw) << 32) + lsw;
208 int tf =
mu.trackFinderType();
226 rawTrkAddr = (detSide & 0x1) << bmtfTrAddrDetSideShift_ |
227 (wheelNum & bmtfTrAddrWheelMask_) << bmtfTrAddrWheelShift_ |
228 (stat1 & bmtfTrAddrStat1Mask_) << bmtfTrAddrStat1Shift_ |
229 (stat2 & bmtfTrAddrStat2Mask_) << bmtfTrAddrStat2Shift_ |
230 (stat3 & bmtfTrAddrStat3Mask_) << bmtfTrAddrStat3Shift_ |
231 (stat4 & bmtfTrAddrStat4Mask_) << bmtfTrAddrStat4Shift_;
233 edm::LogWarning(
"L1T") <<
"BMTF muon track address map contains " <<
mu.trackAddress().size()
235 <<
" subaddresses. Check the data format. Setting track address to 0.";
251 edm::LogWarning(
"L1T") <<
"EMTF muon track address map contains " <<
mu.trackAddress().size()
253 <<
" subaddresses. Check the data format. Setting track address to 0.";
263 edm::LogWarning(
"L1T") <<
"OMTF muon track address map contains " <<
mu.trackAddress().size()
265 <<
" subaddresses. Check the data format. Setting track address to 0.";
269 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_
static constexpr unsigned phiSignShift_
static constexpr unsigned trackAddressShift_
static constexpr unsigned absEtaMask_
static constexpr unsigned bmtfTrAddrStat2Shift_
static constexpr unsigned bmtfTrAddrStat3Mask_
void setOneLooseInTime(const bool bit)
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 void generatePackedShowerPayload(const RegionalMuonShower &shower, std::array< uint32_t, 6 > &payload, bool useEmtfNominalTightShowers, bool useEmtfLooseShowers)
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 bool fillRegionalMuonShower(RegionalMuonShower &muShower, std::vector< uint32_t > bxPayload, int proc, tftype tf, bool useEmtfNominalTightShowers, bool useEmtfLooseShowers)
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 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_
static constexpr unsigned emtfTrAddrTrkNumShift_
static constexpr unsigned absPhiMask_
static constexpr unsigned emtfTrAddrMe1SegShift_