From 2c52668fc3b04db8255e965eea076d6bcaf79e76 Mon Sep 17 00:00:00 2001
From: Soshi Tsuno <soshi.tsuno@cern.ch>
Date: Mon, 1 Jun 2020 06:04:12 +0200
Subject: [PATCH] update

---
 .../src/PixelConditionsSummaryTool.cxx        |  13 +-
 .../src/PixelRawDataProvider.cxx              |  43 +++--
 .../src/PixelRodDecoder.cxx                   |   2 +-
 .../src/PixelAthErrorMonAlg.cxx               | 177 +++++++++---------
 .../PixelMonitoring/src/PixelAthErrorMonAlg.h |   2 +-
 5 files changed, 129 insertions(+), 108 deletions(-)

diff --git a/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelConditionsSummaryTool.cxx b/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelConditionsSummaryTool.cxx
index 47f56a6d50cf..3a274be6414e 100644
--- a/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelConditionsSummaryTool.cxx
+++ b/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelConditionsSummaryTool.cxx
@@ -62,7 +62,8 @@ StatusCode PixelConditionsSummaryTool::initialize(){
   return StatusCode::SUCCESS;
 }
 
-bool PixelConditionsSummaryTool::isBSError([[maybe_unused]] const IdentifierHash & moduleHash) const {
+// STSTST bool PixelConditionsSummaryTool::isBSError([[maybe_unused]] const IdentifierHash & moduleHash) const {
+bool PixelConditionsSummaryTool::isBSError(const IdentifierHash & moduleHash) const {
   if (!m_useByteStream) {
      return false;
   }
@@ -71,6 +72,9 @@ bool PixelConditionsSummaryTool::isBSError([[maybe_unused]] const IdentifierHash
     ATH_MSG_ERROR("BSErrContainer is not valid!");
     return true;
   }
+
+  std::cout << "STSTST PixelConditionsSummaryTool::isBSError OK1" << std::endl;
+
   if (m_pixelID->wafer_hash_max()==2048) {   // RUN-2 setup
     if ((m_pixelID->barrel_ec(m_pixelID->wafer_id(moduleHash))==0 && m_pixelID->layer_disk(m_pixelID->wafer_id(moduleHash))==0) 
         || m_pixelID->is_dbm(m_pixelID->wafer_id(moduleHash))) {
@@ -100,11 +104,14 @@ bool PixelConditionsSummaryTool::isBSError([[maybe_unused]] const IdentifierHash
   return true;
 }
 
-bool PixelConditionsSummaryTool::isBSActive([[maybe_unused]] const IdentifierHash & moduleHash) const {
+// STSTST bool PixelConditionsSummaryTool::isBSActive([[maybe_unused]] const IdentifierHash & moduleHash) const {
+bool PixelConditionsSummaryTool::isBSActive(const IdentifierHash & moduleHash) const {
   SG::ReadHandle<InDetBSErrContainer> errCont(m_BSErrContReadKey);
   for (const auto* elt : *errCont) {
     IdentifierHash myHash=elt->first;
-    if (myHash-m_pixelID->wafer_hash_max()==moduleHash) { return false; }
+    if (myHash-m_pixelID->wafer_hash_max()==moduleHash) { 
+      std::cout << "STSTST PixelConditionsSummaryTool::isBSActive FALSE " << moduleHash << std::endl;
+      return false; }
   }
   return true;
 }
diff --git a/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRawDataProvider.cxx b/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRawDataProvider.cxx
index c27779a91dac..7047225aac4e 100644
--- a/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRawDataProvider.cxx
+++ b/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRawDataProvider.cxx
@@ -47,13 +47,10 @@ StatusCode PixelRawDataProvider::initialize() {
 
   ATH_CHECK(detStore()->retrieve(m_pixel_id, "PixelID"));
   ATH_CHECK( m_rdoContainerKey.initialize() );
-
   ATH_CHECK( m_rdoCacheKey.initialize( SG::AllowEmpty ) );
-
   ATH_CHECK( m_bsErrorsKey.initialize() );
   ATH_CHECK( m_bsErrorsCacheKey.initialize( SG::AllowEmpty ) );
 
-
   if (m_roiSeeded) {
     ATH_CHECK( m_roiCollectionKey.initialize() );
     ATH_CHECK(m_regionSelector.retrieve());
@@ -93,6 +90,18 @@ StatusCode PixelRawDataProvider::execute(const EventContext& ctx) const {
   }
   ATH_CHECK(rdoContainer.isValid());
 
+  SG::WriteHandle<IDCInDetBSErrContainer> bsErrorsHandle(m_bsErrorsKey, ctx);
+  if (m_bsErrorsCacheKey.empty()) {
+    ATH_CHECK(bsErrorsHandle.record(std::make_unique<IDCInDetBSErrContainer>(m_pixel_id->wafer_hash_max(),std::numeric_limits<int>::min())));
+    ATH_MSG_DEBUG("Created IDCInDetBSErrContainer w/o using external cache");
+  } 
+  else { // use cache
+    SG::UpdateHandle<IDCInDetBSErrContainer_Cache> cacheHandle(m_bsErrorsCacheKey,ctx);
+    ATH_CHECK(cacheHandle.isValid());
+    ATH_CHECK(bsErrorsHandle.record(std::make_unique<IDCInDetBSErrContainer>(cacheHandle.ptr())));
+    ATH_MSG_DEBUG("Created Pixel IDCInDetBSErrContainer using external cache");
+  }
+
   // Print ROB map in m_robDataProvider
   //m_robDataProvider->print_robmap();
 
@@ -135,25 +144,27 @@ StatusCode PixelRawDataProvider::execute(const EventContext& ctx) const {
   IPixelRDO_Container *containerInterface = tempcont ? static_cast< IPixelRDO_Container* >(tempcont.get()) :
          static_cast< IPixelRDO_Container* >(rdoContainer.ptr());
 
-  std::unique_ptr<IDCInDetBSErrContainer> decodingErrors;
-  if ( not m_bsErrorsCacheKey.empty() ) {
-    SG::UpdateHandle<IDCInDetBSErrContainer_Cache> bsErrorsCacheHandle( m_bsErrorsCacheKey, ctx);
-    decodingErrors = std::make_unique<IDCInDetBSErrContainer>( bsErrorsCacheHandle.ptr() );
-  } else {
-    decodingErrors = std::make_unique<IDCInDetBSErrContainer>( m_pixel_id->wafer_hash_max(), std::numeric_limits<int>::min() );
-  }
-
+// STSTST  std::unique_ptr<IDCInDetBSErrContainer> decodingErrors;
+// STSTST  if ( not m_bsErrorsCacheKey.empty() ) {
+// STSTST    SG::UpdateHandle<IDCInDetBSErrContainer_Cache> bsErrorsCacheHandle( m_bsErrorsCacheKey, ctx);
+// STSTST    decodingErrors = std::make_unique<IDCInDetBSErrContainer>( bsErrorsCacheHandle.ptr() );
+// STSTST  } else {
+// STSTST    decodingErrors = std::make_unique<IDCInDetBSErrContainer>( m_pixel_id->wafer_hash_max(), std::numeric_limits<int>::min() );
+// STSTST  }
+// STSTST
+// STSTST  // ask PixelRawDataProviderTool to decode it and to fill the IDC
+// STSTST  if (m_rawDataTool->convert(listOfRobf,  containerInterface, *decodingErrors).isFailure())
+// STSTST    ATH_MSG_ERROR("BS conversion into RDOs failed");
 
   // ask PixelRawDataProviderTool to decode it and to fill the IDC
-  if (m_rawDataTool->convert(listOfRobf,  containerInterface, *decodingErrors).isFailure())
+  if (m_rawDataTool->convert(listOfRobf,containerInterface,*bsErrorsHandle).isFailure()) {
     ATH_MSG_ERROR("BS conversion into RDOs failed");
-
-
+  }
 
   if(tempcont) ATH_CHECK(tempcont->MergeToRealContainer(rdoContainer.ptr()));
 
-  SG::WriteHandle<IDCInDetBSErrContainer> bsErrorsHandle(m_bsErrorsKey, ctx);
-  ATH_CHECK( bsErrorsHandle.record( std::move( decodingErrors ) ) );
+// STSTST  SG::WriteHandle<IDCInDetBSErrContainer> bsErrorsHandle(m_bsErrorsKey, ctx);
+// STSTST  ATH_CHECK( bsErrorsHandle.record( std::move( decodingErrors ) ) );
 
 #ifdef PIXEL_DEBUG
     ATH_MSG_DEBUG("Number of Collections in IDC " << rdoContainer->numberOfCollections());
diff --git a/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRodDecoder.cxx b/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRodDecoder.cxx
index ca9d3a6f0e39..566b9f89c3b0 100644
--- a/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRodDecoder.cxx
+++ b/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRodDecoder.cxx
@@ -1150,7 +1150,7 @@ StatusCode PixelRodDecoder::fillCollection( const ROBFragment *robFrag, IPixelRD
 }
 
 StatusCode PixelRodDecoder::StoreBSError() const {
-  ATH_CHECK(m_errors->recordData());
+// STSTST  ATH_CHECK(m_errors->recordData());
   return StatusCode::SUCCESS;
 }
 
diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthErrorMonAlg.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthErrorMonAlg.cxx
index 2378a8e29b91..8282295ae276 100644
--- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthErrorMonAlg.cxx
+++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthErrorMonAlg.cxx
@@ -9,7 +9,7 @@ PixelAthErrorMonAlg::PixelAthErrorMonAlg( const std::string& name, ISvcLocator*
   m_pixelid(nullptr)
 {
   //jo flags
-  declareProperty("ErrorsTool", m_pixelErrorTool);
+// STSTST  declareProperty("ErrorsTool", m_pixelErrorTool);
   declareProperty("doOnline", m_doOnline = false);
   declareProperty("doModules", m_doModules = false);
   declareProperty("doLumiBlock", m_doLumiBlock = false);
@@ -26,7 +26,7 @@ StatusCode PixelAthErrorMonAlg::initialize() {
 
   ATH_CHECK( detStore()->retrieve(m_pixelid, "PixelID") );
   ATH_CHECK( m_pixelCondSummaryTool.retrieve() );
-  if ( !m_pixelErrorTool.empty() ) ATH_CHECK( m_pixelErrorTool.retrieve() );
+// STSTST  if ( !m_pixelErrorTool.empty() ) ATH_CHECK( m_pixelErrorTool.retrieve() );
 
   return AthMonitorAlgorithm::initialize();
 }
@@ -52,7 +52,8 @@ StatusCode PixelAthErrorMonAlg::fillHistograms( const EventContext& ctx ) const
   float num_errormodules_per_cat[ErrorCategory::COUNT][PixLayers::COUNT] = {{0}};
   float num_errormodules_per_cat_rodmod[ErrorCategoryRODMOD::COUNT][PixLayers::COUNT] = {{0}};
 
-  const auto& kFeErrorWords = m_pixelErrorTool->getAllFeErrors();
+// STSTST  std::cout << "STSTST PixelAthErrorMonAlg::fillHistograms 1" << std::endl;
+// STSTST  const auto& kFeErrorWords = m_pixelErrorTool->getAllFeErrors();
 
   // const auto& kFeSvcRecord  = m_pixelErrorTool->getAllServiceCodes(); //REVIEW n.y. implemented
   // temporary kFeSvcRecord
@@ -95,12 +96,14 @@ StatusCode PixelAthErrorMonAlg::fillHistograms( const EventContext& ctx ) const
   for (; idIt != idItEnd; ++idIt) {
     Identifier waferID = *idIt;
     IdentifierHash id_hash = m_pixelid->wafer_hash(waferID);
-    const auto& kErrorWord = m_pixelErrorTool->getModuleErrors(id_hash);
+// STSTST    std::cout << "STSTST PixelAthErrorMonAlg::fillHistograms 2" << std::endl;
+// STSTST    const auto& kErrorWord = m_pixelErrorTool->getModuleErrors(id_hash);
 
     bool is_fei4 = false;
-    if (m_pixelErrorTool->isActive(id_hash) &&  // isActive from PixelBytestreamErrorTool to REVIEW
-	( (m_pixelid->barrel_ec(waferID) == 0 && m_pixelid->layer_disk(waferID) == 0) ||
-	  abs(m_pixelid->barrel_ec(waferID)) == 4) ) is_fei4 = true;
+// STSTST    std::cout << "STSTST PixelAthErrorMonAlg::fillHistograms 3" << std::endl;
+// STSTST    if (m_pixelErrorTool->isActive(id_hash) &&  // isActive from PixelBytestreamErrorTool to REVIEW
+// STSTST	( (m_pixelid->barrel_ec(waferID) == 0 && m_pixelid->layer_disk(waferID) == 0) ||
+// STSTST	  abs(m_pixelid->barrel_ec(waferID)) == 4) ) is_fei4 = true;
 
     int pixlayer = getPixLayersID(m_pixelid->barrel_ec(waferID), m_pixelid->layer_disk(waferID) );
 
@@ -108,87 +111,87 @@ StatusCode PixelAthErrorMonAlg::fillHistograms( const EventContext& ctx ) const
     bool has_err_cat[ErrorCategory::COUNT] = {false};
     bool has_err_cat_rodmod[ErrorCategoryRODMOD::COUNT] = {false};
 
-    if (!is_fei4) {
-      // Bit-shifting over module errors, only for ROD-type errors for FE-I3
-      for (unsigned int bit = 0; bit < kNumErrorBitsFEI3; bit++) {
-	if ((kErrorWord & (static_cast<uint64_t>(1) << bit)) != 0) {
-	  if (bit >=4 && bit <=16) continue;
-	  num_errors[pixlayer]++;
-	  num_errors_per_bit[bit][pixlayer]++;
-	  
-	  int error_cat_rodmod = 0;
-	  if (bit == 20 || bit == 21)              error_cat_rodmod = 2;  // ROD synchronization errors      (20: BCID, 21: LVL1ID)
-	  if (bit == 0  || bit == 1)               error_cat_rodmod = 4;  // ROD truncation errors           (0: FIFO Overflow, 1: H/T Limit)
-	  if (bit == 23)                           error_cat_rodmod = 5;  // optical errors                  (23: preamble (bitflip))
-	  if (bit == 22)                           error_cat_rodmod = 7;  // timeout errors                  (22: timeout on ROD formatter)
-	  if (error_cat_rodmod) {
-	    has_err_cat_rodmod[error_cat_rodmod - 1] = true;
-	    if (!m_doOnline) {
-	      all_errors_maps.add(pixlayer, waferID, m_pixelid, 1.0);
-	    }
-	    if (getErrorCategory(error_cat_rodmod)!=99) has_err_cat[getErrorCategory(error_cat_rodmod)] = true;
-	  }
-	  if (getErrorState(bit, is_fei4) != 99) {
-	    num_errors_per_state[getErrorState(bit, is_fei4)][pixlayer]++;
-	    error_maps_per_state[getErrorState(bit, is_fei4)].add(pixlayer, waferID, m_pixelid, 1.0);
-	  }
-	}
-      }
-    } //end of FEI3-only part
-     
-    // Bit-shifting over FE errors, kFeErrorWords are common to both FEI3 and FEI4
-    // but bits are different, see 
-    // InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRodDecoder.cxx
+// STSTST    if (!is_fei4) {
+// STSTST      // Bit-shifting over module errors, only for ROD-type errors for FE-I3
+// STSTST      for (unsigned int bit = 0; bit < kNumErrorBitsFEI3; bit++) {
+// STSTST	if ((kErrorWord & (static_cast<uint64_t>(1) << bit)) != 0) {
+// STSTST	  if (bit >=4 && bit <=16) continue;
+// STSTST	  num_errors[pixlayer]++;
+// STSTST	  num_errors_per_bit[bit][pixlayer]++;
+// STSTST	  
+// STSTST	  int error_cat_rodmod = 0;
+// STSTST	  if (bit == 20 || bit == 21)              error_cat_rodmod = 2;  // ROD synchronization errors      (20: BCID, 21: LVL1ID)
+// STSTST	  if (bit == 0  || bit == 1)               error_cat_rodmod = 4;  // ROD truncation errors           (0: FIFO Overflow, 1: H/T Limit)
+// STSTST	  if (bit == 23)                           error_cat_rodmod = 5;  // optical errors                  (23: preamble (bitflip))
+// STSTST	  if (bit == 22)                           error_cat_rodmod = 7;  // timeout errors                  (22: timeout on ROD formatter)
+// STSTST	  if (error_cat_rodmod) {
+// STSTST	    has_err_cat_rodmod[error_cat_rodmod - 1] = true;
+// STSTST	    if (!m_doOnline) {
+// STSTST	      all_errors_maps.add(pixlayer, waferID, m_pixelid, 1.0);
+// STSTST	    }
+// STSTST	    if (getErrorCategory(error_cat_rodmod)!=99) has_err_cat[getErrorCategory(error_cat_rodmod)] = true;
+// STSTST	  }
+// STSTST	  if (getErrorState(bit, is_fei4) != 99) {
+// STSTST	    num_errors_per_state[getErrorState(bit, is_fei4)][pixlayer]++;
+// STSTST	    error_maps_per_state[getErrorState(bit, is_fei4)].add(pixlayer, waferID, m_pixelid, 1.0);
+// STSTST	  }
+// STSTST	}
+// STSTST      }
+// STSTST    } //end of FEI3-only part
+// STSTST     
+// STSTST    // Bit-shifting over FE errors, kFeErrorWords are common to both FEI3 and FEI4
+// STSTST    // but bits are different, see 
+// STSTST    // InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRodDecoder.cxx
     unsigned int num_femcc_errwords = 0;
-    if (kFeErrorWords.find(id_hash) != kFeErrorWords.end()) {
-      // Collection of: FE ID, associated error word
-      std::map<unsigned int, unsigned int> fe_errorword_map = kFeErrorWords.find(id_hash)->second;
-      
-      for (const auto& [fe_id, fe_errorword] : fe_errorword_map) {
-	bool has_femcc_errbits(false);
-	
-	for (unsigned int bit = 0; bit < kNumErrorBitsFEI3; bit++) {
-	  if ((fe_errorword & (static_cast<uint64_t>(1) << bit)) != 0) {
-            if (is_fei4 && bit > 7) continue; // For FE-I4 we are interested only in trailer errors, which are the first 8 bits, service records are taken separately
-	    // For FE-I3, no double-counting w/ other bits? REVIEW
-	    
-	    num_errors[pixlayer]++;
-	    num_errors_per_bit[bit][pixlayer]++;
-	    // This error word contains FE/MCC related errors. 
-	    if (bit >=4 && bit <=16) has_femcc_errbits = true;
-	    
-	    int error_cat_rodmod = 0;
-	    if (!is_fei4) {
-	      if (bit == 14 || bit == 15 || bit == 16) error_cat_rodmod = 1;  // module synchronization errors   (14: BCID, 15: BCID. 16: LVL1ID)
-	      if (bit == 4  || bit == 12 || bit == 13) error_cat_rodmod = 3;  // module truncation errors        (4: EOC, 12: hit overflow, 13: EoE overflow)
-	      if (bit >= 5  && bit <= 7)               error_cat_rodmod = 6;  // SEU (single event upset) errors (5,6,7: hit parity, register parity, hammingcode)
-	    } else {
-              if (bit == 3 || bit == 4)                error_cat_rodmod = 2;  // synchronization error   (3:LVL1ID, 4:BCID)
-              if (bit == 0 || bit == 1)                error_cat_rodmod = 4;  // ROD truncation error    (0:Row/Column error, 1:Limit error)
-              if (bit == 5)                            error_cat_rodmod = 5;  // optical error           (5:Preable error)
-              if (bit == 2 || bit == 7)                error_cat_rodmod = 7;  // Timeout error           (2:Trailer timeout error, 7:Timeout error)
-	    }
-	    if (error_cat_rodmod) {
-	      has_err_cat_rodmod[error_cat_rodmod - 1] = true;
-	      if (!m_doOnline) {
-		all_errors_maps.add(pixlayer, waferID, m_pixelid, 1.0);
-	      }
-	      if (getErrorCategory(error_cat_rodmod)!=99) has_err_cat[getErrorCategory(error_cat_rodmod)] = true;
-	    }
-	    if (getErrorState(bit, is_fei4) != 99) {
-	      if (!is_fei4) {
-		num_errors_per_state[getErrorState(bit, is_fei4)][pixlayer]++;
-	      } else {
-		num_errors_per_state[getErrorState(bit, is_fei4)-error_names_stateFEI3.size()][pixlayer]++;
-	      }
-	      error_maps_per_state[getErrorState(bit, is_fei4)].add(pixlayer, waferID, m_pixelid, 1.0);
-	    }
-	  }
-	}
-	// If we have bits generated by FE/MCC, count this error word.
-	if (has_femcc_errbits) num_femcc_errwords++;
-      }
-    }
+// STSTST    if (kFeErrorWords.find(id_hash) != kFeErrorWords.end()) {
+// STSTST      // Collection of: FE ID, associated error word
+// STSTST      std::map<unsigned int, unsigned int> fe_errorword_map = kFeErrorWords.find(id_hash)->second;
+// STSTST      
+// STSTST      for (const auto& [fe_id, fe_errorword] : fe_errorword_map) {
+// STSTST	bool has_femcc_errbits(false);
+// STSTST	
+// STSTST	for (unsigned int bit = 0; bit < kNumErrorBitsFEI3; bit++) {
+// STSTST	  if ((fe_errorword & (static_cast<uint64_t>(1) << bit)) != 0) {
+// STSTST            if (is_fei4 && bit > 7) continue; // For FE-I4 we are interested only in trailer errors, which are the first 8 bits, service records are taken separately
+// STSTST	    // For FE-I3, no double-counting w/ other bits? REVIEW
+// STSTST	    
+// STSTST	    num_errors[pixlayer]++;
+// STSTST	    num_errors_per_bit[bit][pixlayer]++;
+// STSTST	    // This error word contains FE/MCC related errors. 
+// STSTST	    if (bit >=4 && bit <=16) has_femcc_errbits = true;
+// STSTST	    
+// STSTST	    int error_cat_rodmod = 0;
+// STSTST	    if (!is_fei4) {
+// STSTST	      if (bit == 14 || bit == 15 || bit == 16) error_cat_rodmod = 1;  // module synchronization errors   (14: BCID, 15: BCID. 16: LVL1ID)
+// STSTST	      if (bit == 4  || bit == 12 || bit == 13) error_cat_rodmod = 3;  // module truncation errors        (4: EOC, 12: hit overflow, 13: EoE overflow)
+// STSTST	      if (bit >= 5  && bit <= 7)               error_cat_rodmod = 6;  // SEU (single event upset) errors (5,6,7: hit parity, register parity, hammingcode)
+// STSTST	    } else {
+// STSTST              if (bit == 3 || bit == 4)                error_cat_rodmod = 2;  // synchronization error   (3:LVL1ID, 4:BCID)
+// STSTST              if (bit == 0 || bit == 1)                error_cat_rodmod = 4;  // ROD truncation error    (0:Row/Column error, 1:Limit error)
+// STSTST              if (bit == 5)                            error_cat_rodmod = 5;  // optical error           (5:Preable error)
+// STSTST              if (bit == 2 || bit == 7)                error_cat_rodmod = 7;  // Timeout error           (2:Trailer timeout error, 7:Timeout error)
+// STSTST	    }
+// STSTST	    if (error_cat_rodmod) {
+// STSTST	      has_err_cat_rodmod[error_cat_rodmod - 1] = true;
+// STSTST	      if (!m_doOnline) {
+// STSTST		all_errors_maps.add(pixlayer, waferID, m_pixelid, 1.0);
+// STSTST	      }
+// STSTST	      if (getErrorCategory(error_cat_rodmod)!=99) has_err_cat[getErrorCategory(error_cat_rodmod)] = true;
+// STSTST	    }
+// STSTST	    if (getErrorState(bit, is_fei4) != 99) {
+// STSTST	      if (!is_fei4) {
+// STSTST		num_errors_per_state[getErrorState(bit, is_fei4)][pixlayer]++;
+// STSTST	      } else {
+// STSTST		num_errors_per_state[getErrorState(bit, is_fei4)-error_names_stateFEI3.size()][pixlayer]++;
+// STSTST	      }
+// STSTST	      error_maps_per_state[getErrorState(bit, is_fei4)].add(pixlayer, waferID, m_pixelid, 1.0);
+// STSTST	    }
+// STSTST	  }
+// STSTST	}
+// STSTST	// If we have bits generated by FE/MCC, count this error word.
+// STSTST	if (has_femcc_errbits) num_femcc_errwords++;
+// STSTST      }
+// STSTST    }
 
     // Loop over IBL service records, FE-I4 only
     if (is_fei4 && kFeSvcRecord.find(id_hash) != kFeSvcRecord.end()) {
diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthErrorMonAlg.h b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthErrorMonAlg.h
index 6eb8baf04c6e..450f9da634d2 100644
--- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthErrorMonAlg.h
+++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthErrorMonAlg.h
@@ -134,7 +134,7 @@ class PixelAthErrorMonAlg : public PixelAthMonitoringBase {
 
  private:
 
-  ToolHandle<IPixelByteStreamErrorsTool> m_pixelErrorTool{this, "PixelByteStreamErrorsTool", "PixelByteStreamErrorsTool", "Tool to retrieve PixelByteStreamErrors"};
+// STSTST  ToolHandle<IPixelByteStreamErrorsTool> m_pixelErrorTool{this, "PixelByteStreamErrorsTool", "PixelByteStreamErrorsTool", "Tool to retrieve PixelByteStreamErrors"};
   ToolHandle<IInDetConditionsTool> m_pixelCondSummaryTool{this, "PixelConditionsSummaryTool", "PixelConditionsSummaryTool", "Tool to retrieve Pixel Conditions summary"};
 
   const PixelID* m_pixelid;
-- 
GitLab