From 7ebacc9318fe72283baba11b8a019ae10cf945fd Mon Sep 17 00:00:00 2001 From: Efe Yigitbasi Date: Tue, 20 Sep 2022 20:35:11 +0200 Subject: [PATCH] Fixing a bug in GEM and RPC unpacker blocks. --- .../plugins/implementations_stage2/EMTFBlockGEM.cc | 3 ++- .../plugins/implementations_stage2/EMTFBlockRPC.cc | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/EMTFBlockGEM.cc b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/EMTFBlockGEM.cc index 91e66e85d2270..a6f5cc4de77a8 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/EMTFBlockGEM.cc +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/EMTFBlockGEM.cc @@ -147,7 +147,8 @@ namespace l1t { uint16_t GEMc = payload[2]; uint16_t GEMd = payload[3]; - for (int i = 0; i < nTPs; i++) { + // If there are 2 TPs in the block we fill them 1 by 1 + for (int i = 1; i <= nTPs; i++) { // res is a pointer to a collection of EMTFDaqOut class objects // There is one EMTFDaqOut for each MTF7 (60 deg. sector) in the event EMTFDaqOutCollection* res; diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/EMTFBlockRPC.cc b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/EMTFBlockRPC.cc index 271f84efb7005..392becf28dd0a 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/EMTFBlockRPC.cc +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/EMTFBlockRPC.cc @@ -140,7 +140,8 @@ namespace l1t { uint16_t RPCc = payload[2]; uint16_t RPCd = payload[3]; - for (int i = 0; i < nTPs; i++) { + // If there are 2 TPs in the block we fill them 1 by 1 + for (int i = 1; i <= nTPs; i++) { // res is a pointer to a collection of EMTFDaqOut class objects // There is one EMTFDaqOut for each MTF7 (60 deg. sector) in the event EMTFDaqOutCollection* res; @@ -159,7 +160,7 @@ namespace l1t { //////////////////////////// if (run3_DAQ_format) { // Run 3 DAQ format has 2 TPs per block - if (i == 0) { + if (i == 1) { RPC_.set_phi(GetHexBits(RPCa, 0, 10)); RPC_.set_word(GetHexBits(RPCa, 11, 12)); RPC_.set_frame(GetHexBits(RPCa, 13, 14));