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;
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_);
152 payload.at(emtfShowerInTimeFrame_) |= (shower.
isOneNominalInTime() & 1) << emtfShowerOneNominalShift_ |
154 payload.at(emtfShowerOOTFrame_) |= (shower.
isOneNominalOutOfTime() & 1) << emtfShowerOneNominalShift_ |
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_;
182 raw_data_32_63 |= (mu.
hwPtUnconstrained() & ptUnconstrainedMask_) << bmtfPtUnconstrainedShift_ |
183 (mu.
hwDXY() & dxyMask_) << bmtfDxyShift_;
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;
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_;
228 <<
" subaddresses. Check the data format. Setting track address to 0.";
246 <<
" subaddresses. Check the data format. Setting track address to 0.";
258 <<
" subaddresses. Check the data format. Setting track address to 0.";
void setOneTightInTime(const bool bit)
static constexpr unsigned emtfTrAddrMe4SegShift_
static constexpr unsigned trackAddressMask_
void setHwPhi(int bits)
Set compressed relative phi as transmitted by hardware LSB = 2*pi/576 (8 bits)
static constexpr unsigned bmtfTrAddrStat1Mask_
static constexpr unsigned etaSignShift_
const int hwSignValid() const
Get charge sign valid bit (0 - not valid (high pT muon); 1 - valid)
const int hwDXY() const
Get compressed impact parameter (4 bits)
void setOneTightOutOfTime(const bool bit)
static constexpr unsigned phiSignShift_
static constexpr unsigned trackAddressShift_
bool isOneTightInTime() const
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_
bool isOneTightOutOfTime() const
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
bool isOneNominalInTime() const
void setTrackAddress(const std::map< int, int > &address)
Set the whole track address.
static constexpr unsigned emtfPtUnconstrainedShift_
static constexpr unsigned bmtfPtUnconstrainedShift_
static constexpr unsigned emtfTrAddrTrkNumMask_
const int hwQual() const
Get quality code.
static constexpr unsigned bmtfTrAddrWheelShift_
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 isOneNominalOutOfTime() const
static constexpr unsigned hfMask_
static constexpr unsigned emtfDxyShift_
static constexpr unsigned bmtfTrAddrStat2Mask_
void setTFIdentifiers(int processor, tftype trackFinder)
Set the processor ID, track-finder type. From these two, the link is set.
static constexpr unsigned omtfTrAddrWeightShift_
static constexpr unsigned emtfTrAddrBxShift_
void setTrackSubAddress(bmtfAddress subAddress, int value)
Set a part of the muon candidates track address; specialised for BMTF.
static constexpr unsigned bmtfTrAddrStat4Mask_
static constexpr unsigned ptShift_
const int hwHF() const
Get HF (halo / fine eta) bit (EMTF: halo -> 1; BMTF: fine eta -> 1)
void setDataword(uint32_t msbs, uint32_t lsbs)
void setHwHF(bool bit)
Set HF (halo / fine eta) bit (EMTF: halo -> 1; BMTF: fine eta -> 1)
static constexpr unsigned ptUnconstrainedMask_
const int hwEta() const
Get compressed eta (returned int * 0.010875 = eta)
const std::map< int, int > & trackAddress() const
Get the track address (identifies track primitives used for reconstruction)
static constexpr unsigned bmtfDxyShift_
const int hwPhi() const
Get compressed local phi (returned int * 2*pi/576 = local phi in rad)
static constexpr unsigned emtfTrAddrMe4ChMask_
static constexpr unsigned emtfTrAddrMe2ChShift_
static constexpr unsigned ptMask_
const tftype trackFinderType() const
Get track-finder which found the muon (bmtf, emtf_pos/emtf_neg or omtf_pos/omtf_neg) ...
void setHwQual(int bits)
Set compressed quality code as transmitted by hardware (4 bits)
void setHwPt(int bits)
Set compressed pT as transmitted by hardware LSB = 0.5 (9 bits)
static constexpr unsigned emtfTrAddrMe2SegShift_
static constexpr unsigned bmtfTrAddrDetSideShift_
void setHwEta(int bits)
Set compressed eta as transmitted by hardware LSB = 0.010875 (9 bits)
static constexpr unsigned bmtfTrAddrWheelMask_
void setHwDXY(int bits)
Set compressed impact parameter with respect to beamspot (4 bits)
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_
static constexpr unsigned signValidShift_
void setTFIdentifiers(int processor, tftype trackFinder)
Set the processor ID, track-finder type. From these two, the link is set.
int trackSubAddress(bmtfAddress subAddress) const
Get part of track address (identifies track primitives used for reconstruction)
static constexpr unsigned emtfTrAddrMe3SegShift_
const int hwPt() const
Get compressed pT (returned int * 0.5 = pT (GeV))
static constexpr unsigned qualMask_
const int hwSign() const
Get charge sign bit (charge = (-1)^(sign))
void setHwSignValid(int bits)
Set whether charge measurement is valid (0 for high pT muons)
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)
void setHwPtUnconstrained(int bits)
Set compressed second displaced pT as transmitted by hardware LSB = 1.0 (8 bits)
static constexpr unsigned emtfTrAddrTrkNumShift_
static constexpr unsigned absPhiMask_
void setHwSign(int bits)
Set charge sign bit (charge = (-1)^(sign))
const int hwPtUnconstrained() const
Get second compressed pT (returned int * 1.0 = pT (GeV))
static constexpr unsigned emtfTrAddrMe1SegShift_