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 crash in CorrelationConditions uGT emulator #13809

Merged
Merged
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
55 changes: 53 additions & 2 deletions L1Trigger/L1TGlobal/src/CorrCondition.cc
Original file line number Diff line number Diff line change
Expand Up @@ -439,11 +439,36 @@ const bool l1t::CorrCondition::evaluateCondition(const int bxEval) const {
// Energy Sums
case CondEnergySum: {

l1t::EtSum::EtSumType type;
switch( cndObjTypeVec[0] ){
case ETM:
type = l1t::EtSum::EtSumType::kMissingEt;
break;
case ETT:
type = l1t::EtSum::EtSumType::kTotalEt;
break;
case HTM:
type = l1t::EtSum::EtSumType::kMissingHt;
break;
case HTT:
type = l1t::EtSum::EtSumType::kTotalHt;
break;
default:
edm::LogError("l1t|Global")
<< "\n Error: "
<< "Unmatched object type from template to EtSumType, cndObjTypeVec[0] = "
<< cndObjTypeVec[0]
<< std::endl;
type = l1t::EtSum::EtSumType::kTotalEt;
break;
}

candEtSumVec = m_uGtB->getCandL1EtSum();
for( int iEtSum=0; iEtSum < (int)candEtSumVec->size(bxEval); iEtSum++) {
// this is clearly a bug:
//if( (candEtSumVec->at(bxEval,iEtSum))->getType() == cndObjTypeVec[0] ) {
// untested bug fix, to quiet compile time warnings, will need to push back to GT experts:
if( (candEtSumVec->at(bxEval,iEtSum))->getType() == l1t::EtSum::kMissingEt ) {
if( (candEtSumVec->at(bxEval,iEtSum))->getType() == type ) {
phiIndex0 = (candEtSumVec->at(bxEval,iEtSum))->hwPhi();
etaIndex0 = (candEtSumVec->at(bxEval,iEtSum))->hwEta();
etIndex0 = (candEtSumVec->at(bxEval,iEtSum))->hwPt();
Expand Down Expand Up @@ -539,11 +564,37 @@ const bool l1t::CorrCondition::evaluateCondition(const int bxEval) const {
break;
case CondEnergySum: {


l1t::EtSum::EtSumType type;
switch( cndObjTypeVec[1] ){
case ETM:
type = l1t::EtSum::EtSumType::kMissingEt;
break;
case ETT:
type = l1t::EtSum::EtSumType::kTotalEt;
break;
case HTM:
type = l1t::EtSum::EtSumType::kMissingHt;
break;
case HTT:
type = l1t::EtSum::EtSumType::kTotalHt;
break;
default:
edm::LogError("l1t|Global")
<< "\n Error: "
<< "Unmatched object type from template to EtSumType, cndObjTypeVec[1] = "
<< cndObjTypeVec[1]
<< std::endl;
type = l1t::EtSum::EtSumType::kTotalEt;
break;
}

candEtSumVec = m_uGtB->getCandL1EtSum();
for( int iEtSum=0; iEtSum < (int)candEtSumVec->size(bxEval); iEtSum++) {
// this is clearly a bug:
//if( (candEtSumVec->at(bxEval,iEtSum))->getType() == cndObjTypeVec[1] ) {
// untested bug fix, to quiet compile time warnings, will need to push back to GT experts:
if( (candEtSumVec->at(bxEval,iEtSum))->getType() == l1t::EtSum::kMissingEt ) {
if( (candEtSumVec->at(bxEval,iEtSum))->getType() == type ) {
phiIndex1 = (candEtSumVec->at(bxEval,iEtSum))->hwPhi();
etaIndex1 = (candEtSumVec->at(bxEval,iEtSum))->hwEta();
etIndex1 = (candEtSumVec->at(bxEval,iEtSum))->hwPt();
Expand Down