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) {
100 std::map<int, int> trackAddr;
101 trackAddr[0] = rawTrackAddress;
102 mu.setTrackAddress(trackAddr);
105 mu.setTFIdentifiers(
proc, tf);
106 mu.setDataword(raw_data_32_63, raw_data_00_31);
114 const bool useOmtfDisplacementInfo,
115 const bool useEmtfDisplacementInfo) {
116 fillRegionalMuonCand(
mu,
117 (uint32_t)(dataword & 0xFFFFFFFF),
118 (uint32_t)((dataword >> 32) & 0xFFFFFFFF),
122 useOmtfDisplacementInfo,
123 useEmtfDisplacementInfo);
127 const std::vector<uint32_t> bxPayload,
130 const bool useEmtfNominalTightShowers,
131 const bool useEmtfLooseShowers) {
133 bool showerValid{
false};
135 muShower.
setOneNominalInTime(((bxPayload[kEmtfShowerStandardFrame] >> kEmtfShowerOneNominalShift) & 1) == 1);
136 muShower.
setOneTightInTime(((bxPayload[kEmtfShowerStandardFrame] >> kEmtfShowerOneTightShift) & 1) == 1);
138 showerValid = muShower.
isValid();
141 muShower.
setOneLooseInTime(((bxPayload[kEmtfShowerExtendedFrame] >> kEmtfShowerOneLooseShift) & 1) == 1);
143 showerValid = muShower.
isValid();
149 std::array<uint32_t, 6>&
payload,
150 const bool useEmtfNominalTightShowers,
151 const bool useEmtfLooseShowers) {
152 if (!useEmtfNominalTightShowers || !useEmtfLooseShowers || !shower.
isValid()) {
156 if ((((
payload.at(kEmtfShowerStandardFrame) >> kEmtfShowerOneNominalShift) & kEmtfShowerMask) != 0) ||
157 (((
payload.at(kEmtfShowerStandardFrame) >> kEmtfShowerOneTightShift) & kEmtfShowerMask) != 0) ||
158 (((
payload.at(kEmtfShowerExtendedFrame) >> kEmtfShowerOneLooseShift) & kEmtfShowerMask) != 0)) {
159 edm::LogError(
"L1T") <<
"Check constants for RegionalMuonShower fields! It looks like we're in danger of " 160 "overwriting muon data in the packer! StandardFrame is " 161 <<
payload.at(kEmtfShowerStandardFrame) <<
", ExtendedFrame is " 162 <<
payload.at(kEmtfShowerExtendedFrame);
172 uint32_t& raw_data_00_31,
173 uint32_t& raw_data_32_63,
175 const bool useOmtfDisplacementInfo,
176 const bool useEmtfDisplacementInfo) {
177 int abs_eta =
mu.hwEta();
179 abs_eta += (1 << (etaSignShift_ - absEtaShift_));
181 int abs_phi =
mu.hwPhi();
183 abs_phi += (1 << (phiSignShift_ - absPhiShift_));
185 raw_data_00_31 = (
mu.hwPt() & ptMask_) << ptShift_ | (
mu.hwQual() & qualMask_) << qualShift_ |
186 (abs_eta & absEtaMask_) << absEtaShift_ | (
mu.hwEta() < 0) << etaSignShift_ |
187 (
mu.hwHF() & hfMask_) << hfShift_ | (abs_phi & absPhiMask_) << absPhiShift_ |
188 (
mu.hwPhi() < 0) << phiSignShift_;
191 int rawTrkAddr = generateRawTrkAddress(
mu, isKbmtf);
193 raw_data_32_63 =
mu.hwSign() << signShift_ |
mu.hwSignValid() << signValidShift_ |
194 (rawTrkAddr & trackAddressMask_) << trackAddressShift_;
195 if (isKbmtf &&
mu.trackFinderType() ==
bmtf) {
196 raw_data_32_63 |= (
mu.hwPtUnconstrained() & ptUnconstrainedMask_) << bmtfPtUnconstrainedShift_ |
197 (
mu.hwDXY() & dxyMask_) << bmtfDxyShift_;
198 }
else if (useOmtfDisplacementInfo && (
mu.trackFinderType() ==
omtf_pos ||
mu.trackFinderType() ==
omtf_neg)) {
199 raw_data_32_63 |= (
mu.hwPtUnconstrained() & ptUnconstrainedMask_) << kOmtfPtUnconstrainedShift_;
200 }
else if (useEmtfDisplacementInfo && (
mu.trackFinderType() ==
emtf_pos ||
mu.trackFinderType() ==
emtf_neg)) {
201 raw_data_32_63 |= (
mu.hwPtUnconstrained() & ptUnconstrainedMask_) << emtfPtUnconstrainedShift_ |
202 (
mu.hwDXY() & dxyMask_) << emtfDxyShift_;
208 const bool useOmtfDisplacementInfo,
209 const bool useEmtfDisplacementInfo) {
213 generatePackedDataWords(
mu, lsw, msw, isKbmtf, useOmtfDisplacementInfo, useEmtfDisplacementInfo);
214 return (((
uint64_t)msw) << 32) + lsw;
218 int tf =
mu.trackFinderType();
236 rawTrkAddr = (detSide & 0x1) << bmtfTrAddrDetSideShift_ |
237 (wheelNum & bmtfTrAddrWheelMask_) << bmtfTrAddrWheelShift_ |
238 (stat1 & bmtfTrAddrStat1Mask_) << bmtfTrAddrStat1Shift_ |
239 (stat2 & bmtfTrAddrStat2Mask_) << bmtfTrAddrStat2Shift_ |
240 (stat3 & bmtfTrAddrStat3Mask_) << bmtfTrAddrStat3Shift_ |
241 (stat4 & bmtfTrAddrStat4Mask_) << bmtfTrAddrStat4Shift_;
243 edm::LogWarning(
"L1T") <<
"BMTF muon track address map contains " <<
mu.trackAddress().size()
245 <<
" subaddresses. Check the data format. Setting track address to 0.";
261 edm::LogWarning(
"L1T") <<
"EMTF muon track address map contains " <<
mu.trackAddress().size()
263 <<
" subaddresses. Check the data format. Setting track address to 0.";
273 edm::LogWarning(
"L1T") <<
"OMTF muon track address map contains " <<
mu.trackAddress().size()
275 <<
" subaddresses. Check the data format. Setting track address to 0.";
279 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 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 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 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_