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

Add fix for different indexing convention in early uGT prescale columns #22314

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions L1Trigger/L1TGlobal/src/L1TGlobalUtil.cc
Expand Up @@ -225,6 +225,22 @@ void l1t::L1TGlobalUtil::retrieveL1Event(const edm::Event& iEvent, const edm::Ev
if (algBlk != m_uGtAlgBlk->end(0)){
if (! m_readPrescalesFromFile){
m_PreScaleColumn = static_cast<unsigned int>(algBlk->getPreScColumn());

// Fix for MC prescale column being set to index+1 in early versions of uGT emulator
if (iEvent.run() == 1){
if (m_prescaleFactorsAlgoTrig->size() == 1 && m_PreScaleColumn ==1) m_PreScaleColumn = 0;
}

// add protection against out-of-bound index for prescale column
if(m_PreScaleColumn >= m_prescaleFactorsAlgoTrig->size()) {
LogDebug("l1t|Global")
<< "Prescale column extracted from GlobalAlgBlk too large: " << m_PreScaleColumn
<< "\tMaximum value allowed: " << m_prescaleFactorsAlgoTrig->size()-1
<< "\tResetting prescale column to 0"
<< std::endl;
m_PreScaleColumn = 0;
}

}
const std::vector<int>& prescaleSet = (*m_prescaleFactorsAlgoTrig)[m_PreScaleColumn];

Expand Down