5 const uint32_t raw_data_00_31,
6 const uint32_t raw_data_32_63,
10 const bool useOmtfDisplacementInfo,
11 const bool useEmtfDisplacementInfo) {
80 if (useEmtfDisplacementInfo) {
91 if (useOmtfDisplacementInfo) {
101 std::map<int, int> trackAddr;
102 trackAddr[0] = rawTrackAddress;
103 mu.setTrackAddress(trackAddr);
106 mu.setTFIdentifiers(
proc, tf);
107 mu.setDataword(raw_data_32_63, raw_data_00_31);
115 const bool useOmtfDisplacementInfo,
116 const bool useEmtfDisplacementInfo) {
117 fillRegionalMuonCand(
mu,
118 (uint32_t)(dataword & 0xFFFFFFFF),
119 (uint32_t)((dataword >> 32) & 0xFFFFFFFF),
123 useOmtfDisplacementInfo,
124 useEmtfDisplacementInfo);
128 const std::vector<uint32_t> bxPayload,
131 const bool useEmtfNominalTightShowers,
132 const bool useEmtfLooseShowers) {
134 bool showerValid{
false};
136 muShower.
setOneNominalInTime(((bxPayload[kEmtfShowerStandardFrame] >> kEmtfShowerOneNominalShift) & 1) == 1);
137 muShower.
setOneTightInTime(((bxPayload[kEmtfShowerStandardFrame] >> kEmtfShowerOneTightShift) & 1) == 1);
139 showerValid = muShower.
isValid();
142 muShower.
setOneLooseInTime(((bxPayload[kEmtfShowerExtendedFrame] >> kEmtfShowerOneLooseShift) & 1) == 1);
144 showerValid = muShower.
isValid();
150 std::array<uint32_t, 6>&
payload,
151 const bool useEmtfNominalTightShowers,
152 const bool useEmtfLooseShowers) {
153 if (!useEmtfNominalTightShowers || !useEmtfLooseShowers || !shower.
isValid()) {
157 if ((((
payload.at(kEmtfShowerStandardFrame) >> kEmtfShowerOneNominalShift) & kEmtfShowerMask) != 0) ||
158 (((
payload.at(kEmtfShowerStandardFrame) >> kEmtfShowerOneTightShift) & kEmtfShowerMask) != 0) ||
159 (((
payload.at(kEmtfShowerExtendedFrame) >> kEmtfShowerOneLooseShift) & kEmtfShowerMask) != 0)) {
160 edm::LogError(
"L1T") <<
"Check constants for RegionalMuonShower fields! It looks like we're in danger of " 161 "overwriting muon data in the packer! StandardFrame is " 162 <<
payload.at(kEmtfShowerStandardFrame) <<
", ExtendedFrame is " 163 <<
payload.at(kEmtfShowerExtendedFrame);
173 uint32_t& raw_data_00_31,
174 uint32_t& raw_data_32_63,
176 const bool useOmtfDisplacementInfo,
177 const bool useEmtfDisplacementInfo) {
178 int abs_eta =
mu.hwEta();
180 abs_eta += (1 << (etaSignShift_ - absEtaShift_));
182 int abs_phi =
mu.hwPhi();
184 abs_phi += (1 << (phiSignShift_ - absPhiShift_));
186 raw_data_00_31 = (
mu.hwPt() & ptMask_) << ptShift_ | (
mu.hwQual() & qualMask_) << qualShift_ |
187 (abs_eta & absEtaMask_) << absEtaShift_ | (
mu.hwEta() < 0) << etaSignShift_ |
188 (
mu.hwHF() & hfMask_) << hfShift_ | (abs_phi & absPhiMask_) << absPhiShift_ |
189 (
mu.hwPhi() < 0) << phiSignShift_;
192 int rawTrkAddr = generateRawTrkAddress(
mu, isKbmtf, useOmtfDisplacementInfo);
194 raw_data_32_63 =
mu.hwSign() << signShift_ |
mu.hwSignValid() << signValidShift_ |
195 (rawTrkAddr & trackAddressMask_) << trackAddressShift_;
196 if (isKbmtf &&
mu.trackFinderType() ==
bmtf) {
197 raw_data_32_63 |= (
mu.hwPtUnconstrained() & ptUnconstrainedMask_) << bmtfPtUnconstrainedShift_ |
198 (
mu.hwDXY() & dxyMask_) << bmtfDxyShift_;
199 }
else if (useOmtfDisplacementInfo && (
mu.trackFinderType() ==
omtf_pos ||
mu.trackFinderType() ==
omtf_neg)) {
200 raw_data_32_63 |= (
mu.hwPtUnconstrained() & ptUnconstrainedMask_) << kOmtfPtUnconstrainedShift_;
201 }
else if (useEmtfDisplacementInfo && (
mu.trackFinderType() ==
emtf_pos ||
mu.trackFinderType() ==
emtf_neg)) {
202 raw_data_32_63 |= (
mu.hwPtUnconstrained() & ptUnconstrainedMask_) << emtfPtUnconstrainedShift_ |
203 (
mu.hwDXY() & dxyMask_) << emtfDxyShift_;
209 const bool useOmtfDisplacementInfo,
210 const bool useEmtfDisplacementInfo) {
214 generatePackedDataWords(
mu, lsw, msw, isKbmtf, useOmtfDisplacementInfo, useEmtfDisplacementInfo);
215 return (((
uint64_t)msw) << 32) + lsw;
220 const bool useOmtfDisplacementInfo) {
221 int tf =
mu.trackFinderType();
239 rawTrkAddr = (detSide & 0x1) << bmtfTrAddrDetSideShift_ |
240 (wheelNum & bmtfTrAddrWheelMask_) << bmtfTrAddrWheelShift_ |
241 (stat1 & bmtfTrAddrStat1Mask_) << bmtfTrAddrStat1Shift_ |
242 (stat2 & bmtfTrAddrStat2Mask_) << bmtfTrAddrStat2Shift_ |
243 (stat3 & bmtfTrAddrStat3Mask_) << bmtfTrAddrStat3Shift_ |
244 (stat4 & bmtfTrAddrStat4Mask_) << bmtfTrAddrStat4Shift_;
246 edm::LogWarning(
"L1T") <<
"BMTF muon track address map contains " <<
mu.trackAddress().size()
248 <<
" subaddresses. Check the data format. Setting track address to 0.";
264 edm::LogWarning(
"L1T") <<
"EMTF muon track address map contains " <<
mu.trackAddress().size()
266 <<
" subaddresses. Check the data format. Setting track address to 0.";
269 }
else if ((tf ==
omtf_neg || tf ==
omtf_pos) && !useOmtfDisplacementInfo) {
276 edm::LogWarning(
"L1T") <<
"OMTF muon track address map contains " <<
mu.trackAddress().size()
278 <<
" subaddresses. Check the data format. Setting track address to 0.";
282 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 void generatePackedDataWords(const RegionalMuonCand &mu, uint32_t &raw_data_00_31, uint32_t &raw_data_32_63, bool isKbmtf, bool useOmtfDisplacementInfo, bool useEmtfDisplacementInfo)
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 int generateRawTrkAddress(const RegionalMuonCand &, bool isKalman, bool useOmtfDisplacementInfo)
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)
static void fillRegionalMuonCand(RegionalMuonCand &mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63, int proc, tftype tf, bool isKbmtf, bool useOmtfDisplacementInfo, bool useEmtfDisplacementInfo)
static uint64_t generate64bitDataWord(const RegionalMuonCand &mu, bool isKbmtf, bool useOmtfDisplacementInfo, bool useEmtfDisplacementInfo)
unsigned long long uint64_t
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 constexpr unsigned emtfTrAddrMe1ChShift_
static constexpr unsigned hfShift_
static constexpr unsigned omtfTrAddrWeightMask_
Log< level::Warning, false > LogWarning
static constexpr unsigned qualShift_
static constexpr unsigned absEtaShift_
static constexpr unsigned omtfTrAddrLayersShift_
static constexpr unsigned emtfTrAddrMe4ChShift_
static constexpr unsigned emtfTrAddrTrkNumShift_
static constexpr unsigned absPhiMask_
static constexpr unsigned kOmtfPtUnconstrainedShift_
static constexpr unsigned emtfTrAddrMe1SegShift_