Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix packing of muon-shower objects for L1-uGT FED #45519

Merged
merged 1 commit into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace l1t {
GMTOutputObjectMap gmtObjMap;
std::pair<int, int> muonBx = getMuons(gmtObjMap, event, static_cast<const CommonTokens*>(toks)->getMuonToken());
std::pair<int, int> muonShowerBx{0, 0};
if ((fedId_ == 1402 && fwId_ >= 0x7000000) || (fedId_ == 1404 && fwId_ >= 0x00010f01)) {
if (MuonRawDigiTranslator::isFwVersionWithShowers(fedId_, fwId_)) {
muonShowerBx = getMuonShowers(gmtObjMap, event, static_cast<const CommonTokens*>(toks)->getMuonShowerToken());
}

Expand Down
1 change: 1 addition & 0 deletions L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ namespace l1t {
int muInBx);
static void fillMuon(Muon& mu, uint32_t raw_data_spare, uint64_t dataword, int fed, int fw, int muInBx);
static void fillIntermediateMuon(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63, int fw);
static bool isFwVersionWithShowers(int fedId, int fwId);
static bool showerFired(uint32_t shower_word, int fedId, int fwId);
static void generatePackedMuonDataWords(const Muon& mu,
uint32_t& raw_data_spare,
Expand Down
11 changes: 7 additions & 4 deletions L1Trigger/L1TMuon/src/MuonRawDigiTranslator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,13 @@ void l1t::MuonRawDigiTranslator::generate64bitDataWord(
dataword = (((uint64_t)msw) << 32) + lsw;
}

bool l1t::MuonRawDigiTranslator::isFwVersionWithShowers(int fedId, int fwId) {
return ((fedId == kUgmtFedId && fwId >= kUgmtFwVersionFirstWithShowers) ||
(fedId == kUgtFedId && fwId >= kUgtFwVersionFirstWithShowers));
}

bool l1t::MuonRawDigiTranslator::showerFired(uint32_t shower_word, int fedId, int fwId) {
if ((fedId == kUgmtFedId && fwId >= kUgmtFwVersionFirstWithShowers) ||
(fedId == kUgtFedId && fwId >= kUgtFwVersionFirstWithShowers)) {
if (isFwVersionWithShowers(fedId, fwId)) {
return ((shower_word >> showerShift_) & 1) == 1;
}
return false;
Expand All @@ -274,8 +278,7 @@ std::array<std::array<uint32_t, 4>, 2> l1t::MuonRawDigiTranslator::getPackedShow
const int fedId,
const int fwId) {
std::array<std::array<uint32_t, 4>, 2> res{};
if ((fedId == kUgmtFedId && fwId >= kUgmtFwVersionFirstWithShowers) ||
(fedId == kUgtFedId && fwId >= kUgtFwVersionFirstWithShowers)) {
if (isFwVersionWithShowers(fedId, fwId)) {
res.at(0).at(0) = shower.isOneNominalInTime() ? (1 << showerShift_) : 0;
res.at(0).at(1) = shower.isOneTightInTime() ? (1 << showerShift_) : 0;
}
Expand Down