From f93445cdc55898fef54377350821a7ab789a6eb4 Mon Sep 17 00:00:00 2001 From: Andrew David Loeliger Date: Tue, 25 Apr 2023 15:32:40 +0200 Subject: [PATCH] Update GlobalAlgBlkUnpacker to throw error in the case of headers received in the wrong order --- .../plugins/implementations_stage2/GlobalAlgBlkUnpacker.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/GlobalAlgBlkUnpacker.cc b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/GlobalAlgBlkUnpacker.cc index f057000ab55f7..de9d703eb2d43 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/GlobalAlgBlkUnpacker.cc +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/GlobalAlgBlkUnpacker.cc @@ -46,6 +46,13 @@ namespace l1t { GlobalAlgBlk talg = GlobalAlgBlk(); res_->push_back(bx, talg); } + //If this is not the first block, but the vector is empty, something has gone wrong (corrupted data) + else if (res_->isEmpty(bx)) + throw cms::Exception("InvalidGlobalAlgBlkBxCollection") + << "The GlobalAlgBlk unpacker result vector is empty, but is not receiving the first expected header " + "ID! This may be due to corrupted, or poorly formatted events.\n" + << "uGTBoard: " << uGTBoard << "\nBX: " << bx << "\nFirst expected block: " << initialBlkID + << "\nReceived block: " << block.header().getID(); //fetch GlobalAlgBlk alg = res_->at(bx, 0);