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
EMTF unpacked muons match uGMT unpacked muons #22090
Changes from 5 commits
8243a0b
07b9960
b8c6780
e0bc63e
3ae747f
1cb2dfb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ MicroGMTConverter::~MicroGMTConverter() { | |
} | ||
|
||
void MicroGMTConverter::convert( | ||
const int global_event_BX, | ||
const EMTFTrack& in_track, | ||
l1t::RegionalMuonCand& out_cand | ||
) const { | ||
|
@@ -24,6 +25,10 @@ void MicroGMTConverter::convert( | |
out_cand.setHwQual ( in_track.GMT_quality() ); | ||
out_cand.setHwHF ( false ); // EMTF: halo -> 1 | ||
out_cand.setTFIdentifiers ( sector, tftype ); | ||
// Truncate to 11 bits and offset by 25 from global event BX in EMTF firmware | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This code does not belong here. Instead it should replace line 85. https://github.com/cms-sw/cmssw/pull/22090/files#diff-0098191652eebd75579da4dd04b68427R85 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would not put the offset in "convert_all", because "convert" can be called stand-alone, and I would not want to have to perform the truncation and shift every time I call "convert". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line 85 is not in convert_all but in this function. |
||
int EMTF_kBX = (abs(global_event_BX) % 2048) - 25 + in_track.BX(); | ||
if (EMTF_kBX < 0) EMTF_kBX += 2048; | ||
out_cand.setTrackSubAddress( l1t::RegionalMuonCand::kBX, EMTF_kBX ); | ||
|
||
const EMTFPtLUT& ptlut_data = in_track.PtLUT(); | ||
|
||
|
@@ -81,6 +86,7 @@ void MicroGMTConverter::convert( | |
} | ||
|
||
void MicroGMTConverter::convert_all( | ||
const edm::Event& iEvent, | ||
const EMTFTrackCollection& in_tracks, | ||
l1t::RegionalMuonCandBxCollection& out_cands | ||
) const { | ||
|
@@ -96,8 +102,46 @@ void MicroGMTConverter::convert_all( | |
if (gmtMinBX <= bx && bx <= gmtMaxBX) { | ||
l1t::RegionalMuonCand out_cand; | ||
|
||
convert(in_track, out_cand); | ||
convert(iEvent.bunchCrossing(), in_track, out_cand); | ||
out_cands.push_back(bx, out_cand); | ||
} | ||
} | ||
|
||
// Sort by processor to match uGMT unpacked order | ||
emtf::sort_uGMT_muons(out_cands); | ||
|
||
} | ||
|
||
|
||
namespace emtf { | ||
|
||
void sort_uGMT_muons( | ||
l1t::RegionalMuonCandBxCollection& cands | ||
) { | ||
|
||
int minBX = cands.getFirstBX(); | ||
int maxBX = cands.getLastBX(); | ||
int emtfMinProc = 0; // ME+ sector 1 | ||
int emtfMaxProc = 11; // ME- sector 6 | ||
|
||
// New collection, sorted by processor to match uGMT unpacked order | ||
auto sortedCands = std::make_unique<l1t::RegionalMuonCandBxCollection>(); | ||
sortedCands->clear(); | ||
sortedCands->setBXRange(minBX, maxBX); | ||
for (int iBX = minBX; iBX <= maxBX; ++iBX) { | ||
for (int proc = emtfMinProc; proc <= emtfMaxProc; proc++) { | ||
for (l1t::RegionalMuonCandBxCollection::const_iterator cand = cands.begin(iBX); cand != cands.end(iBX); ++cand) { | ||
int cand_proc = cand->processor(); | ||
if (cand->trackFinderType() == l1t::tftype::emtf_neg) cand_proc += 6; | ||
if (cand_proc != proc) continue; | ||
sortedCands->push_back(iBX, *cand); | ||
} | ||
} | ||
} | ||
|
||
// Return sorted collection | ||
std::swap(cands, *sortedCands); | ||
sortedCands.reset(); | ||
} | ||
|
||
} // End namespace emtf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @abrinke1 I think there is no need to change this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not? Don't we want the EMTF unpacker and emulator to match, wherever possible? I confirmed that L1A_BXN() in EMTFBlockSP.cc matches iEvent.bunchCrossing() in MicroGMTConverter.cc. The offset and truncation is required in both to match how the EMTF firmware fills the track address which is transmitted to the uGMT.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks as if you just changed the formatting in this file.