From 8eae9a4ad95981af6f5b177686f971d176d0f40e Mon Sep 17 00:00:00 2001 From: Sergi Rodriguez Date: Fri, 3 Jun 2022 12:14:53 +0200 Subject: [PATCH 1/3] adding jEM container in the jFEX BS deco. --- .../python/L1CaloFEXByteStreamConfig.py | 4 + .../src/jFexByteStreamTool.cxx | 110 ++++++++++++------ .../src/jFexByteStreamTool.h | 14 ++- .../python/TrigT1ResultByteStreamConfig.py | 1 + 4 files changed, 88 insertions(+), 41 deletions(-) diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXByteStream/python/L1CaloFEXByteStreamConfig.py b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXByteStream/python/L1CaloFEXByteStreamConfig.py index 744e24704c8..14076ddb9f4 100644 --- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXByteStream/python/L1CaloFEXByteStreamConfig.py +++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXByteStream/python/L1CaloFEXByteStreamConfig.py @@ -14,6 +14,7 @@ def jFexByteStreamToolCfg(name, flags, writeBS=False): tool.jJRoIContainerReadKey ="L1_jFexSRJetRoI" tool.jLJRoIContainerReadKey ="L1_jFexLRJetRoI" tool.jTauRoIContainerReadKey ="L1_jFexTauRoI" + tool.jEMRoIContainerReadKey ="L1_jFexFwdElRoI" tool.jTERoIContainerReadKey ="L1_jFexSumETRoI" tool.jXERoIContainerReadKey ="L1_jFexMETRoI" @@ -21,6 +22,7 @@ def jFexByteStreamToolCfg(name, flags, writeBS=False): tool.jJRoIContainerWriteKey ="" tool.jLJRoIContainerWriteKey ="" tool.jTauRoIContainerWriteKey="" + tool.jEMRoIContainerWriteKey ="" tool.jTERoIContainerWriteKey ="" tool.jXERoIContainerWriteKey ="" else: @@ -28,6 +30,7 @@ def jFexByteStreamToolCfg(name, flags, writeBS=False): tool.jJRoIContainerReadKey ="" tool.jLJRoIContainerReadKey ="" tool.jTauRoIContainerReadKey ="" + tool.jEMRoIContainerReadKey ="" tool.jTERoIContainerReadKey ="" tool.jXERoIContainerReadKey ="" @@ -35,6 +38,7 @@ def jFexByteStreamToolCfg(name, flags, writeBS=False): tool.jJRoIContainerWriteKey ="L1_jFexSRJetRoI" tool.jLJRoIContainerWriteKey ="L1_jFexLRJetRoI" tool.jTauRoIContainerWriteKey="L1_jFexTauRoI" + tool.jEMRoIContainerWriteKey ="L1_jFexFwdElRoI" tool.jTERoIContainerWriteKey ="L1_jFexSumETRoI" tool.jXERoIContainerWriteKey ="L1_jFexMETRoI" diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXByteStream/src/jFexByteStreamTool.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXByteStream/src/jFexByteStreamTool.cxx index 86828e9a874..fa0f56bc67f 100644 --- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXByteStream/src/jFexByteStreamTool.cxx +++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXByteStream/src/jFexByteStreamTool.cxx @@ -34,7 +34,7 @@ struct color { std::string B_GRAY ="\033[1;100m"; std::string B_RED ="\033[1;41m"; std::string B_GREEN ="\033[1;42m"; -} /*C*/; +} const C; jFexByteStreamTool::jFexByteStreamTool(const std::string& type, const std::string& name, @@ -66,6 +66,14 @@ StatusCode jFexByteStreamTool::initialize() { ATH_MSG_DEBUG((jTaumode==ConversionMode::Encoding ? "Encoding" : "Decoding") << " jTau ROB IDs: " << MSG::hex << m_robIds.value() << MSG::dec); + // Conversion mode for jEM TOBs + ConversionMode jEMmode = getConversionMode(m_jEMReadKey, m_jEMWriteKey, msg()); + ATH_CHECK(jEMmode!=ConversionMode::Undefined); + ATH_CHECK(m_jEMWriteKey.initialize(jEMmode==ConversionMode::Decoding)); + ATH_CHECK(m_jEMReadKey.initialize(jEMmode==ConversionMode::Encoding)); + ATH_MSG_DEBUG((jEMmode==ConversionMode::Encoding ? "Encoding" : "Decoding") << " jEM ROB IDs: " + << MSG::hex << m_robIds.value() << MSG::dec); + // Conversion mode for jTE TOBs ConversionMode jTEmode = getConversionMode(m_jTEReadKey, m_jTEWriteKey, msg()); ATH_CHECK(jTEmode!=ConversionMode::Undefined); @@ -83,7 +91,7 @@ StatusCode jFexByteStreamTool::initialize() { << MSG::hex << m_robIds.value() << MSG::dec); //checking all Conversion modes.. avoid misconfigurations - const std::array modes{jLJmode,jTaumode,jTEmode,jXEmode}; + const std::array modes{jLJmode,jTaumode,jEMmode,jTEmode,jXEmode}; if (std::any_of(modes.begin(),modes.end(),[&jJmode](ConversionMode m) { return m!=jJmode; } )) { ATH_MSG_ERROR("Inconsistent conversion modes"); return StatusCode::FAILURE; @@ -97,7 +105,7 @@ StatusCode jFexByteStreamTool::initialize() { // BS->xAOD conversion StatusCode jFexByteStreamTool::convertFromBS(const std::vector& vrobf, const EventContext& ctx) const { - //std::cout<& vro ATH_CHECK(jTauContainer.record(std::make_unique(), std::make_unique())); ATH_MSG_DEBUG("Recorded jFexTauRoIContainer with key " << jTauContainer.key()); + //---EM EDM + SG::WriteHandle jEMContainer(m_jEMWriteKey, ctx); + ATH_CHECK(jEMContainer.record(std::make_unique(), std::make_unique())); + ATH_MSG_DEBUG("Recorded jFexFwdElRoIContainer with key " << jEMContainer.key()); + //---SumET EDM SG::WriteHandle jTEContainer(m_jTEWriteKey, ctx); ATH_CHECK(jTEContainer.record(std::make_unique(), std::make_unique())); @@ -128,19 +141,25 @@ StatusCode jFexByteStreamTool::convertFromBS(const std::vector& vro ATH_MSG_DEBUG("Recorded jFexMETRoIContainer with key " << jXEContainer.key()); - //std::cout << "ROBFragments to decode: " << vrobf.size() << std::endl; + std::cout << "ROBFragments to decode: " << vrobf.size() << std::endl; // Iterate over ROBFragments to decode for (const ROBF* rob : vrobf) { // Iterate over ROD words and decode //ATH_MSG_DEBUG("Starting to decode " << ndata << " ROD words from ROB 0x" << std::hex << rob->rob_source_id() << std::dec); - //std::cout<< "Starting to decode " << rob->rod_ndata() << " ROD words from ROB 0x" << std::hex << rob->rob_source_id() << std::dec << std::endl; + std::cout<< "Starting to decode " << rob->rod_ndata() << " ROD words from ROB 0x" << std::hex << rob->rob_source_id() << std::dec << std::endl; + + //There is no data to decode.. not even the ROD trailers + if(rob->rod_ndata() <= 0){ + printf("ERROR No ROD words read. rob->rod_ndata() =%3d \n",rob->rod_ndata()); + continue; + } const auto dataArray = CxxUtils::span{rob->rod_data(), rob->rod_ndata()}; std::vector vec_words(dataArray.begin(),dataArray.end()); -/* for debug + int aux = 1; //delete, for debug for (const uint32_t word : vec_words) { @@ -148,7 +167,7 @@ StatusCode jFexByteStreamTool::convertFromBS(const std::vector& vro aux++; //delete, for debug } -*/ + // Starting to loop over the different jFEX blocks bool READ_TOBS = true; @@ -157,20 +176,35 @@ StatusCode jFexByteStreamTool::convertFromBS(const std::vector& vro while(READ_TOBS){ - //printf("----------------------------------------------------------------------------------------------------------------------\n"); + printf("----------------------------------------------------------------------------------------------------------------------\n"); const auto [payload, fpga, jfex] = jFEXtoRODTrailer ( vec_words.at(trailers_pos-2), vec_words.at(trailers_pos-1) ); const auto [n_xjJ, n_xjLJ, n_xjTau, n_xjEM] = xTOBCounterTrailer( vec_words.at(trailers_pos-3) ); const auto [n_jJ, n_jLJ, n_jTau, n_jEM, n_jTE, n_jXE] = TOBCounterTrailer ( vec_words.at(trailers_pos-4) ); - //printf("----------> trailer_pos:%3d payload:%3d fpga:%3d jfex:%3d\n",trailers_pos,payload,fpga,jfex); - //printf("xTOBs: xjJ:%3d xjLJ:%3d xjTau:%3d xjEM:%3d\n",n_xjJ,n_xjLJ,n_xjTau,n_xjEM); - //printf(" TOBs: jJ:%3d jLJ:%3d jTau:%3d jEM:%3d jTE:%3d jXE:%3d\n",n_jJ,n_jLJ,n_jTau,n_jEM,n_jTE,n_jXE); + printf("----------> trailer_pos:%3d payload:%3d fpga:%3d jfex:%3d\n",trailers_pos,payload,fpga,jfex); + printf(" TOBs(0x%08x): jJ:%3d jLJ:%3d jTau:%3d jEM:%3d jTE:%3d jXE:%3d\n",vec_words.at(trailers_pos-4),n_jJ,n_jLJ,n_jTau,n_jEM,n_jTE,n_jXE); + printf("xTOBs(0x%08x): xjJ:%3d xjLJ:%3d xjTau:%3d xjEM:%3d\n",vec_words.at(trailers_pos-3),n_xjJ,n_xjLJ,n_xjTau,n_xjEM); + + if(jfex == 5 or jfex == 0){ + trailers_pos -= (payload+2); + if(trailers_pos == 0) { + READ_TOBS = false; + } + continue; + } + + //The minimum number for the payload should be 2 (The TOB/xTOB counters). If lower send an error message + if(payload < jBits::TOB_TRAILERS){ + printf("ERROR Payload is lower than the TOB/xTOB trailers. (Payload = %3d < %3d = TOB Trailer) \n",payload,jBits::TOB_TRAILERS); + break; + } + //There can be a padding word, even number in the payload, but odd number of xTOB and TOB.. need to check and remove the extra word. unsigned int total_tobs = n_xjJ + n_xjLJ + n_xjTau + n_xjEM + n_jJ + n_jLJ + n_jTau + n_jEM + n_jTE + n_jXE; unsigned int paddingWord = 0; if(total_tobs % 2){ - //printf("Odd number of TOBs + xTOBs: %4d, there is a padding word! CAREFUL!\n",total_tobs); + printf("Odd number of TOBs + xTOBs: %4d, there is a padding word! CAREFUL!\n",total_tobs); paddingWord = 1; } @@ -180,18 +214,20 @@ StatusCode jFexByteStreamTool::convertFromBS(const std::vector& vro /************************************************** DECODING xTOBS **************************************************/ //saving xjEM into the EDM container - //printf("**** %7s: %3d ****\n","n_xjEM",n_xjEM); -/* for(unsigned int i=tobIndex; i>tobIndex-n_xjEM; i--){ - //printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); + printf("**** %7s: %3d ****\n","n_xjEM",n_xjEM); + for(unsigned int i=tobIndex; i>tobIndex-n_xjEM; i--){ + printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); + jEMContainer->push_back( std::make_unique() ); + jEMContainer->back()->initialize(jfex, fpga, vec_words.at(i-1) ,0 , 200, -99, -99); } -*/ //removing xjEM counter from TOBs + //removing xjEM counter from TOBs tobIndex -= n_xjEM; //saving xjTau into the EDM container - //printf("**** %7s: %3d ****\n","n_xjTau",n_xjTau); + printf("**** %7s: %3d ****\n","n_xjTau",n_xjTau); for(unsigned int i=tobIndex; i>tobIndex-n_xjTau; i--){ - //printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); + printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); jTauContainer->push_back( std::make_unique() ); jTauContainer->back()->initialize(jfex, fpga, vec_words.at(i-1) ,0 , 200, -99, -99); @@ -200,10 +236,10 @@ StatusCode jFexByteStreamTool::convertFromBS(const std::vector& vro tobIndex -= n_xjTau; //saving xjLJ into the EDM container - //printf("**** %7s: %3d ****\n","n_xjLJ",n_xjLJ); + printf("**** %7s: %3d ****\n","n_xjLJ",n_xjLJ); for(unsigned int i=tobIndex; i>tobIndex-n_xjLJ; i--){ - //printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); + printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); jLJContainer->push_back( std::make_unique() ); jLJContainer->back()->initialize(jfex, fpga, vec_words.at(i-1) ,0 , 200, -99, -99); @@ -212,10 +248,10 @@ StatusCode jFexByteStreamTool::convertFromBS(const std::vector& vro tobIndex -= n_xjLJ; //saving xjJ into the EDM container - //printf("**** %7s: %3d ****\n","n_xjJ",n_xjJ); + printf("**** %7s: %3d ****\n","n_xjJ",n_xjJ); for(unsigned int i=tobIndex; i>tobIndex-n_xjJ; i--){ - //printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); + printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); jJContainer->push_back( std::make_unique() ); jJContainer->back()->initialize(jfex, fpga, vec_words.at(i-1) ,0 , 200, -99, -99); @@ -227,10 +263,10 @@ StatusCode jFexByteStreamTool::convertFromBS(const std::vector& vro /************************************************** DECODING TOBS **************************************************/ //saving jXE into the EDM container - //printf("**** %7s: %3d ****\n","n_jXE",n_jXE); + printf("**** %7s: %3d ****\n","n_jXE",n_jXE); for(unsigned int i=tobIndex; i>tobIndex-n_jXE; i--){ - //printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); + printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); jXEContainer->push_back( std::make_unique() ); jXEContainer->back()->initialize(jfex, fpga, vec_words.at(i-1), 200); @@ -239,10 +275,10 @@ StatusCode jFexByteStreamTool::convertFromBS(const std::vector& vro tobIndex -= n_jXE; //saving jTE into the EDM container - //printf("**** %7s: %3d ****\n","n_jTE",n_jTE); + printf("**** %7s: %3d ****\n","n_jTE",n_jTE); for(unsigned int i=tobIndex; i>tobIndex-n_jTE; i--){ - //printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); + printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); jTEContainer->push_back( std::make_unique() ); jTEContainer->back()->initialize(jfex, fpga, vec_words.at(i-1), 200); @@ -251,18 +287,20 @@ StatusCode jFexByteStreamTool::convertFromBS(const std::vector& vro tobIndex -= n_jTE; //saving jEM into the EDM container - //printf("**** %7s: %3d ****\n","n_jEM",n_jEM); -/* for(unsigned int i=tobIndex; i>tobIndex-n_jEM; i--){ - //printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); + printf("**** %7s: %3d ****\n","n_jEM",n_jEM); + for(unsigned int i=tobIndex; i>tobIndex-n_jEM; i--){ + printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); + jEMContainer->push_back( std::make_unique() ); + jEMContainer->back()->initialize(jfex, fpga, vec_words.at(i-1) ,0 , 200, -99, -99); } -*/ //removing jEM counter from TOBs + //removing jEM counter from TOBs tobIndex -= n_jEM; //saving jTau into the EDM container - //printf("**** %7s: %3d ****\n","n_jTau",n_jTau); + printf("**** %7s: %3d ****\n","n_jTau",n_jTau); for(unsigned int i=tobIndex; i>tobIndex-n_jTau; i--){ - //printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); + printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); jTauContainer->push_back( std::make_unique() ); jTauContainer->back()->initialize(jfex, fpga, vec_words.at(i-1) ,1 , 200, -99, -99); @@ -271,10 +309,10 @@ StatusCode jFexByteStreamTool::convertFromBS(const std::vector& vro tobIndex -= n_jTau; //saving jLJ into the EDM container - //printf("**** %7s: %3d ****\n","n_jLJ",n_jLJ); + printf("**** %7s: %3d ****\n","n_jLJ",n_jLJ); for(unsigned int i=tobIndex; i>tobIndex-n_jLJ; i--){ - //printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); + printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); jLJContainer->push_back( std::make_unique() ); jLJContainer->back()->initialize(jfex, fpga, vec_words.at(i-1) ,1 , 200, -99, -99); @@ -283,10 +321,10 @@ StatusCode jFexByteStreamTool::convertFromBS(const std::vector& vro tobIndex -= n_jLJ; //saving jJ into the EDM container - //printf("**** %7s: %3d ****\n","n_jJ",n_jJ); + printf("**** %7s: %3d ****\n","n_jJ",n_jJ); for(unsigned int i=tobIndex; i>tobIndex-n_jJ; i--){ - //printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); + printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); jJContainer->push_back( std::make_unique() ); jJContainer->back()->initialize(jfex, fpga, vec_words.at(i-1) ,1 , 200, -99, -99); diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXByteStream/src/jFexByteStreamTool.h b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXByteStream/src/jFexByteStreamTool.h index 3ad750ca457..52d9bbcd942 100644 --- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXByteStream/src/jFexByteStreamTool.h +++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXByteStream/src/jFexByteStreamTool.h @@ -21,6 +21,8 @@ #include "xAODTrigger/jFexLRJetRoIAuxContainer.h" #include "xAODTrigger/jFexTauRoIContainer.h" #include "xAODTrigger/jFexTauRoIAuxContainer.h" +#include "xAODTrigger/jFexFwdElRoIContainer.h" +#include "xAODTrigger/jFexFwdElRoIAuxContainer.h" #include "xAODTrigger/jFexMETRoIContainer.h" #include "xAODTrigger/jFexMETRoIAuxContainer.h" #include "xAODTrigger/jFexSumETRoIContainer.h" @@ -62,18 +64,20 @@ class jFexByteStreamTool : public extends Gaudi::Property> m_robIds {this, "ROBIDs", {}, "List of ROB IDs required for conversion to/from xAOD RoI"}; // Write handle keys for the L1Calo EDMs for BS->xAOD mode of operation - SG::WriteHandleKey< xAOD::jFexSRJetRoIContainer> m_jJWriteKey {this,"jJRoIContainerWriteKey" ,"L1_jFexSRJetRoI","Write jFexEM container"}; - SG::WriteHandleKey< xAOD::jFexLRJetRoIContainer> m_jLJWriteKey {this,"jLJRoIContainerWriteKey" ,"L1_jFexLRJetRoI","Write jFexEM container"}; + SG::WriteHandleKey< xAOD::jFexSRJetRoIContainer> m_jJWriteKey {this,"jJRoIContainerWriteKey" ,"L1_jFexSRJetRoI","Write jFexEDM SRjet container"}; + SG::WriteHandleKey< xAOD::jFexLRJetRoIContainer> m_jLJWriteKey {this,"jLJRoIContainerWriteKey" ,"L1_jFexLRJetRoI","Write jFexEDM LRjet container"}; SG::WriteHandleKey< xAOD::jFexTauRoIContainer > m_jTauWriteKey {this,"jTauRoIContainerWriteKey","L1_jFexTauRoI" ,"Write jFexEDM tau container"}; SG::WriteHandleKey< xAOD::jFexSumETRoIContainer> m_jTEWriteKey {this,"jTERoIContainerWriteKey" ,"L1_jFexSumETRoI","Write jFexEDM SumET container"}; SG::WriteHandleKey< xAOD::jFexMETRoIContainer > m_jXEWriteKey {this,"jXERoIContainerWriteKey" ,"L1_jFexMETRoI" ,"Write jFexEDM Met container"}; + SG::WriteHandleKey< xAOD::jFexFwdElRoIContainer> m_jEMWriteKey {this,"jEMRoIContainerWriteKey" ,"L1_jFexFwdElRoI","Write jFexEDM fwdEl container"}; // Read handle keys for the L1Calo EDMs for xAOD->BS mode of operation - SG::ReadHandleKey< xAOD::jFexSRJetRoIContainer> m_jJReadKey {this,"jJRoIContainerReadKey" ,"L1_jFexSRJetRoI","Read jFexEM container"}; - SG::ReadHandleKey< xAOD::jFexLRJetRoIContainer> m_jLJReadKey {this,"jLJRoIContainerReadKey" ,"L1_jFexLRJetRoI","Read jFexEM container"}; + SG::ReadHandleKey< xAOD::jFexSRJetRoIContainer> m_jJReadKey {this,"jJRoIContainerReadKey" ,"L1_jFexSRJetRoI","Read jFexEDM SRjet container"}; + SG::ReadHandleKey< xAOD::jFexLRJetRoIContainer> m_jLJReadKey {this,"jLJRoIContainerReadKey" ,"L1_jFexLRJetRoI","Read jFexEDM LRjet container"}; SG::ReadHandleKey< xAOD::jFexTauRoIContainer > m_jTauReadKey {this,"jTauRoIContainerReadKey","L1_jFexTauRoI" ,"Read jFexEDM tau container"}; SG::ReadHandleKey< xAOD::jFexSumETRoIContainer> m_jTEReadKey {this,"jTERoIContainerReadKey" ,"L1_jFexSumETRoI","Read jFexEDM SumET container"}; - SG::ReadHandleKey< xAOD::jFexMETRoIContainer > m_jXEReadKey {this,"jXERoIContainerReadKey" ,"L1_jFexMETRoI" ,"Read jFexEDM Met container"}; + SG::ReadHandleKey< xAOD::jFexMETRoIContainer > m_jXEReadKey {this,"jXERoIContainerReadKey" ,"L1_jFexMETRoI" ,"Read jFexEDM Met container"}; + SG::ReadHandleKey< xAOD::jFexFwdElRoIContainer> m_jEMReadKey {this,"jEMRoIContainerReadKey" ,"L1_jFexFwdElRoI","Read jFexEDM fwdEl container"}; std::array TOBCounterTrailer (uint32_t word) const; std::array xTOBCounterTrailer(uint32_t word) const; diff --git a/Trigger/TrigT1/TrigT1ResultByteStream/python/TrigT1ResultByteStreamConfig.py b/Trigger/TrigT1/TrigT1ResultByteStream/python/TrigT1ResultByteStreamConfig.py index 3793cafc6e7..4627a4d9505 100644 --- a/Trigger/TrigT1/TrigT1ResultByteStream/python/TrigT1ResultByteStreamConfig.py +++ b/Trigger/TrigT1/TrigT1ResultByteStream/python/TrigT1ResultByteStreamConfig.py @@ -237,6 +237,7 @@ if __name__ == '__main__': outputEDM += addEDM('xAOD::jFexSRJetRoIContainer', jFexTool.jJRoIContainerWriteKey.Path) outputEDM += addEDM('xAOD::jFexLRJetRoIContainer', jFexTool.jLJRoIContainerWriteKey.Path) outputEDM += addEDM('xAOD::jFexTauRoIContainer' , jFexTool.jTauRoIContainerWriteKey.Path) + outputEDM += addEDM('xAOD::jFexFwdElRoIContainer', jFexTool.jEMRoIContainerReadKey.Path) outputEDM += addEDM('xAOD::jFexSumETRoIContainer', jFexTool.jTERoIContainerWriteKey.Path) outputEDM += addEDM('xAOD::jFexMETRoIContainer' , jFexTool.jXERoIContainerWriteKey.Path) -- GitLab From f8ea9241525517527d8c9ffb3ae57fad29ddae0c Mon Sep 17 00:00:00 2001 From: Sergi Rodriguez Date: Fri, 3 Jun 2022 12:23:44 +0200 Subject: [PATCH 2/3] commenting out debug prints --- .../src/jFexByteStreamTool.cxx | 65 +++++++++---------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXByteStream/src/jFexByteStreamTool.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXByteStream/src/jFexByteStreamTool.cxx index fa0f56bc67f..51c73c88196 100644 --- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXByteStream/src/jFexByteStreamTool.cxx +++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXByteStream/src/jFexByteStreamTool.cxx @@ -105,8 +105,7 @@ StatusCode jFexByteStreamTool::initialize() { // BS->xAOD conversion StatusCode jFexByteStreamTool::convertFromBS(const std::vector& vrobf, const EventContext& ctx) const { - std::cout<& vro ATH_MSG_DEBUG("Recorded jFexMETRoIContainer with key " << jXEContainer.key()); - std::cout << "ROBFragments to decode: " << vrobf.size() << std::endl; + //std::cout << "ROBFragments to decode: " << vrobf.size() << std::endl; // Iterate over ROBFragments to decode for (const ROBF* rob : vrobf) { // Iterate over ROD words and decode //ATH_MSG_DEBUG("Starting to decode " << ndata << " ROD words from ROB 0x" << std::hex << rob->rob_source_id() << std::dec); - std::cout<< "Starting to decode " << rob->rod_ndata() << " ROD words from ROB 0x" << std::hex << rob->rob_source_id() << std::dec << std::endl; + //std::cout<< "Starting to decode " << rob->rod_ndata() << " ROD words from ROB 0x" << std::hex << rob->rob_source_id() << std::dec << std::endl; //There is no data to decode.. not even the ROD trailers if(rob->rod_ndata() <= 0){ - printf("ERROR No ROD words read. rob->rod_ndata() =%3d \n",rob->rod_ndata()); + //printf("ERROR No ROD words read. rob->rod_ndata() =%3d \n",rob->rod_ndata()); continue; } const auto dataArray = CxxUtils::span{rob->rod_data(), rob->rod_ndata()}; std::vector vec_words(dataArray.begin(),dataArray.end()); - +/* int aux = 1; //delete, for debug for (const uint32_t word : vec_words) { @@ -167,7 +166,7 @@ StatusCode jFexByteStreamTool::convertFromBS(const std::vector& vro aux++; //delete, for debug } - +*/ // Starting to loop over the different jFEX blocks bool READ_TOBS = true; @@ -176,14 +175,14 @@ StatusCode jFexByteStreamTool::convertFromBS(const std::vector& vro while(READ_TOBS){ - printf("----------------------------------------------------------------------------------------------------------------------\n"); + //printf("----------------------------------------------------------------------------------------------------------------------\n"); const auto [payload, fpga, jfex] = jFEXtoRODTrailer ( vec_words.at(trailers_pos-2), vec_words.at(trailers_pos-1) ); const auto [n_xjJ, n_xjLJ, n_xjTau, n_xjEM] = xTOBCounterTrailer( vec_words.at(trailers_pos-3) ); const auto [n_jJ, n_jLJ, n_jTau, n_jEM, n_jTE, n_jXE] = TOBCounterTrailer ( vec_words.at(trailers_pos-4) ); - printf("----------> trailer_pos:%3d payload:%3d fpga:%3d jfex:%3d\n",trailers_pos,payload,fpga,jfex); - printf(" TOBs(0x%08x): jJ:%3d jLJ:%3d jTau:%3d jEM:%3d jTE:%3d jXE:%3d\n",vec_words.at(trailers_pos-4),n_jJ,n_jLJ,n_jTau,n_jEM,n_jTE,n_jXE); - printf("xTOBs(0x%08x): xjJ:%3d xjLJ:%3d xjTau:%3d xjEM:%3d\n",vec_words.at(trailers_pos-3),n_xjJ,n_xjLJ,n_xjTau,n_xjEM); + //printf("----------> trailer_pos:%3d payload:%3d fpga:%3d jfex:%3d\n",trailers_pos,payload,fpga,jfex); + //printf(" TOBs(0x%08x): jJ:%3d jLJ:%3d jTau:%3d jEM:%3d jTE:%3d jXE:%3d\n",vec_words.at(trailers_pos-4),n_jJ,n_jLJ,n_jTau,n_jEM,n_jTE,n_jXE); + //printf("xTOBs(0x%08x): xjJ:%3d xjLJ:%3d xjTau:%3d xjEM:%3d\n",vec_words.at(trailers_pos-3),n_xjJ,n_xjLJ,n_xjTau,n_xjEM); if(jfex == 5 or jfex == 0){ trailers_pos -= (payload+2); @@ -195,7 +194,7 @@ StatusCode jFexByteStreamTool::convertFromBS(const std::vector& vro //The minimum number for the payload should be 2 (The TOB/xTOB counters). If lower send an error message if(payload < jBits::TOB_TRAILERS){ - printf("ERROR Payload is lower than the TOB/xTOB trailers. (Payload = %3d < %3d = TOB Trailer) \n",payload,jBits::TOB_TRAILERS); + //printf("ERROR Payload is lower than the TOB/xTOB trailers. (Payload = %3d < %3d = TOB Trailer) \n",payload,jBits::TOB_TRAILERS); break; } @@ -204,7 +203,7 @@ StatusCode jFexByteStreamTool::convertFromBS(const std::vector& vro unsigned int total_tobs = n_xjJ + n_xjLJ + n_xjTau + n_xjEM + n_jJ + n_jLJ + n_jTau + n_jEM + n_jTE + n_jXE; unsigned int paddingWord = 0; if(total_tobs % 2){ - printf("Odd number of TOBs + xTOBs: %4d, there is a padding word! CAREFUL!\n",total_tobs); + //printf("Odd number of TOBs + xTOBs: %4d, there is a padding word! CAREFUL!\n",total_tobs); paddingWord = 1; } @@ -214,9 +213,9 @@ StatusCode jFexByteStreamTool::convertFromBS(const std::vector& vro /************************************************** DECODING xTOBS **************************************************/ //saving xjEM into the EDM container - printf("**** %7s: %3d ****\n","n_xjEM",n_xjEM); + //printf("**** %7s: %3d ****\n","n_xjEM",n_xjEM); for(unsigned int i=tobIndex; i>tobIndex-n_xjEM; i--){ - printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); + //printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); jEMContainer->push_back( std::make_unique() ); jEMContainer->back()->initialize(jfex, fpga, vec_words.at(i-1) ,0 , 200, -99, -99); } @@ -224,10 +223,10 @@ StatusCode jFexByteStreamTool::convertFromBS(const std::vector& vro tobIndex -= n_xjEM; //saving xjTau into the EDM container - printf("**** %7s: %3d ****\n","n_xjTau",n_xjTau); + //printf("**** %7s: %3d ****\n","n_xjTau",n_xjTau); for(unsigned int i=tobIndex; i>tobIndex-n_xjTau; i--){ - printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); + //printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); jTauContainer->push_back( std::make_unique() ); jTauContainer->back()->initialize(jfex, fpga, vec_words.at(i-1) ,0 , 200, -99, -99); @@ -236,10 +235,10 @@ StatusCode jFexByteStreamTool::convertFromBS(const std::vector& vro tobIndex -= n_xjTau; //saving xjLJ into the EDM container - printf("**** %7s: %3d ****\n","n_xjLJ",n_xjLJ); + //printf("**** %7s: %3d ****\n","n_xjLJ",n_xjLJ); for(unsigned int i=tobIndex; i>tobIndex-n_xjLJ; i--){ - printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); + //printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); jLJContainer->push_back( std::make_unique() ); jLJContainer->back()->initialize(jfex, fpga, vec_words.at(i-1) ,0 , 200, -99, -99); @@ -248,10 +247,10 @@ StatusCode jFexByteStreamTool::convertFromBS(const std::vector& vro tobIndex -= n_xjLJ; //saving xjJ into the EDM container - printf("**** %7s: %3d ****\n","n_xjJ",n_xjJ); + //printf("**** %7s: %3d ****\n","n_xjJ",n_xjJ); for(unsigned int i=tobIndex; i>tobIndex-n_xjJ; i--){ - printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); + //printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); jJContainer->push_back( std::make_unique() ); jJContainer->back()->initialize(jfex, fpga, vec_words.at(i-1) ,0 , 200, -99, -99); @@ -263,10 +262,10 @@ StatusCode jFexByteStreamTool::convertFromBS(const std::vector& vro /************************************************** DECODING TOBS **************************************************/ //saving jXE into the EDM container - printf("**** %7s: %3d ****\n","n_jXE",n_jXE); + //printf("**** %7s: %3d ****\n","n_jXE",n_jXE); for(unsigned int i=tobIndex; i>tobIndex-n_jXE; i--){ - printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); + //printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); jXEContainer->push_back( std::make_unique() ); jXEContainer->back()->initialize(jfex, fpga, vec_words.at(i-1), 200); @@ -275,10 +274,10 @@ StatusCode jFexByteStreamTool::convertFromBS(const std::vector& vro tobIndex -= n_jXE; //saving jTE into the EDM container - printf("**** %7s: %3d ****\n","n_jTE",n_jTE); + //printf("**** %7s: %3d ****\n","n_jTE",n_jTE); for(unsigned int i=tobIndex; i>tobIndex-n_jTE; i--){ - printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); + //printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); jTEContainer->push_back( std::make_unique() ); jTEContainer->back()->initialize(jfex, fpga, vec_words.at(i-1), 200); @@ -287,9 +286,9 @@ StatusCode jFexByteStreamTool::convertFromBS(const std::vector& vro tobIndex -= n_jTE; //saving jEM into the EDM container - printf("**** %7s: %3d ****\n","n_jEM",n_jEM); + //printf("**** %7s: %3d ****\n","n_jEM",n_jEM); for(unsigned int i=tobIndex; i>tobIndex-n_jEM; i--){ - printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); + //printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); jEMContainer->push_back( std::make_unique() ); jEMContainer->back()->initialize(jfex, fpga, vec_words.at(i-1) ,0 , 200, -99, -99); } @@ -297,10 +296,10 @@ StatusCode jFexByteStreamTool::convertFromBS(const std::vector& vro tobIndex -= n_jEM; //saving jTau into the EDM container - printf("**** %7s: %3d ****\n","n_jTau",n_jTau); + //printf("**** %7s: %3d ****\n","n_jTau",n_jTau); for(unsigned int i=tobIndex; i>tobIndex-n_jTau; i--){ - printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); + //printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); jTauContainer->push_back( std::make_unique() ); jTauContainer->back()->initialize(jfex, fpga, vec_words.at(i-1) ,1 , 200, -99, -99); @@ -309,10 +308,10 @@ StatusCode jFexByteStreamTool::convertFromBS(const std::vector& vro tobIndex -= n_jTau; //saving jLJ into the EDM container - printf("**** %7s: %3d ****\n","n_jLJ",n_jLJ); + //printf("**** %7s: %3d ****\n","n_jLJ",n_jLJ); for(unsigned int i=tobIndex; i>tobIndex-n_jLJ; i--){ - printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); + //printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); jLJContainer->push_back( std::make_unique() ); jLJContainer->back()->initialize(jfex, fpga, vec_words.at(i-1) ,1 , 200, -99, -99); @@ -321,10 +320,10 @@ StatusCode jFexByteStreamTool::convertFromBS(const std::vector& vro tobIndex -= n_jLJ; //saving jJ into the EDM container - printf("**** %7s: %3d ****\n","n_jJ",n_jJ); + //printf("**** %7s: %3d ****\n","n_jJ",n_jJ); for(unsigned int i=tobIndex; i>tobIndex-n_jJ; i--){ - printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); + //printf(" N.:%3d raw word: 0x%08x with index:%3d\n",tobIndex-i,vec_words.at(i-1),i); jJContainer->push_back( std::make_unique() ); jJContainer->back()->initialize(jfex, fpga, vec_words.at(i-1) ,1 , 200, -99, -99); -- GitLab From 6aa196d97c717b54aaa27d141839b9a6ae243615 Mon Sep 17 00:00:00 2001 From: Sergi Rodriguez Date: Fri, 3 Jun 2022 14:23:53 +0200 Subject: [PATCH 3/3] save properly jEM --- .../python/TrigT1ResultByteStreamConfig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Trigger/TrigT1/TrigT1ResultByteStream/python/TrigT1ResultByteStreamConfig.py b/Trigger/TrigT1/TrigT1ResultByteStream/python/TrigT1ResultByteStreamConfig.py index 4627a4d9505..a5ddeaeef25 100644 --- a/Trigger/TrigT1/TrigT1ResultByteStream/python/TrigT1ResultByteStreamConfig.py +++ b/Trigger/TrigT1/TrigT1ResultByteStream/python/TrigT1ResultByteStreamConfig.py @@ -237,7 +237,7 @@ if __name__ == '__main__': outputEDM += addEDM('xAOD::jFexSRJetRoIContainer', jFexTool.jJRoIContainerWriteKey.Path) outputEDM += addEDM('xAOD::jFexLRJetRoIContainer', jFexTool.jLJRoIContainerWriteKey.Path) outputEDM += addEDM('xAOD::jFexTauRoIContainer' , jFexTool.jTauRoIContainerWriteKey.Path) - outputEDM += addEDM('xAOD::jFexFwdElRoIContainer', jFexTool.jEMRoIContainerReadKey.Path) + outputEDM += addEDM('xAOD::jFexFwdElRoIContainer', jFexTool.jEMRoIContainerWriteKey.Path) outputEDM += addEDM('xAOD::jFexSumETRoIContainer', jFexTool.jTERoIContainerWriteKey.Path) outputEDM += addEDM('xAOD::jFexMETRoIContainer' , jFexTool.jXERoIContainerWriteKey.Path) -- GitLab