Skip to content

Commit

Permalink
Merge pull request #22332 from apana/apana-fixEarlyMC_uGT_PSIndex_CMS…
Browse files Browse the repository at this point in the history
…SW_9_4_MAOD_X

Add fix for different indexing convention in early uGT prescale columns
  • Loading branch information
cmsbuild committed Feb 27, 2018
2 parents c73014f + 1fc1f6f commit 18cc310
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions L1Trigger/L1TGlobal/src/L1TGlobalUtil.cc
Expand Up @@ -219,6 +219,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

0 comments on commit 18cc310

Please sign in to comment.