Skip to content

Commit 839d7f2

Browse files
committed
Add empty vector guard to CICADA/uGT emulation
1 parent e0f3447 commit 839d7f2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

L1Trigger/L1TGlobal/src/GlobalBoard.cc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,10 +356,18 @@ void l1t::GlobalBoard::receiveCaloObjectData(const edm::Event& iEvent,
356356
<< "\nSetting score to 0.0";
357357
}
358358
setCICADAScore(0.0);
359-
} else
359+
} else if (cicadaScoreHandle->isEmpty(0)) {
360+
if (m_verbosity) {
361+
edm::LogWarning("L1Tglobal")
362+
<< "\nWarning: CICADA score had a valid input tag, but an empty BX collection"
363+
<< "\nThe CICADA score will be filled with 0.0 to prevent any failure of uGT emulation";
364+
}
365+
setCICADAScore(0.0);
366+
} else {
360367
setCICADAScore(cicadaScoreHandle->at(
361368
0,
362369
0)); //CICADA emulation will only provide a central BX, and one value. Unpacking may have more values, but that can't be guaranteed.
370+
}
363371
}
364372
}
365373

0 commit comments

Comments
 (0)