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 3fb8b0e commit f41ee91
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 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
17 changes: 7 additions & 10 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 @@ -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

0 comments on commit f41ee91

Please sign in to comment.