Skip to content

Commit

Permalink
Fix position of unconstrained pT coming from OMTF
Browse files Browse the repository at this point in the history
  • Loading branch information
dinyar committed Apr 22, 2024
1 parent f048ad6 commit 7cf527b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
4 changes: 2 additions & 2 deletions L1Trigger/L1TMuon/interface/RegionalMuonRawDigiTranslator.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace l1t {
bool isKbmtf,
bool useOmtfDisplacementInfo,
bool useEmtfDisplacementInfo);
static int generateRawTrkAddress(const RegionalMuonCand&, bool isKalman, bool useOmtfDisplacementInfo);
static int generateRawTrkAddress(const RegionalMuonCand&, bool isKalman);

static constexpr unsigned ptMask_ = 0x1FF;
static constexpr unsigned ptShift_ = 0;
Expand All @@ -63,7 +63,7 @@ namespace l1t {
static constexpr unsigned emtfDxyShift_ = 29;
static constexpr unsigned ptUnconstrainedMask_ = 0xFF;
static constexpr unsigned bmtfPtUnconstrainedShift_ = 23;
static constexpr unsigned kOmtfPtUnconstrainedShift_ = 18;
static constexpr unsigned kOmtfPtUnconstrainedShift_ = 20;
static constexpr unsigned emtfPtUnconstrainedShift_ = 20;
static constexpr unsigned trackAddressMask_ = 0x1FFFFFFF;
static constexpr unsigned trackAddressShift_ = 2;
Expand Down
19 changes: 8 additions & 11 deletions L1Trigger/L1TMuon/src/RegionalMuonRawDigiTranslator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,12 @@ void l1t::RegionalMuonRawDigiTranslator::fillRegionalMuonCand(RegionalMuonCand&
} else if (tf == omtf_neg || tf == omtf_pos) {
if (useOmtfDisplacementInfo) { // In Run-3 2024 we receive displaced muon information from OMTF
mu.setHwPtUnconstrained((raw_data_32_63 >> kOmtfPtUnconstrainedShift_) & ptUnconstrainedMask_);
} else {
mu.setTrackSubAddress(RegionalMuonCand::kLayers,
(rawTrackAddress >> omtfTrAddrLayersShift_) & omtfTrAddrLayersMask_);
mu.setTrackSubAddress(RegionalMuonCand::kZero, 0);
mu.setTrackSubAddress(RegionalMuonCand::kWeight,
(rawTrackAddress >> omtfTrAddrWeightShift_) & omtfTrAddrWeightMask_);
}
mu.setTrackSubAddress(RegionalMuonCand::kLayers,
(rawTrackAddress >> omtfTrAddrLayersShift_) & omtfTrAddrLayersMask_);
mu.setTrackSubAddress(RegionalMuonCand::kZero, 0);
mu.setTrackSubAddress(RegionalMuonCand::kWeight,
(rawTrackAddress >> omtfTrAddrWeightShift_) & omtfTrAddrWeightMask_);
} else {
std::map<int, int> trackAddr;
trackAddr[0] = rawTrackAddress;
Expand Down Expand Up @@ -189,7 +188,7 @@ void l1t::RegionalMuonRawDigiTranslator::generatePackedDataWords(const RegionalM
(mu.hwPhi() < 0) << phiSignShift_;

// generate the raw track address from the subaddresses
int rawTrkAddr = generateRawTrkAddress(mu, isKbmtf, useOmtfDisplacementInfo);
int rawTrkAddr = generateRawTrkAddress(mu, isKbmtf);

raw_data_32_63 = mu.hwSign() << signShift_ | mu.hwSignValid() << signValidShift_ |
(rawTrkAddr & trackAddressMask_) << trackAddressShift_;
Expand All @@ -215,9 +214,7 @@ uint64_t l1t::RegionalMuonRawDigiTranslator::generate64bitDataWord(const Regiona
return (((uint64_t)msw) << 32) + lsw;
}

int l1t::RegionalMuonRawDigiTranslator::generateRawTrkAddress(const RegionalMuonCand& mu,
const bool isKalman,
const bool useOmtfDisplacementInfo) {
int l1t::RegionalMuonRawDigiTranslator::generateRawTrkAddress(const RegionalMuonCand& mu, const bool isKalman) {
int tf = mu.trackFinderType();
int rawTrkAddr = 0;
if (tf == bmtf) {
Expand Down Expand Up @@ -266,7 +263,7 @@ int l1t::RegionalMuonRawDigiTranslator::generateRawTrkAddress(const RegionalMuon
<< " subaddresses. Check the data format. Setting track address to 0.";
rawTrkAddr = 0;
}
} else if ((tf == omtf_neg || tf == omtf_pos) && !useOmtfDisplacementInfo) {
} else if (tf == omtf_neg || tf == omtf_pos) {
// protection against a track address map with the wrong size
if (mu.trackAddress().size() == RegionalMuonCand::kNumOmtfSubAddr) {
rawTrkAddr = (mu.trackSubAddress(RegionalMuonCand::kLayers) & omtfTrAddrLayersMask_) << omtfTrAddrLayersShift_ |
Expand Down
2 changes: 1 addition & 1 deletion L1Trigger/L1TNtuples/src/L1AnalysisL1UpgradeTfMuon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void L1Analysis::L1AnalysisL1UpgradeTfMuon::SetTfMuon(const l1t::RegionalMuonCan
}
l1upgradetfmuon_.tfMuonDecodedTrAdd.push_back(decoded_track_address);
l1upgradetfmuon_.tfMuonHwTrAdd.push_back(
l1t::RegionalMuonRawDigiTranslator::generateRawTrkAddress(*it, isRun3_, isRun3_));
l1t::RegionalMuonRawDigiTranslator::generateRawTrkAddress(*it, isRun3_));
l1upgradetfmuon_.nTfMuons++;
}
}
Expand Down

0 comments on commit 7cf527b

Please sign in to comment.