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);