Skip to content

Commit 5958df3

Browse files
authored
Merge pull request #45519 from missirol/devel_isFwVersionWithShowers
fix packing of muon-shower objects for L1-uGT FED
2 parents a058a31 + 4d7c9de commit 5958df3

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

EventFilter/L1TRawToDigi/plugins/implementations_stage2/MuonPacker.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace l1t {
99
GMTOutputObjectMap gmtObjMap;
1010
std::pair<int, int> muonBx = getMuons(gmtObjMap, event, static_cast<const CommonTokens*>(toks)->getMuonToken());
1111
std::pair<int, int> muonShowerBx{0, 0};
12-
if ((fedId_ == 1402 && fwId_ >= 0x7000000) || (fedId_ == 1404 && fwId_ >= 0x00010f01)) {
12+
if (MuonRawDigiTranslator::isFwVersionWithShowers(fedId_, fwId_)) {
1313
muonShowerBx = getMuonShowers(gmtObjMap, event, static_cast<const CommonTokens*>(toks)->getMuonShowerToken());
1414
}
1515

L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ namespace l1t {
1818
int muInBx);
1919
static void fillMuon(Muon& mu, uint32_t raw_data_spare, uint64_t dataword, int fed, int fw, int muInBx);
2020
static void fillIntermediateMuon(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63, int fw);
21+
static bool isFwVersionWithShowers(int fedId, int fwId);
2122
static bool showerFired(uint32_t shower_word, int fedId, int fwId);
2223
static void generatePackedMuonDataWords(const Muon& mu,
2324
uint32_t& raw_data_spare,

L1Trigger/L1TMuon/src/MuonRawDigiTranslator.cc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,13 @@ void l1t::MuonRawDigiTranslator::generate64bitDataWord(
262262
dataword = (((uint64_t)msw) << 32) + lsw;
263263
}
264264

265+
bool l1t::MuonRawDigiTranslator::isFwVersionWithShowers(int fedId, int fwId) {
266+
return ((fedId == kUgmtFedId && fwId >= kUgmtFwVersionFirstWithShowers) ||
267+
(fedId == kUgtFedId && fwId >= kUgtFwVersionFirstWithShowers));
268+
}
269+
265270
bool l1t::MuonRawDigiTranslator::showerFired(uint32_t shower_word, int fedId, int fwId) {
266-
if ((fedId == kUgmtFedId && fwId >= kUgmtFwVersionFirstWithShowers) ||
267-
(fedId == kUgtFedId && fwId >= kUgtFwVersionFirstWithShowers)) {
271+
if (isFwVersionWithShowers(fedId, fwId)) {
268272
return ((shower_word >> showerShift_) & 1) == 1;
269273
}
270274
return false;
@@ -274,8 +278,7 @@ std::array<std::array<uint32_t, 4>, 2> l1t::MuonRawDigiTranslator::getPackedShow
274278
const int fedId,
275279
const int fwId) {
276280
std::array<std::array<uint32_t, 4>, 2> res{};
277-
if ((fedId == kUgmtFedId && fwId >= kUgmtFwVersionFirstWithShowers) ||
278-
(fedId == kUgtFedId && fwId >= kUgtFwVersionFirstWithShowers)) {
281+
if (isFwVersionWithShowers(fedId, fwId)) {
279282
res.at(0).at(0) = shower.isOneNominalInTime() ? (1 << showerShift_) : 0;
280283
res.at(0).at(1) = shower.isOneTightInTime() ? (1 << showerShift_) : 0;
281284
}

0 commit comments

Comments
 (0)