From e240c88206a30f7f6984e3a1b8b54dc0deeca740 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Mon, 2 Aug 2021 16:47:18 +0200
Subject: [PATCH] TrigT1RPChardware: remove DISP_ macros

Replace the usage of `DISP` macros as appropriate:
  - pass `MsgStream` for useful messages
  - plain `cout` for standalone/validation code
  - `throw` exception for fatal errors
  - comment code if only needed for debugging

Also delete methods that were marked as obsolete.

Relates to ATLASRECTS-6313.
---
 .../src/RpcDigitToRpcRDO.cxx                  |   1 +
 Trigger/TrigT1/TrigT1RPChardware/README       |   0
 .../TrigT1RPChardware/MatrixReadOut.h         |   6 +-
 .../TrigT1RPChardware/PadReadOut.h            |   4 +-
 .../TrigT1RPChardware/src/CMROCompare.cxx     |  22 +-
 .../TrigT1RPChardware/src/CMReprocessing.cxx  |   8 +-
 .../TrigT1/TrigT1RPChardware/src/Matrix.cxx   | 463 +++++++-----------
 .../TrigT1RPChardware/src/MatrixReadOut.cxx   | 220 ++-------
 .../TrigT1RPChardware/src/PadReadOut.cxx      |  58 +--
 .../TrigT1RPChardware/src/RPCRODDecode.cxx    | 407 ++++++---------
 .../TrigT1RPChardware/src/RPCRXRODDecode.cxx  | 363 +++++---------
 .../TrigT1/TrigT1RPChardware/src/SectorL.cxx  |  15 +-
 .../TrigT1RPChardware/src/SectorLogic.cxx     |  32 +-
 .../src/SectorLogicReadOut.cxx                |  51 +-
 Trigger/TrigT1/TrigT1RPClogic/CMakeLists.txt  |   2 +-
 .../TrigT1RPClogic/RPCbytestream.h            |  11 +-
 .../TrigT1RPClogic/src/RPCbytestream.cxx      |  30 +-
 .../TrigT1/TrigT1RPClogic/src/SLpatterns.cxx  |   2 +-
 .../TrigT1RPCsteering/src/TrigT1RPC.cxx       |  15 +-
 19 files changed, 574 insertions(+), 1136 deletions(-)
 delete mode 100644 Trigger/TrigT1/TrigT1RPChardware/README

diff --git a/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/RpcDigitToRpcRDO.cxx b/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/RpcDigitToRpcRDO.cxx
index 7e0e3ad5dec..762568a067b 100644
--- a/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/RpcDigitToRpcRDO.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/RpcDigitToRpcRDO.cxx
@@ -115,6 +115,7 @@ StatusCode RpcDigitToRpcRDO::execute(const EventContext& ctx) const {
 
   RPCbytestream bytestream (patterns,
                             (std::string) m_bytestream_file,
+                            msg(),
                             (unsigned long int) m_cma_ro_debug,
                             (unsigned long int) m_pad_ro_debug,
                             (unsigned long int) m_rx_ro_debug,
diff --git a/Trigger/TrigT1/TrigT1RPChardware/README b/Trigger/TrigT1/TrigT1RPChardware/README
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/Trigger/TrigT1/TrigT1RPChardware/TrigT1RPChardware/MatrixReadOut.h b/Trigger/TrigT1/TrigT1RPChardware/TrigT1RPChardware/MatrixReadOut.h
index c9a08a7b2be..17f52a60860 100755
--- a/Trigger/TrigT1/TrigT1RPChardware/TrigT1RPChardware/MatrixReadOut.h
+++ b/Trigger/TrigT1/TrigT1RPChardware/TrigT1RPChardware/MatrixReadOut.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef TrigT1RPChardware_MatrixReadOut_H
@@ -68,8 +68,7 @@ void bytestream(std::ostream &stream);
 //*********************************************************//
 // general user methods to check ReadOut stream structure  //
 //*********************************************************//
-ubit16 checkBodyOrder();
-ubit16 checkBodyOrderObsolete();
+ubit16 checkBodyOrder(bool debugPrint=false);
 ubit16 checkFragment();
 //*********************************************************//
 // overload of "inseritore" operator                       //
@@ -145,7 +144,6 @@ void makeCMABody();
 void makeFooter();
 ubit16 makeCMABodyHit();
 ubit16 makeCMABodyTrg();
-ubit16 makeCMABodyTrgObsolete();
 void makeNewHit(ubit16 newHit);
 void makeNewHit(ubit16 newHit, CMROData *previous, CMROData *next);
 void sortAndMakeNewHit(ubit16 newHit);
diff --git a/Trigger/TrigT1/TrigT1RPChardware/TrigT1RPChardware/PadReadOut.h b/Trigger/TrigT1/TrigT1RPChardware/TrigT1RPChardware/PadReadOut.h
index 2b0a4c45f25..06584f105b5 100755
--- a/Trigger/TrigT1/TrigT1RPChardware/TrigT1RPChardware/PadReadOut.h
+++ b/Trigger/TrigT1/TrigT1RPChardware/TrigT1RPChardware/PadReadOut.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef TrigT1RPChardware_PadReadOut_H
@@ -21,7 +21,7 @@ void reset();
 void makeFragment();
 void makeHeader();
 void makeFooter();
-void makeBody();
+void makeBody(bool debugPrint=false);
 ubit16 readHeader(); 
 ubit16 readFooter();
 ubit16 readBody();
diff --git a/Trigger/TrigT1/TrigT1RPChardware/src/CMROCompare.cxx b/Trigger/TrigT1/TrigT1RPChardware/src/CMROCompare.cxx
index ea38d04e16b..ca18e3bcec7 100755
--- a/Trigger/TrigT1/TrigT1RPChardware/src/CMROCompare.cxx
+++ b/Trigger/TrigT1/TrigT1RPChardware/src/CMROCompare.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #include <iostream>
@@ -55,22 +55,19 @@ void CMROCompare::compareBody() {
 bool FragmentOK=true;
 bool firstDiff=true;
 
-DISP<<" ora stampo la matrice hardware"<<endl
-    <<m_hardware<<endl;
-DISP_DEBUG;
-DISP<<" ora stampo la matrice simulata"<<endl
+cout<<" ora stampo la matrice hardware"<<endl
+    <<m_hardware<<endl
+    <<" ora stampo la matrice simulata"<<endl
     <<m_simulation<<endl;
-DISP_DEBUG;
 
 ubit16 numberOfBodyRecHard = m_hardware->numberOfBodyWords();
 ubit16 numberOfBodyRecSimu = m_simulation->numberOfBodyWords();
 if(numberOfBodyRecHard!=numberOfBodyRecSimu) {
  FragmentOK=false;
  m_diffOutput+=1000000;
- DISP<<" CMROCompare: different number of body words "<<endl
+ cout<<" CMROCompare: different number of body words "<<endl
      <<"   hardware: "<<numberOfBodyRecHard
      <<"   simulation: "<<numberOfBodyRecSimu<<endl;
- DISP_DEBUG;
 } else {
   m_hardware->topCMABody(); m_simulation->topCMABody();
  for(ubit16 i=0; i<numberOfBodyRecHard; i++) {
@@ -78,10 +75,9 @@ if(numberOfBodyRecHard!=numberOfBodyRecSimu) {
   ubit16 simuRec=m_simulation->readCMABodyCurrent();
   if(hardRec!=simuRec){
    FragmentOK=false;
-   DISP<<" CMROCompare: different body words "
+   cout<<" CMROCompare: different body words "
        <<"   hardware: "<<std::hex<<hardRec<<std::dec
        <<"   simulation: "<<std::hex<<simuRec<<std::dec<<std::endl;
-   DISP_DEBUG;
    if(firstDiff) {
     if(i<50000) 
      m_diffOutput+=100000+(i+1);
@@ -93,11 +89,9 @@ if(numberOfBodyRecHard!=numberOfBodyRecSimu) {
  }//end-of-for
 }//end-of-if(number...
 if(FragmentOK) {
- DISP<<" CMROCompare: Fragment OK "<<endl;
- DISP_DEBUG;
+ cout<<" CMROCompare: Fragment OK "<<endl;
 } else {
- DISP<<" CMROCompare: Fragment NOT OK "<<endl;
- DISP_DEBUG;
+ cout<<" CMROCompare: Fragment NOT OK "<<endl;
 }//end-of-if(FragmentOK)
 }//end-of-CMROCompare::compareBody()
 //----------------------------------------------------------------------------//
diff --git a/Trigger/TrigT1/TrigT1RPChardware/src/CMReprocessing.cxx b/Trigger/TrigT1/TrigT1RPChardware/src/CMReprocessing.cxx
index 83fd6aa5044..1a7bca1e348 100755
--- a/Trigger/TrigT1/TrigT1RPChardware/src/CMReprocessing.cxx
+++ b/Trigger/TrigT1/TrigT1RPChardware/src/CMReprocessing.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #include <iostream>
@@ -31,14 +31,12 @@ CMReprocessing::CMReprocessing(MatrixReadOut *hard, Matrix *CMsimu)
 //
   CMROCompare CMROcmp(hard,&simu);
   int outCompare = CMROcmp.diffOut();
-  DISP<<" Comparison flag = "<<outCompare<<endl
+  cout<<" Comparison flag = "<<outCompare<<endl
       <<" check Fragment = "<<simu.checkFragment()<<endl;
-  DISP_DEBUG;
 
   if(outCompare) {
    CMsimu->display();
-   DISP<<endl;
-   DISP_DEBUG;
+   cout<<endl;
   }//
   
 }//end-of-CMReprocessing
diff --git a/Trigger/TrigT1/TrigT1RPChardware/src/Matrix.cxx b/Trigger/TrigT1/TrigT1RPChardware/src/Matrix.cxx
index a22e647e32d..5d4035f265c 100755
--- a/Trigger/TrigT1/TrigT1RPChardware/src/Matrix.cxx
+++ b/Trigger/TrigT1/TrigT1RPChardware/src/Matrix.cxx
@@ -47,12 +47,11 @@ m_event=event;
 m_matrixDebug = debug;
 
 if(m_matrixDebug&1<<df) {
- DISP <<"============================================="<<endl
+ cout <<"============================================="<<endl
       <<"Constructor of Matrix called with parameters:"<<endl
       <<subsys<<" "<<proj<<" "<<sect<<" "<<lowhig
       <<" "<<add[0]<<add[1]<<endl
       <<"============================================="<<endl;
- DISP_DEBUG;
 }
 m_thisBC=0;                       // temporary initialization
 
@@ -111,8 +110,7 @@ Matrix::~Matrix() {
 ubit16 df=1;
 deleteRPCdata();
 if(m_matrixDebug&1<<df) {
- DISP<<"Distructor of Matrix executed "<<endl;
- DISP_DEBUG;
+ cout<<"Distructor of Matrix executed "<<endl;
 }
 }//end-of-Matrix::~Matrix()
 //-----------------------------------------------------------------------//
@@ -329,11 +327,10 @@ m_BunchOffset=0; // test with hardware; use with setBCzero(0);
 for(i=0; i<s_nchan[0]; i++) { m_diagonal[i]=0;}
  
 if(m_matrixDebug&1<<df) {
-    DISP <<"===================================================================="<<endl
+    cout <<"===================================================================="<<endl
          <<"Matrix::setDefaultConfiguration: "
          <<"Default settings have been loaded."<<std::endl
          <<"==================================================================="<<endl;
-    DISP_DEBUG;
     dispDefaultConfiguration();
 } 
 }//end-of-Matrix::setDefaultConfiguration
@@ -343,116 +340,95 @@ ubit16 i,j,k;
 //
 // Coincidence Windows for the the three thresholds
 //
-DISP <<"================================="<<std::endl
+cout <<"================================="<<std::endl
      <<"Matrix::dispDefaultConfiguration:"<<std::endl
-     <<"=================================";
-DISP_DEBUG;
-DISP <<"--------------------------------"<<std::endl
+     <<"================================="<<std::endl;
+cout <<"--------------------------------"<<std::endl
      <<"+ Coincidence Windows:          "<<std::endl;
-DISP_DEBUG;
 for(i=0; i<s_nthres; i++) {
- DISP  <<" + Threshold address:"<<i;
- DISP_DEBUG;
+ cout  <<" + Threshold address:"<<i<<std::endl;
  for(j=0; j<s_nchan[0]; j++) {
-  DISP  <<"    -Channel address:"<<j
+  cout  <<"    -Channel address:"<<j
         <<" Window 63-32 "
-	<<std::hex<<m_trigRoad[i][j][1]
+        <<std::hex<<m_trigRoad[i][j][1]
         <<" Window 31-00 "
-	<<          m_trigRoad[i][j][0]<<std::dec;
-  DISP_DEBUG;
+        <<          m_trigRoad[i][j][0]<<std::dec<<std::endl;
  }//end-of-for(j
 }//end-of-for(i
 //
 // Majority setting
 //
-DISP <<"--------------------------------"<<std::endl
+cout <<"--------------------------------"<<std::endl
      <<"+ Majority addresses:           "<<std::endl
-     <<"--------------------------------";
-DISP_DEBUG;
+     <<"--------------------------------"<<std::endl;
 for(i=0; i<s_nthres; i++) {
- DISP <<" - threshold address "<<i<<" value "<<m_majorities[i];
- DISP_DEBUG;
-}    
+ cout <<" - threshold address "<<i<<" value "<<m_majorities[i]<<std::endl;
+}
 //
 // threshold to be used for coincidence of the lowpt trigger with the
 // external RPC doublet
 //
-DISP <<"--------------------------------"<<std::endl
+cout <<"--------------------------------"<<std::endl
      <<"+ Threshold address low-to-high: "<<m_lowtohigh<<std::endl
      <<"+ Threshold address low-to-readout: "<<m_toreadout<<std::endl
-     <<"+ Threshold address for overlap: "<<m_overlapthres;
-DISP_DEBUG;
+     <<"+ Threshold address for overlap: "<<m_overlapthres<<std::endl;
 //
 // address of the configuration for the local coincidence
 //
-DISP <<"--------------------------------"<<std::endl
+cout <<"--------------------------------"<<std::endl
      <<"+ Local coincidence setting:    "<<std::endl
      <<" -Pivot Plane:       "<<m_localDirec[0]<<std::endl
-     <<" -Coincidence Plane: "<<m_localDirec[1];
-DISP_DEBUG;
+     <<" -Coincidence Plane: "<<m_localDirec[1]<<std::endl;
 //
 // Overlap default masking
 //
-DISP <<"--------------------------------"<<std::endl
+cout <<"--------------------------------"<<std::endl
      <<"+ Overlap mask setting:    "<<std::endl
      <<" -`right' address          "<<m_matOverlap[0]<<std::endl
-     <<" -`left ' address          "<<m_matOverlap[1];
-DISP_DEBUG;
+     <<" -`left ' address          "<<m_matOverlap[1]<<std::endl;
 //
 // default for the signal delay, deadtime and pulse width arrays
 //
-DISP <<"-----------------------------------------------"<<std::endl
-     <<"+ Channel pulse-width, delay and deadtime :    ";
-DISP_DEBUG;
+cout <<"-----------------------------------------------"<<std::endl
+     <<"+ Channel pulse-width, delay and deadtime :    "<<std::endl;
 for(i=0; i<2; i++) {    // side
  if(!i) {
-  DISP<<" +Pivot Plane ";
-  DISP_DEBUG;
+  cout<<" +Pivot Plane "<<std::endl;
  } else {
-  DISP<<" +Coincidence Plane ";
-  DISP_DEBUG;
+  cout<<" +Coincidence Plane "<<std::endl;
  }
  for(j=0; j<2; j++) {   // layer
-  DISP<<"  +Layer "<<j;
-  DISP_DEBUG;
+  cout<<"  +Layer "<<j<<std::endl;
   for(k=0; k<(s_nchan[i]/s_timeGroupB); k++) {  // group
-   DISP <<"   -group "<<k
-        <<" pulsewidth "<<m_pulseWidth[i][j][k];
-   DISP_DEBUG;
+   cout <<"   -group "<<k
+        <<" pulsewidth "<<m_pulseWidth[i][j][k]<<std::endl;
   }//end-of-for(k
   for(k=0; k<(s_nchan[i]/s_timeGroupA); k++) {  // group
-   DISP <<"   -group "<<k
-	<<" delay "<<m_channDelay[i][j][k];
-   DISP_DEBUG;
+   cout <<"   -group "<<k
+        <<" delay "<<m_channDelay[i][j][k]<<std::endl;
   }//end-of-for(k
   for(k=0; k<(s_nchan[i]/s_timeGroupB); k++) {  // group
-   DISP <<"   -group "<<k
-	<<" deadtime "<<m_channDeadT[i][j][k];
-   DISP_DEBUG;
+   cout <<"   -group "<<k
+        <<" deadtime "<<m_channDeadT[i][j][k]<<std::endl;
   }//end-of-for(k
  }//end-of-for(j
 }//end-of-for(i
 //
 // Masking to 0
 //
-DISP <<"-----------------------------------------------"<<std::endl
-     <<"+ Map of the masked-to-0 channels :    ";
-DISP_DEBUG;
+cout <<"-----------------------------------------------"<<std::endl
+     <<"+ Map of the masked-to-0 channels :    "<<std::endl;
 for(i=0; i<2; i++) {    // side
  if(!i) {
-  DISP<<" +Pivot Plane ";
-  DISP_DEBUG;
+  cout<<" +Pivot Plane "<<std::endl;
  } else {
-  DISP<<" +Coincidence Plane ";
-  DISP_DEBUG;
+  cout<<" +Coincidence Plane "<<std::endl;
  }
  for(j=0; j<2; j++) {   // layer
-  DISP<<"  +Layer "<<j;
-  DISP_DEBUG;
+  cout<<"  +Layer "<<j<<std::endl;
   for(k=0; k<s_nchan[1]; k++) {
    if(m_channMask0[i][j][k]) {
-    DISP<<"   -channel "<<k;
-    DISP_DEBUG;
+    cout<<"   -channel "<<k<<std::endl;
    }//end-of-if
   }//end-of-for(k
  }//end-of-for(j
@@ -460,38 +436,32 @@ for(i=0; i<2; i++) {    // side
 //
 // default for trigger dead time
 //
-DISP <<"-----------------------------------------------"<<std::endl
-     <<"+ Trigger Dead Time   ";
-DISP_DEBUG;
+cout <<"-----------------------------------------------"<<std::endl
+     <<"+ Trigger Dead Time   "<<std::endl;
 for(k=0; k<(s_nchan[0]/s_timeGroupB); k++) {  // group
- DISP <<" -group "<<k
-      <<" Trigger DeadTime "<<m_trigDeadTime[k];
- DISP_DEBUG;
+ cout <<" -group "<<k
+      <<" Trigger DeadTime "<<m_trigDeadTime[k]<<std::endl;
 }//end-of-for(
 //
 // Simulation relevant parameters (used to align with the hardware)
 //
-DISP <<"-----------------------------------------------"<<std::endl
-     <<"+ Simulation parameters to align with the hardware (not used in CM)";
-DISP_DEBUG;
+cout <<"-----------------------------------------------"<<std::endl
+     <<"+ Simulation parameters to align with the hardware (not used in CM)"<<std::endl;
 //
 // m_BunchPhase and m_BunchOffset
 //
-DISP <<"+BunchPhase  "<<m_BunchPhase<<std::endl
+cout <<"+BunchPhase  "<<m_BunchPhase<<std::endl
      <<"  BunchPhase =  0 : to be used for standard ATLAS LVL1 simulation"<<std::endl
      <<"  BunchPhase = -1 : to be used to compare with the hardware; "<<std::endl
-     <<"                    this value fixed with VHDL comparison 1-7 august 2004.";  
-DISP_DEBUG;
-DISP <<"+BunchOffset  "<<m_BunchOffset<<std::endl
-     <<"  BunchOffset = 0 : to test with hardware; use this setting with setBCzero(0).";
-DISP_DEBUG;
+     <<"                    this value fixed with VHDL comparison 1-7 august 2004."<<std::endl
+     <<"+BunchOffset  "<<m_BunchOffset<<std::endl
+     <<"  BunchOffset = 0 : to test with hardware; use this setting with setBCzero(0)."<<std::endl;
 //
 // the end
 //
-DISP <<"======================================"<<std::endl
+cout <<"======================================"<<std::endl
      <<"Matrix::dispDefaultConfiguration: Done"<<std::endl
-     <<"======================================";
-DISP_DEBUG;
+     <<"======================================"<<std::endl;
 }//end-of-Matrix::dispDefaultConfiguration
 //-----------------------------------------------------------------------//
 void  Matrix::putData (int sidemat, int layer, int stripaddress, float time){
@@ -501,9 +471,8 @@ ubit16 DLLID;            // DLL time bin (from 0)
 ubit16 df=2;             // debug flag address
 rpcdata *rpcpntnew;	
 if(m_matrixDebug&1<<df) {
- DISP<<"Matrix:putData: putting data on Matrix"<<endl;
- DISP_DEBUG;
-}   
+ cout<<"Matrix:putData: putting data on Matrix"<<endl;
+}
 //
    BCID = (int)(time/s_BCtime);
    if(time<0.0) BCID--; // to cope with negative times
@@ -550,9 +519,8 @@ if (BCID>=NOBXS) return;
    m_datarpc[sidemat] = rpcpntnew;  
 
    } else {
-    DISP<<" Matrix::putData failure: channel addressed is "
-        <<stripaddress<<" for matrix side "<<sidemat<<endl;
-    DISP_ERROR;
+    throw std::out_of_range("Matrix::putData failure: channel addressed is " + std::to_string(stripaddress) +
+                            " for matrix side " + std::to_string(sidemat));
    }//end-of-if
 }//end-of-putData
 //----------------------------------------------------------------------//
@@ -565,8 +533,7 @@ CMAword k;
 ubit16 i, j;
 ubit16 df=3; // debug flag address
 if(m_matrixDebug&1<<df) {
- DISP<<" method putPatt called; p is "<<p<<endl;
- DISP_DEBUG;
+ cout<<" method putPatt called; p is "<<p<<endl;
 }
 //
 //
@@ -609,8 +576,7 @@ for(i=0; i<s_nchan[0]; i++) {
 }//end-of-for(i
 //
 if(m_matrixDebug&1<<df) {
- DISP<<" copy_pivot; input matrix address "<<p<<endl;
- DISP_DEBUG;
+ cout<<" copy_pivot; input matrix address "<<p<<endl;
 }//end-of-if(m_matrixDebug&1<<df)
 }//end-of-method putPatt
 //----------------------------------------------------------------------//
@@ -649,25 +615,22 @@ void Matrix::setDeadTime (ubit16 iside, ubit16 ilayer, ubit16 igroup,
 if(iside<2 && ilayer<2 && igroup<(s_nchan[1]/s_timeGroupB)) {
  m_channDeadT[iside][ilayer][igroup]=deadt;
  if(iside==0 && igroup>3) {
-  DISP<<" Matrix::setDeadTime: problems with side and group addresses"<<endl
-      <<" Matrix::setDeadTime: side="<<iside<<" layer="<<ilayer
-      <<" group="<<igroup<<endl;
-  DISP_ERROR;
+  throw std::out_of_range("Matrix::setDeadTime: problems with side and group addresses: "
+                          "side="+std::to_string(iside)+" layer="+std::to_string(ilayer)+
+                          " group="+std::to_string(igroup));
  }//end-of-if
 } else {
- DISP<<" Matrix::setDeadTime: problems in adressing pulseWidth"<<endl
-     <<" Matrix::setDeadTime: side="<<iside<<" layer="<<ilayer
-     <<" group="<<igroup<<endl;
- DISP_ERROR;
+ throw std::out_of_range("Matrix::setDeadTime: problems in adressing pulseWidth: "
+                         "side="+std::to_string(iside)+" layer="+std::to_string(ilayer)+
+                         " group="+std::to_string(igroup));
 }//end-of-if
 }//end-of-setDeadTime
 //----------------------------------------------------------------------//
 void Matrix::setDelay (ubit16 iside, ubit16 ilayer, 
                        ubit16 delay) {
 if(iside > 1 || ilayer > 1 ) {
-   DISP<<" Matrix::setDelay: problems with side and layer addresses"<<endl
-       <<" Matrix::setDelay: side="<<iside<<" layer="<<ilayer<<endl;
-   DISP_ERROR;
+ throw std::out_of_range("Matrix::setDelay: problems with side and layer addresses: "
+                         "side="+std::to_string(iside)+" layer="+std::to_string(ilayer));
 } else {
   for(ubit16 k=0; k<(s_nchan[iside]/s_timeGroupA); k++) {
    setDelay(iside,ilayer,k,delay);
@@ -680,16 +643,14 @@ void Matrix::setDelay (ubit16 iside, ubit16 ilayer, ubit16 igroup,
 if(iside<2 && ilayer<2 && igroup<(s_nchan[1]/s_timeGroupA)) {
  m_channDelay[iside][ilayer][igroup]=delay;
  if(iside==0 && igroup>3) {
-  DISP<<" Matrix::setDelay: problems with side and group addresses"<<endl
-      <<" Matrix::setDelay: side="<<iside<<" layer="<<ilayer
-      <<" group="<<igroup<<endl;
-  DISP_ERROR;
+  throw std::out_of_range("Matrix::setDelay: problems with side and group addresses:"
+                          "side="+std::to_string(iside)+" layer="+std::to_string(ilayer)+
+                          " group="+std::to_string(igroup));
  }//end-of-if
 } else {
- DISP<<" Matrix::setDelay: problems in adressing pulseWidth"<<endl
-     <<" Matrix::setDelay: side="<<iside<<" layer="<<ilayer
-     <<" group="<<igroup<<endl;
- DISP_ERROR;
+  throw std::out_of_range("Matrix::setDelay: problems in adressing pulseWidth:"
+                          "side="+std::to_string(iside)+" layer="+std::to_string(ilayer)+
+                          " group="+std::to_string(igroup));
 }//end-of-if
 }//end-of-setDelay
 //----------------------------------------------------------------------//
@@ -715,25 +676,22 @@ void Matrix::setPulseWidth (ubit16 iside, ubit16 ilayer, ubit16 igroup,
 if(iside<2 && ilayer<2 && igroup<s_nchan[1]/s_timeGroupB) {
  m_pulseWidth[iside][ilayer][igroup]=length;
  if(iside==0 && igroup>3) {
-  DISP<<" Matrix::setPulseWidth: problems with side and group addresses"<<endl
-      <<" Matrix::setPulseWidth: side="<<iside<<" layer="<<ilayer
-      <<" group="<<igroup<<endl;
-  DISP_ERROR;
+  throw std::out_of_range("Matrix::setDelay: problems with side and group addresses:"
+                          "side="+std::to_string(iside)+" layer="+std::to_string(ilayer)+
+                          " group="+std::to_string(igroup));
  }//end-of-if
 } else {
- DISP<<" Matrix::setPulseWidth: problems in adressing pulseWidth"<<endl
-     <<" Matrix::setPulseWidth: side="<<iside<<" layer="<<ilayer
-     <<" group="<<igroup<<endl;
- DISP_ERROR;
+ throw std::out_of_range("Matrix::setDelay: problems in adressing pulseWidth:"
+                         "side="+std::to_string(iside)+" layer="+std::to_string(ilayer)+
+                         " group="+std::to_string(igroup));
 }//end-of-if
 }//end-of-setPulseWidth
 //----------------------------------------------------------------------//
 void Matrix::setMask0 (ubit16 iside, ubit16 ilayer, ubit16 ichannel) {
 if(iside>1 || ilayer>1 || ichannel>(s_nchan[iside]-1)) {
- DISP<<" Matrix::setMask0: problems with side/layer/channel addresses"<<endl
-     <<" Matrix::setMask0: side="<<iside<<" layer="<<ilayer
-     <<" channel="<<ichannel<<endl;
- DISP_ERROR;
+ throw std::out_of_range("Matrix::setMask0: problems with side/layer/channel addresses: "
+                         "side="+std::to_string(iside)+" layer="+std::to_string(ilayer)+
+                         " channel="+std::to_string(ichannel));
 } else {
  m_channMask0[iside][ilayer][ichannel]=1;
 }
@@ -741,10 +699,9 @@ if(iside>1 || ilayer>1 || ichannel>(s_nchan[iside]-1)) {
 //----------------------------------------------------------------------//
 void Matrix::setMask1 (ubit16 ithreshold, ubit16 iside, ubit16 imajority, ubit16 ichannel) {
 if(ithreshold>2 || iside>1 || imajority>1 || ichannel>(s_nchan[iside]-1)) {
- DISP<<" Matrix::setMask1: problems with side/layer/channel addresses"<<endl
-     <<" Matrix::setMask1: threshold= "<<ithreshold<<" side="<<iside<<" majority="<<imajority
-     <<" channel="<<ichannel<<endl;
- DISP_ERROR;
+ throw std::out_of_range("Matrix::setMask1: problems with side/layer/channel addresses: "
+                         "threshold= "+std::to_string(ithreshold)+" side="+std::to_string(iside)+
+                         " majority="+std::to_string(imajority)+" channel="+std::to_string(ichannel));
 } else {
  set_to_1 (&m_channMask1[ithreshold][iside][imajority][0],ichannel);
 }
@@ -764,9 +721,9 @@ for(int imajority=0; imajority<2; imajority++) {
 //----------------------------------------------------------------------//
 void Matrix::setMaskReadOut (ubit16 iside, ubit16 ilayer, ubit16 ichannel) {
 if(iside>1 || ilayer>1 || ichannel>(s_nchan[iside]-1)) {
- DISP<<" Matrix::setMaskReadOut: problems with side/layer/channel addresses"<<endl
-     <<" Matrix::setMaskReadOut: side= "<<iside<<" layer="<<ilayer<<" channel="<<ichannel<<endl;
- DISP_ERROR;
+ throw std::out_of_range("Matrix::setMaskReadout: problems with side/layer/channel addresses: "
+                         "side="+std::to_string(iside)+" layer="+std::to_string(ilayer)+
+                         " channel="+std::to_string(ichannel));
 } else {
  set_to_1 (&m_channReadOutMask[iside][ilayer][0],ichannel);
 }
@@ -833,8 +790,7 @@ for(i=0; i<s_nchan[0]; i++) { setDiagonal(i,*(m_geome+i));}
 //----------------------------------------------------------------------//
 void Matrix::setLocalDirection(ubit16 add, int content) {
 if(add>1) {
- DISP<<" Matrix::setLocalDirection :  add= "<<add<<" not valid"<<endl;
- DISP_ERROR;
+ throw std::out_of_range("Matrix::setLocalDirection :  add="+std::to_string(add)+" not valid");
 } else {
  m_localDirec[add]=content;
 }//end-of-if;
@@ -842,9 +798,8 @@ if(add>1) {
 //----------------------------------------------------------------------//
 void Matrix::setKReadOut(int content) {
 if(content<0||content>>2) {
- DISP<<" Matrix::setKReadout :  threshold address = "
-     <<content<<" not valid"<<endl;
- DISP_ERROR;
+ throw std::out_of_range("Matrix::setKReadout :  threshold address = "+
+                         std::to_string(content)+" not valid");
 } else {
  m_toreadout=content;
 }//end-of-if
@@ -862,8 +817,7 @@ void Matrix::setTrigDeadTime (ubit16 igroup, ubit16 deadt) {
 if(igroup<4) {
  m_trigDeadTime[igroup] = deadt;
 } else {
- DISP<<" Matrix::setTrigDeadTime :  igroup= "<<igroup<<" not valid"<<endl;
- DISP_ERROR;
+ throw std::out_of_range("Matrix::setTrigDeadTime :  igroup= "+std::to_string(igroup)+" not valid");
 }
 }//end-of-setTrigDeadTime
 //----------------------------------------------------------------------//
@@ -875,8 +829,7 @@ for(ubit16 k=0; k<(s_nchan[0]/s_timeGroupB); k++) {
 //----------------------------------------------------------------------//
 void Matrix::setMajority(ubit16 add, int content) {
 if(add>=s_nthres) {
- DISP<<" Matrix::setMajority :  add= "<<add<<" not valid"<<endl;
- DISP_ERROR;
+ throw std::out_of_range("Matrix::setMajority :  add="+std::to_string(add)+" not valid");
 } else {
  m_majorities[add]=content;
 }//end-of-if
@@ -885,10 +838,9 @@ if(add>=s_nthres) {
 void Matrix::setRoad(ubit16 addThres, ubit16 addChn, ubit16 add64, 
                       CMAword content){
 if(addThres>=s_nthres||addChn>s_nchan[0]||add64>1) {
- DISP<<" Matrix::setRoad :  addThres= "<<addThres
-     <<" addChn= "<<addChn
-     <<" add64= "<<add64<<" not valid"<<endl;
- DISP_ERROR;
+ throw std::out_of_range("Matrix::setRoad :  addThres= "+std::to_string(addThres)+
+                         " addChn= "+std::to_string(addChn)+
+                         " add64= "+std::to_string(add64)+" not valid");
 } else {
  m_trigRoad[addThres][addChn][add64] = content;
 }//end-of-if
@@ -896,16 +848,13 @@ if(addThres>=s_nthres||addChn>s_nchan[0]||add64>1) {
 //----------------------------------------------------------------------//
 void Matrix::setRoad(ubit16 addThres, ubit16 addChn, char road[17]) {
 if(addThres>=s_nthres||addChn>s_nchan[0]) {
- DISP<<" Matrix::setRoad :  addThres= "<<addThres
-     <<" addChn= "<<addChn<<endl;
- DISP_ERROR;
+ throw std::out_of_range("Matrix::setRoad :  addThres= "+std::to_string(addThres)+
+                         " addChn= "+std::to_string(addChn));
 } else {
  CMAword the32[2]={0,0};
  ubit16 outflag = char2int(road,the32);
  if(outflag) {
-  DISP<<" Matrix::setRoad; outflag from char2int is positive: "
-      <<outflag<<endl;
-  DISP_ERROR;
+  throw std::runtime_error("Matrix::setRoad; outflag from char2int is positive: "+std::to_string(outflag));
   m_trigRoad[addThres][addChn][0] = 0;
   m_trigRoad[addThres][addChn][1] = 0;
  } else {
@@ -917,8 +866,7 @@ if(addThres>=s_nthres||addChn>s_nchan[0]) {
 //----------------------------------------------------------------------//
 void Matrix::setMatOverlap(ubit16 add, CMAword content) {
 if(add>1) {
- DISP<<" Matrix::setMatOverlap :  add= "<<add<<" not valid"<<endl;
- DISP_ERROR;
+ throw std::out_of_range("Matrix::setMatOverlap :  add= "+std::to_string(add)+" not valid");
 } else {
  m_matOverlap[add]=content;
 }
@@ -926,8 +874,7 @@ if(add>1) {
 //----------------------------------------------------------------------//
 void Matrix::setDiagonal(ubit16 add, sbit32 content) {
 if(add>s_nchan[0]) {
- DISP<<" Matrix::setDiagonal :  add= "<<add<<" not valid"<<endl;
- DISP_ERROR;
+ throw std::out_of_range("Matrix::setDiagonal :  add= "+std::to_string(add)+" not valid");
 } else {
  m_diagonal[add]=content;
 }//end-of-if
@@ -936,8 +883,7 @@ if(add>s_nchan[0]) {
 CMAword Matrix::getMatOverlap(ubit16 add) const {
 CMAword output=0;
 if(add>1) {
- DISP<<" Matrix::getMatOverlap :  add= "<<add<<" not valid"<<endl;
- DISP_ERROR;
+ throw std::out_of_range("Matrix::getMatOverlap :  add= "+std::to_string(add)+" not valid");
 } else {
  output=m_matOverlap[add];
 }
@@ -948,10 +894,9 @@ CMAword Matrix::getRoad(ubit16 addThres,
                                    ubit16 addChn, ubit16 add64) const {
 CMAword output=0;
 if(addThres>=s_nthres||addChn>s_nchan[0]||add64>1) {
- DISP<<" Matrix::getRoad :  addThres= "<<addThres
-     <<" addChn= "<<addChn
-     <<" add64= "<<add64<<" not valid"<<endl;
- DISP_ERROR;
+ throw std::out_of_range("Matrix::getRoad :  addThres= "+std::to_string(addThres)+
+                         " addChn= "+std::to_string(addChn)+
+                         " add64= "+std::to_string(add64)+" not valid");
 } else {
 output=m_trigRoad[addThres][addChn][add64];
 }//end-of-if
@@ -961,8 +906,7 @@ return output;
 int Matrix::getMajority(ubit16 add) const {
 int output=0;
 if(add>=s_nthres) {
- DISP<<" Matrix::getMajority :  add= "<<add<<" not valid"<<endl;
- DISP_ERROR;
+ throw std::out_of_range("Matrix::getMajority :  add= "+std::to_string(add)+" not valid");
 } else {
  output=m_majorities[add];
 }//end-of-if
@@ -978,13 +922,12 @@ void Matrix::execute() {
 //
 ubit16 df=4;  // debug flag address 
 if(m_matrixDebug&1<<df) {
- DISP<<"===================="<<endl
+ cout<<"===================="<<endl
      <<"|                  |"<<endl
      <<"|  Matrix::execute |"<<endl
      <<"|  --------------- |"<<endl
      <<"|                  |"<<endl
      <<"===================="<<endl;
- DISP_DEBUG;
  show_attributes();
 }//end-of-if(m_matrixDebug&1<<df)
 //
@@ -1019,10 +962,9 @@ void Matrix::storeDeadtime() {
 ubit16 df=5;
 rpcdata *rpchit;
 if(m_matrixDebug&1<<df) {
- DISP<<"--------------------------"<<endl
+ cout<<"--------------------------"<<endl
      <<"|  Matrix::storeDeadtime |"<<endl
      <<"--------------------------"<<endl;
- DISP_DEBUG;
 }//end-of-if(m_matrixDebug&1<<df)
 for(ubit16 i=0; i<2; i++) {
  rpchit=m_datarpc[i];
@@ -1038,10 +980,9 @@ void Matrix::masking() {
 ubit16 df=6;
 rpcdata *rpchit;
 if(m_matrixDebug&1<<df) {
- DISP<<"--------------------"<<endl 
+ cout<<"--------------------"<<endl
      <<"|  Matrix::masking |"<<endl
      <<"--------------------"<<endl;
- DISP_DEBUG;
 }//end-of-if(m_matrixDebug&1<<df)
 for(ubit16 i=0; i<2; i++) {
  rpchit=m_datarpc[i];
@@ -1057,10 +998,9 @@ void Matrix::delay() {
 ubit16 df=7;
 rpcdata *rpchit;
 if(m_matrixDebug&1<<df) {
- DISP<<"--------------------"<<endl
+ cout<<"--------------------"<<endl
      <<"|  Matrix::delay   |"<<endl
      <<"--------------------"<<endl;
- DISP_DEBUG;
 }//end-of-if(m_matrixDebug&1<<df)
 for(ubit16 i=0; i<2; i++) {
  rpchit=m_datarpc[i];
@@ -1078,17 +1018,16 @@ sbit32 abs_time, timeadd;
 rpcdata *rpcpnt;
 //
 if(m_matrixDebug&1<<df) {
- DISP<<"--------------------"<<endl
+ cout<<"--------------------"<<endl
      <<"|  Matrix::load    |"<<endl
      <<"--------------------"<<endl;
- DISP_DEBUG;
 }//end-of-if(m_matrixDebug&1<<df)
 //
 for(ubit16 i=0; i<2; i++) {  // "i" is the CMA side address
  rpcpnt=m_datarpc[i];
  while (rpcpnt) {
   if(m_matrixDebug&1<<df) {
-   DISP<<"  Layer= " <<rpcpnt->layer
+   cout<<"  Layer= " <<rpcpnt->layer
        <<" stripadd= "<<rpcpnt->stripadd
        <<" time= "<<rpcpnt->time
        <<" mask= "<<rpcpnt->masked
@@ -1096,7 +1035,6 @@ for(ubit16 i=0; i<2; i++) {  // "i" is the CMA side address
        <<" DLL= "<<rpcpnt->DLL
        <<" delay= "<<rpcpnt->delay
        <<endl;
-   DISP_DEBUG;
   }//end-of-if(m_matrixDebug&1<<df)
   abs_time = s_NDLLCYC*rpcpnt->BC
            + rpcpnt->DLL
@@ -1106,8 +1044,7 @@ for(ubit16 i=0; i<2; i++) {  // "i" is the CMA side address
           + s_NDLLCYC*m_BCzero;         // put m_thisBC at the center of the buffer
                                       
   if(m_matrixDebug&1<<df) {
-   DISP<<" abs_time= "<<abs_time<<" timeadd= "<<timeadd<<endl;
-   DISP_DEBUG;
+   cout<<" abs_time= "<<abs_time<<" timeadd= "<<timeadd<<endl;
   }
   
 //
@@ -1115,10 +1052,9 @@ for(ubit16 i=0; i<2; i++) {  // "i" is the CMA side address
 //   
   if(timeadd>=0 && timeadd<s_nclock && !rpcpnt->masked) {
    if(m_matrixDebug&1<<df) {
-    DISP<<" setting input with side "<<i<<" "<<rpcpnt->layer
+    cout<<" setting input with side "<<i<<" "<<rpcpnt->layer
         <<" "<<timeadd<<" 0"<<" for channel "<<rpcpnt->stripadd
 	<<" timeadd "<<timeadd<<endl;
-    DISP_DEBUG;
    }//end-of-if(m_matrixDebug&1<<df)
    set_to_1(&m_input[i][rpcpnt->layer][timeadd][0],rpcpnt->stripadd);
   }//end-of-if(timeadd
@@ -1147,10 +1083,9 @@ for(ubit16 i=0; i<2; i++)      {     // side address
 void Matrix::prepro () {
 ubit16 df=9;
 if(m_matrixDebug&1<<df) {
- DISP<<"-------------------------"<<endl
+ cout<<"-------------------------"<<endl
      <<"| matrix: preprocessing |"<<endl
      <<"-------------------------"<<endl;
- DISP_DEBUG;
 }//end-of-if(m_matrixDebug&1<<df)
 //
 // 1) pulse width
@@ -1182,10 +1117,9 @@ for(i=0;i<4;i++) {
 }
 //
 if(m_matrixDebug&1<<df) {
- DISP<<"--------------------"<<endl
+ cout<<"--------------------"<<endl
      <<"| matrix: coincide |"<<endl
      <<"--------------------"<<endl;
- DISP_DEBUG;
 }//end-of-if(m_matrixDebug&1<<df)
 //
 // nconf gives the number of possible configurations compatible with
@@ -1194,10 +1128,9 @@ if(m_matrixDebug&1<<df) {
 // array respectively correspondent to the configurtion number "i"
 //
 if(m_matrixDebug&1<<df) {
- DISP<<" Matrix::coincidence; lowhigh= "<<m_lowhigh<<endl
+ cout<<" Matrix::coincidence; lowhigh= "<<m_lowhigh<<endl
      <<" Matrix::coincidence; majority array ="
      <<" "<<m_majorities[0]<<" "<<m_majorities[1]<<" "<<m_majorities[2]<<endl;
- DISP_DEBUG;
 }//end-of-if(m_matrixDebug&1<<df)
 //
 for(i=0; i<s_nclock; i++)             { // loop on clock cycles
@@ -1207,12 +1140,11 @@ for(i=0; i<s_nclock; i++)             { // loop on clock cycles
   nconf = config(thres,&conf[0][0]);  // number of config. for this threshold
 //
 //if(m_matrixDebug&1<<df) {
-// DISP<<"nconf="<<nconf<<" conf=";
-// DISP_DEBUG;
-// for(int ii=0;ii<4;ii++){ DISP<<" "<<conf[ii][0]; DISP_DEBUG;}
-// DISP<<"  "; DISP_DEBUG;
-// for(int ii=0;ii<4;ii++){ DISP<<" "<<conf[ii][1]; DISP_DEBUG;}
-// DISP<<endl; DISP_DEBUG;
+// cout<<"nconf="<<nconf<<" conf="<<endl;
+// for(int ii=0;ii<4;ii++){ cout<<" "<<conf[ii][0]<<endl;}
+// cout<<endl;
+// for(int ii=0;ii<4;ii++){ cout<<" "<<conf[ii][1]<<endl;}
+// cout<<endl;
 //}//end-of-if(m_matrixDebug&1<<df)
 
   for(l=0; l<nconf; l++)            { // loop on all config. for this threshold
@@ -1238,8 +1170,7 @@ for(i=0; i<s_nclock; i++)             { // loop on clock cycles
              |  (m_mjori[thres][1][conf[l][1]][i][1]&m_trigRoad[thres][j][1]))){
 
     if(m_matrixDebug&1<<df) {
-     DISP<<"coincidence!!!"<<" clock="<<i<<" xchan="<<j<<endl;
-     DISP_DEBUG;
+     cout<<"coincidence!!!"<<" clock="<<i<<" xchan="<<j<<endl;
     }//end-of-if(m_matrixDebug
 
      set_to_1(&m_trigg[thres][i],j);
@@ -1353,10 +1284,9 @@ for(i=0;i<s_NBunch; i++) { //loop on bunches
 void Matrix::maskTo1 () {
 ubit16 df=11;
 if(m_matrixDebug&1<<df) {
- DISP<<"---------------------"<<endl
+ cout<<"---------------------"<<endl
      <<"| Matrix::mask_to_1 |"<<endl
      <<"---------------------"<<endl;
- DISP_DEBUG;
 }//end-of-if(m_matrixDebug&1<<df)
 
 ubit16 i, j, k, l, m;
@@ -1421,10 +1351,9 @@ ubit16 df=12;
 ubit16 i,j,l,m;
 sbit16 k;
 if(m_matrixDebug&1<<df) {
- DISP<<"-----------------------"<<endl
+ cout<<"-----------------------"<<endl
      <<"| Matrix::pulse_width |"<<endl
      <<"-----------------------"<<endl;
- DISP_DEBUG;
 }//end-of-if(m_matrixDebug&1<<df)
 //
 for(i=0; i<2; i++) {                // loop on the two Matrix sides 
@@ -1462,10 +1391,9 @@ ubit16 i, j, k, l, n;
 ubit16 df=13;  // debug flag address
 CMAword buffi[2], buffo[2];
 if(m_matrixDebug&1<<df) {
- DISP<<"-------------------"<<endl
+ cout<<"-------------------"<<endl
      <<"| Matrix::majori  |"<<endl
      <<"-------------------"<<endl;
- DISP_DEBUG;
 }//end-of-if(m_matrixDebug&1<<df)
 //
 // the loop on the CMA sides has to be made as follows:
@@ -1561,10 +1489,9 @@ ubit16 df=14;
 ubit16 nup,first, i,j,k,l;
 first=0;
 if(m_matrixDebug&1<<df) {
- DISP<<"------------------------"<<endl
+ cout<<"------------------------"<<endl
      <<"| matrix: declustering |"<<endl
      <<"------------------------"<<endl;
- DISP_DEBUG;
 }//end-of-if(m_matrixDebug&1<<df)
 //
 // loop on m_input data
@@ -1607,11 +1534,10 @@ ubit16 df=15;
 ncop=0;
 j=0;
 if(m_matrixDebug&1<<df) {
- DISP<<" --------------------"<<endl
+ cout<<" --------------------"<<endl
      <<" |  Matrix::reduce  |"<<endl
      <<" --------------------"<<endl
      <<" nup= "<<nup<<" first "<<first<<endl;
- DISP_DEBUG;
 }//end-of-if(m_matrixDebug&1<<df)
 //
 // analyse nup value and apply the cluster reduction according to it.
@@ -1632,8 +1558,7 @@ if        (nup<=2) {
            ncop=nup-4;
 }//end-of-if
 if(m_matrixDebug&1<<df) {
- DISP<<" j= "<<j<<" ncop= "<<ncop<<endl;
- DISP_DEBUG;
+ cout<<" j= "<<j<<" ncop= "<<ncop<<endl;
 }//end-of-if(m_matrixDebug&1<<df)
 //
 // copy the reduced cluster into the "s_nthres" m_prepr registers
@@ -1713,10 +1638,9 @@ strcpy(plane[1],"I1");
 strcpy(plane[2],"J0");
 strcpy(plane[3],"J1");
 if(m_matrixDebug&1<<df) {
- DISP<<"-------------------------------"<<endl
+ cout<<"-------------------------------"<<endl
      <<"|  Matrix::makeTestPattern    |"<<endl
      <<"-------------------------------"<<endl;
- DISP_DEBUG;
 }//end-of-if(m_matrixDebug&1<<df)
 //
 ntimes = 0;
@@ -1772,13 +1696,11 @@ while(!completed) {
 ofstream vhdlinput;
 vhdlinput.open("k-trigger.output",ios::app);
 if(!vhdlinput){
- DISP<<" File for vhdl analysis not opened. "<<endl
+ cout<<" File for vhdl analysis not opened. "<<endl
      <<" =================================="<<endl<<endl;
- DISP_ERROR;
  } else {
   if(m_matrixDebug&1<<df) {
-   DISP<<" File for vhdl analysis correctly opened"<<endl<<endl;
-   DISP_ERROR;
+   cout<<" File for vhdl analysis correctly opened"<<endl<<endl;
  }//end-of-if(m_matrixDebug&1<<df)
 }//end-of-if(!vhdlinput
 if(mode) {
@@ -1898,9 +1820,8 @@ ubit16 Matrix::config (ubit16 i, ubit16 *arr) const {
 //
 ubit16 nconf=0;
 //
-// DISP<<"lowhig="<<m_lowhigh<< "majorities= "<<m_majorities[0]
+// cout<<"lowhig="<<m_lowhigh<< "majorities= "<<m_majorities[0]
 //     <<" "<< m_majorities[1]<<" "<<m_majorities[2]<<endl;
-// DISP_DEBUG;
 //
 switch (m_lowhigh) {
  case 0:                    // low-pt trigger matrix
@@ -1923,9 +1844,8 @@ switch (m_lowhigh) {
    *(arr+0)=1; *(arr+1)=1;
    break;
   default:
-   DISP<<" Matrix::config: the majority "<<m_majorities[i]
-       <<" is unforeseen "<<endl;
-   DISP_ERROR;
+   throw std::runtime_error("Matrix::config: the majority "+std::to_string(m_majorities[i])+
+                            " is unforeseen");
  }
   break;
  case 1:                    // high-pt trigger matrix
@@ -1942,14 +1862,12 @@ switch (m_lowhigh) {
     *(arr+1)=1;
     break;
    default:
-    DISP<<" Matrix::config: the majority "<<m_majorities[i]
-        <<" is unforeseen "<<endl;
-    DISP_ERROR;
+    throw std::runtime_error("Matrix::config: the majority "+std::to_string(m_majorities[i])+
+                             " is unforeseen");
   }
   break;
  default:
-  DISP<<" Matrix::config: lowhighpt "<<m_lowhigh<<" is unforeseen "<<endl;
-  DISP_ERROR;
+  throw std::runtime_error("Matrix::config: lowhighpt "+std::to_string(m_lowhigh)+" is unforeseen");
 }
  return nconf;
 }//end-of-method-config
@@ -1995,10 +1913,8 @@ inds(&i[0],channel);
 if(!(channel<0)) {
  *(p+i[0]) = *(p+i[0]) | j<<i[1];
 } else {
- DISP<<" Matrix::set_to_1: channel is negative; channel= "
-     <<channel<<endl;
- DISP_ERROR;
-}//end-of-if(!(channel<0 
+ throw std::out_of_range("Matrix::set_to_1: channel is negative; channel="+std::to_string(channel));
+}//end-of-if(!(channel<0
 }//end-of-Matrix::set_to_1
 //----------------------------------------------------------------------//
 void Matrix::set_to_0(CMAword *p, sbit16 channel) const {
@@ -2009,10 +1925,8 @@ inds(&i[0],channel);
 if(!(channel<0)) {
  *(p+i[0]) = *(p+i[0]) & ~(j<<i[1]);
 } else {
- DISP<<" Matrix::set_to_1: channel is negative; channel= "
-     <<channel<<endl;
- DISP_ERROR;
-}//end-of-if(!(channel<0 
+ throw std::out_of_range("Matrix::set_to_1: channel is negative; channel="+std::to_string(channel));
+}//end-of-if(!(channel<0
 }//end-of-Matrix::set_to_1
 //----------------------------------------------------------------------//
 ubit16 Matrix::bitstatus(const CMAword *p,ubit16 channel) const {
@@ -2025,31 +1939,26 @@ return *(p+id[0])& j<<id[1] ? 1 : 0 ;
 //----------------------------------------------------------------------//
 void Matrix::wind () const {
 sbit16 i, j;
- DISP<<"-----------------------"<<endl
+ cout<<"-----------------------"<<endl
      <<"|     Matrix::wind    |"<<endl
      <<"-----------------------"<<endl
      <<" Matrix Roads "<<endl;
- DISP_DEBUG;
  for(i=0; i<s_nthres; i++) {
   for(j=0; j<s_nchan[0]; j++) {
-   DISP<<" thres. "<<i<<" channel "<<j
+   cout<<" thres. "<<i<<" channel "<<j
 //       <<" Road0 "<<hex<<(*(m_roads+32*2*i+2*j+0))<<dec
 //       <<" Road1 "<<hex<<(*(m_roads+32*2*i+2*j+1))<<dec<<endl;
        <<" Road0 "<<hex<<(m_trigRoad[i][j][0])<<dec
        <<" Road1 "<<hex<<(m_trigRoad[i][j][1])<<dec<<endl;
-   DISP_DEBUG;
   }
  }
- DISP<<" majorities: ";
- DISP_DEBUG;
- for(i=0;i<3;i++) {DISP<<m_majorities[i]<<" ";DISP_DEBUG;} 
- DISP<<" "<<endl; DISP_DEBUG;
- DISP<<" number of overlapping ' low' channels: "<<m_matOverlap[0]<<endl
+ cout<<" majorities: "<<endl;
+ for(i=0;i<3;i++) {cout<<m_majorities[i]<<" "<<endl;}
+ cout<<endl
+     <<" number of overlapping ' low' channels: "<<m_matOverlap[0]<<endl
      <<" number of overlapping 'high' channels: "<<m_matOverlap[1]<<endl;
- DISP_DEBUG;
  for(i=0;i<s_nchan[0];i++) {
- DISP<<" channel "<<i<<" in coincidence with "<<m_diagonal[i]<<endl;
- DISP_DEBUG;
+ cout<<" channel "<<i<<" in coincidence with "<<m_diagonal[i]<<endl;
  }//end-of-for(i
 }//end-of-method-wind
 //----------------------------------------------------------------------//
@@ -2059,23 +1968,18 @@ ubit16 df=19;
 rpcdata *rpcpnt;
 //
 //if(this) {
- DISP<<"======================="<<endl
+ cout<<"======================="<<endl
      <<"||   Matrix Display  ||"<<endl
      <<"======================="<<endl
      <<endl;
- DISP_DEBUG;
  show_attributes();
- DISP<<" "<<endl;
- DISP_DEBUG;
-//
- DISP<<" All raw data "<<endl;
- DISP_DEBUG;
+
+ cout<<endl<<" All raw data "<<endl;
  for(i=0; i<2; i++) {
-  DISP<<" Matrix Side is "<<i<<endl;
-  DISP_DEBUG;
+  cout<<" Matrix Side is "<<i<<endl;
   rpcpnt=m_datarpc[i];
   while (rpcpnt) {
-   DISP<<"  Layer= " <<rpcpnt->layer
+   cout<<"  Layer= " <<rpcpnt->layer
        <<" stripadd= "<<rpcpnt->stripadd
        <<" time= "<<rpcpnt->time
        <<" mask= "<<rpcpnt->masked
@@ -2083,50 +1987,43 @@ rpcdata *rpcpnt;
        <<" DLL= "<<rpcpnt->DLL
        <<" delay= "<<rpcpnt->delay
        <<endl;
-   DISP_DEBUG;
    rpcpnt=rpcpnt->next;
   }//end-of-while(rpcpnt)
  }//end-of-for(i
 //
 if(m_matrixDebug&1<<(df+0)) {
- DISP<<" Display Matrix Input "<<endl;
- DISP_DEBUG;
+ cout<<" Display Matrix Input "<<endl;
  disp_CMAreg(0); //display the input registers
 }
 //
 //
 if(m_matrixDebug&1<<(df+1)) {
- DISP<<" Display Matrix Preprocessing "<<endl;
- DISP_DEBUG;
+ cout<<" Display Matrix Preprocessing "<<endl;
  disp_CMAreg(1); //display the prepro registers
 }
 //
 if(m_matrixDebug&1<<(df+2)) {
- DISP<<" Display Matrix Majority "<<endl;
- DISP_DEBUG;
+ cout<<" Display Matrix Majority "<<endl;
  disp_CMAreg(2); //display the majority registers
 }
 //
 if(m_matrixDebug&1<<(df+3)) {
- DISP<<" Display Trigger  "<<endl;
- DISP_DEBUG;
+ cout<<" Display Trigger  "<<endl;
  disp_CMAreg(3); //display the trigger registers
 }
 //
 //} else {
-// DISP<<"======================="<<endl
+// cout<<"======================="<<endl
 //     <<"||    Matrix EMPTY   ||"<<endl
 //     <<"======================="<<endl;
-// DISP_DEBUG;
 //}//end-of-Matrix::display
 }//end-of-method display
 //------------------------------------------------------------------------//
 void Matrix::show_attributes () const {
-DISP<<" Matrix Attributes: "<<endl
+cout<<" Matrix Attributes: "<<endl
     <<" Subsystem "<<m_subsystem<<"; Projection "<<m_projection
     <<"; Sector "<<m_sector<<"; Pad "<<m_pad<<"; LowHig "<<m_lowhigh
     <<"; addresses: "<<m_address[0]<<"  "<<m_address[1]<<endl; 
-DISP_DEBUG;
 }//end-of-Matrix::attributes
 //------------------------------------------------------------------------//
 void Matrix::disp_CMAreg(ubit16 id) const {
@@ -2136,23 +2033,19 @@ void Matrix::disp_CMAreg(ubit16 id) const {
 ubit16 i, j, k;
 if(id<2) {
  for(i=0; i<2; i++) {     // loop on the two Matrix sides
-  DISP<<" CMA Side (0=side-x; 1=side-y) "<<i;
-  DISP_DEBUG;
+  cout<<" CMA Side (0=side-x; 1=side-y) "<<i<<endl;
   for(j=0; j<2; j++) {    // loop on the two Matrix layers
    switch (id) {
     case 0:
-     DISP<<" Layer "<<j<<endl;
-     DISP_DEBUG;
+     cout<<" Layer "<<j<<endl;
      dispRegister(&m_input[i][j][0][0],i);
      break;
     case 1:
-     DISP<<" Layer "<<j<<endl;
-     DISP_DEBUG;
+     cout<<" Layer "<<j<<endl;
      dispRegister(&m_prepr[0][i][j][0][0],i);
      break;
     default:
-     DISP<<" Matrix::disp_CMAreg id value "<<id<<" not foreseen "<<endl;
-     DISP_DEBUG;
+     cout<<" Matrix::disp_CMAreg id value "<<id<<" not foreseen "<<endl;
    }//end-of-switch
   }//end-of-for(j
  }//end-of-for(i
@@ -2162,14 +2055,11 @@ if(id<2) {
  switch (id) {
   case 2:  
    for(i=0; i<s_nthres; i++) { // loop on threshold
-    DISP<<" Threshold address "<<i<<endl;
-    DISP_DEBUG;
+    cout<<" Threshold address "<<i<<endl;
     for(j=0; j<2; j++) {     // loop on matrix sides
-     DISP<<" CMA Side (0=side-x; 1=side-y) "<<j;
-     DISP_DEBUG;
+     cout<<" CMA Side (0=side-x; 1=side-y) "<<j<<endl;
      for(k=0; k<2; k++) {    // loop on majority types
-      DISP<<" Majority type (0=1/2; 1=2/2) "<<k<<endl;
-      DISP_DEBUG;
+      cout<<" Majority type (0=1/2; 1=2/2) "<<k<<endl;
       dispRegister(&m_mjori[i][j][k][0][0],j);
      }//end-of-for(k
     }//end-of-for(j
@@ -2177,22 +2067,18 @@ if(id<2) {
    break;
   case 3:
    for(i=0; i<s_nthres; i++) { // loop on the three thresholds
-    DISP<<" Trigger Threshold address "<<i<<endl;
-    DISP_DEBUG;
+    cout<<" Trigger Threshold address "<<i<<endl;
     dispTrigger(&m_trigg[i][0]);
    }//end-of-for(i
-   DISP<<" ReadOut Buffer "<<endl;
-   DISP_DEBUG;
+   cout<<" ReadOut Buffer "<<endl;
    dispRegister(&rodat[0][0][0][0],0);
    break;
    default:
-    DISP<<" Matrix::disp_CMAreg id value "<<id<<" not foreseen "<<endl;
-    DISP_DEBUG;
-  }//end-of-switch (id) 
+    cout<<" Matrix::disp_CMAreg id value "<<id<<" not foreseen "<<endl;
+  }//end-of-switch (id)
  
 }//end-of-if(id
-DISP<<" "<<endl;
-DISP_DEBUG;
+cout<<" "<<endl;
 }//end-of-Matrix::disp_CMAreg
 //------------------------------------------------------------------------//
 void Matrix::dispRegister(const CMAword *p, ubit16 side) const {
@@ -2226,8 +2112,7 @@ for(j=0; j<s_nclock; j++) {       // loop on the s_nclock cycles
 
 }//end-of-for(j
 
- DISP << strdisp->str();
- DISP_DEBUG;
+ cout << strdisp->str() << endl;
  
  delete strdisp;
 }//end-of-Matrix::dispRegister
@@ -2260,10 +2145,9 @@ for(j=0; j<s_nclock; j++) {       // loop on the s_nclock cycles
  *strdisp<<" "<<endl;
 }//end-of-for(j
 
- DISP << strdisp->str();
- DISP_DEBUG;
+cout << strdisp->str() << endl;
  
- delete strdisp;
+delete strdisp;
 }//end-of-Matrix::dispTrigger
 //------------------------------------------------------------------------//
 void Matrix::dispBinary (const CMAword *p, __osstream *strdisp) const {
@@ -2325,9 +2209,8 @@ for(sbit16 j=s_nchan[1]-1; j>=0; j--) {
 *strdisp<<"   00000000001111111111222222222233"<<endl
         <<"   01234567890123456789012345678901"<<endl;
 //
- DISP << strdisp->str();
- DISP_DEBUG; 
- delete strdisp;
+cout << strdisp->str() << endl;
+delete strdisp;
 }//end-of-dispWind
 //------------------------------------------------------------------------//
 void Matrix::inds(ubit16 *i, ubit16 channel) const{
diff --git a/Trigger/TrigT1/TrigT1RPChardware/src/MatrixReadOut.cxx b/Trigger/TrigT1/TrigT1RPChardware/src/MatrixReadOut.cxx
index db59009db3a..6f8342aedda 100755
--- a/Trigger/TrigT1/TrigT1RPChardware/src/MatrixReadOut.cxx
+++ b/Trigger/TrigT1/TrigT1RPChardware/src/MatrixReadOut.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #include<fstream>
@@ -74,8 +74,7 @@ MatrixReadOut::MatrixReadOut(ubit16 *v, ubit16 numWords, DataVersion ver)
     //
     // Fragment Scanning ...
     //
-    //    DISP<<" field= "<<field<<endl;
-    //    DISP_DEBUG;
+    //    cout<<" field= "<<field<<endl;
     if(field=='B') {
       //
       // this is a Body word
@@ -291,8 +290,7 @@ void MatrixReadOut::makeHeader() {
     }  
     writeHeader(CMcode);
   } else {
-    DISP<<" MatrixReadOut::makeHeader: m_CM object does not exist"<<endl;
-    DISP_ERROR;
+    throw std::runtime_error("MatrixReadOut::makeHeader: m_CM object does not exist");
   }//end-of-if
 }//end-of-MatrixReadOut::makeHeader
 //----------------------------------------------------------------------------//
@@ -300,20 +298,17 @@ void MatrixReadOut::makeSubHeader() {
   if(m_CM) {
     writeSubHeader();
   } else {
-    DISP<<" MatrixReadOut::makeSubHeader: m_CM object does not exist"<<endl;
-    DISP_ERROR;
+    throw std::runtime_error("MatrixReadOut::makeSubHeader: m_CM object does not exist");
   }//end-of-if
 }//end-of-MatrixReadOut::makeSubHeader
 //----------------------------------------------------------------------------//
 void MatrixReadOut::makeCMABody() {
   if(m_CM) {
-    //    DISP<<"number of hits in matrixReadOut:"<<makeCMABodyHit()<<endl;
-    //    DISP_DEBUG;
+    //    cout<<"number of hits in matrixReadOut:"<<makeCMABodyHit()<<endl;
     makeCMABodyHit();
     makeCMABodyTrg();
   } else {
-    DISP<<" MatrixReadOut::makeCMABody: m_CM object does not exist"<<endl;
-    DISP_ERROR;
+    throw std::runtime_error("MatrixReadOut::makeCMABody: m_CM object does not exist");
   }//end-of-if
 }//end-of-MatrixReadOut::makeCMABody
 //----------------------------------------------------------------------------//
@@ -321,8 +316,7 @@ void MatrixReadOut::makeFooter() {
   if(m_CM) {
     writeFooter();
   } else {
-    DISP<<" MatrixReadOut::makeFooter: m_CM object does not exist"<<endl;
-    DISP_ERROR;
+    throw std::runtime_error("MatrixReadOut::makeFooter: m_CM object does not exist");
   }//end-of-if(m_CM
 }//end-of-makeFooter
 //----------------------------------------------------------------------------//
@@ -411,8 +405,7 @@ ubit16 MatrixReadOut::makeCMABodyHit() {
 	    //   
 	    //       #4 STRIP filled with: CHANNEL  or k-readout 
 	    //    
-	    //	DISP<<"rodat="<<m_CM->rodat[i][j][k][l/32]<<" boh="<<(1<<(l%32))<<endl;
-	    //  DISP_DEBUG;
+	    //	cout<<"rodat="<<m_CM->rodat[i][j][k][l/32]<<" boh="<<(1<<(l%32))<<endl;
 	    if( (m_CM->rodat[i][j][k][l/32]&(1<<(l%32))) ) {
 	      ubit16 SIDE=i;
 	      ubit16 TIME =(k+m_ROOffset)%m_NDLLCYC;     // from struct rpcdata in Matrix
@@ -431,10 +424,9 @@ ubit16 MatrixReadOut::makeCMABodyHit() {
 	      // BC>0 and BC<=7 and time>0
 	      //
               if (BC>=m_BunchFrom && BC<=m_BunchTo){
-//  		DISP<<"Now store CM_hit with: BCID= "<<BC<<" TIME = "<<TIME
+//  		cout<<"Now store CM_hit with: BCID= "<<BC<<" TIME = "<<TIME
 //  		    <<" SIDE = "<<SIDE<<" layer = "<<j
-//  		    <<" IJK = " <<IJK<< " CHANNEL = "<<CHANNEL<<endl; //print
-//              DISP_DEBUG;
+//  		    <<" IJK = " <<IJK<< " CHANNEL = "<<CHANNEL<<endl;
 		CMABodyval[0] = 0;
 		CMABodyval[1] = BC-m_BunchFrom;
 		CMABodyval[2] = TIME;
@@ -450,96 +442,11 @@ ubit16 MatrixReadOut::makeCMABodyHit() {
 
     //
   } else {
-    DISP<<" MatrixReadOut::makeCMABodyHit: m_CM class empty"<<endl;
-    DISP_DEBUG;
+    throw std::runtime_error("MatrixReadOut::makeCMABodyHit: m_CM object does not exist");
   }//end-of-if
   return numberOfHits;
 }//end-of-MatrixReadOut::makeCMABodyHit
 //----------------------------------------------------------------------------//
-ubit16 MatrixReadOut::makeCMABodyTrgObsolete() {
-  ubit16 CMABodyval[5];
-  ubit16 channel=0;
-  ubit16 BC, TIME, IJK, CHANNEL;
-  int set_latenza;
-  int h_last[32]; // only pivot plane
-//
-// initialize h_last to value large value
-//
-  for(ubit16 i=0; i<m_nchan[0]; i++) {h_last[i]=0xffff;}
-//
-  ubit16 numberOfHits=0;
-  if(m_CM) {
-    CMAword one=1;
-    //
-    for (int h=0; h<m_nclock;h++){               // loop on time clock
-      for (channel=0; channel<m_nchan[0]; channel++){
-	if(m_CM->k_readout[h]&(one<<channel)){ //check K-readout register for 
-	  set_latenza=abs(h-h_last[channel]);
-	  if (set_latenza >m_timeSeparation) {
-	    // a real-trigger data!
-	    BC=(h+m_ROOffset)/m_NDLLCYC;       // fill BCID word
-	    TIME=(h+m_ROOffset)%m_NDLLCYC;    // from struct rpcdata in Matrix
-	    IJK=6;              //Trigger flag for IJK
-	    CHANNEL=channel;
-	    h_last[channel]=h;
-
-	    DISP<<"MatrixReadOut: Now store Trigger_hit with: BCID= "<<BC
-		<<" TIME = "<<TIME<<" IJK = "<<IJK<<" CHANNEL = "<<CHANNEL<<endl;
-            DISP_DEBUG;
-	    //       
-	    CMABodyval[0] = 0;
-	    CMABodyval[1] = BC;
-	    CMABodyval[2] = TIME;
-	    CMABodyval[3] = IJK;
-	    CMABodyval[4] = CHANNEL;
-	    makeNewHit(m_MROS.makeBody(CMABodyval));
-	    numberOfHits++;
-	  }//end of if set_latenza   
-	}//end of if k_readout
-      }//end of for(channel
-    }//end of for(int h 
-//
-// Thershold and overlap word
-//
-    ubit16 lastTime=0xffff;
-    for (int n=0;n<m_nclock;n++){
-//**      if(!m_CM->highestthRO[n] || m_CM->highestthRO[n]!=highestthprec)????chefamo
-       if(m_CM->highestthRO[n]){
-        set_latenza=abs(n-lastTime);
-	if(set_latenza>m_timeSeparation) {
-         ubit16 thresh_n= m_CM->highestthRO[n];
-	 ubit16 over_n=m_CM->overlapRO[n];
-	 over_n=over_n<<2;
-	 BC=(n+m_ROOffset)/m_NDLLCYC;       // fill BCID word
-	 TIME=(n+m_ROOffset)%m_NDLLCYC;
-	 CHANNEL =(over_n|thresh_n);
-	 IJK=7;
-	 lastTime=n;
-//  	 DISP<<"MatrixReadOut: Now store Trigger_hit with: BCID= "
-//  	     <<BC<<" TIME = "<<TIME
-//  	     <<" IJK = "<<IJK<<" CHANNEL = "<<CHANNEL<<endl;
-//       DISP_DEBUG;
-	 //
-	 CMABodyval[0] = 0;
-	 CMABodyval[1] = BC;
-	 CMABodyval[2] = TIME;
-	 CMABodyval[3] = IJK;
-	 CMABodyval[4] = CHANNEL;
-	 makeNewHit(m_MROS.makeBody(CMABodyval));
-	 numberOfHits++;
-	}//end-of-if(set_latenza
-      }//end-of-if(highestthRO  
-    }//end-of-for(n=0
-    //
-    //    DISP<<"     ** Exit from makeCMABodyTrg method **"<<endl<<endl;
-    //    DISP_DEBUG;
-  } else {
-    DISP<<" MatrixReadOut::makeCMABodyTrg: m_CM class empty"<<endl;
-    DISP_ERROR;
-  }//end-of-if(m_CM
-  return numberOfHits;
-}//end-of-MatrixReadOut::makeCMABodyTrgObsolete
-//----------------------------------------------------------------------------//
 ubit16 MatrixReadOut::makeCMABodyTrg() {
   ubit16 CMABodyval[5];
   ubit16 channel=0;
@@ -570,9 +477,8 @@ ubit16 MatrixReadOut::makeCMABodyTrg() {
 	    CHANNEL=channel;
 	    // h_last[channel]=h;
 
-	    DISP<<"MatrixReadOut: Now store Trigger_hit with: BCID= "<<BC
-		<<" TIME = "<<TIME<<" IJK = "<<IJK<<" CHANNEL = "<<CHANNEL<<endl;
-            DISP_DEBUG;
+	    //cout<<"MatrixReadOut: Now store Trigger_hit with: BCID= "<<BC
+		//<<" TIME = "<<TIME<<" IJK = "<<IJK<<" CHANNEL = "<<CHANNEL<<endl;
 	    //
 	    if (BC>=m_BunchFrom && BC<=m_BunchTo){   
 	      triggerRO=true; // there is a trigger hit in the ReadOut
@@ -600,10 +506,9 @@ ubit16 MatrixReadOut::makeCMABodyTrg() {
 	 CHANNEL =(over_h|thresh_h);
 	 IJK=7;
 //
-//  	 DISP<<"MatrixReadOut: Now store Trigger_hit with: BCID= "
+//  	 cout<<"MatrixReadOut: Now store Trigger_hit with: BCID= "
 //  	     <<BC<<" TIME = "<<TIME
 //  	     <<" IJK = "<<IJK<<" CHANNEL = "<<CHANNEL<<endl;
-//       DISP_DEBUG;
 	 //
 	 CMABodyval[0] = 0;
 	 CMABodyval[1] = BC-m_BunchFrom;
@@ -616,12 +521,10 @@ ubit16 MatrixReadOut::makeCMABodyTrg() {
       }//end-of-if(highestthRO  
     }//end of for(int h 
 //
-//    DISP<<"     ** Exit from makeCMABodyTrg method **"<<endl<<endl;
-//    DISP_DEBUG;
+//    cout<<"     ** Exit from makeCMABodyTrg method **"<<endl<<endl;
 //
   } else {
-    DISP<<" MatrixReadOut::makeCMABodyTrg: m_CM class empty"<<endl;
-    DISP_ERROR;
+    throw std::runtime_error("MatrixReadOut::makeHeader: m_CM object does not exist");
   }//end-of-if(m_CM
   return numberOfHits;
 }//end-of-MatrixReadOut::makeCMABodyTrg
@@ -690,20 +593,17 @@ void MatrixReadOut::makeNewHit(ubit16 newHit,
 void MatrixReadOut::sortAndMakeNewHit(ubit16 newHit) {
   CMROData *p, *previous;//, *newElement;
   char field;
-  DISP<<" new Hit is "<<hex<<newHit<<dec<<endl;
-  DISP_DEBUG;
+  //cout<<" new Hit is "<<hex<<newHit<<dec<<endl;
   p          = m_Body;
   previous   = m_Body;
   //newElement = 0;
   m_MROS.decodeFragment(newHit,field);
-  DISP<<" IELD= "<<field<<endl;
-  DISP_DEBUG;
+  //cout<<" IELD= "<<field<<endl;
   const ubit16 hitBCID      = m_MROS.bcid();
   const ubit16 hitTIME      = m_MROS.time();
   const ubit16 hitIJK       = m_MROS.ijk();
   const ubit16 hitCHANNEL   = m_MROS.channel();
-  DISP<<" decode HIT "<<hitBCID<<" "<<hitTIME<<" "<<hitIJK<<" "<<hitCHANNEL<<endl;
-  DISP_DEBUG;
+  //cout<<" decode HIT "<<hitBCID<<" "<<hitTIME<<" "<<hitIJK<<" "<<hitCHANNEL<<endl;
   //
   do {
 
@@ -745,9 +645,8 @@ void MatrixReadOut::sortAndMakeNewHit(ubit16 newHit) {
 			    makeNewHit(newHit,previous,p);
 			    break;
 			  } else {
-			    DISP<<" duplicazione di hit??? "<<endl;
-			    DISP_ERROR;
-			    break; 
+			    throw std::runtime_error("duplicazione di hit???");
+			    break;
 			  }//end-of-if(hitCHANNEL 
 		      }//end-of-if(hitTIME
 		}//end-of-if(hitBCID
@@ -810,10 +709,9 @@ MatrixReadOutStructure MatrixReadOut::getCMAHit(int index) {
   MatrixReadOutStructure theStruct;
   ubit16 theHit;
   if((m_numberOfWordsInBody<=index)||(m_numberOfWordsInBody==0)){
-    DISP<<" getCMAHit: Wrong index given;"
-	<<" numberOfWordsInBody= "<<m_numberOfWordsInBody
-	<<" index = "<<index<<endl;
-    DISP_DEBUG;
+    //cout<<" getCMAHit: Wrong index given;"
+	//<<" numberOfWordsInBody= "<<m_numberOfWordsInBody
+	//<<" index = "<<index<<endl;
   } else {
 
     CMROData *p;
@@ -919,7 +817,7 @@ stream<<hex<<m_Footer<<dec<<endl;      // footer
 }//end-of-MatrixReadOut::bytestream
 //----------------------------------------------------------------------------//
 ubit16 MatrixReadOut::checkFragment() {
-//DISP<<" MatrixReadOut(ubit16 *pointer, ubit16 num) ";
+//cout<<" MatrixReadOut(ubit16 *pointer, ubit16 num) ";
 //    cout<<endl
 //    cout<<" check dump "<<endl
 //    std::cout<<" m_checkHeaderNum = "<<m_checkHeaderNum
@@ -930,7 +828,6 @@ ubit16 MatrixReadOut::checkFragment() {
 //        <<" CheckFooterPos = "<<m_checkFooterPos<<endl
 //    cout<<" CheckUnkown = "<<m_checkUnkown<<endl
 //    cout<<" Number of Words In Fragment = "<<m_numberOfWordsInFrag<<endl;
-//DISP_DEBUG;
   ubit16 output = 0;
   if(m_checkHeaderNum!=1 &&                   !(output&0x00000001)) output+=1;//=1
   if(m_checkHeaderPos>1 &&                    !(output&0x00000002)) output+=2;//=1 
@@ -949,7 +846,7 @@ ubit16 MatrixReadOut::checkCRC8(ubit16 foot) {
   return output;
 }//end-of-MatrixReadOut::checkCRC8()
 //----------------------------------------------------------------------------//
-ubit16 MatrixReadOut::checkBodyOrder() {
+ubit16 MatrixReadOut::checkBodyOrder(bool debugPrint) {
   CMROData *p, *pnext;
   char field;
   ubit16 currIJK, currBCID, currTIME, currCHANNEL;
@@ -1015,24 +912,20 @@ ubit16 MatrixReadOut::checkBodyOrder() {
       
       }//end-of-if(currIJK
       
-      if(outTemp>0){
-       DISP<<"checkBodyOrder output= "<<output<<" with "<< hex<<pnext->hit<<dec
-           <<endl;
-       DISP_DEBUG;
-      }//end-of-if(outTemp      
+      if(outTemp>0 && debugPrint){
+        cout<<"checkBodyOrder output= "<<output<<" with "<< hex<<pnext->hit<<dec<<endl;
+      }//end-of-if(outTemp
       outTemp=0;     
       
     } else {  // else of if(p->next
      
      if(currIJK==6) {
       output+=64;
-      DISP<<" CheckBodyOrder; IJK 6 exists but the related IJK 7 has been found "<<endl;
-      DISP_DEBUG;
+      if (debugPrint) cout<<" CheckBodyOrder; IJK 6 exists but the related IJK 7 has been found "<<endl;
      } else if(currIJK==7 && prevIJK!=6) {   // we are at the last m_CM hit; if this has IJK=7
       output+=128;                            // then the previous m_CM hit must have IJK=6
-      DISP<<" CheckBodyOrder; IJK 7 exists but the related IJK 6 has been found "<<endl;
-      DISP_DEBUG;
-     }    
+      if (debugPrint) cout<<" CheckBodyOrder; IJK 7 exists but the related IJK 6 has been found "<<endl;
+     }
        
     }//end-of-if(p->next   
     
@@ -1047,49 +940,6 @@ ubit16 MatrixReadOut::checkBodyOrder() {
   return output;
 }//end-of-checkBodyOrder
 //----------------------------------------------------------------------------//
-ubit16 MatrixReadOut::checkBodyOrderObsolete() {
-  CMROData *p, *pnext;
-  char field;
-  ubit16 currIJK, currBCID, currTIME, currCHANNEL;
-  ubit16 nextIJK, nextBCID, nextTIME, nextCHANNEL;
-  ubit16 output=0;
-  ubit16 outTemp=0;
-  p=m_Body;
-  while(p) {
-    pnext=p->next;
-    if(pnext) {
-      //      output=0;
-      m_MROS.decodeFragment(p->hit,field);
-      currIJK     = m_MROS.ijk();
-      currBCID    = m_MROS.bcid();
-      currTIME    = m_MROS.time();
-      currCHANNEL = m_MROS.channel();
-      m_MROS.decodeFragment(pnext->hit,field);
-      nextIJK     = m_MROS.ijk();
-      nextBCID    = m_MROS.bcid();
-      nextTIME    = m_MROS.time();
-      nextCHANNEL = m_MROS.channel();
-      //
-      if(nextIJK<currIJK)          {output+=1; outTemp=1;} else if(nextIJK==currIJK) {
-	if(nextBCID<currBCID)        {output+=2; outTemp=2;} else if(nextBCID==currBCID) {
-	  if(nextTIME<currTIME)        {output+=4; outTemp=4;} else if(nextTIME==currTIME) {
-	    if(nextCHANNEL<=currCHANNEL) {output+=8; outTemp=8;}
-          }
-        }
-      }
-
-      if(outTemp>0){
-       DISP<<"checkBodyOrder output= "<<output<<" with "<< hex<<pnext->hit<<dec
-           <<endl;
-       DISP_DEBUG;
-      }//end-of-if
-      outTemp=0;
-    }//end-of-if(p->next
-    p=p->next;
-  }//end-of-while(p)
-  return output;
-}//end-of-checkBodyOrderObsolete
-//----------------------------------------------------------------------------//
 void MatrixReadOut::setManager( ReadOutManager* boss ) {
   m_myBoss= boss;
   return;
@@ -1153,8 +1003,7 @@ for(ubit16 n=0; n<m_numberOfWordsInBody; n++) {
     sidemat=1; layer=1; stripaddress= CHANNEL;
     break;
    default:
-    DISP<<" IJK= "<<IJK<<" out of RANGE "<<endl;
-    DISP_ERROR;
+    throw std::runtime_error("MatrixReadOut::doMatrix: IJK= "+std::to_string(IJK)+" out of RANGE");
   }//end-of-switch
 //
 // estimate absolute time from CMA time
@@ -1182,9 +1031,8 @@ ubit16 cmid = MRS.cmid(); // m_CM Address (or identifier)
 ofstream vhdlinput;
 vhdlinput.open("vhdl.input",ios::app);
 if(!vhdlinput){
- DISP<<" File for vhdl analysis not opened. "<<endl
+ cout<<" File for vhdl analysis not opened. "<<endl
      <<" =================================="<<endl<<endl;
- DISP_ERROR;
  };
 //
 const ubit16 maxchan = 100;
diff --git a/Trigger/TrigT1/TrigT1RPChardware/src/PadReadOut.cxx b/Trigger/TrigT1/TrigT1RPChardware/src/PadReadOut.cxx
index 422aaf8c1a7..c46e603104a 100755
--- a/Trigger/TrigT1/TrigT1RPChardware/src/PadReadOut.cxx
+++ b/Trigger/TrigT1/TrigT1RPChardware/src/PadReadOut.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #include<fstream>
@@ -15,22 +15,13 @@ PadReadOut::PadReadOut(ubit16 padID, MatrixReadOut* MROlist[8])
                       : BaseObject(Hardware,"PadReadOut") {
 m_padID=padID;
 //
-DISP<<" WELCOME in PadReadOut: PadID= " << m_padID;
-DISP_DEBUG;
-//
 // copy MROlist pointers to m_MROlist
 //
 for(ubit16 i=0; i<8; i++) {m_MROlist[i]=MROlist[i];}
 reset();
 makeFragment();
-DISP<<" After makeFragment number of Words in PAD body ="
-    <<m_numberOfWordsInFragment;
-DISP_DEBUG;
+//cout<<" After makeFragment number of Words in PadID" << padID << " body =" << m_numberOfWordsInFragment<<endl;
 topPADBody();
-for(ubit16 i=0; i<m_numberOfWordsInFragment; i++) {
- DISP<<" output is "<<hex<<readPADWord()<<dec;
- DISP_DEBUG;
-}
 decodeBytestream();
 //
 }//end-of-PadReadOut::PadReadOut
@@ -72,8 +63,7 @@ headerval[1] = m_padID;
 headerval[2] = 0; // Status bits (to be defined yet)
 m_Header = m_PROS.makeHeader(headerval);
 m_numberOfWordsInFragment+=1;
-DISP<<" Header: "<<hex<<m_Header<<dec<<endl;
-DISP_DEBUG;
+//cout<<" Header: "<<hex<<m_Header<<dec<<endl;
 }//end-of-PadReadOut::makeHeader()
 //----------------------------------------------------------------------------//
 void PadReadOut::makeFooter() {
@@ -83,37 +73,30 @@ m_Footer = m_PROS.makeFooter(errorCodes);
 m_numberOfWordsInFragment+=1;
 }//end-of-PadReadOut::makeFooter()
 //----------------------------------------------------------------------------//
-void PadReadOut::makeBody() {
+void PadReadOut::makeBody(bool debugPrint) {
 MatrixReadOut *CMAFragment[8]={0};
 MatrixReadOutStructure MROS;
 ubit16 numberOfCMBodyWords=0;
 ubit16 i;
-DISP<<" makeBody "<<endl;
-DISP_DEBUG;
+if (debugPrint) cout <<" makeBody "<<endl;
 
 for(i=0; i<8; i++) {
  if(m_MROlist[i]) {
-  DISP<<m_MROlist[i]<<endl;
-  DISP_DEBUG;
+  if (debugPrint) cout<<m_MROlist[i]<<endl;
   MROS = m_MROlist[i]->getHeader();
   numberOfCMBodyWords=m_MROlist[i]->numberOfBodyWords();
   ubit16 cmid = MROS.cmid();
-  DISP<<" Identificatore di questa Matrice e': "<<cmid<<endl
-      <<"                    il numnero di Body words = "<<numberOfCMBodyWords;
-  DISP_DEBUG;
+  if (debugPrint) cout<<" Identificatore di questa Matrice e': "<<cmid<<endl
+      <<"                    il numnero di Body words = "<<numberOfCMBodyWords<<endl;
   if(cmid<8 ) {
    if(!CMAFragment[cmid]) {
     CMAFragment[cmid] = m_MROlist[i];
    } else {
-    DISP<<" PadReadOut::makeBody: more than one CMA with address "
-        <<cmid;
-    DISP_DEBUG;
+    if (debugPrint) cout<<" PadReadOut::makeBody: more than one CMA with address "<<cmid<<endl;
    }
-   DISP<<" Matrix: "<<hex<<m_MROlist[i]->readHeader()<<dec<<endl;
-   DISP_DEBUG;
+   if (debugPrint) cout<<" Matrix: "<<hex<<m_MROlist[i]->readHeader()<<dec<<endl;
   } else {
-   DISP<<" PadReadOut::makeBody: cmid address "<<cmid<<" is bad ";
-   DISP_DEBUG;
+   if (debugPrint) cout<<" PadReadOut::makeBody: cmid address "<<cmid<<" is bad "<<endl;
   }//end-of-if(cmid<8  
  }//end-of-if(m_MROlist
 }//end-of-while
@@ -124,16 +107,14 @@ ubit16 j=0;
 for(i=0; i<8; i++) {
  if(CMAFragment[i]) {
   m_CMAFragment[j]=CMAFragment[i];
-  DISP<<" makeBody; number of CM WOrds="
-      <<m_CMAFragment[j]->numberOfFragmentWords();
-  DISP_DEBUG;
+  if (debugPrint) cout<<" makeBody; number of CM WOrds="
+      <<m_CMAFragment[j]->numberOfFragmentWords()<<endl;
   m_numberOfWordsInFragment+=m_CMAFragment[j]->numberOfFragmentWords();
   j++;
  }//end-of-if(
 }//end-of-for(i
 m_numberOfCMFragments=j;
-DISP<<" Number of CMA Fragments= "<<m_numberOfCMFragments;
-DISP_DEBUG;
+if (debugPrint) cout<<" Number of CMA Fragments= "<<m_numberOfCMFragments<<endl;
 }//end-of-PadReadOut::makeBody
 //----------------------------------------------------------------------------//
 ubit16 PadReadOut::readHeader() {
@@ -147,12 +128,11 @@ ubit16 PadReadOut::readFooter() {
 ubit16 PadReadOut::readBody() {
 ubit16 output=0xffff;
 
-//DISP<<" m_newCMIndex "<<m_newCMIndex
+//cout<<" m_newCMIndex "<<m_newCMIndex
 //    <<" m_newCMRO "<<m_newCMRO
 //    <<" m_numberOfWordsInCMRO "<<m_numberOfWordsInCMRO
 //    <<" m_numberOfWordsRead "<<m_numberOfWordsRead
 //    <<" m_endOfCMFragments "<<m_endOfCMFragments<<endl;
-//DISP_DEBUG;
 
  if(m_newCMRO) {
  
@@ -206,15 +186,13 @@ ubit16 padHeaderfound=0;
 topPADBody();
 for(ubit16 i=0; i<m_numberOfWordsInFragment; i++) {
  inputData = readPADWord();
- DISP<<" bytestream: current word is "<<hex<<inputData<<dec;
- DISP_DEBUG;
- 
+ //cout<<" bytestream: current word is "<<hex<<inputData<<dec<<endl;
+
  if(!padHeaderfound) {
   PROS.decodeFragment(inputData,field);
   if(PROS.isHeader()) {
    padHeaderfound+=1;
-   DISP<<" decodeBytestream: PAD Header Found ";
-   DISP_DEBUG;
+   //cout<<" decodeBytestream: PAD Header Found"<<endl;
   }
  } else {
  }
diff --git a/Trigger/TrigT1/TrigT1RPChardware/src/RPCRODDecode.cxx b/Trigger/TrigT1/TrigT1RPChardware/src/RPCRODDecode.cxx
index 6b40f8e3cf1..ad3af26f204 100755
--- a/Trigger/TrigT1/TrigT1RPChardware/src/RPCRODDecode.cxx
+++ b/Trigger/TrigT1/TrigT1RPChardware/src/RPCRODDecode.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #include <iostream>
@@ -149,8 +149,7 @@ bool thereIsASL=false; // true if the data word is a SL footer
                        // that closes the SL fragment.
 char recField;         // record field
 if(m_enablePrintOut) {
-  DISP<<" RPCRODDecode; inword= "<<std::hex<<inword<<std::dec<<std::endl;
-  DISP_DEBUG;
+  std::cout<<" RPCRODDecode; inword= "<<std::hex<<inword<<std::dec<<std::endl;
 }
 //
 // recognize first the current word
@@ -167,11 +166,10 @@ if(SLROS.isHeader()) {
 //
 // SL Header
 //
-        if(m_enablePrintOut) {
-          DISP<<" RPCRODDecode: SectorLogic Header "<<std::endl;
-	  DISP_DEBUG;
+    if(m_enablePrintOut) {
+          std::cout<<" RPCRODDecode: SectorLogic Header "<<std::endl;
 	}
-        m_isSLBody=true;
+	m_isSLBody=true;
 	SLRO.reset();
 	SLRO.writeRecord(inword,false);
 	thereIsASL=false;
@@ -181,8 +179,7 @@ if(SLROS.isHeader()) {
 // SL Footer
 //
         if(m_enablePrintOut) {
-          DISP<<" RPCRODDecode: SectorLogic Footer "<<std::endl;
-	  DISP_DEBUG;
+          std::cout<<" RPCRODDecode: SectorLogic Footer "<<std::endl;
         }
         m_isSLBody=false;
 	thereIsASL=true;
@@ -193,8 +190,7 @@ if(SLROS.isHeader()) {
 // SL Body
 //
         if(m_enablePrintOut) {
-          DISP<<" RPCRODDecode: SectorLogic Body "<<std::endl;
-	  DISP_DEBUG;	
+          std::cout<<" RPCRODDecode: SectorLogic Body "<<std::endl;
         }
 	SLRO.writeRecord(inword,false);
 	thereIsASL=false;
@@ -205,9 +201,8 @@ if(SLROS.isHeader()) {
 // RX header
 //
         if(m_enablePrintOut) {
-          DISP<<" RPCRODDecode: RX Header "<<std::endl;
-	  DISP_DEBUG;
-        }	  
+          std::cout<<" RPCRODDecode: RX Header "<<std::endl;
+        }
 	m_RXFlag++;
 	RXROS.decodeFragment(inword,recField);
 	if(recField=='H') {
@@ -215,8 +210,7 @@ if(SLROS.isHeader()) {
 	}
 	thereIsACM=false;
 	if(m_enablePrintOut) {
-	  DISP<<" Sector ID = "<<SectorID<<std::endl;
-	  DISP_DEBUG;
+	  std::cout<<" Sector ID = "<<SectorID<<std::endl;
 	}
 	
 	switch(m_previousRecord){
@@ -224,8 +218,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CM SubHeader expected and RX Header found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CM SubHeader expected and RX Header found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -233,8 +226,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CM Body expected and and RX Header found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CM Body expected and and RX Header found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -242,8 +234,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMBod:
 	  if(m_enablePrintOut) {
-	   DISP<<" RPCRODDecode Fragment problem: CM Body or Footer expected and RX Header found"<<std::endl;
-	   DISP_DEBUG;
+	   std::cout<<" RPCRODDecode Fragment problem: CM Body or Footer expected and RX Header found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -251,38 +242,32 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CM Header or Pad Footer expected and RX Header found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CM Header or Pad Footer expected and RX Header found"<<std::endl;
 	  }
 	  break;
 	 case PadHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
-	    DISP_DEBUG;
-	  }  
+	    std::cout<<" RPCRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
+	  }
 	  break;
 	 case PadPre:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CMA fragment expected"<<std::endl;
-	    DISP_DEBUG;
-	  } 
+	    std::cout<<" RPCRODDecode Fragment problem: CMA fragment expected"<<std::endl;
+	  }
 	  break;
 	 case PadSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CMA Footer expected"<<std::endl;
-	    DISP_DEBUG;
-	  } 
+	    std::cout<<" RPCRODDecode Fragment problem: CMA Footer expected"<<std::endl;
+	  }
 	  break;
 	 case PadFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
-	    DISP_DEBUG;
-	  } 
+	    std::cout<<" RPCRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
+	  }
 	  break;
 	 default:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode ERROR in previousRecord "<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode ERROR in previousRecord "<<std::endl;
 	  }
 	}//end-of-switch 
 	m_previousRecord=Empty;	
@@ -292,9 +277,8 @@ if(SLROS.isHeader()) {
 //
 // RX footer
 //
-        if(m_enablePrintOut) {
-          DISP<<" RX footer "<<std::endl;
-	  DISP_DEBUG;
+    if(m_enablePrintOut) {
+      std::cout<<" RX footer "<<std::endl;
 	}
 	m_RXFlag--;
         RXROS.decodeFragment(inword,recField);
@@ -302,8 +286,7 @@ if(SLROS.isHeader()) {
 	}
 	thereIsACM=false;
 	if(m_enablePrintOut) {
-	  DISP<<" RPCRODDecode: Footer of Sector with ID = "<<SectorID<<std::endl;
-	  DISP_DEBUG;
+	  std::cout<<" RPCRODDecode: Footer of Sector with ID = "<<SectorID<<std::endl;
 	}
 	
 	switch(m_previousRecord){
@@ -311,8 +294,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CM SubHeader expected and RX Footer found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CM SubHeader expected and RX Footer found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -320,8 +302,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CM Body expected and RX Footer found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CM Body expected and RX Footer found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -329,8 +310,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMBod:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CM Body or Footer expected and and RX Footer found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CM Body or Footer expected and and RX Footer found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -338,38 +318,32 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CM Header or Pad Footer expected and RX Footer found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CM Header or Pad Footer expected and RX Footer found"<<std::endl;
 	  }
 	  break;
 	 case PadHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
 	  }
 	  break;
 	 case PadPre:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CMA fragment expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CMA fragment expected"<<std::endl;
 	  }
 	  break;
 	 case PadSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CMA Footer expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CMA Footer expected"<<std::endl;
 	  }
 	  break;
 	 case PadFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
 	  }
 	  break;
 	 default:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode ERROR in previousRecord "<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode ERROR in previousRecord "<<std::endl;
 	  }
 	}//end-of-switch 
 	m_previousRecord=Empty;
@@ -381,9 +355,8 @@ if(SLROS.isHeader()) {
 //
 // Pad header
 //
-        if(m_enablePrintOut) {
-          DISP<<" PAD Header "<<std::hex<<inword<<std::dec<<std::endl;
-	  DISP_DEBUG;
+    if(m_enablePrintOut) {
+      std::cout<<" PAD Header "<<std::hex<<inword<<std::dec<<std::endl;
 	}
 	m_PADFlag++;
 	PDROS.decodeFragment(inword,recField);
@@ -392,8 +365,7 @@ if(SLROS.isHeader()) {
 	}
 	thereIsACM=false;
 	if(m_enablePrintOut) {
-	  DISP<<" PAD "<<PadID<<" LVL1 "<<std::hex<<((inword & 0x0e00)>>8)<<std::dec<<std::endl;
-	  DISP_DEBUG;
+	  std::cout<<" PAD "<<PadID<<" LVL1 "<<std::hex<<((inword & 0x0e00)>>8)<<std::dec<<std::endl;
 	}
 	
 	switch(m_previousRecord){
@@ -401,8 +373,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CM SubHeader expected and not found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CM SubHeader expected and not found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -410,8 +381,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CM Body expected and not found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CM Body expected and not found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -419,8 +389,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMBod:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CM Body or Footer expected and not found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CM Body or Footer expected and not found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -430,32 +399,27 @@ if(SLROS.isHeader()) {
 	  break;
 	 case PadHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
 	  }
 	  break;
 	 case PadPre:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CMA fragment expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CMA fragment expected"<<std::endl;
 	  }
 	  break;
 	 case PadSub:
 	  if(m_enablePrintOut) {
-	   DISP<<" RPCRODDecode Fragment problem: CMA Footer expected"<<std::endl;
-	   DISP_DEBUG;
+	   std::cout<<" RPCRODDecode Fragment problem: CMA Footer expected"<<std::endl;
 	  }
 	  break;
 	 case PadFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
 	  }
 	  break;
 	 default:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode ERROR in previousRecord "<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode ERROR in previousRecord "<<std::endl;
 	  }
 	}//end-of-switch 
 	m_previousRecord=Empty;
@@ -466,17 +430,15 @@ if(SLROS.isHeader()) {
 //
 // Pad Subheader
 //
-        if(m_enablePrintOut) {
-	  DISP<<"   BCID "<<std::hex<<(inword & 0x0fff)<<std::dec<<std::endl;
-	  DISP_DEBUG;
+    if(m_enablePrintOut) {
+	  std::cout<<"   BCID "<<std::hex<<(inword & 0x0fff)<<std::dec<<std::endl;
 	}
 	switch(m_previousRecord){
 	 case Empty:
 	  break;
 	 case CMHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CM SubHeader expected and not found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CM SubHeader expected and not found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -484,8 +446,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CM Body expected and not found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CM Body expected and not found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -493,8 +454,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMBod:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CM Body or Footer expected and not found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CM Body or Footer expected and not found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -502,38 +462,32 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMFoot:
 	  if(m_enablePrintOut) {
-            DISP<<" RPCRODDecode Fragment problem: Pad Header expected and not found"<<std::endl;
-	    DISP_DEBUG;
-	  } 
+        std::cout<<" RPCRODDecode Fragment problem: Pad Header expected and not found"<<std::endl;
+	  }
 	  break;
 	 case PadHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
 	  }  
 	  break;
 	 case PadPre:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CMA fragment expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CMA fragment expected"<<std::endl;
 	  }
 	  break;
 	 case PadSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CMA Footer expected"<<std::endl;
-	    DISP_DEBUG;
-	  } 
+	    std::cout<<" RPCRODDecode Fragment problem: CMA Footer expected"<<std::endl;
+	  }
 	  break;
 	 case PadFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
-	    DISP_DEBUG;
-	  }  
+	    std::cout<<" RPCRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
+	  }
 	  break;
 	 default:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode ERROR in previousRecord "<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode ERROR in previousRecord "<<std::endl;
 	  }
 	}//end-of-switch 
 	m_previousRecord=Empty;
@@ -543,17 +497,15 @@ if(SLROS.isHeader()) {
 //
 // Pad PreFooter
 //
-        if(m_enablePrintOut) {
-	  DISP<<"   STATUS ERROR "<<std::hex<<(inword & 0x000f)<<std::dec<<std::endl;
-	  DISP_DEBUG;
+    if(m_enablePrintOut) {
+	  std::cout<<"   STATUS ERROR "<<std::hex<<(inword & 0x000f)<<std::dec<<std::endl;
 	}
 	switch(m_previousRecord){
 	 case Empty:
 	  break;
 	 case CMHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CM SubHeader expected and not found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CM SubHeader expected and not found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -561,8 +513,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMSub:
 	  if(m_enablePrintOut) {
-	   DISP<<" RPCRODDecode Fragment problem: CM Body expected and not found"<<std::endl;
-	   DISP_DEBUG;
+	   std::cout<<" RPCRODDecode Fragment problem: CM Body expected and not found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -570,8 +521,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMBod:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CM Body or Footer expected and not found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CM Body or Footer expected and not found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -581,32 +531,27 @@ if(SLROS.isHeader()) {
 	  break;
 	 case PadHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
 	  }
 	  break;
 	 case PadPre:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CMA fragment expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CMA fragment expected"<<std::endl;
 	  }
 	  break;
 	 case PadSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CMA Footer expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CMA Footer expected"<<std::endl;
 	  }
 	  break;
 	 case PadFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
 	  }
 	  break;
 	 default:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode ERROR in previousRecord "<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode ERROR in previousRecord "<<std::endl;
 	  }
 	}//end-of-switch 
 	m_previousRecord=PadPre;
@@ -616,19 +561,17 @@ if(SLROS.isHeader()) {
 //
 // Pad footer
 //
-        if(m_enablePrintOut) {
-          DISP<<" PAD Footer "<<std::hex<<inword<<std::dec
-	      <<"  ERROR FLAG "<<std::hex<<(inword & 0x0fff)<<std::dec<<std::endl;
-	  DISP_DEBUG;
-	}
+    if(m_enablePrintOut) {
+      std::cout<<" PAD Footer "<<std::hex<<inword<<std::dec
+               <<"  ERROR FLAG "<<std::hex<<(inword & 0x0fff)<<std::dec<<std::endl;
+    }
 	m_PADFlag--;
 	PDROS.decodeFragment(inword,recField);
 	if(recField=='F') {
 	}
 	thereIsACM=false;
 	if(m_enablePrintOut) {
-	  DISP<<" Footer of Pad with ID = "<<PadID<<std::endl;
-	  DISP_DEBUG;
+	  std::cout<<" Footer of Pad with ID = "<<PadID<<std::endl;
 	}
 	
 	switch(m_previousRecord){
@@ -636,8 +579,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CM SubHeader expected and not found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CM SubHeader expected and not found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -645,8 +587,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CM Body expected and not found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CM Body expected and not found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -654,8 +595,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMBod:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CM Body or Footer expected and not found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CM Body or Footer expected and not found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -663,34 +603,29 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: Pad PreFooter expected and not found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: Pad PreFooter expected and not found"<<std::endl;
 	  }
 	  break;
 	 case PadHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
 	  }
 	  break;
 	 case PadPre:
 	  break;
 	 case PadSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CMA Footer expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CMA Footer expected"<<std::endl;
 	  }
 	  break;
 	 case PadFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
 	  }
 	  break;
 	 default:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode ERROR in previousRecord "<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode ERROR in previousRecord "<<std::endl;
 	  }
 	}//end-of-switch 
 	m_previousRecord=Empty;
@@ -710,48 +645,41 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode warning: CM SubHeader expected and CM Header found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode warning: CM SubHeader expected and CM Header found"<<std::endl;
 	  }
 	  break;
 	 case CMSub:
 	  break;
 	 case CMBod:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode warning: CM Body or CM Footer expected and CM Header found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode warning: CM Body or CM Footer expected and CM Header found"<<std::endl;
 	  }
 	  break;
 	 case CMFoot:
 	  break;
 	 case PadHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
 	  }
 	  break;
 	 case PadPre:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CMA fragment expected"<<std::endl;
-	    DISP_DEBUG;
-	  } 
+	    std::cout<<" RPCRODDecode Fragment problem: CMA fragment expected"<<std::endl;
+	  }
 	  break;
 	 case PadSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CMA Footer expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CMA Footer expected"<<std::endl;
 	  }
 	  break;
 	 case PadFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
 	  }
 	  break;
 	 default:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode ERROR in previousRecord "<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode ERROR in previousRecord "<<std::endl;
 	  }
 	}//end-of-switch 
 	m_previousRecord=CMHead;
@@ -769,58 +697,49 @@ if(SLROS.isHeader()) {
 	switch(m_previousRecord){
 	 case Empty:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode warning: previous record was not a CM Header"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode warning: previous record was not a CM Header"<<std::endl;
 	  }
 	  break;
 	 case CMHead:
 	  break;
 	 case CMSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode warning: CM Body expected and CM SubHeader found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode warning: CM Body expected and CM SubHeader found"<<std::endl;
 	  }
 	  break;
 	 case CMBod:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode warning: CM Body or CM Footer expected; CM SubHeader found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode warning: CM Body or CM Footer expected; CM SubHeader found"<<std::endl;
 	  }
 	  break;
 	 case CMFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode warning: CM Header or Pad Footer expected; CM SubHeader found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode warning: CM Header or Pad Footer expected; CM SubHeader found"<<std::endl;
 	  }
 	  break;
 	 case PadHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
 	  }
 	  break;
 	 case PadPre:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CMA fragment expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CMA fragment expected"<<std::endl;
 	  }
 	  break;
 	 case PadSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CMA Footer expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CMA Footer expected"<<std::endl;
 	  }
 	  break;
 	 case PadFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
 	  }
 	  break;
 	 default:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode ERROR in previousRecord "<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode ERROR in previousRecord "<<std::endl;
 	  }
 	}//end-of-switch 
 	m_previousRecord=CMSub;
@@ -835,16 +754,14 @@ if(SLROS.isHeader()) {
 	switch(m_previousRecord){
 	 case Empty:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode (CMBody1) warning: previous record was not a CM subHeader"
+	    std::cout<<" RPCRODDecode (CMBody1) warning: previous record was not a CM subHeader"
 	        <<" or CM Body Record "<<std::endl;
-	    DISP_DEBUG;
 	  }
 	  break;
 	 case CMHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode (CMBody2) warning: previous record was not a CM subHeader"
+	    std::cout<<" RPCRODDecode (CMBody2) warning: previous record was not a CM subHeader"
 	        <<" or CM Body Record "<<std::endl;
-	    DISP_DEBUG;
 	  }
 	  break;
 	 case CMSub:
@@ -853,39 +770,33 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode (CMBody3) warning: previous record was not a CM subHeader"
+	    std::cout<<" RPCRODDecode (CMBody3) warning: previous record was not a CM subHeader"
 	             <<" or CM Body Record "<<std::endl;
-	    DISP_DEBUG;
 	  }
 	  break;
 	 case PadHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
 	  }
 	  break;
 	 case PadPre:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CMA fragment expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CMA fragment expected"<<std::endl;
 	  }
 	  break;
 	 case PadSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CMA Footer expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CMA Footer expected"<<std::endl;
 	  }
 	  break;
 	 case PadFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
 	  }
 	  break;
 	 default:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode ERROR in previousRecord="<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode ERROR in previousRecord="<<std::endl;
 	  }
 	}//end-of-switch 
 	m_previousRecord=CMBod;
@@ -904,58 +815,49 @@ if(SLROS.isHeader()) {
 	switch(m_previousRecord){
 	case Empty:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode (CMFooter1) warning: previous record was not a Body record "<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode (CMFooter1) warning: previous record was not a Body record "<<std::endl;
 	  }
 	  break;
 	 case CMHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode (CMFooter2) warning: previous record was not a Body record"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode (CMFooter2) warning: previous record was not a Body record"<<std::endl;
 	  }
 	  break;
 	 case CMSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode warning: previous record was not a Body record"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode warning: previous record was not a Body record"<<std::endl;
 	  }
 	  break;
 	 case CMBod:
 	  break;
 	 case CMFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode (CMFooter3) warning: previous record was not a Body record"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode (CMFooter3) warning: previous record was not a Body record"<<std::endl;
 	  }
 	  break;
 	 case PadHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
 	  }
 	  break;
 	 case PadPre:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CMA fragment expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CMA fragment expected"<<std::endl;
 	  }
 	  break;
 	 case PadSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CMA Footer expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CMA Footer expected"<<std::endl;
 	  }
 	  break;
 	 case PadFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
 	  }
 	  break;
 	 default:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode ERROR in previousRecord"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode ERROR in previousRecord"<<std::endl;
 	  }
 	}//end-of-switch 
 	m_previousRecord=CMFoot;
@@ -970,8 +872,7 @@ if(SLROS.isHeader()) {
 //	  
 	thereIsACM=false; 
 	if(m_enablePrintOut) { 
-          DISP<<" (reserved) "<<std::endl;
-	  DISP_DEBUG;
+          std::cout<<" (reserved) "<<std::endl;
 	}
 	
 	switch(m_previousRecord){
@@ -979,8 +880,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMHead:
 	  if(m_enablePrintOut) { 
-	    DISP<<" RPCRODDecode Fragment problem: CM SubHeader expected and (reserved) found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CM SubHeader expected and (reserved) found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -988,8 +888,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMSub:
 	  if(m_enablePrintOut) { 
-	    DISP<<" RPCRODDecode Fragment problem: CM Body expected and (reserved) found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CM Body expected and (reserved) found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -997,8 +896,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMBod:
 	  if(m_enablePrintOut) { 
-	    DISP<<" RPCRODDecode Fragment problem: CM Body or Footer expected and (reserved) found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CM Body or Footer expected and (reserved) found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -1006,38 +904,32 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMFoot:
 	  if(m_enablePrintOut) { 
-	    DISP<<" RPCRODDecode Fragment problem: CM Header or Pad Footer expected and (reserved) found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CM Header or Pad Footer expected and (reserved) found"<<std::endl;
 	  }
 	  break;
 	 case PadHead:
 	  if(m_enablePrintOut) { 
-	    DISP<<" RPCRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
 	  }
 	  break;
 	 case PadPre:
 	  if(m_enablePrintOut) { 
-	    DISP<<" RPCRODDecode Fragment problem: CMA fragment expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CMA fragment expected"<<std::endl;
 	  }
 	  break;
 	 case PadSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: CMA Footer expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: CMA Footer expected"<<std::endl;
 	  }
 	  break;
 	 case PadFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
 	  }
 	  break;
 	 default:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRODDecode ERROR in previousRecord "<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRODDecode ERROR in previousRecord "<<std::endl;
 	  }
 	}//end-of-switch 
 	m_previousRecord=Empty;
@@ -1054,28 +946,25 @@ MatrixReadOutStructure CMROS;
 ubit16 nCMROData=CMRO.numberOfBodyWords();
 
 if(m_enablePrintOut) {
-  DISP<<" number of Body Words in this CM Fragment "<<nCMROData<<std::endl;
-  DISP_DEBUG;
-  
+  std::cout<<" number of Body Words in this CM Fragment "<<nCMROData<<std::endl;
+
 //
 // get header data
 //
   CMROS = CMRO.getHeader();
 
-  DISP<<" gimeCMROData,   CMID: "<<CMROS.cmid()<<std::endl
-      <<" gimeCMROData, FEL1ID: "<<CMROS.fel1id()<<std::endl
-      <<" isLowPt  = "<<CMROS.isLowPt()<<std::endl
-      <<" isEtaProj= "<<CMROS.isEtaProj()<<std::endl
-      <<" is0LocAdd= "<<CMROS.is0LocAdd()<<std::endl;
-  DISP_DEBUG;
+  std::cout<<" gimeCMROData,   CMID: "<<CMROS.cmid()<<std::endl
+           <<" gimeCMROData, FEL1ID: "<<CMROS.fel1id()<<std::endl
+           <<" isLowPt  = "<<CMROS.isLowPt()<<std::endl
+           <<" isEtaProj= "<<CMROS.isEtaProj()<<std::endl
+           <<" is0LocAdd= "<<CMROS.is0LocAdd()<<std::endl;
 
 //
 // get subheader data
 //
   CMROS = CMRO.getSubHeader();
 
-  DISP<<" gimeCMROData, FEBCID: "<<CMROS.febcid()<<std::endl;
-  DISP_DEBUG;
+  std::cout<<" gimeCMROData, FEBCID: "<<CMROS.febcid()<<std::endl;
 
 //
 // get Body data
@@ -1084,24 +973,19 @@ if(m_enablePrintOut) {
    CMROS = CMRO.getCMAHit(i);
    ubit16 ijk = CMROS.ijk();
           if(ijk<6)  {
-     DISP<<" gimeCMROData, hit chan: "<<CMROS.channel()
-         <<" gimeCMROData, hit stri: "<<CMROS.global_channel()
-         <<" hit BCID: "<<CMROS.bcid();
-     DISP_DEBUG;
+     std::cout<<" gimeCMROData, hit chan: "<<CMROS.channel()
+              <<" gimeCMROData, hit stri: "<<CMROS.global_channel()
+              <<" hit BCID: "<<CMROS.bcid()<<std::endl;
    } else if(ijk==6) {
-     DISP<<" gimeCMROData, trg chan: "<<CMROS.channel()
-         <<" hit BCID: "<<CMROS.bcid();
-     DISP_DEBUG;
+     std::cout<<" gimeCMROData, trg chan: "<<CMROS.channel()
+              <<" hit BCID: "<<CMROS.bcid()<<std::endl;
    } else if(ijk==7) {
-    DISP<<" gimeCMROData, trg thr: "<<CMROS.threshold()
-        <<" trg ovl: "<<CMROS.overlap();
-    DISP_DEBUG;
+    std::cout<<" gimeCMROData, trg thr: "<<CMROS.threshold()
+             <<" trg ovl: "<<CMROS.overlap()<<std::endl;
    } else {
-    DISP<<" this value of ijk="<<ijk<<" is NOT ALLOWED "<<std::endl;
-    DISP_DEBUG;
+    std::cout<<" this value of ijk="<<ijk<<" is NOT ALLOWED "<<std::endl;
    }//end-of-if
-   DISP<<std::endl;
-   DISP_DEBUG;
+   std::cout<<std::endl;
   }//end-of-for
 }//end-of-if(m_enablePrintOut
 }//end-of-gimeCMROData
@@ -1173,7 +1057,7 @@ if(statusBlockPosition) {
 //----------------------------------------------------------------------------//
 void RPCRODDecode::RODHeaderDisplay() {
 if(m_enablePrintOut) {
-  DISP<<"*****************************************************"<<std::endl
+  std::cout<<"*****************************************************"<<std::endl
       <<"******         R O D    H E A D E R           *******"<<std::endl
       <<"*****************************************************"<<std::endl
       <<" ROD Header marker:               "<<std::hex<<headerMarker<<std::dec<<std::endl
@@ -1189,6 +1073,5 @@ if(m_enablePrintOut) {
       <<" ROD Level1 Type:                 "<<Level1Type<<std::endl
       <<" ROD Detector Ev. Type:           "<<DetectorEventType<<std::endl
       <<"*****************************************************"<<std::endl;
-  DISP_DEBUG;
 }//end-of-if(m_enablePrintOut
 }//end-of-RODHeaderDisplay
diff --git a/Trigger/TrigT1/TrigT1RPChardware/src/RPCRXRODDecode.cxx b/Trigger/TrigT1/TrigT1RPChardware/src/RPCRXRODDecode.cxx
index 523040db861..9d1981c3b0a 100755
--- a/Trigger/TrigT1/TrigT1RPChardware/src/RPCRXRODDecode.cxx
+++ b/Trigger/TrigT1/TrigT1RPChardware/src/RPCRXRODDecode.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #include <iostream>
@@ -150,8 +150,7 @@ bool thereIsASL=false; // true if the data word is a SL footer
                        // that closes the SL fragment.
 char recField;         // record field
 if(m_enablePrintOut) {
-  DISP<<" RPCRXRODDecode; inword= "<<std::hex<<inword<<std::dec<<std::endl;
-  DISP_DEBUG;
+  std::cout<<" RPCRXRODDecode; inword= "<<std::hex<<inword<<std::dec<<std::endl;
 }
 //
 // recognize first the current word
@@ -169,8 +168,7 @@ if(SLROS.isHeader()) {
 // SL Header
 //
         if(m_enablePrintOut) {
-          DISP<<" RPCRXRODDecode: SectorLogic Header "<<std::endl;
-	  DISP_DEBUG;
+          std::cout<<" RPCRXRODDecode: SectorLogic Header "<<std::endl;
 	}
         m_isSLBody=false;
 	SLRO.reset();
@@ -183,8 +181,7 @@ if(SLROS.isHeader()) {
 // SL Header
 //
         if(m_enablePrintOut) {
-          DISP<<" RPCRXRODDecode: SectorLogic SubHeader "<<std::endl;
-	  DISP_DEBUG;
+          std::cout<<" RPCRXRODDecode: SectorLogic SubHeader "<<std::endl;
 	}
         m_isSLBody=true;
 	SLRO.writeRecord(inword,false);
@@ -194,8 +191,7 @@ if(SLROS.isHeader()) {
 // SL Footer
 //
         if(m_enablePrintOut) {
-          DISP<<" RPCRXRODDecode: SectorLogic Footer "<<std::endl;
-	  DISP_DEBUG;
+          std::cout<<" RPCRXRODDecode: SectorLogic Footer "<<std::endl;
         }
         m_isSLBody=false;
 	thereIsASL=true;
@@ -208,8 +204,7 @@ if(SLROS.isHeader()) {
 // SL Body
 //
         if(m_enablePrintOut) {
-          DISP<<" RPCRXRODDecode: SectorLogic Body "<<std::endl;
-	  DISP_DEBUG;	
+          std::cout<<" RPCRXRODDecode: SectorLogic Body "<<std::endl;
         }
 	SLRO.writeRecord(inword,false);
 	thereIsASL=false;
@@ -220,8 +215,7 @@ if(SLROS.isHeader()) {
 // RX header
 //
         if(m_enablePrintOut) {
-          DISP<<" RPCRXRODDecode: RX Header "<<std::endl;
-	  DISP_DEBUG;
+          std::cout<<" RPCRXRODDecode: RX Header "<<std::endl;
         }	  
 	m_RXFlag++;
 	RXROS.decodeFragment(inword,recField);
@@ -230,8 +224,7 @@ if(SLROS.isHeader()) {
 	}
 	thereIsACM=false;
 	if(m_enablePrintOut) {
-	  DISP<<" Sector ID = "<<SectorID<<std::endl;
-	  DISP_DEBUG;
+	  std::cout<<" Sector ID = "<<SectorID<<std::endl;
 	}
 	
 	switch(m_previousRecord){
@@ -239,8 +232,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CM SubHeader expected and RX Header found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CM SubHeader expected and RX Header found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -248,8 +240,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CM Body expected and and RX Header found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CM Body expected and and RX Header found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -257,8 +248,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMBod:
 	  if(m_enablePrintOut) {
-	   DISP<<" RPCRXRODDecode Fragment problem: CM Body or Footer expected and RX Header found"<<std::endl;
-	   DISP_DEBUG;
+	   std::cout<<" RPCRXRODDecode Fragment problem: CM Body or Footer expected and RX Header found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -266,38 +256,32 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CM Header or Pad Footer expected and RX Header found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CM Header or Pad Footer expected and RX Header found"<<std::endl;
 	  }
 	  break;
 	 case PadHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
 	  }  
 	  break;
 	 case PadPre:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CMA fragment expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CMA fragment expected"<<std::endl;
 	  } 
 	  break;
 	 case PadSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CMA Footer expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CMA Footer expected"<<std::endl;
 	  } 
 	  break;
 	 case PadFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
 	  } 
 	  break;
 	 default:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode ERROR in previousRecord "<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode ERROR in previousRecord "<<std::endl;
 	  }
 	}//end-of-switch 
 	m_previousRecord=Empty;	
@@ -308,8 +292,7 @@ if(SLROS.isHeader()) {
 // RX footer
 //
         if(m_enablePrintOut) {
-          DISP<<" RX footer "<<std::endl;
-	  DISP_DEBUG;
+          std::cout<<" RX footer "<<std::endl;
 	}
 	m_RXFlag--;
         RXROS.decodeFragment(inword,recField);
@@ -317,8 +300,7 @@ if(SLROS.isHeader()) {
 	}
 	thereIsACM=false;
 	if(m_enablePrintOut) {
-	  DISP<<" RPCRXRODDecode: Footer of Sector with ID = "<<SectorID<<std::endl;
-	  DISP_DEBUG;
+	  std::cout<<" RPCRXRODDecode: Footer of Sector with ID = "<<SectorID<<std::endl;
 	}
 	
 	switch(m_previousRecord){
@@ -326,8 +308,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CM SubHeader expected and RX Footer found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CM SubHeader expected and RX Footer found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -335,8 +316,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CM Body expected and RX Footer found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CM Body expected and RX Footer found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -344,8 +324,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMBod:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CM Body or Footer expected and and RX Footer found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CM Body or Footer expected and and RX Footer found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -353,38 +332,32 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CM Header or Pad Footer expected and RX Footer found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CM Header or Pad Footer expected and RX Footer found"<<std::endl;
 	  }
 	  break;
 	 case PadHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
 	  }
 	  break;
 	 case PadPre:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CMA fragment expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CMA fragment expected"<<std::endl;
 	  }
 	  break;
 	 case PadSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CMA Footer expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CMA Footer expected"<<std::endl;
 	  }
 	  break;
 	 case PadFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
 	  }
 	  break;
 	 default:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode ERROR in previousRecord "<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode ERROR in previousRecord "<<std::endl;
 	  }
 	}//end-of-switch 
 	m_previousRecord=Empty;
@@ -397,8 +370,7 @@ if(SLROS.isHeader()) {
 // Pad header
 //
         if(m_enablePrintOut) {
-          DISP<<" PAD Header "<<std::hex<<inword<<std::dec<<std::endl;
-	  DISP_DEBUG;
+          std::cout<<" PAD Header "<<std::hex<<inword<<std::dec<<std::endl;
 	}
 	m_PADFlag++;
 	PDROS.decodeFragment(inword,recField);
@@ -407,8 +379,7 @@ if(SLROS.isHeader()) {
 	}
 	thereIsACM=false;
 	if(m_enablePrintOut) {
-	  DISP<<" PAD "<<PadID<<" LVL1 "<<std::hex<<((inword & 0x0e00)>>8)<<std::dec<<std::endl;
-	  DISP_DEBUG;
+	  std::cout<<" PAD "<<PadID<<" LVL1 "<<std::hex<<((inword & 0x0e00)>>8)<<std::dec<<std::endl;
 	}
 	
 	switch(m_previousRecord){
@@ -416,8 +387,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CM SubHeader expected and not found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CM SubHeader expected and not found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -425,8 +395,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CM Body expected and not found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CM Body expected and not found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -434,8 +403,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMBod:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CM Body or Footer expected and not found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CM Body or Footer expected and not found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -445,32 +413,27 @@ if(SLROS.isHeader()) {
 	  break;
 	 case PadHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
 	  }
 	  break;
 	 case PadPre:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CMA fragment expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CMA fragment expected"<<std::endl;
 	  }
 	  break;
 	 case PadSub:
 	  if(m_enablePrintOut) {
-	   DISP<<" RPCRXRODDecode Fragment problem: CMA Footer expected"<<std::endl;
-	   DISP_DEBUG;
+	   std::cout<<" RPCRXRODDecode Fragment problem: CMA Footer expected"<<std::endl;
 	  }
 	  break;
 	 case PadFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
 	  }
 	  break;
 	 default:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode ERROR in previousRecord "<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode ERROR in previousRecord "<<std::endl;
 	  }
 	}//end-of-switch 
 	m_previousRecord=Empty;
@@ -482,16 +445,14 @@ if(SLROS.isHeader()) {
 // Pad Subheader
 //
         if(m_enablePrintOut) {
-	  DISP<<"   BCID "<<std::hex<<(inword & 0x0fff)<<std::dec<<std::endl;
-	  DISP_DEBUG;
+	  std::cout<<"   BCID "<<std::hex<<(inword & 0x0fff)<<std::dec<<std::endl;
 	}
 	switch(m_previousRecord){
 	 case Empty:
 	  break;
 	 case CMHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CM SubHeader expected and not found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CM SubHeader expected and not found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -499,8 +460,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CM Body expected and not found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CM Body expected and not found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -508,8 +468,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMBod:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CM Body or Footer expected and not found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CM Body or Footer expected and not found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -517,38 +476,32 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMFoot:
 	  if(m_enablePrintOut) {
-            DISP<<" RPCRXRODDecode Fragment problem: Pad Header expected and not found"<<std::endl;
-	    DISP_DEBUG;
+            std::cout<<" RPCRXRODDecode Fragment problem: Pad Header expected and not found"<<std::endl;
 	  } 
 	  break;
 	 case PadHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
 	  }  
 	  break;
 	 case PadPre:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CMA fragment expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CMA fragment expected"<<std::endl;
 	  }
 	  break;
 	 case PadSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CMA Footer expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CMA Footer expected"<<std::endl;
 	  } 
 	  break;
 	 case PadFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
 	  }  
 	  break;
 	 default:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode ERROR in previousRecord "<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode ERROR in previousRecord "<<std::endl;
 	  }
 	}//end-of-switch 
 	m_previousRecord=Empty;
@@ -559,16 +512,14 @@ if(SLROS.isHeader()) {
 // Pad PreFooter
 //
         if(m_enablePrintOut) {
-	  DISP<<"   STATUS ERROR "<<std::hex<<(inword & 0x000f)<<std::dec<<std::endl;
-	  DISP_DEBUG;
+	  std::cout<<"   STATUS ERROR "<<std::hex<<(inword & 0x000f)<<std::dec<<std::endl;
 	}
 	switch(m_previousRecord){
 	 case Empty:
 	  break;
 	 case CMHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CM SubHeader expected and not found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CM SubHeader expected and not found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -576,8 +527,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMSub:
 	  if(m_enablePrintOut) {
-	   DISP<<" RPCRXRODDecode Fragment problem: CM Body expected and not found"<<std::endl;
-	   DISP_DEBUG;
+	   std::cout<<" RPCRXRODDecode Fragment problem: CM Body expected and not found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -585,8 +535,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMBod:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CM Body or Footer expected and not found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CM Body or Footer expected and not found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -596,32 +545,27 @@ if(SLROS.isHeader()) {
 	  break;
 	 case PadHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
 	  }
 	  break;
 	 case PadPre:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CMA fragment expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CMA fragment expected"<<std::endl;
 	  }
 	  break;
 	 case PadSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CMA Footer expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CMA Footer expected"<<std::endl;
 	  }
 	  break;
 	 case PadFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
 	  }
 	  break;
 	 default:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode ERROR in previousRecord "<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode ERROR in previousRecord "<<std::endl;
 	  }
 	}//end-of-switch 
 	m_previousRecord=PadPre;
@@ -632,9 +576,8 @@ if(SLROS.isHeader()) {
 // Pad footer
 //
         if(m_enablePrintOut) {
-          DISP<<" PAD Footer "<<std::hex<<inword<<std::dec
+          std::cout<<" PAD Footer "<<std::hex<<inword<<std::dec
 	      <<"  ERROR FLAG "<<std::hex<<(inword & 0x0fff)<<std::dec<<std::endl;
-	  DISP_DEBUG;
 	}
 	m_PADFlag--;
 	PDROS.decodeFragment(inword,recField);
@@ -642,8 +585,7 @@ if(SLROS.isHeader()) {
 	}
 	thereIsACM=false;
 	if(m_enablePrintOut) {
-	  DISP<<" Footer of Pad with ID = "<<PadID<<std::endl;
-	  DISP_DEBUG;
+	  std::cout<<" Footer of Pad with ID = "<<PadID<<std::endl;
 	}
 	
 	switch(m_previousRecord){
@@ -651,8 +593,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CM SubHeader expected and not found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CM SubHeader expected and not found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -660,8 +601,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CM Body expected and not found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CM Body expected and not found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -669,8 +609,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMBod:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CM Body or Footer expected and not found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CM Body or Footer expected and not found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -678,34 +617,29 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: Pad PreFooter expected and not found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: Pad PreFooter expected and not found"<<std::endl;
 	  }
 	  break;
 	 case PadHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
 	  }
 	  break;
 	 case PadPre:
 	  break;
 	 case PadSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CMA Footer expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CMA Footer expected"<<std::endl;
 	  }
 	  break;
 	 case PadFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
 	  }
 	  break;
 	 default:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode ERROR in previousRecord "<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode ERROR in previousRecord "<<std::endl;
 	  }
 	}//end-of-switch 
 	m_previousRecord=Empty;
@@ -725,48 +659,41 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode warning: CM SubHeader expected and CM Header found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode warning: CM SubHeader expected and CM Header found"<<std::endl;
 	  }
 	  break;
 	 case CMSub:
 	  break;
 	 case CMBod:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode warning: CM Body or CM Footer expected and CM Header found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode warning: CM Body or CM Footer expected and CM Header found"<<std::endl;
 	  }
 	  break;
 	 case CMFoot:
 	  break;
 	 case PadHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
 	  }
 	  break;
 	 case PadPre:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CMA fragment expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CMA fragment expected"<<std::endl;
 	  } 
 	  break;
 	 case PadSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CMA Footer expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CMA Footer expected"<<std::endl;
 	  }
 	  break;
 	 case PadFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
 	  }
 	  break;
 	 default:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode ERROR in previousRecord "<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode ERROR in previousRecord "<<std::endl;
 	  }
 	}//end-of-switch 
 	m_previousRecord=CMHead;
@@ -784,58 +711,49 @@ if(SLROS.isHeader()) {
 	switch(m_previousRecord){
 	 case Empty:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode warning: previous record was not a CM Header"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode warning: previous record was not a CM Header"<<std::endl;
 	  }
 	  break;
 	 case CMHead:
 	  break;
 	 case CMSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode warning: CM Body expected and CM SubHeader found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode warning: CM Body expected and CM SubHeader found"<<std::endl;
 	  }
 	  break;
 	 case CMBod:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode warning: CM Body or CM Footer expected; CM SubHeader found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode warning: CM Body or CM Footer expected; CM SubHeader found"<<std::endl;
 	  }
 	  break;
 	 case CMFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode warning: CM Header or Pad Footer expected; CM SubHeader found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode warning: CM Header or Pad Footer expected; CM SubHeader found"<<std::endl;
 	  }
 	  break;
 	 case PadHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
 	  }
 	  break;
 	 case PadPre:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CMA fragment expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CMA fragment expected"<<std::endl;
 	  }
 	  break;
 	 case PadSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CMA Footer expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CMA Footer expected"<<std::endl;
 	  }
 	  break;
 	 case PadFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
 	  }
 	  break;
 	 default:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode ERROR in previousRecord "<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode ERROR in previousRecord "<<std::endl;
 	  }
 	}//end-of-switch 
 	m_previousRecord=CMSub;
@@ -850,16 +768,14 @@ if(SLROS.isHeader()) {
 	switch(m_previousRecord){
 	 case Empty:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode (CMBody1) warning: previous record was not a CM subHeader"
+	    std::cout<<" RPCRXRODDecode (CMBody1) warning: previous record was not a CM subHeader"
 	        <<" or CM Body Record "<<std::endl;
-	    DISP_DEBUG;
 	  }
 	  break;
 	 case CMHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode (CMBody2) warning: previous record was not a CM subHeader"
+	    std::cout<<" RPCRXRODDecode (CMBody2) warning: previous record was not a CM subHeader"
 	        <<" or CM Body Record "<<std::endl;
-	    DISP_DEBUG;
 	  }
 	  break;
 	 case CMSub:
@@ -868,39 +784,33 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode (CMBody3) warning: previous record was not a CM subHeader"
+	    std::cout<<" RPCRXRODDecode (CMBody3) warning: previous record was not a CM subHeader"
 	             <<" or CM Body Record "<<std::endl;
-	    DISP_DEBUG;
 	  }
 	  break;
 	 case PadHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
 	  }
 	  break;
 	 case PadPre:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CMA fragment expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CMA fragment expected"<<std::endl;
 	  }
 	  break;
 	 case PadSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CMA Footer expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CMA Footer expected"<<std::endl;
 	  }
 	  break;
 	 case PadFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
 	  }
 	  break;
 	 default:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode ERROR in previousRecord="<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode ERROR in previousRecord="<<std::endl;
 	  }
 	}//end-of-switch 
 	m_previousRecord=CMBod;
@@ -919,58 +829,49 @@ if(SLROS.isHeader()) {
 	switch(m_previousRecord){
 	case Empty:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode (CMFooter1) warning: previous record was not a Body record "<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode (CMFooter1) warning: previous record was not a Body record "<<std::endl;
 	  }
 	  break;
 	 case CMHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode (CMFooter2) warning: previous record was not a Body record"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode (CMFooter2) warning: previous record was not a Body record"<<std::endl;
 	  }
 	  break;
 	 case CMSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode warning: previous record was not a Body record"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode warning: previous record was not a Body record"<<std::endl;
 	  }
 	  break;
 	 case CMBod:
 	  break;
 	 case CMFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode (CMFooter3) warning: previous record was not a Body record"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode (CMFooter3) warning: previous record was not a Body record"<<std::endl;
 	  }
 	  break;
 	 case PadHead:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
 	  }
 	  break;
 	 case PadPre:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CMA fragment expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CMA fragment expected"<<std::endl;
 	  }
 	  break;
 	 case PadSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CMA Footer expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CMA Footer expected"<<std::endl;
 	  }
 	  break;
 	 case PadFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
 	  }
 	  break;
 	 default:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode ERROR in previousRecord"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode ERROR in previousRecord"<<std::endl;
 	  }
 	}//end-of-switch 
 	m_previousRecord=CMFoot;
@@ -985,8 +886,7 @@ if(SLROS.isHeader()) {
 //	  
 	thereIsACM=false; 
 	if(m_enablePrintOut) { 
-          DISP<<" (reserved) "<<std::endl;
-	  DISP_DEBUG;
+          std::cout<<" (reserved) "<<std::endl;
 	}
 	
 	switch(m_previousRecord){
@@ -994,8 +894,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMHead:
 	  if(m_enablePrintOut) { 
-	    DISP<<" RPCRXRODDecode Fragment problem: CM SubHeader expected and (reserved) found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CM SubHeader expected and (reserved) found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -1003,8 +902,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMSub:
 	  if(m_enablePrintOut) { 
-	    DISP<<" RPCRXRODDecode Fragment problem: CM Body expected and (reserved) found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CM Body expected and (reserved) found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -1012,8 +910,7 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMBod:
 	  if(m_enablePrintOut) { 
-	    DISP<<" RPCRXRODDecode Fragment problem: CM Body or Footer expected and (reserved) found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CM Body or Footer expected and (reserved) found"<<std::endl;
 	  }
 	  thereIsACM=true; // close this matrix fragment
 	  CMRO.writeRecord(inword,true);
@@ -1021,38 +918,32 @@ if(SLROS.isHeader()) {
 	  break;
 	 case CMFoot:
 	  if(m_enablePrintOut) { 
-	    DISP<<" RPCRXRODDecode Fragment problem: CM Header or Pad Footer expected and (reserved) found"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CM Header or Pad Footer expected and (reserved) found"<<std::endl;
 	  }
 	  break;
 	 case PadHead:
 	  if(m_enablePrintOut) { 
-	    DISP<<" RPCRXRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: PadSubHeader expected"<<std::endl;
 	  }
 	  break;
 	 case PadPre:
 	  if(m_enablePrintOut) { 
-	    DISP<<" RPCRXRODDecode Fragment problem: CMA fragment expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CMA fragment expected"<<std::endl;
 	  }
 	  break;
 	 case PadSub:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: CMA Footer expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: CMA Footer expected"<<std::endl;
 	  }
 	  break;
 	 case PadFoot:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode Fragment problem: Pad PreFooter expected"<<std::endl;
 	  }
 	  break;
 	 default:
 	  if(m_enablePrintOut) {
-	    DISP<<" RPCRXRODDecode ERROR in previousRecord "<<std::endl;
-	    DISP_DEBUG;
+	    std::cout<<" RPCRXRODDecode ERROR in previousRecord "<<std::endl;
 	  }
 	}//end-of-switch 
 	m_previousRecord=Empty;
@@ -1069,28 +960,25 @@ MatrixReadOutStructure CMROS;
 ubit16 nCMROData=CMRO.numberOfBodyWords();
 
 if(m_enablePrintOut) {
-  DISP<<" number of Body Words in this CM Fragment "<<nCMROData<<std::endl;
-  DISP_DEBUG;
+  std::cout<<" number of Body Words in this CM Fragment "<<nCMROData<<std::endl;
   
 //
 // get header data
 //
   CMROS = CMRO.getHeader();
 
-  DISP<<" gimeCMROData,   CMID: "<<CMROS.cmid()<<std::endl
+  std::cout<<" gimeCMROData,   CMID: "<<CMROS.cmid()<<std::endl
       <<" gimeCMROData, FEL1ID: "<<CMROS.fel1id()<<std::endl
       <<" isLowPt  = "<<CMROS.isLowPt()<<std::endl
       <<" isEtaProj= "<<CMROS.isEtaProj()<<std::endl
       <<" is0LocAdd= "<<CMROS.is0LocAdd()<<std::endl;
-  DISP_DEBUG;
 
 //
 // get subheader data
 //
   CMROS = CMRO.getSubHeader();
 
-  DISP<<" gimeCMROData, FEBCID: "<<CMROS.febcid()<<std::endl;
-  DISP_DEBUG;
+  std::cout<<" gimeCMROData, FEBCID: "<<CMROS.febcid()<<std::endl;
 
 //
 // get Body data
@@ -1099,24 +987,19 @@ if(m_enablePrintOut) {
    CMROS = CMRO.getCMAHit(i);
    ubit16 ijk = CMROS.ijk();
           if(ijk<6)  {
-     DISP<<" gimeCMROData, hit chan: "<<CMROS.channel()
+     std::cout<<" gimeCMROData, hit chan: "<<CMROS.channel()
          <<" gimeCMROData, hit stri: "<<CMROS.global_channel()
-         <<" hit BCID: "<<CMROS.bcid();
-     DISP_DEBUG;
+         <<" hit BCID: "<<CMROS.bcid()<<std::endl;
    } else if(ijk==6) {
-     DISP<<" gimeCMROData, trg chan: "<<CMROS.channel()
-         <<" hit BCID: "<<CMROS.bcid();
-     DISP_DEBUG;
+     std::cout<<" gimeCMROData, trg chan: "<<CMROS.channel()
+         <<" hit BCID: "<<CMROS.bcid()<<std::endl;
    } else if(ijk==7) {
-    DISP<<" gimeCMROData, trg thr: "<<CMROS.threshold()
-        <<" trg ovl: "<<CMROS.overlap();
-    DISP_DEBUG;
+    std::cout<<" gimeCMROData, trg thr: "<<CMROS.threshold()
+        <<" trg ovl: "<<CMROS.overlap()<<std::endl;
    } else {
-    DISP<<" this value of ijk="<<ijk<<" is NOT ALLOWED "<<std::endl;
-    DISP_DEBUG;
+    std::cout<<" this value of ijk="<<ijk<<" is NOT ALLOWED "<<std::endl;
    }//end-of-if
-   DISP<<std::endl;
-   DISP_DEBUG;
+   std::cout<<std::endl;
   }//end-of-for
 }//end-of-if(m_enablePrintOut
 }//end-of-gimeCMROData
@@ -1188,7 +1071,8 @@ if(statusBlockPosition) {
 //----------------------------------------------------------------------------//
 void RPCRXRODDecode::RODHeaderDisplay() {
 if(m_enablePrintOut) {
-  DISP<<"*****************************************************"<<std::endl
+  std::cout
+      <<"*****************************************************"<<std::endl
       <<"******         R O D    H E A D E R           *******"<<std::endl
       <<"*****************************************************"<<std::endl
       <<" ROD Header marker:               "<<std::hex<<headerMarker<<std::dec<<std::endl
@@ -1204,6 +1088,5 @@ if(m_enablePrintOut) {
       <<" ROD Level1 Type:                 "<<Level1Type<<std::endl
       <<" ROD Detector Ev. Type:           "<<DetectorEventType<<std::endl
       <<"*****************************************************"<<std::endl;
-  DISP_DEBUG;
 }//end-of-if(m_enablePrintOut
 }//end-of-RODHeaderDisplay
diff --git a/Trigger/TrigT1/TrigT1RPChardware/src/SectorL.cxx b/Trigger/TrigT1/TrigT1RPChardware/src/SectorL.cxx
index 25d97eb629b..3c9ad5258e3 100755
--- a/Trigger/TrigT1/TrigT1RPChardware/src/SectorL.cxx
+++ b/Trigger/TrigT1/TrigT1RPChardware/src/SectorL.cxx
@@ -1,10 +1,11 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #include<fstream>
 #include <iostream>
 #include <cmath>
+#include <stdexcept>
 #include "TrigT1RPChardware/Matrix.h"
 #include "TrigT1RPChardware/Pad.h"
 #include "TrigT1RPChardware/SectorL.h"
@@ -67,8 +68,7 @@ if( padAdd<10 && RoIAdd<4 && pT<7 && OPL<2 && overlapPhi<2 &&
  m_sectorInput[BX][m_numOfPads[BX]][7]=BCIDcounter;
  m_numOfPads[BX]++;
 } else {
-DISP<<" problems loading Pad Output Data "<<endl;
-DISP_ERROR;
+ throw std::out_of_range("problems loading Pad Output Data");
 }
 }//end-of-SectorL::load
 //-------------------------------------------------------------------//
@@ -82,9 +82,8 @@ for(i=0; i<m_nBunMax; i++) {
  for(j=0; j<m_numOfPads[i]; j++) {
   if(m_sectorInput[i][j][2]) m_numberOfRoIs[i]++;
 //  if(m_sectorInput[i][j][2]) {
-//   DISP<<" Bunch "<<i<<" PadInd "<<j<<" PT "<<m_sectorInput[i][j][2]
+//   cout<<" Bunch "<<i<<" PadInd "<<j<<" PT "<<m_sectorInput[i][j][2]
 //       <<endl;
-//   DISP_DEBUG;
 //  }//end-of-if(m_sectorInput[i][j][2]
   for(k=0; k<2; k++) {
    if(m_sectorInput[i][j][2]>m_pTArray[i][k][0]) {
@@ -96,12 +95,11 @@ for(i=0; i<m_nBunMax; i++) {
 }//end-of-for(i
 //
 //for(i=0; i<m_nBunMax; i++) {
-// DISP<<" pTArray[0] pT= "<<m_pTArray[i][0][0]
+// cout<<" pTArray[0] pT= "<<m_pTArray[i][0][0]
 //     <<" padInd= "<<m_pTArray[i][0][1]<<endl
 //     <<" pTArray[1] pT= "<<m_pTArray[i][1][0]
 //     <<" padInd= "<<m_pTArray[i][1][1]<<endl
 //     <<" number of RoIs= "<<m_numberOfRoIs[i]<<endl;
-// DISP_DEBUG;
 //}
 //
 // now fill the output buffer
@@ -140,7 +138,7 @@ for(i=0; i<m_nBunMax; i++) {
  if(!m_sectorOut[i][3]) m_sectorOut[i][3]=7;
  if(!m_sectorOut[i][4]) m_sectorOut[i][4]=7;
 
-// DISP<<" Bunch ID "<<i<<endl
+// cout<<" Bunch ID "<<i<<endl
 //     <<" >2 Candidates in a sector "<<m_sectorOut[i][0]<<endl
 //     <<" ROI 1 "<<m_sectorOut[i][1]<<endl
 //     <<" ROI 2 "<<m_sectorOut[i][2]<<endl
@@ -151,7 +149,6 @@ for(i=0; i<m_nBunMax; i++) {
 //     <<" BCID counter "<<m_sectorOut[i][7]<<endl
 //     <<" Candidate1 sign "<<m_sectorOut[i][8]<<endl
 //     <<" Candidate2 sign "<<m_sectorOut[i][9]<<endl;
-// DISP_DEBUG;
 //
 // now fille the Sector Logic Output word
 // 
diff --git a/Trigger/TrigT1/TrigT1RPChardware/src/SectorLogic.cxx b/Trigger/TrigT1/TrigT1RPChardware/src/SectorLogic.cxx
index 700831f5eae..d37efcabe39 100755
--- a/Trigger/TrigT1/TrigT1RPChardware/src/SectorLogic.cxx
+++ b/Trigger/TrigT1/TrigT1RPChardware/src/SectorLogic.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 //****************************************************************************//
@@ -243,9 +243,7 @@ CMAword  SectorLogic::outputToMuCTPI(int deltaBC) {
         ubit16 bxsafe = (ubit16)bunchID;
         return  output(bxsafe);
     } else {
-        DISP << "warning : bunchID out of range, " << bunchID ;
-        DISP_WARNING;
-        return 0;
+        throw std::out_of_range("SectorLogic::outputToMuCTPI: bunchID out of range: "+std::to_string(bunchID));
     }
 }
 
@@ -256,8 +254,7 @@ CMAword SectorLogic::outputToMuCTPI(ubit16 bunchID) {
   if( bunchID <= m_nBunMax-1 ) {
     bxsafe=bunchID;
   } else {
-      DISP << "warning : bunchID out of range, set to default value" << bxsafe ;
-    DISP_WARNING;
+    cout << "warning : bunchID out of range, set to default value" << bxsafe << endl;
   }
   return output(bxsafe);
 }
@@ -275,7 +272,7 @@ void SectorLogic::check(void) {
 
   for(bcid=0;bcid<=m_nBunMax-1;bcid++) {
 
-    DISP << "LowPtFilter_in BCID is " << m_LowPtFilter_in[bcid].out.bcid << endl
+    cout << "LowPtFilter_in BCID is " << m_LowPtFilter_in[bcid].out.bcid << endl
          << "LowPtFilter_out BCID is " << m_LowPtFilter_out[bcid].out.bcid << endl
 
          << "TileCalConfirm_in BCID is " << m_TileCalConfirm_in[bcid].out.bcid << endl
@@ -289,8 +286,6 @@ void SectorLogic::check(void) {
 
          << "Sort2ndHighest_in BCID is " << m_Sort2ndHighest_in[bcid].out.bcid << endl
          << "Sort2ndHighest_out BCID is " << m_Sort2ndHighest_out[bcid].out.bcid << endl;
-     DISP_DEBUG;
-
   }
 
 }
@@ -352,9 +347,8 @@ void SectorLogic::load(ubit16 padAdd, ubit16 BX, ubit16 RoIAdd, ubit16 pT,
   m_InFromTileCal[BX]=0xff;
 
   /*
-  DISP << "input from pad : BC = " << BX << " padAdd = " << padAdd
-       << " pT = "<<  pT << " roi = " << RoIAdd << " bcid = " << BCIDcounter;
-  DISP_DEBUG;
+  cout << "input from pad : BC = " << BX << " padAdd = " << padAdd
+       << " pT = "<<  pT << " roi = " << RoIAdd << " bcid = " << BCIDcounter << endl;
   */
 }
 //****************************************************************************//
@@ -506,9 +500,10 @@ void SectorLogic::execute(){
     int k1=0;
     for(k1=0;k1<=7;k1++) {
       if( m_SolveEtaOverlap_out[ibx].pad[k1].oveta &&  m_SolveEtaOverlap_out[ibx].pad[k1].pt==0 ) {
-	DISP << "warning :\n"
-	     << "pad # " << k1 << " bcid # " << ibx << " has eta overlap flag on but no triggered track\n";
-	DISP_DEBUG;
+        if (m_debug) {
+          std::cout << "pad # " << k1 << " bcid # " << ibx <<
+            " has eta overlap flag on but no triggered track" << std::endl;
+        }
       }
     }
     // run the overlap resolution algorithm on EVEN and then on ODD pads
@@ -533,9 +528,10 @@ void SectorLogic::execute(){
 	      }
 	    }
 	    else {
-	      DISP << "warning :\n"
-		   << "pads " << k3 << " and " << k3+1 << " have eta overlap flags on with wrong RoIs\n";
-	      DISP_DEBUG;
+          if (m_debug) {
+            std::cout << "pads " << k3 << " and " << k3+1 <<
+              " have eta overlap flags on with wrong RoIs" << std::endl;
+          }
 	    }
 	  }
 	}
diff --git a/Trigger/TrigT1/TrigT1RPChardware/src/SectorLogicReadOut.cxx b/Trigger/TrigT1/TrigT1RPChardware/src/SectorLogicReadOut.cxx
index 136c5351306..b42ca9f62ab 100755
--- a/Trigger/TrigT1/TrigT1RPChardware/src/SectorLogicReadOut.cxx
+++ b/Trigger/TrigT1/TrigT1RPChardware/src/SectorLogicReadOut.cxx
@@ -1,11 +1,12 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #include<fstream>
 #include<iostream>
 #include<iomanip>
 #include<cstring>
+#include<stdexcept>
 #include "TrigT1RPChardware/SectorLogicReadOut.h"
 #include "MuonCablingTools/BaseObject.h"
 
@@ -202,11 +203,8 @@ RODword SectorLogicReadOut::getCounter32(ubit16 index){
   if(index<s_numberOfDecodedCounters) {
     return m_counter32[index];
   } else {
-   DISP<<" getCounter32: index= "<<index<<" is larger than "<<s_numberOfDecodedCounters<<std::endl;
-   DISP_ERROR;
-   DISP<<" getCounter32: ... return 0 value"<<std::endl;
-   DISP_ERROR;
-   return 0;
+    throw std::out_of_range("SectorLogicReadout::getCounter32: index=" + std::to_string(index) +
+                            " is larger than " + std::to_string(s_numberOfDecodedCounters));
   }
 }
 //----------------------------------------------------------------------------//
@@ -220,10 +218,8 @@ float SectorLogicReadOut::padTriggerRate(ubit16 padAddress){
    return convertToTriggerRate
           * (float (m_counter32[padAddress*2+1])/float (m_counter32[padAddress*2+0]));
   } else {
-    DISP<<" padTrigger: input padAddress= "<<padAddress<<" is not possible; "
-        <<" return -1 value "<<std::endl;
-    DISP_ERROR;
-    return -1.0;
+    throw std::out_of_range("SectorLogicReadout::padTrigger: input padAddress=" +
+                            std::to_string(padAddress) + " is not possible");
   }
 }
 //----------------------------------------------------------------------------//
@@ -241,10 +237,7 @@ ubit16 SectorLogicReadOut::cmadd(ubit16 indexLink, ubit16 indexGate) {
   if(indexLink<s_nLinks && indexGate<s_nGates) {
    return (m_hit[indexLink][indexGate]   ) & 0x3;
   } else {
-    DISP<<" cmid: indexLink or indexGate is not possible "
-        <<" return 0 value "<<std::endl;
-    DISP_ERROR;
-    return 0;
+    throw std::out_of_range("SectorLogicReadout::cmid: indexLink or indexGate out of range");
   }
 }//end-of-SectorLogicReadOut::cmid(ubit16 indexLink, ubit16 indexGate)
 //----------------------------------------------------------------------------//
@@ -253,10 +246,7 @@ ubit16 SectorLogicReadOut::ptid(ubit16 indexLink, ubit16 indexGate) {
   if(indexLink<s_nLinks && indexGate<s_nGates) {
    return (m_hit[indexLink][indexGate]>>2) & 0x7;
   } else {
-    DISP<<" ptid: indexLink or indexGate is not possible "
-        <<" return 0 value "<<std::endl;
-    DISP_ERROR;
-    return 0;
+    throw std::out_of_range("SectorLogicReadout::ptid: indexLink or indexGate out of range");
   }
 }//end-of-SectorLogicReadOut::ptid(ubit16 indexLink, ubit16 indexGate)
 //----------------------------------------------------------------------------//
@@ -265,10 +255,7 @@ ubit16 SectorLogicReadOut::opl(ubit16 indexLink, ubit16 indexGate) {
   if(indexLink<s_nLinks && indexGate<s_nGates) {
    return (m_hit[indexLink][indexGate]>>5) & 0x1;
   } else {
-    DISP<<" opl : indexLink or indexGate is not possible "
-        <<" return 0 value "<<std::endl;
-    DISP_ERROR;
-    return 0;
+    throw std::out_of_range("SectorLogicReadout::opl: indexLink or indexGate out of range");
   }
 }//end-of-SectorLogicReadOut::opl(ubit16 indexLink, ubit16 indexGate)
 //----------------------------------------------------------------------------//
@@ -277,10 +264,7 @@ ubit16 SectorLogicReadOut::ovphi(ubit16 indexLink, ubit16 indexGate) {
   if(indexLink<s_nLinks && indexGate<s_nGates) {
    return (m_hit[indexLink][indexGate]>>6) & 0x1;
   } else {
-    DISP<<" ovphi: indexLink or indexGate is not possible "
-        <<" return 0 value "<<std::endl;
-    DISP_ERROR;
-    return 0;
+    throw std::out_of_range("SectorLogicReadout::ovphi: indexLink or indexGate out of range");
   }
 }//end-of-SectorLogicReadOut::ovphi(ubit16 indexLink, ubit16 indexGate)
 //----------------------------------------------------------------------------//
@@ -289,10 +273,7 @@ ubit16 SectorLogicReadOut::oveta(ubit16 indexLink, ubit16 indexGate) {
   if(indexLink<s_nLinks && indexGate<s_nGates) {
    return (m_hit[indexLink][indexGate]>>7) & 0x1;
   } else {
-    DISP<<" oveta: indexLink or indexGate is not possible "
-        <<" return 0 value "<<std::endl;
-    DISP_ERROR;
-    return 0;
+    throw std::out_of_range("SectorLogicReadout::oveta: indexLink or indexGate out of range");
   }
 }//end-of-SectorLogicReadOut::oveta(ubit16 indexLink, ubit16 indexGate)
 //----------------------------------------------------------------------------//
@@ -301,10 +282,7 @@ ubit16 SectorLogicReadOut::res(ubit16 indexLink, ubit16 indexGate) {
   if(indexLink<s_nLinks && indexGate<s_nGates) {
    return (m_hit[indexLink][indexGate]>>8) & 0x1;
   } else {
-    DISP<<" res : indexLink or indexGate is not possible "
-        <<" return 0 value "<<std::endl;
-    DISP_ERROR;
-    return 0;
+    throw std::out_of_range("SectorLogicReadout::res : indexLink or indexGate out of range");
   }
 }//end-of-SectorLogicReadOut::res(ubit16 indexLink, ubit16 indexGate)
 //----------------------------------------------------------------------------//
@@ -313,10 +291,7 @@ ubit16 SectorLogicReadOut::bcid(ubit16 indexLink, ubit16 indexGate) {
   if(indexLink<s_nLinks && indexGate<s_nGates) {
    return (m_hit[indexLink][indexGate]>>9) & 0x7;
   } else {
-    DISP<<" bcid: indexLink or indexGate is not possible "
-        <<" return 0 value "<<std::endl;
-    DISP_ERROR;
-    return 0;
+    throw std::out_of_range("SectorLogicReadout::bcid: indexLink or indexGate out of range");
   }
 }//end-of-SectorLogicReadOut::bcid(ubit16 indexLink, ubit16 indexGate)
 //----------------------------------------------------------------------------//
diff --git a/Trigger/TrigT1/TrigT1RPClogic/CMakeLists.txt b/Trigger/TrigT1/TrigT1RPClogic/CMakeLists.txt
index 303257b5751..327faeb00a0 100644
--- a/Trigger/TrigT1/TrigT1RPClogic/CMakeLists.txt
+++ b/Trigger/TrigT1/TrigT1RPClogic/CMakeLists.txt
@@ -7,4 +7,4 @@ atlas_subdir( TrigT1RPClogic )
 atlas_add_library( TrigT1RPClogicLib
                    src/*.cxx
                    PUBLIC_HEADERS TrigT1RPClogic
-                   LINK_LIBRARIES MuonCablingTools RPC_CondCablingLib TrigT1RPChardwareLib )
+                   LINK_LIBRARIES MuonCablingTools GaudiKernel RPC_CondCablingLib TrigT1RPChardwareLib )
diff --git a/Trigger/TrigT1/TrigT1RPClogic/TrigT1RPClogic/RPCbytestream.h b/Trigger/TrigT1/TrigT1RPClogic/TrigT1RPClogic/RPCbytestream.h
index 45163364c14..8354ffb682b 100755
--- a/Trigger/TrigT1/TrigT1RPClogic/TrigT1RPClogic/RPCbytestream.h
+++ b/Trigger/TrigT1/TrigT1RPClogic/TrigT1RPClogic/RPCbytestream.h
@@ -1,7 +1,7 @@
 /* // -*- C++ -*- */
 
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 
@@ -14,6 +14,7 @@
 #include "TrigT1RPClogic/CMAreadout.h"
 #include "TrigT1RPClogic/PADreadout.h"
 
+#include "GaudiKernel/MsgStream.h"
 
 class RPCbytestream : public RPCtrigDataObject
 {
@@ -38,13 +39,12 @@ class RPCbytestream : public RPCtrigDataObject
     CMA_Readout m_cma_readout;
     PAD_Readout m_pad_readout;
 
-    void build_pad_readout(void);
-
+    void build_pad_readout(MsgStream& log);
     void dump_rpc_bytestream(void);
 
     public:
-    RPCbytestream(CMAdata&,std::string,debu,debu,debu,debu,debu,debu,debu,
-                  debu);
+    RPCbytestream(CMAdata&,std::string,MsgStream&,
+                  debu,debu,debu,debu,debu,debu,debu,debu);
     RPCbytestream(const RPCbytestream&);
     ~RPCbytestream();
 
@@ -64,5 +64,4 @@ class RPCbytestream : public RPCtrigDataObject
     PAD_Readout pad_readout(void) const {return m_pad_readout;}
 };
 
-
 #endif
diff --git a/Trigger/TrigT1/TrigT1RPClogic/src/RPCbytestream.cxx b/Trigger/TrigT1/TrigT1RPClogic/src/RPCbytestream.cxx
index 8557e3aa7df..4fe63864d30 100755
--- a/Trigger/TrigT1/TrigT1RPClogic/src/RPCbytestream.cxx
+++ b/Trigger/TrigT1/TrigT1RPClogic/src/RPCbytestream.cxx
@@ -1,7 +1,7 @@
 /* // -*- C++ -*- */
 
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 
@@ -10,7 +10,7 @@
 
 using namespace std;
 
-RPCbytestream::RPCbytestream(CMAdata& data,std::string filename,
+RPCbytestream::RPCbytestream(CMAdata& data,std::string filename,MsgStream& log,
                              debu cma_debug,debu pad_debug,debu rx_debug,
                              debu sl_debug,debu cma_struc_debug,
                              debu pad_struc_debug,debu rx_struc_debug,
@@ -40,17 +40,16 @@ RPCbytestream::RPCbytestream(CMAdata& data,std::string filename,
         m_cma_readout.insert(CMA_Readout::value_type(key,CMAreadout(*it)));
         if(!ins.second)
 	{
-	    DISP << "Found duplicate CMA readout into CMA data!";
-            DISP_ERROR;
+        log << MSG::ERROR << "Found duplicate CMA readout into CMA data!" << endmsg;
 	}
 
 	++it;
     }
 
-    build_pad_readout();
+    build_pad_readout(log);
     if(m_filename != "" ) dump_rpc_bytestream();
 }
-    
+
 RPCbytestream::RPCbytestream(const RPCbytestream& readout) :
     RPCtrigDataObject(readout.number(),readout.name())
 {
@@ -76,7 +75,7 @@ RPCbytestream::~RPCbytestream()
 
 
 void
-RPCbytestream::build_pad_readout()
+RPCbytestream::build_pad_readout(MsgStream& log)
 {
     for (int i=0;i<64;++i)
     {
@@ -98,8 +97,7 @@ RPCbytestream::build_pad_readout()
 					
                 if(SLid != i)
 	        {
-                    DISP << "Key doesn't correspond to CMA Sector Id!";
-		    DISP_ERROR;
+                log << MSG::ERROR << "Key doesn't correspond to CMA Sector Id!" << endmsg;
 	        }
 
                 for (CMA_Readout::iterator it = PAD_l; it != PAD_h; ++it)
@@ -107,19 +105,19 @@ RPCbytestream::build_pad_readout()
                     MatrixReadOut** cma_readout = 
                                             (*it).second.give_matrix_readout();
                     pad_readout.load_readout(cma_readout);
-                    DISP << "Dump of the matrices readout into PAD " << PADid
-			 << endl
-                         << cma_readout[0]
-                         << cma_readout[1];
-		    DISP_DEBUG;
+                    if (log.level() <= MSG::DEBUG) {
+                        log << MSG::DEBUG << "Dump of the matrices readout into PAD " << PADid
+                             << endl
+                             << cma_readout[0]
+                             << cma_readout[1] << endmsg;
+                    }
 	        }
 
                 std::pair < PAD_Readout::iterator, bool> ins = 
                 m_pad_readout.insert(PAD_Readout::value_type(key,pad_readout));
                 if(!ins.second)
 	        {
-	            DISP << "Found duplicate PAD readout into CMA data!";
-                    DISP_ERROR;
+	            log << MSG::ERROR << "Found duplicate PAD readout into CMA data!" << endmsg;
 	        }
 	    }
         }
diff --git a/Trigger/TrigT1/TrigT1RPClogic/src/SLpatterns.cxx b/Trigger/TrigT1/TrigT1RPClogic/src/SLpatterns.cxx
index 18572df63b4..7c980cd0e54 100755
--- a/Trigger/TrigT1/TrigT1RPClogic/src/SLpatterns.cxx
+++ b/Trigger/TrigT1/TrigT1RPClogic/src/SLpatterns.cxx
@@ -1,7 +1,7 @@
 /* // -*- C++ -*- */
 
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 
diff --git a/Trigger/TrigT1/TrigT1RPCsteering/src/TrigT1RPC.cxx b/Trigger/TrigT1/TrigT1RPCsteering/src/TrigT1RPC.cxx
index 7dd98625e60..778620e1c47 100755
--- a/Trigger/TrigT1/TrigT1RPCsteering/src/TrigT1RPC.cxx
+++ b/Trigger/TrigT1/TrigT1RPCsteering/src/TrigT1RPC.cxx
@@ -20,6 +20,7 @@
 
 #include <algorithm>
 #include <cmath>
+#include <stdexcept>
 
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
@@ -125,9 +126,14 @@ StatusCode TrigT1RPC::execute() {
       int logic_sector  = sector%32;//
 
       for (int dbc=m_firstBC_to_MUCTPI; dbc<=m_lastBC_to_MUCTPI; dbc++){
-          
-          unsigned int data_word = logic->outputToMuCTPI(dbc);
-          
+
+          unsigned int data_word = 0;
+          try {
+              data_word = logic->outputToMuCTPI(dbc);
+          }
+          catch (const std::out_of_range& ex) {
+              ATH_MSG_WARNING(ex.what());
+          }
           ATH_MSG_DEBUG(                                               //
               "Input to MuCTPI: side=" << subsystem                    //
               << ", SL= " << logic_sector                                 //
@@ -177,7 +183,8 @@ StatusCode TrigT1RPC::execute() {
   if(m_bytestream_production)
   {
       RPCbytestream bytestream (patterns,
-			       (std::string) m_bytestream_file,
+                               (std::string) m_bytestream_file,
+                               msg(),
                                (unsigned long int) m_cma_ro_debug,
                                (unsigned long int) m_pad_ro_debug,
                                (unsigned long int) m_rx_ro_debug,
-- 
GitLab