diff --git a/AtlasTest/TestTools/share/post.sh b/AtlasTest/TestTools/share/post.sh
index 426541c251fab90da542179244f694ef2ae84d60..71a10cc92ea5a60e7bdd75111b239c210ee59734 100755
--- a/AtlasTest/TestTools/share/post.sh
+++ b/AtlasTest/TestTools/share/post.sh
@@ -164,6 +164,7 @@ PP="$PP"'|servers found for host'
 PP="$PP"'|^(Sun|Mon|Tue|Wed|Thu|Fri|Sat) '
 PP="$PP"'|INFO Database being retired|^Domain.*INFO'
 PP="$PP"'|SZ='
+PP="$PP"'|using job opts'
 
 # Outputs dependent on whether or not a file catalog already exists.
 PP="$PP"'|XMLFileCatalog|File is not in Catalog|Failed to open container to check POOL collection|Open     DbSession|Access   DbDomain|Access   DbDatabase|^RootDatabase.open|Deaccess DbDatabase'
diff --git a/AtlasTest/TestTools/src/initGaudi.cxx b/AtlasTest/TestTools/src/initGaudi.cxx
index bc58fa6ee8e5600ae084da3b7e9943cbb10ca1d1..630e662261a4057465082c8eda4c2bd35efcb555 100644
--- a/AtlasTest/TestTools/src/initGaudi.cxx
+++ b/AtlasTest/TestTools/src/initGaudi.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /***************************************************************************
@@ -33,6 +33,23 @@ namespace Athena_test {
     string jobOptsPath = jobOptsFile;
     if (access (jobOptsPath.c_str(), R_OK) != 0)
       jobOptsPath = "../share/"+jobOptsFile;
+    if (access (jobOptsPath.c_str(), R_OK) != 0) {
+      const char* jopath = getenv ("JOBOPTSEARCHPATH");
+      if (jopath) {
+        char* savepath = new char[strlen(jopath)+1];
+        strcpy (savepath, jopath);
+        char* saveptr = nullptr;
+        char* str = savepath;
+        while (char* tok = strtok_r (str, ":", &saveptr)) {
+          str = nullptr;
+          jobOptsPath = std::string(tok) + "/" + jobOptsFile;
+          if (access (jobOptsPath.c_str(), R_OK) == 0) {
+            break;
+          }
+        }
+        delete [] savepath;
+      }
+    }
     bool noJobOpts(jobOptsFile.empty());
     if (!noJobOpts) {
       cout << "\n\nInitializing Gaudi ApplicationMgr using job opts " << jobOptsPath << endl;
diff --git a/Calorimeter/CaloCnv/CaloJiveXML/CaloJiveXML/BadLArRetriever.h b/Calorimeter/CaloCnv/CaloJiveXML/CaloJiveXML/BadLArRetriever.h
index 66e9a46fc55155c23430356f74fef9cddf2a04fa..d2b37ef42b1c511043d3ffccf1458177e15241b8 100644
--- a/Calorimeter/CaloCnv/CaloJiveXML/CaloJiveXML/BadLArRetriever.h
+++ b/Calorimeter/CaloCnv/CaloJiveXML/CaloJiveXML/BadLArRetriever.h
@@ -19,7 +19,6 @@
 
 class IToolSvc;
 
-class CaloIdManager;
 class Identifier;
 class CaloCellContainer;
 
@@ -64,7 +63,6 @@ namespace JiveXML{
       ///The data type that is generated by this retriever
       const std::string m_typeName;
 
-      const CaloIdManager* m_calo_id_man;
       const CaloCell_ID*   m_calocell_id;
       SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};
     
diff --git a/Calorimeter/CaloCnv/CaloJiveXML/CaloJiveXML/BadTileRetriever.h b/Calorimeter/CaloCnv/CaloJiveXML/CaloJiveXML/BadTileRetriever.h
index 84e8273c18a3e9ab316b0d885c8135086467b0be..0ed4ad4476e96932f77035c1dc7c9753b1400a64 100644
--- a/Calorimeter/CaloCnv/CaloJiveXML/CaloJiveXML/BadTileRetriever.h
+++ b/Calorimeter/CaloCnv/CaloJiveXML/CaloJiveXML/BadTileRetriever.h
@@ -18,7 +18,6 @@
 
 class IToolSvc;
 
-class CaloIdManager;
 class Identifier;
 class CaloCellContainer;
 
@@ -63,7 +62,6 @@ namespace JiveXML{
       const std::string m_typeName;
 
       void calcTILELayerSub(Identifier&);
-      const CaloIdManager* m_calo_id_man;
       const CaloCell_ID*   m_calocell_id;
     
       std::string m_sgKey; 
diff --git a/Calorimeter/CaloCnv/CaloJiveXML/CaloJiveXML/CaloFCalRetriever.h b/Calorimeter/CaloCnv/CaloJiveXML/CaloJiveXML/CaloFCalRetriever.h
index 62fe4e698fb23db7823fa2b5bbc9c5994bdb4375..f84a02d3136afa09a0c16a7d39b576f2b478941d 100644
--- a/Calorimeter/CaloCnv/CaloJiveXML/CaloJiveXML/CaloFCalRetriever.h
+++ b/Calorimeter/CaloCnv/CaloJiveXML/CaloJiveXML/CaloFCalRetriever.h
@@ -19,7 +19,6 @@
 
 class IToolSvc;
 
-class CaloIdManager;
 class Identifier;
 class CaloCellContainer;
 
@@ -68,7 +67,6 @@ namespace JiveXML{
       ///The data type that is generated by this retriever
       const std::string m_typeName;
 
-      const CaloIdManager* m_calo_id_man;
       const CaloCell_ID*   m_calocell_id;
       SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};
     
diff --git a/Calorimeter/CaloCnv/CaloJiveXML/CaloJiveXML/CaloHECRetriever.h b/Calorimeter/CaloCnv/CaloJiveXML/CaloJiveXML/CaloHECRetriever.h
index d06633e4995fe2638c4f2f842a9fe66937783d57..e2e7fdf32c7e067b5059c6d4f877db484386699b 100644
--- a/Calorimeter/CaloCnv/CaloJiveXML/CaloJiveXML/CaloHECRetriever.h
+++ b/Calorimeter/CaloCnv/CaloJiveXML/CaloJiveXML/CaloHECRetriever.h
@@ -19,7 +19,6 @@
 
 class IToolSvc;
 
-class CaloIdManager;
 class Identifier;
 class CaloCellContainer;
 
@@ -68,7 +67,6 @@ namespace JiveXML{
       ///The data type that is generated by this retriever
       const std::string m_typeName;
 
-      const CaloIdManager* m_calo_id_man;
       const CaloCell_ID*   m_calocell_id;
       SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};
     
diff --git a/Calorimeter/CaloCnv/CaloJiveXML/CaloJiveXML/CaloLArRetriever.h b/Calorimeter/CaloCnv/CaloJiveXML/CaloJiveXML/CaloLArRetriever.h
index cc7157d011d850942ae7d7c3f536118ccc755a43..0b584dd0cdc8c858fe67ad58bb8fb77bedeb5c9b 100644
--- a/Calorimeter/CaloCnv/CaloJiveXML/CaloJiveXML/CaloLArRetriever.h
+++ b/Calorimeter/CaloCnv/CaloJiveXML/CaloJiveXML/CaloLArRetriever.h
@@ -19,7 +19,6 @@
 
 class IToolSvc;
 
-class CaloIdManager;
 class Identifier;
 class CaloCellContainer;
 
@@ -68,7 +67,6 @@ namespace JiveXML{
       ///The data type that is generated by this retriever
       const std::string m_typeName;
 
-      const CaloIdManager* m_calo_id_man;
       const CaloCell_ID*   m_calocell_id;
       SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};
     
diff --git a/Calorimeter/CaloCnv/CaloJiveXML/CaloJiveXML/CaloTileRetriever.h b/Calorimeter/CaloCnv/CaloJiveXML/CaloJiveXML/CaloTileRetriever.h
index 17aa9a9e89adecce65acf85633a56a4b611689fd..5506bd8ddb72bc7f92b9ba9452450a0a6e7a0b1e 100644
--- a/Calorimeter/CaloCnv/CaloJiveXML/CaloJiveXML/CaloTileRetriever.h
+++ b/Calorimeter/CaloCnv/CaloJiveXML/CaloJiveXML/CaloTileRetriever.h
@@ -22,7 +22,6 @@
 
 class IToolSvc;
 
-class CaloIdManager;
 class Identifier;
 class CaloCellContainer;
 
@@ -78,7 +77,6 @@ namespace JiveXML{
           "TileBadChanTool", "TileBadChanTool", "Tile bad channel tool"};
 
       void calcTILELayerSub(Identifier&);
-      const CaloIdManager* m_calo_id_man;
       const CaloCell_ID*   m_calocell_id;
     
       std::string m_sgKey; 
diff --git a/Calorimeter/CaloCnv/CaloJiveXML/CaloJiveXML/LArDigitRetriever.h b/Calorimeter/CaloCnv/CaloJiveXML/CaloJiveXML/LArDigitRetriever.h
index 69a7c5b9c86f1d7d105f5b82de58d40f5b216ca2..2f49b5f89585b22de9183388c7a46ca0b5b88e94 100644
--- a/Calorimeter/CaloCnv/CaloJiveXML/CaloJiveXML/LArDigitRetriever.h
+++ b/Calorimeter/CaloCnv/CaloJiveXML/CaloJiveXML/LArDigitRetriever.h
@@ -19,7 +19,6 @@
 
 class IToolSvc;
 
-class CaloIdManager;
 class Identifier;
 class CaloCellContainer;
 
@@ -77,7 +76,6 @@ namespace JiveXML{
       std::string m_sgKeyLArDigit[2]; 
       SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};
     
-      const CaloIdManager* m_calo_id_man;
       const CaloCell_ID*   m_calocell_id;
 
       bool m_lar;
diff --git a/Calorimeter/CaloCnv/CaloJiveXML/src/BadLArRetriever.cxx b/Calorimeter/CaloCnv/CaloJiveXML/src/BadLArRetriever.cxx
index a07815054c089c2e930805e8ef31058e84cd5e45..728dc4b6087cf760951de5d608a0db826c28106b 100644
--- a/Calorimeter/CaloCnv/CaloJiveXML/src/BadLArRetriever.cxx
+++ b/Calorimeter/CaloCnv/CaloJiveXML/src/BadLArRetriever.cxx
@@ -9,7 +9,6 @@
 #include "EventContainers/SelectAllObject.h"
 
 #include "CaloEvent/CaloCellContainer.h"
-#include "CaloIdentifier/CaloIdManager.h"
 #include "CaloDetDescr/CaloDetDescrElement.h"
 #include "LArElecCalib/ILArPedestal.h"
 #include "LArElecCalib/ILArADC2MeVTool.h"
@@ -31,14 +30,13 @@ namespace JiveXML {
    **/
   BadLArRetriever::BadLArRetriever(const std::string& type,const std::string& name,const IInterface* parent):
     AthAlgTool(type,name,parent),
-    m_typeName("BadLAr")
+    m_typeName("BadLAr"),
+    m_calocell_id(nullptr)
   {
 
     //Only declare the interface
     declareInterface<IDataRetriever>(this);
-    
-    m_calo_id_man  = CaloIdManager::instance();
-    m_calocell_id  = m_calo_id_man->getCaloCell_ID();
+
     m_sgKey = "AllCalo"; 
 
     declareInterface<IDataRetriever>(this);
@@ -57,7 +55,8 @@ namespace JiveXML {
 
   StatusCode BadLArRetriever::initialize() {
 
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Initialising Tool" << endmsg;
+    ATH_MSG_DEBUG( "Initialising Tool"  );
+    ATH_CHECK( detStore()->retrieve (m_calocell_id, "CaloCell_ID") );
 
     ATH_CHECK( m_cablingKey.initialize() );
 
@@ -69,22 +68,19 @@ namespace JiveXML {
    */
   StatusCode BadLArRetriever::retrieve(ToolHandle<IFormatTool> &FormatTool) {
     
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG)  << "in retrieve()" << endmsg;
+    ATH_MSG_DEBUG( "in retrieve()"  );
 
     const CaloCellContainer* cellContainer;
     if ( !evtStore()->retrieve(cellContainer,m_sgKey))
       {
-	if (msgLvl(MSG::WARNING)) msg(MSG::WARNING)  << "Could not retrieve Calorimeter Cells " << endmsg;
+	ATH_MSG_WARNING( "Could not retrieve Calorimeter Cells "  );
 	return StatusCode::FAILURE;
       }
 
     if(m_lar){
       DataMap data = getBadLArData(cellContainer);
-      if ( FormatTool->AddToEvent(dataTypeName(), m_sgKey, &data).isFailure()){
-        return StatusCode::FAILURE;
-      } else {
-	if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Bad cell retrieved" << endmsg;
-      }
+      ATH_CHECK( FormatTool->AddToEvent(dataTypeName(), m_sgKey, &data) );
+      ATH_MSG_DEBUG( "Bad cell retrieved"  );
     }
     //LAr cells retrieved okay
     return StatusCode::SUCCESS;
@@ -97,7 +93,7 @@ namespace JiveXML {
    */
   const DataMap BadLArRetriever::getBadLArData(const CaloCellContainer* cellContainer) {
     
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "getBadLArData()" << endmsg;
+    ATH_MSG_DEBUG( "getBadLArData()"  );
 
     DataMap DataMap;
 
@@ -118,16 +114,16 @@ namespace JiveXML {
     SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey};
     const LArOnOffIdMapping* cabling{*cablingHdl};
       
-    const LArOnlineID* onlineId;
+    const LArOnlineID* onlineId = nullptr;
     if ( detStore()->retrieve(onlineId, "LArOnlineID").isFailure()) {
-      if (msgLvl(MSG::ERROR)) msg(MSG::ERROR) << "in getBadLArData(),Could not get LArOnlineID!" << endmsg;
+      ATH_MSG_ERROR( "in getBadLArData(),Could not get LArOnlineID!"  );
     }
 
     if (m_doBadLAr && cabling) {
 
       double energyGeV;
 
-      if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Start iterator loop over cells" << endmsg;
+      ATH_MSG_DEBUG( "Start iterator loop over cells"  );
       
       for(;it1!=it2;it1++){
 
@@ -163,10 +159,8 @@ namespace JiveXML {
     DataMap["feedThrough"] = feedThrough;
     DataMap["slot"] = slot;
     //Be verbose
-    if (msgLvl(MSG::DEBUG)) {
-      msg(MSG::DEBUG) << dataTypeName() << " , collection: " << dataTypeName();
-      msg(MSG::DEBUG) << " retrieved with " << phi.size() << " entries"<< endmsg;
-    }
+    ATH_MSG_DEBUG( dataTypeName() << " , collection: " << dataTypeName()
+                   << " retrieved with " << phi.size() << " entries" );
 
     //All collections retrieved okay
     return DataMap;
diff --git a/Calorimeter/CaloCnv/CaloJiveXML/src/BadTileRetriever.cxx b/Calorimeter/CaloCnv/CaloJiveXML/src/BadTileRetriever.cxx
index fac3afa68323083e050a3a433bb4e94db8bc0bbb..500224dd4fd18f24631a9b76b0a4003854ca70fa 100644
--- a/Calorimeter/CaloCnv/CaloJiveXML/src/BadTileRetriever.cxx
+++ b/Calorimeter/CaloCnv/CaloJiveXML/src/BadTileRetriever.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "CaloJiveXML/BadTileRetriever.h"
@@ -9,7 +9,6 @@
 #include "EventContainers/SelectAllObject.h"
 
 #include "CaloEvent/CaloCellContainer.h"
-#include "CaloIdentifier/CaloIdManager.h"
 #include "CaloIdentifier/CaloCell_ID.h"
 #include "CaloDetDescr/CaloDetDescrElement.h"
 #include "TileEvent/TileCell.h"
@@ -38,13 +37,13 @@ namespace JiveXML {
    **/
   BadTileRetriever::BadTileRetriever(const std::string& type,const std::string& name,const IInterface* parent):
     AthAlgTool(type,name,parent),
-    m_typeName("BadTILE"){
+    m_typeName("BadTILE"),
+    m_calocell_id(nullptr)
+  {
 
     //Only declare the interface
     declareInterface<IDataRetriever>(this);
     
-    m_calo_id_man  = CaloIdManager::instance();
-    m_calocell_id  = m_calo_id_man->getCaloCell_ID();
     m_sgKey = "AllCalo"; 
      
     declareProperty("StoreGateKey" , m_sgKey);
@@ -61,7 +60,8 @@ namespace JiveXML {
 
   StatusCode BadTileRetriever::initialize() {
 
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Initialising Tool" << endmsg;
+    ATH_MSG_DEBUG( "Initialising Tool"  );
+    ATH_CHECK( detStore()->retrieve (m_calocell_id, "CaloCell_ID") );
 
     return StatusCode::SUCCESS;	
   }
@@ -71,24 +71,19 @@ namespace JiveXML {
    */
   StatusCode BadTileRetriever::retrieve(ToolHandle<IFormatTool> &FormatTool) {
     
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG)  << "in retrieve()" << endmsg;
+    ATH_MSG_DEBUG( "in retrieve()"  );
 
     const CaloCellContainer* cellContainer = nullptr;
     if (!evtStore()->retrieve(cellContainer,m_sgKey))
       {
-	if (msgLvl(MSG::WARNING)) msg(MSG::WARNING)  << 
-	  "Could not retrieve Calorimeter Cells for Tile " << endmsg;
+	ATH_MSG_WARNING( "Could not retrieve Calorimeter Cells for Tile "  );
 //        return StatusCode::SUCCESS;
       }
 
     if(m_tile){
       DataMap data = getBadTileData(cellContainer);
-      if ( FormatTool->AddToEvent(dataTypeName(), m_sgKey, &data).isFailure()){
-	if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Error reading Tile data" << endmsg;
-//        return StatusCode::SUCCESS;
-      } else {
-	if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Tile retrieved" << endmsg;
-      }
+      ATH_CHECK( FormatTool->AddToEvent(dataTypeName(), m_sgKey, &data) );
+      ATH_MSG_DEBUG( "Tile retrieved"  );
     }
     //Tile cells retrieved okay
     return StatusCode::SUCCESS;
@@ -101,7 +96,7 @@ namespace JiveXML {
    */
   const DataMap BadTileRetriever::getBadTileData(const CaloCellContainer* cellContainer) {
     
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "getBadTileData()" << endmsg;
+    ATH_MSG_DEBUG( "getBadTileData()"  );
     char rndStr[30];
     DataMap DataMap;
 
@@ -112,7 +107,6 @@ namespace JiveXML {
 
 //    m_sub; m_sub.reserve(cellContainer->size());
     m_sub.clear();
-//     msg(MSG::INFO)  << "Size of CellC =  " << cellContainer->size() << endmsg;
 	  
 //Loop Over CaloCellContainer to retrieve TileCell information
 
@@ -124,7 +118,7 @@ namespace JiveXML {
       double energyGeV;
       //int cellInd;
 
-      if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Start iterator loop over cells" << endmsg;
+      ATH_MSG_DEBUG( "Start iterator loop over cells"  );
 
       for(;it1!=it2;it1++){
       
@@ -154,9 +148,7 @@ namespace JiveXML {
     DataMap["energy"] = energyVec;
     
     //Be verbose
-    if (msgLvl(MSG::DEBUG)) {
-      msg(MSG::DEBUG) << dataTypeName() << " retrieved with " << phi.size() << " entries"<< endmsg;
-    }
+    ATH_MSG_DEBUG( dataTypeName() << " retrieved with " << phi.size() << " entries" );
 
     //All collections retrieved okay
     return DataMap;
diff --git a/Calorimeter/CaloCnv/CaloJiveXML/src/CaloClusterRetriever.cxx b/Calorimeter/CaloCnv/CaloJiveXML/src/CaloClusterRetriever.cxx
index 9e29cfb5a6d4110cda8f6b5ce8a0649114816db2..67c661158b3f9cc879347d6b5a409206b805be00 100755
--- a/Calorimeter/CaloCnv/CaloJiveXML/src/CaloClusterRetriever.cxx
+++ b/Calorimeter/CaloCnv/CaloJiveXML/src/CaloClusterRetriever.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "CaloJiveXML/CaloClusterRetriever.h"
@@ -41,30 +41,29 @@ namespace JiveXML {
    */
   StatusCode CaloClusterRetriever::retrieve(ToolHandle<IFormatTool> &FormatTool) {
     
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG)  << "in retrieveAll()" << endmsg;
+    ATH_MSG_DEBUG( "in retrieveAll()"  );
     
     const DataHandle<CaloClusterContainer> iterator, end;
     const CaloClusterContainer* ccc;
 
     //obtain the default collection first
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG)  << "Trying to retrieve " << dataTypeName() << " (" << m_sgKeyFavourite << ")" << endmsg;
+    ATH_MSG_DEBUG( "Trying to retrieve " << dataTypeName() << " (" << m_sgKeyFavourite << ")"  );
 
     if ( evtStore()->retrieve(ccc, m_sgKeyFavourite).isFailure() ) {
-      if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Favourite Collection " << m_sgKeyFavourite << " not found in SG " << endmsg; 
+      ATH_MSG_WARNING( "Favourite Collection " << m_sgKeyFavourite << " not found in SG "  );
     }else{
       DataMap data = getData(ccc);
       if ( FormatTool->AddToEvent(dataTypeName(), m_sgKeyFavourite+"_ESD", &data).isFailure()){
-	if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Favourite Collection " << m_sgKeyFavourite << " not found in SG " << endmsg;
+	ATH_MSG_WARNING( "Favourite Collection " << m_sgKeyFavourite << " not found in SG "  );
       }else{
-         if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG)  << dataTypeName() << " (" << m_sgKeyFavourite << ") CaloCluster retrieved" << endmsg;
+        ATH_MSG_DEBUG( dataTypeName() << " (" << m_sgKeyFavourite << ") CaloCluster retrieved"  );
       }
     }
 
     if ( m_otherKeys.empty() ) {
       //obtain all other collections from StoreGate
       if (( evtStore()->retrieve(iterator, end)).isFailure()){
-         if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << 
-	 "Unable to retrieve iterator for CaloCluster collection" << endmsg;
+        ATH_MSG_WARNING( "Unable to retrieve iterator for CaloCluster collection"  );
 //        return false;
       }
       
@@ -73,16 +72,14 @@ namespace JiveXML {
         std::string::size_type position = iterator.key().find("HLTAutoKey",0);
         if ( m_doWriteHLT ){ position = 99; } // override SG key find
 
-//      if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " CaloCluster: HLTAutoKey in " << iterator.key() << " at position " 
-//	    << position << endmsg;
         if ( position != 0 ){  // SG key doesn't contain HLTAutoKey         
 	  if (iterator.key()!=m_sgKeyFavourite) {
-             if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG)  << "Trying to retrieve all " << dataTypeName() << " (" << iterator.key() << ")" << endmsg;
+             ATH_MSG_DEBUG( "Trying to retrieve all " << dataTypeName() << " (" << iterator.key() << ")"  );
              DataMap data = getData(iterator);
              if ( FormatTool->AddToEvent(dataTypeName(), iterator.key()+"_ESD", &data).isFailure()){
-	       if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Collection " << iterator.key() << " not found in SG " << endmsg;
+	       ATH_MSG_WARNING( "Collection " << iterator.key() << " not found in SG "  );
 	    }else{
-	      if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << dataTypeName() << " (" << iterator.key() << ") CaloCluster retrieved" << endmsg;
+               ATH_MSG_DEBUG( dataTypeName() << " (" << iterator.key() << ") CaloCluster retrieved"  );
 	    }
           }
 	}
@@ -93,12 +90,12 @@ namespace JiveXML {
       for ( keyIter=m_otherKeys.begin(); keyIter!=m_otherKeys.end(); ++keyIter ){
        if ( evtStore()->contains<CaloClusterContainer>(*keyIter) ){ // to avoid some SG dumps
 	if ( !evtStore()->retrieve( ccc, (*keyIter) ).isFailure()) {
-          if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG)  << "Trying to retrieve selected " << dataTypeName() << " (" << (*keyIter) << ")" << endmsg;
+          ATH_MSG_DEBUG( "Trying to retrieve selected " << dataTypeName() << " (" << (*keyIter) << ")"  );
           DataMap data = getData(ccc);
           if ( FormatTool->AddToEvent(dataTypeName(), (*keyIter)+"_ESD", &data).isFailure()){
-	    if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Collection " << (*keyIter) << " not found in SG " << endmsg;
+	    ATH_MSG_WARNING( "Collection " << (*keyIter) << " not found in SG "  );
 	  }else{
-	     if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << dataTypeName() << " (" << (*keyIter) << ") retrieved" << endmsg;
+            ATH_MSG_DEBUG( dataTypeName() << " (" << (*keyIter) << ") retrieved"  );
 	  }
 	}
        }
@@ -117,7 +114,7 @@ namespace JiveXML {
    */
   const DataMap CaloClusterRetriever::getData(const CaloClusterContainer* ccc) {
     
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "getData()" << endmsg;
+    ATH_MSG_DEBUG( "getData()"  );
 
     DataMap DataMap;
 
@@ -170,10 +167,8 @@ namespace JiveXML {
     DataMap["id"] = idVec;
 
     //Be verbose
-    if (msgLvl(MSG::DEBUG)) {
-      msg(MSG::DEBUG) << dataTypeName() << " , collection: " << dataTypeName();
-      msg(MSG::DEBUG) << " retrieved with " << phi.size() << " entries"<< endmsg;
-    }
+    ATH_MSG_DEBUG( dataTypeName() << " , collection: " << dataTypeName()
+                   << " retrieved with " << phi.size() << " entries" );
 
     //All collections retrieved okay
     return DataMap;
diff --git a/Calorimeter/CaloCnv/CaloJiveXML/src/CaloFCalRetriever.cxx b/Calorimeter/CaloCnv/CaloJiveXML/src/CaloFCalRetriever.cxx
index feaacd0c3b055b3d280929a99e4be5c7d0061c1a..46c91572dc8428484f5e55ab2d872446e2b43a86 100644
--- a/Calorimeter/CaloCnv/CaloJiveXML/src/CaloFCalRetriever.cxx
+++ b/Calorimeter/CaloCnv/CaloJiveXML/src/CaloFCalRetriever.cxx
@@ -9,7 +9,6 @@
 #include "EventContainers/SelectAllObject.h"
 
 #include "CaloEvent/CaloCellContainer.h"
-#include "CaloIdentifier/CaloIdManager.h"
 #include "CaloDetDescr/CaloDetDescrElement.h"
 #include "LArElecCalib/ILArPedestal.h"
 #include "LArElecCalib/ILArADC2MeVTool.h"
@@ -31,14 +30,13 @@ namespace JiveXML {
    **/
   CaloFCalRetriever::CaloFCalRetriever(const std::string& type,const std::string& name,const IInterface* parent):
     AthAlgTool(type,name,parent),
-    m_typeName("FCAL")
+    m_typeName("FCAL"),
+    m_calocell_id(nullptr)
   {
 
     //Only declare the interface
     declareInterface<IDataRetriever>(this);
     
-    m_calo_id_man  = CaloIdManager::instance();
-    m_calocell_id  = m_calo_id_man->getCaloCell_ID();
     m_sgKey = "AllCalo"; 
 
     declareInterface<IDataRetriever>(this);
@@ -61,7 +59,8 @@ namespace JiveXML {
 
   StatusCode CaloFCalRetriever::initialize() {
 
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Initialising Tool" << endmsg;
+    ATH_MSG_DEBUG( "Initialising Tool"  );
+    ATH_CHECK( detStore()->retrieve (m_calocell_id, "CaloCell_ID") );
 
     ATH_CHECK( m_cablingKey.initialize() );
 
@@ -73,22 +72,19 @@ namespace JiveXML {
    */
   StatusCode CaloFCalRetriever::retrieve(ToolHandle<IFormatTool> &FormatTool) {
     
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG)  << "in retrieve()" << endmsg;
+    ATH_MSG_DEBUG( "in retrieve()"  );
 
     const CaloCellContainer* cellContainer;
     if ( !evtStore()->retrieve(cellContainer,m_sgKey))
       {
-	if (msgLvl(MSG::WARNING)) msg(MSG::WARNING)  << "Could not retrieve Calorimeter Cells " << endmsg;
+	ATH_MSG_WARNING( "Could not retrieve Calorimeter Cells "  );
 	return StatusCode::FAILURE;
       }
 
    if(m_fcal){
       DataMap data = getFCalData(cellContainer);
-      if ( FormatTool->AddToEvent(dataTypeName(), m_sgKey, &data).isFailure()){
-        return StatusCode::FAILURE;
-      } else {
-       if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "FCal retrieved" << endmsg;
-      }
+      ATH_CHECK( FormatTool->AddToEvent(dataTypeName(), m_sgKey, &data) );
+      ATH_MSG_DEBUG( "FCal retrieved"  );
     }
     //FCal cells retrieved okay
     return StatusCode::SUCCESS;
@@ -101,7 +97,7 @@ namespace JiveXML {
    */
   const DataMap CaloFCalRetriever::getFCalData(const CaloCellContainer* cellContainer) {
     
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "getFCalData()" << endmsg;
+    ATH_MSG_DEBUG( "getFCalData()"  );
 
     DataMap DataMap;
 
@@ -139,20 +135,20 @@ namespace JiveXML {
     const ILArPedestal* larPedestal = nullptr;
     if(m_doFCalCellDetails){
 	if( detStore()->retrieve(larPedestal).isFailure() ){
-	  if (msgLvl(MSG::ERROR)) msg(MSG::ERROR) << "in getFCalData(), Could not retrieve LAr Pedestal" << endmsg;
+	  ATH_MSG_ERROR( "in getFCalData(), Could not retrieve LAr Pedestal"  );
 	}
       }
       
     const LArOnlineID* onlineId;
     if ( detStore()->retrieve(onlineId, "LArOnlineID").isFailure()) {
-     if (msgLvl(MSG::ERROR)) msg(MSG::ERROR) << "in getFCalData(),Could not get LArOnlineID!" << endmsg;
+      ATH_MSG_ERROR( "in getFCalData(),Could not get LArOnlineID!"  );
      }
     
       IAlgTool* algtool;
       ILArADC2MeVTool* adc2mevTool=0;
       if(m_doFCalCellDetails){
 	if( toolSvc()->retrieveTool("LArADC2MeVTool", algtool).isFailure()){
-	  if (msgLvl(MSG::ERROR)) msg(MSG::ERROR) << "in getFCalData(), Could not retrieve LAr ADC2MeV Tool" <<endmsg;
+	  ATH_MSG_ERROR( "in getFCalData(), Could not retrieve LAr ADC2MeV Tool"  );
 	} else {
 	  adc2mevTool=dynamic_cast<ILArADC2MeVTool*>(algtool);
 	}
@@ -216,8 +212,7 @@ namespace JiveXML {
  	       else{ adc2Mev.push_back(DataType((*polynom_adc2mev)[1])); }
             }else{
                adc2Mev.push_back(DataType(-1)); // write placeholder
-	       if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) 
- 		<< "LArADC2MeVTool dynamic cast failed" << endmsg;
+	       ATH_MSG_WARNING( "LArADC2MeVTool dynamic cast failed"  );
 	    }
 	  }
 
@@ -234,7 +229,7 @@ namespace JiveXML {
 	    sub.push_back(DataType(0));
       }
 
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " Total energy in FCAL (LAr) in GeV : " <<  energyAllLArFcal << endmsg;
+    ATH_MSG_DEBUG( " Total energy in FCAL (LAr) in GeV : " <<  energyAllLArFcal  );
 
     // write values into DataMap
     DataMap["x"] = x;
@@ -259,9 +254,7 @@ namespace JiveXML {
        DataMap["adc2Mev"] = adc2Mev;
     }
     //Be verbose
-    if (msgLvl(MSG::DEBUG)) {
-      msg(MSG::DEBUG) << dataTypeName() << " retrieved with " << x.size() << " entries"<< endmsg;
-    }
+    ATH_MSG_DEBUG( dataTypeName() << " retrieved with " << x.size() << " entries" );
 
     //All collections retrieved okay
     return DataMap;
diff --git a/Calorimeter/CaloCnv/CaloJiveXML/src/CaloHECRetriever.cxx b/Calorimeter/CaloCnv/CaloJiveXML/src/CaloHECRetriever.cxx
index 1b783e66fd2dc1a46d7b54dfccec23fdb55bd0b6..3a778abc13b4c9ba059a749ff5951e9decaa6959 100644
--- a/Calorimeter/CaloCnv/CaloJiveXML/src/CaloHECRetriever.cxx
+++ b/Calorimeter/CaloCnv/CaloJiveXML/src/CaloHECRetriever.cxx
@@ -9,7 +9,6 @@
 #include "EventContainers/SelectAllObject.h"
 
 #include "CaloEvent/CaloCellContainer.h"
-#include "CaloIdentifier/CaloIdManager.h"
 #include "CaloDetDescr/CaloDetDescrElement.h"
 #include "LArElecCalib/ILArPedestal.h"
 #include "LArElecCalib/ILArADC2MeVTool.h"
@@ -31,14 +30,13 @@ namespace JiveXML {
    **/
   CaloHECRetriever::CaloHECRetriever(const std::string& type,const std::string& name,const IInterface* parent):
     AthAlgTool(type,name,parent),
-    m_typeName("HEC")
+    m_typeName("HEC"),
+    m_calocell_id(nullptr)
   {
 
     //Only declare the interface
     declareInterface<IDataRetriever>(this);
     
-    m_calo_id_man  = CaloIdManager::instance();
-    m_calocell_id  = m_calo_id_man->getCaloCell_ID();
     m_sgKey = "AllCalo"; 
 
     declareInterface<IDataRetriever>(this);
@@ -61,7 +59,8 @@ namespace JiveXML {
 
   StatusCode CaloHECRetriever::initialize() {
 
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Initialising Tool" << endmsg;
+    ATH_MSG_DEBUG( "Initialising Tool"  );
+    ATH_CHECK( detStore()->retrieve (m_calocell_id, "CaloCell_ID") );
 
     ATH_CHECK( m_cablingKey.initialize() );
 
@@ -73,22 +72,19 @@ namespace JiveXML {
    */
   StatusCode CaloHECRetriever::retrieve(ToolHandle<IFormatTool> &FormatTool) {
     
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG)  << "in retrieve()" << endmsg;
+    ATH_MSG_DEBUG( "in retrieve()"  );
 
     const CaloCellContainer* cellContainer;
     if ( !evtStore()->retrieve(cellContainer,m_sgKey))
       {
-	if (msgLvl(MSG::WARNING)) msg(MSG::WARNING)  << "Could not retrieve Calorimeter Cells " << endmsg;
+	ATH_MSG_WARNING( "Could not retrieve Calorimeter Cells "  );
 	return StatusCode::FAILURE;
       }
 
    if(m_hec){
       DataMap data = getHECData(cellContainer);
-      if ( FormatTool->AddToEvent(dataTypeName(), m_sgKey, &data).isFailure()){
-        return StatusCode::FAILURE;
-      } else {
-       if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "HEC retrieved" << endmsg;
-      }
+      ATH_CHECK( FormatTool->AddToEvent(dataTypeName(), m_sgKey, &data) );
+      ATH_MSG_DEBUG( "HEC retrieved"  );
     }
     //HEC cells retrieved okay
     return StatusCode::SUCCESS;
@@ -101,7 +97,7 @@ namespace JiveXML {
    */
   const DataMap CaloHECRetriever::getHECData(const CaloCellContainer* cellContainer) {
     
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "getHECData()" << endmsg;
+    ATH_MSG_DEBUG( "getHECData()"  );
 
     DataMap DataMap;
 
@@ -134,21 +130,21 @@ namespace JiveXML {
 
     const ILArPedestal* larPedestal = nullptr;
     if(m_doHECCellDetails){
-	if( detStore()->retrieve(larPedestal).isFailure() ){
-	  if (msgLvl(MSG::ERROR)) msg(MSG::ERROR) << "in getHECData(), Could not retrieve LAr Pedestal" << endmsg;
-	}
+      if( detStore()->retrieve(larPedestal).isFailure() ){
+        ATH_MSG_ERROR( "in getHECData(), Could not retrieve LAr Pedestal"  );
       }
+    }
       
     const LArOnlineID* onlineId = nullptr;
     if ( detStore()->retrieve(onlineId, "LArOnlineID").isFailure()) {
-     if (msgLvl(MSG::ERROR)) msg(MSG::ERROR) << "in getHECData(),Could not get LArOnlineID!" << endmsg;
-     }
+      ATH_MSG_ERROR( "in getHECData(),Could not get LArOnlineID!"  );
+    }
 
       IAlgTool* algtool;
       ILArADC2MeVTool* adc2mevTool=0;
       if(m_doHECCellDetails){
 	if( toolSvc()->retrieveTool("LArADC2MeVTool", algtool).isFailure()){
-	  if (msgLvl(MSG::ERROR)) msg(MSG::ERROR) << "in getHECData(), Could not retrieve LAr ADC2MeV Tool" <<endmsg;
+	  ATH_MSG_ERROR( "in getHECData(), Could not retrieve LAr ADC2MeV Tool"  );
 	} else {
 	  adc2mevTool=dynamic_cast<ILArADC2MeVTool*>(algtool);
 	}
@@ -213,7 +209,7 @@ namespace JiveXML {
 	  }
       }
 
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " Total energy in HEC (LAr) in GeV : " <<  energyAllLArHEC << endmsg;
+    ATH_MSG_DEBUG( " Total energy in HEC (LAr) in GeV : " <<  energyAllLArHEC  );
 
     // write values into DataMap
     DataMap["phi"] = phi;
@@ -235,10 +231,9 @@ namespace JiveXML {
        DataMap["adc2Mev"] = adc2Mev;
     }
     //Be verbose
-    if (msgLvl(MSG::DEBUG)) {
-      msg(MSG::DEBUG) << dataTypeName() << " , collection: " << dataTypeName();
-      msg(MSG::DEBUG) << " retrieved with " << phi.size() << " entries"<< endmsg;
-    }
+    ATH_MSG_DEBUG( dataTypeName() << " , collection: " << dataTypeName()
+                   << " retrieved with " << phi.size() << " entries" );
+
 
     //All collections retrieved okay
     return DataMap;
diff --git a/Calorimeter/CaloCnv/CaloJiveXML/src/CaloLArRetriever.cxx b/Calorimeter/CaloCnv/CaloJiveXML/src/CaloLArRetriever.cxx
index 0691e794f085f7e36a47894311c3608f105484b2..e7ac5110578d25b534fd4423e3a9e80af81589b1 100644
--- a/Calorimeter/CaloCnv/CaloJiveXML/src/CaloLArRetriever.cxx
+++ b/Calorimeter/CaloCnv/CaloJiveXML/src/CaloLArRetriever.cxx
@@ -9,7 +9,6 @@
 #include "EventContainers/SelectAllObject.h"
 
 #include "CaloEvent/CaloCellContainer.h"
-#include "CaloIdentifier/CaloIdManager.h"
 #include "CaloDetDescr/CaloDetDescrElement.h"
 #include "LArElecCalib/ILArPedestal.h"
 #include "LArElecCalib/ILArADC2MeVTool.h"
@@ -31,14 +30,13 @@ namespace JiveXML {
    **/
   CaloLArRetriever::CaloLArRetriever(const std::string& type,const std::string& name,const IInterface* parent):
     AthAlgTool(type,name,parent),
-    m_typeName("LAr")
+    m_typeName("LAr"),
+    m_calocell_id(nullptr)
   {
 
     //Only declare the interface
     declareInterface<IDataRetriever>(this);
     
-    m_calo_id_man  = CaloIdManager::instance();
-    m_calocell_id  = m_calo_id_man->getCaloCell_ID();
     m_sgKey = "AllCalo"; 
 
     declareInterface<IDataRetriever>(this);
@@ -61,7 +59,8 @@ namespace JiveXML {
 
   StatusCode CaloLArRetriever::initialize() {
 
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Initialising Tool" << endmsg;
+    ATH_MSG_DEBUG( "Initialising Tool"  );
+    ATH_CHECK( detStore()->retrieve (m_calocell_id, "CaloCell_ID") );
 
     ATH_CHECK( m_cablingKey.initialize() );
 
@@ -73,22 +72,19 @@ namespace JiveXML {
    */
   StatusCode CaloLArRetriever::retrieve(ToolHandle<IFormatTool> &FormatTool) {
     
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG)  << "in retrieve()" << endmsg;
+    ATH_MSG_DEBUG( "in retrieve()"  );
 
     const CaloCellContainer* cellContainer;
     if ( !evtStore()->retrieve(cellContainer,m_sgKey))
       {
-	if (msgLvl(MSG::WARNING)) msg(MSG::WARNING)  << "Could not retrieve Calorimeter Cells " << endmsg;
+	ATH_MSG_WARNING( "Could not retrieve Calorimeter Cells "  );
 	return StatusCode::FAILURE;
       }
 
    if(m_lar){
       DataMap data = getLArData(cellContainer);
-      if ( FormatTool->AddToEvent(dataTypeName(), m_sgKey, &data).isFailure()){
-        return StatusCode::FAILURE;
-      } else {
-       if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "LAr retrieved" << endmsg;
-      }
+      ATH_CHECK( FormatTool->AddToEvent(dataTypeName(), m_sgKey, &data) );
+      ATH_MSG_DEBUG( "LAr retrieved"  );
     }
     //LAr cells retrieved okay
     return StatusCode::SUCCESS;
@@ -101,7 +97,7 @@ namespace JiveXML {
    */
   const DataMap CaloLArRetriever::getLArData(const CaloCellContainer* cellContainer) {
     
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "getLArData()" << endmsg;
+    ATH_MSG_DEBUG( "getLArData()"  );
 
     DataMap DataMap;
 
@@ -127,21 +123,21 @@ namespace JiveXML {
     
     const ILArPedestal* larPedestal = nullptr;
     if(m_doLArCellDetails){
-	if( detStore()->retrieve(larPedestal).isFailure() ){
-	  if (msgLvl(MSG::ERROR)) msg(MSG::ERROR) << "in getLArData(), Could not retrieve LAr Pedestal" << endmsg;
-	}
+      if( detStore()->retrieve(larPedestal).isFailure() ){
+        ATH_MSG_ERROR( "in getLArData(), Could not retrieve LAr Pedestal"  );
       }
+    }
       
     const LArOnlineID* onlineId = nullptr;
     if ( detStore()->retrieve(onlineId, "LArOnlineID").isFailure()) {
-     if (msgLvl(MSG::ERROR)) msg(MSG::ERROR) << "in getLArData(),Could not get LArOnlineID!" << endmsg;
-     }
-    
+      ATH_MSG_ERROR( "in getLArData(),Could not get LArOnlineID!"  );
+    }
+
       IAlgTool* algtool;
       ILArADC2MeVTool* adc2mevTool=0;
       if(m_doLArCellDetails){
 	if( toolSvc()->retrieveTool("LArADC2MeVTool", algtool).isFailure()){
-	  if (msgLvl(MSG::ERROR)) msg(MSG::ERROR) << "in getLArData(), Could not retrieve LAr ADC2MeV Tool" <<endmsg;
+	  ATH_MSG_ERROR( "in getLArData(), Could not retrieve LAr ADC2MeV Tool"  );
 	} else {
 	  adc2mevTool=dynamic_cast<ILArADC2MeVTool*>(algtool);
 	}
@@ -150,7 +146,7 @@ namespace JiveXML {
       double energyGeV,cellTime;
       double energyAllLArBarrel = 0.;
 
-      if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Start iterator loop over cells" << endmsg;
+      ATH_MSG_DEBUG( "Start iterator loop over cells"  );
       
       SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey};
       const LArOnOffIdMapping* cabling{*cablingHdl};
@@ -194,9 +190,6 @@ namespace JiveXML {
           feedThrough.push_back(DataType(onlineId->feedthrough(LArhwid))); 
        	  slot.push_back(DataType(onlineId->slot(LArhwid))); 
 
-	  //if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Cell with ID " << (Identifier::value_type)(*it1)->ID().get_compact() <<  
-          //                 " retrieved" << endmsg;
-
 	  if ( m_doLArCellDetails){
 	    cellTime = (*it1)->time();
 	    cellTimeVec.push_back(DataType( gcvt( cellTime, m_cellTimePrec, rndStr) ) );
@@ -219,7 +212,7 @@ namespace JiveXML {
 	  }
       }
 
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " Total energy in LAr barrel in GeV : " <<  energyAllLArBarrel << endmsg;
+    ATH_MSG_DEBUG( " Total energy in LAr barrel in GeV : " <<  energyAllLArBarrel  );
 
     // write values into DataMap
     DataMap["phi"] = phi;
@@ -243,10 +236,8 @@ namespace JiveXML {
        DataMap["adc2Mev"] = adc2Mev;
     }
     //Be verbose
-    if (msgLvl(MSG::DEBUG)) {
-      msg(MSG::DEBUG) << dataTypeName() << " , collection: " << dataTypeName();
-      msg(MSG::DEBUG) << " retrieved with " << phi.size() << " entries"<< endmsg;
-    }
+    ATH_MSG_DEBUG( dataTypeName() << " , collection: " << dataTypeName()
+                   << " retrieved with " << phi.size() << " entries" );
 
     //All collections retrieved okay
     return DataMap;
diff --git a/Calorimeter/CaloCnv/CaloJiveXML/src/CaloMBTSRetriever.cxx b/Calorimeter/CaloCnv/CaloJiveXML/src/CaloMBTSRetriever.cxx
index efe067e3733cc6ee976ffdc41f876648c8da8cf7..10625ad22ccab7fac4b22b6d343feb7dbd9e4b23 100644
--- a/Calorimeter/CaloCnv/CaloJiveXML/src/CaloMBTSRetriever.cxx
+++ b/Calorimeter/CaloCnv/CaloJiveXML/src/CaloMBTSRetriever.cxx
@@ -9,7 +9,6 @@
 #include "EventContainers/SelectAllObject.h"
 
 #include "CaloEvent/CaloCellContainer.h"
-#include "CaloIdentifier/CaloIdManager.h"
 #include "CaloDetDescr/CaloDetDescrElement.h"
 #include "TileEvent/TileCell.h"
 #include "TileEvent/TileRawChannelContainer.h"
@@ -72,22 +71,19 @@ namespace JiveXML {
    */
   StatusCode CaloMBTSRetriever::retrieve(ToolHandle<IFormatTool> &FormatTool) {
 
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG)  << "in retrieve()" << endmsg;
+    ATH_MSG_DEBUG( "in retrieve()"  );
 
     const TileCellContainer* cellContainerMBTS;
     if ( !evtStore()->retrieve(cellContainerMBTS,m_sgKeyMBTS))
     {
-      if (msgLvl(MSG::WARNING)) msg(MSG::WARNING)  << "Could not retrieve Calorimeter Cells " << endmsg;
+      ATH_MSG_WARNING( "Could not retrieve Calorimeter Cells "  );
       return StatusCode::FAILURE;
     }
 
     if (m_mbts) {
       DataMap data = getMBTSData(cellContainerMBTS);
-      if ( FormatTool->AddToEvent(dataTypeName(), m_sgKeyMBTS, &data).isFailure()) {
-        return StatusCode::FAILURE;
-      } else {
-       if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "MBTS retrieved" << endmsg;
-      }
+      ATH_CHECK( FormatTool->AddToEvent(dataTypeName(), m_sgKeyMBTS, &data) );
+      ATH_MSG_DEBUG( "MBTS retrieved"  );
     }
     //MBTS cells retrieved okay
     return StatusCode::SUCCESS;
@@ -100,7 +96,7 @@ namespace JiveXML {
    */
   const DataMap CaloMBTSRetriever::getMBTSData(const TileCellContainer* tileMBTSCellContainer) {
 
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "getMBTSData()" << endmsg;
+    ATH_MSG_DEBUG( "getMBTSData()"  );
 
     DataMap DataMap;
 
@@ -124,23 +120,24 @@ namespace JiveXML {
     StatusCode scTileRawChannel = StatusCode::FAILURE;
     const TileDigitsContainer *tileDigits = nullptr;
     const TileRawChannelContainer* RawChannelCnt = nullptr;
-    const TileHWID* tileHWID;
-    const TileInfo* tileInfo;
+    const TileHWID* tileHWID = nullptr;
+    const TileInfo* tileInfo = nullptr;
     const TileCablingService* cabling=nullptr;
     TileRawChannelUnit::UNIT RChUnit = TileRawChannelUnit::ADCcounts;  //!< Unit for TileRawChannels (ADC, pCb, etc.)
     cabling = TileCablingService::getInstance();
     bool offlineRch = false;
 
-    if ( detStore()->retrieve(m_tileTBID).isFailure() )
-      if (msgLvl(MSG::ERROR)) msg(MSG::ERROR)<< "in getMBTSData(), Could not retrieve m_tileTBID" <<endmsg;
-
-    if ( detStore()->retrieve(tileHWID).isFailure() )
-      if (msgLvl(MSG::ERROR)) msg(MSG::ERROR)<< "in getMBTSData(), Could not retrieve TileHWID" <<endmsg;
+    if ( detStore()->retrieve(m_tileTBID).isFailure() ) {
+      ATH_MSG_ERROR( "in getMBTSData(), Could not retrieve m_tileTBID"  );
+    }
 
-    //=== get TileInfo
-    if ( detStore()->retrieve(tileInfo, "TileInfo").isFailure() )
-      if (msgLvl(MSG::ERROR)) msg(MSG::ERROR) << "in getMBTSData(), Could not retrieve TileInfo"<< endmsg;
+    if ( detStore()->retrieve(tileHWID).isFailure() ) {
+      ATH_MSG_ERROR( "in getMBTSData(), Could not retrieve TileHWID"  );
+    }
 
+    if ( detStore()->retrieve(tileInfo, "TileInfo").isFailure() ) {
+      ATH_MSG_ERROR( "in getMBTSData(), Could not retrieve TileInfo" );
+    }
 
     std::string RchName[7] = {"TileRawChannelOpt2","TileRawChannelOpt","TileRawChannelFixed",
                               "TileRawChannelFitCool","TileRawChannelFit",
@@ -159,7 +156,7 @@ namespace JiveXML {
     }
 
     if (scTileRawChannel.isFailure())
-      if (msgLvl(MSG::WARNING)) msg(MSG::WARNING)<< "in getMBTSData(), Could not retrieve TileRawchannel" << endmsg;
+      ATH_MSG_WARNING( "in getMBTSData(), Could not retrieve TileRawchannel"  );
 
     std::string DigiName[2] = {"TileDigitsCnt","TileDigitsFlt"};
     int icntd=2;
@@ -171,7 +168,7 @@ namespace JiveXML {
     }
 
     if (scTileDigit.isFailure()) {
-      if (msgLvl(MSG::WARNING)) msg(MSG::WARNING)<< "in getMBTSData(), Could not retrieve TileDigits" << endmsg;
+      ATH_MSG_WARNING( "in getMBTSData(), Could not retrieve TileDigits"  );
     }
     // from: TileCalorimeter/TileRec/src/TileCellToNtuple.cxx
 
@@ -319,10 +316,6 @@ namespace JiveXML {
         cellRawAmplitude.push_back(DataType( theMbtsrawamp[id.get_identifier32().get_compact()] ));
         myCellRawTimeStr =  DataType(theMbtsrawtime[id.get_identifier32().get_compact()]).toString();
 
-        //if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG)  << " Capture nan for cellRawTime: "  
-	//	<< theMbtsrawtime[id.get_identifier32().get_compact()] 
-	//	<< " " << myCellRawTimeStr << " " << myCellRawTimeStr.find("n") << endmsg;
-
         if ( myCellRawTimeStr.find("n") == 1 )  myCellRawTimeStr="0."; 
         cellRawTime.push_back( myCellRawTimeStr );
 
@@ -382,8 +375,8 @@ namespace JiveXML {
       }
 
 
-      if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG)  << "MBTS no: " << nchan << ", type_chan_mod: " << MBTS_ID
-                                               << ", energy MeV pC: " << energyMeV << endmsg;
+      ATH_MSG_DEBUG( "MBTS no: " << nchan << ", type_chan_mod: " << MBTS_ID
+                     << ", energy MeV pC: " << energyMeV  );
 
       nchan++;
 
@@ -412,9 +405,7 @@ namespace JiveXML {
     DataMap[adcCountsStr] = adcCounts;
 
     //Be verbose
-    if (msgLvl(MSG::DEBUG)) {
-      msg(MSG::DEBUG) << dataTypeName() << " retrieved with " << phi.size() << " entries"<< endmsg;
-    }
+    ATH_MSG_DEBUG( dataTypeName() << " retrieved with " << phi.size() << " entries" );
 
     //All collections retrieved okay
     return DataMap;
diff --git a/Calorimeter/CaloCnv/CaloJiveXML/src/CaloTileRetriever.cxx b/Calorimeter/CaloCnv/CaloJiveXML/src/CaloTileRetriever.cxx
index 92662bb334665278bcbab5b5754cd5d320ecf483..9817bf1c4148d241e13e353345aa39eb45003138 100644
--- a/Calorimeter/CaloCnv/CaloJiveXML/src/CaloTileRetriever.cxx
+++ b/Calorimeter/CaloCnv/CaloJiveXML/src/CaloTileRetriever.cxx
@@ -9,7 +9,6 @@
 #include "EventContainers/SelectAllObject.h"
 
 #include "CaloEvent/CaloCellContainer.h"
-#include "CaloIdentifier/CaloIdManager.h"
 #include "CaloIdentifier/CaloCell_ID.h"
 #include "CaloDetDescr/CaloDetDescrElement.h"
 #include "TileEvent/TileCell.h"
@@ -36,13 +35,13 @@ namespace JiveXML {
    **/
   CaloTileRetriever::CaloTileRetriever(const std::string& type,const std::string& name,const IInterface* parent):
     AthAlgTool(type,name,parent),
-    m_typeName("TileDigit") {
+    m_typeName("TileDigit"),
+    m_calocell_id(nullptr)
+  {
 
    //Only declare the interface
    declareInterface<IDataRetriever>(this);
 
-   m_calo_id_man  = CaloIdManager::instance();
-   m_calocell_id  = m_calo_id_man->getCaloCell_ID();
    m_sgKey = "AllCalo";
 
    declareProperty("StoreGateKey" , m_sgKey);
@@ -62,6 +61,7 @@ namespace JiveXML {
   StatusCode CaloTileRetriever::initialize() {
 
     ATH_MSG_DEBUG( "Initialising Tool" );
+    ATH_CHECK( detStore()->retrieve (m_calocell_id, "CaloCell_ID") );
 
     //=== get TileCondToolTiming
     ATH_CHECK( m_tileToolTiming.retrieve() );
@@ -80,23 +80,18 @@ namespace JiveXML {
    */
   StatusCode CaloTileRetriever::retrieve(ToolHandle<IFormatTool> &FormatTool) {
 
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG)  << "in retrieve()" << endmsg;
+    ATH_MSG_DEBUG( "in retrieve()"  );
 
     const CaloCellContainer* cellContainer;
     if (!evtStore()->retrieve(cellContainer,m_sgKey)) {
-      if (msgLvl(MSG::WARNING)) msg(MSG::WARNING)  <<
-        "Could not retrieve Calorimeter Cells for Tile " << endmsg;
+      ATH_MSG_WARNING( "Could not retrieve Calorimeter Cells for Tile "  );
       return StatusCode::SUCCESS;
     }
 
     if (m_tile) {
       DataMap data = getCaloTileData(cellContainer);
-      if ( FormatTool->AddToEvent("TILE", m_sgKey, &data).isFailure()) {
-        if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Error reading Tile data" << endmsg;
-        return StatusCode::SUCCESS;
-      } else {
-        if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Tile retrieved" << endmsg;
-      }
+      ATH_CHECK( FormatTool->AddToEvent("TILE", m_sgKey, &data) );
+      ATH_MSG_DEBUG( "Tile retrieved"  );
     }
     //Tile cells retrieved okay
     return StatusCode::SUCCESS;
@@ -109,7 +104,7 @@ namespace JiveXML {
    */
   const DataMap CaloTileRetriever::getCaloTileData(const CaloCellContainer* cellContainer) {
 
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "getTileData()" << endmsg;
+    ATH_MSG_DEBUG( "getTileData()"  );
     char rndStr[30];
     DataMap DataMap;
 
@@ -143,16 +138,15 @@ namespace JiveXML {
 
 //    m_sub; m_sub.reserve(cellContainer->size());
     m_sub.clear();
-//    msg(MSG::INFO)  << "Size of CellC =  " << cellContainer->size() << endmsg;
 
     std::string adcCounts1Str = "adcCounts1 multiple=\"0\"";
     std::string adcCounts2Str = "adcCounts2 multiple=\"0\"";
 
     StatusCode scTileDigit = StatusCode::FAILURE;
     StatusCode scTileRawChannel = StatusCode::FAILURE;
-    const TileID* tileID;
-    const TileHWID* tileHWID;
-    const TileInfo* tileInfo;
+    const TileID* tileID = nullptr;
+    const TileHWID* tileHWID = nullptr;
+    const TileInfo* tileInfo = nullptr;
     const TileCablingService* cabling=nullptr;
     const TileDigitsContainer *tileDigits = nullptr;
     const TileRawChannelContainer* RawChannelCnt;
@@ -178,19 +172,18 @@ namespace JiveXML {
 
     //===== retrieving everything which is needed for Tile
 
-    StatusCode sc = detStore()->retrieve(tileID);
-    if ( sc.isFailure() )
-      if (msgLvl(MSG::ERROR)) msg(MSG::ERROR) << "in getCaloTileData(), Could not retrieve TileID" <<endmsg;
+    if (detStore()->retrieve(tileID).isFailure()) {
+      ATH_MSG_ERROR( "in getCaloTileData(), Could not retrieve TileID"  );
 
-    sc = detStore()->retrieve(tileHWID);
-    if ( sc.isFailure() )
-      if (msgLvl(MSG::ERROR)) msg(MSG::ERROR) << "in getCaloTileData(), Could not retrieve TileHWID" <<endmsg;
+    }
 
-    //=== get TileInfo
-    sc = detStore()->retrieve(tileInfo, "TileInfo");
-    if (sc.isFailure())
-        if (msgLvl(MSG::ERROR)) msg(MSG::ERROR) << "in getCaloTileData(), Could not retrieve TileInfo"<< endmsg;
+    if (detStore()->retrieve(tileHWID).isFailure()) {
+      ATH_MSG_ERROR( "in getCaloTileData(), Could not retrieve TileHWID"  );
+    }
 
+    if (detStore()->retrieve(tileInfo, "TileInfo").isFailure()) {
+      ATH_MSG_ERROR( "in getCaloTileData(), Could not retrieve TileInfo" );
+    }
 
     if (m_doTileDigit) {
 
@@ -204,7 +197,7 @@ namespace JiveXML {
       }
 
       if (scTileDigit.isFailure())
-        if (msgLvl(MSG::ERROR)) msg(MSG::ERROR) << "in getTileData(), Could not retrieve TileDigits" << endmsg;
+        ATH_MSG_ERROR( "in getTileData(), Could not retrieve TileDigits"  );
     }
 
 
@@ -227,7 +220,7 @@ namespace JiveXML {
       }
 
       if (scTileRawChannel.isFailure())
-        if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "in getTileData(), Could not retrieve TileRawchannel" << endmsg;
+        ATH_MSG_WARNING( "in getTileData(), Could not retrieve TileRawchannel"  );
     }
 
 
@@ -516,7 +509,7 @@ namespace JiveXML {
       } //if (m_doTileCellDetails)
     } // end cell iterator
 
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " Total energy in Tile in GeV : " <<  energyAllTile<< endmsg;
+    ATH_MSG_DEBUG( " Total energy in Tile in GeV : " <<  energyAllTile );
 
     if ( !pmt1digit.empty() ) pmt1digit.clear();
     if ( !pmt2digit.empty() ) pmt2digit.clear();
@@ -562,9 +555,7 @@ namespace JiveXML {
     DataMap[adcCounts2Str] = adcCounts2Vec;
 
     //Be verbose
-    if (msgLvl(MSG::DEBUG)) {
-      msg(MSG::DEBUG) << dataTypeName() << " retrieved with " << phi.size() << " entries"<< endmsg;
-    }
+    ATH_MSG_DEBUG( dataTypeName() << " retrieved with " << phi.size() << " entries" );
 
     //All collections retrieved okay
     return DataMap;
diff --git a/Calorimeter/CaloCnv/CaloJiveXML/src/LArDigitRetriever.cxx b/Calorimeter/CaloCnv/CaloJiveXML/src/LArDigitRetriever.cxx
index 5dcaf68e7c1a1064360d21475874da464f2364ae..96f13624db5448e365876659b7202bc7798b5b8c 100644
--- a/Calorimeter/CaloCnv/CaloJiveXML/src/LArDigitRetriever.cxx
+++ b/Calorimeter/CaloCnv/CaloJiveXML/src/LArDigitRetriever.cxx
@@ -9,7 +9,6 @@
 #include "EventContainers/SelectAllObject.h"
 
 #include "CaloEvent/CaloCellContainer.h"
-#include "CaloIdentifier/CaloIdManager.h"
 #include "CaloDetDescr/CaloDetDescrElement.h"
 #include "LArElecCalib/ILArPedestal.h"
 #include "LArElecCalib/ILArADC2MeVTool.h"
@@ -32,14 +31,13 @@ namespace JiveXML {
    **/
   LArDigitRetriever::LArDigitRetriever(const std::string& type,const std::string& name,const IInterface* parent):
     AthAlgTool(type,name,parent),
-    m_typeName("LArDigit")
+    m_typeName("LArDigit"),
+    m_calocell_id(nullptr)
   {
 
     //Only declare the interface
     declareInterface<IDataRetriever>(this);
     
-    m_calo_id_man  = CaloIdManager::instance();
-    m_calocell_id  = m_calo_id_man->getCaloCell_ID();
     m_sgKey = "AllCalo"; 
     m_sgKeyLArDigit[0] = "FREE"; // can also be: "HIGH" (for raw data)
     m_sgKeyLArDigit[1] = "LArDigitContainer_Thinned"; // used for DPD/ESD
@@ -70,7 +68,8 @@ namespace JiveXML {
 
   StatusCode LArDigitRetriever::initialize() {
 
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Initialising Tool" << endmsg;
+    ATH_MSG_DEBUG( "Initialising Tool"  );
+    ATH_CHECK( detStore()->retrieve (m_calocell_id, "CaloCell_ID") );
 
     ATH_CHECK( m_cablingKey.initialize() );
 
@@ -82,7 +81,7 @@ namespace JiveXML {
    */
   StatusCode LArDigitRetriever::retrieve(ToolHandle<IFormatTool> &FormatTool) {
     
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG)  << "in retrieve()" << endmsg;
+    ATH_MSG_DEBUG( "in retrieve()"  );
 
     if (m_doLArDigit || m_doHECDigit || m_doFCalDigit){ 
       m_doDigit = true; 
@@ -91,39 +90,26 @@ namespace JiveXML {
     const CaloCellContainer* cellContainer = nullptr;
     if (!evtStore()->retrieve(cellContainer,m_sgKey))
       {
-        if (msgLvl(MSG::WARNING)) msg(MSG::WARNING)  << 
-          "Could not retrieve Calorimeter Cells" << endmsg;
+        ATH_MSG_WARNING( "Could not retrieve Calorimeter Cells"  );
 //        return StatusCode::SUCCESS;
       }
 
    if(m_fcal){
       DataMap data = getLArDigitData(cellContainer,"FCAL",CaloCell_ID::LARFCAL);
-      if ( FormatTool->AddToEvent("FCAL", m_sgKey, &data).isFailure()){
-       if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Error reading FCAL data" << endmsg;
-//        return StatusCode::SUCCESS;
-      } else {
-       if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "FCAL retrieved" << endmsg;
-      }
+      ATH_CHECK( FormatTool->AddToEvent("FCAL", m_sgKey, &data) );
+      ATH_MSG_DEBUG( "FCAL retrieved"  );
     }
 
     if(m_lar){
       DataMap data = getLArDigitData(cellContainer,"LAr",CaloCell_ID::LAREM);
-      if ( FormatTool->AddToEvent("LAr", m_sgKey, &data).isFailure()){
-       if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Error reading LAr data" << endmsg;
-//        return StatusCode::SUCCESS;
-      } else {
-       if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "LAr retrieved" << endmsg;
-      }
+      ATH_CHECK( FormatTool->AddToEvent("LAr", m_sgKey, &data) );
+      ATH_MSG_DEBUG( "LAr retrieved"  );
     }
 
     if(m_hec){
       DataMap data = getLArDigitData(cellContainer,"HEC",CaloCell_ID::LARHEC);
-      if ( FormatTool->AddToEvent("HEC", m_sgKey, &data).isFailure()){
-       if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Error reading HEC data" << endmsg;
-//        return StatusCode::SUCCESS;
-      } else {
-       if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "HEC retrieved" << endmsg;
-      }
+      ATH_CHECK( FormatTool->AddToEvent("HEC", m_sgKey, &data) );
+      ATH_MSG_DEBUG( "HEC retrieved"  );
     }
     
     //Tile cells retrieved okay
@@ -141,7 +127,7 @@ namespace JiveXML {
   {
     
     //be verbose
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "getLArDigitData()" << endmsg;
+    ATH_MSG_DEBUG( "getLArDigitData()"  );
     
     char rndStr[30];
     DataMap DataMap;
@@ -180,25 +166,25 @@ namespace JiveXML {
     }
 
     if (scLArDigit.isFailure()){
-      if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Could not retrieve LArDigits" << endmsg;
+      ATH_MSG_WARNING( "Could not retrieve LArDigits"  );
     }
 
 
-    const ILArPedestal* larPedestal;
+    const ILArPedestal* larPedestal = nullptr;
     if ( detStore()->retrieve(larPedestal).isFailure()){
-      if (msgLvl(MSG::ERROR)) msg(MSG::ERROR) << "in getLArDigitData(), Could not retrieve LAr Pedestal" << endmsg;
+      ATH_MSG_ERROR( "in getLArDigitData(), Could not retrieve LAr Pedestal"  );
     }
     
-    const LArOnlineID* onlineId;
+    const LArOnlineID* onlineId = nullptr;
     if ( detStore()->retrieve(onlineId, "LArOnlineID").isFailure()) {
-     if (msgLvl(MSG::ERROR)) msg(MSG::ERROR) << "in getLArDigitData(),Could not get LArOnlineID!" << endmsg;
+      ATH_MSG_ERROR( "in getLArDigitData(),Could not get LArOnlineID!"  );
     }
      
-    IAlgTool* algtool;
+    IAlgTool* algtool = nullptr;
     ILArADC2MeVTool* adc2mevTool=0;
 
     if ( toolSvc()->retrieveTool("LArADC2MeVTool", algtool).isFailure()){
-      if (msgLvl(MSG::ERROR)) msg(MSG::ERROR) << "in getLArDigitData(), Could not retrieve LAr ADC2MeV Tool" <<endmsg;
+      ATH_MSG_ERROR( "in getLArDigitData(), Could not retrieve LAr ADC2MeV Tool"  );
     } else {
       adc2mevTool=dynamic_cast<ILArADC2MeVTool*>(algtool);
     }
@@ -253,7 +239,7 @@ namespace JiveXML {
         if ( adc2mevTool ){
           polynom_adc2mev = &(adc2mevTool->ADC2MEV(LArId,largain));
 	}else{
-	  if (msgLvl(MSG::ERROR)) msg(MSG::ERROR) << "in getLArDigitData(), Could not access LAr ADC2MeV Tool" <<endmsg;
+	  ATH_MSG_ERROR( "in getLArDigitData(), Could not access LAr ADC2MeV Tool"  );
 	}
         
         if ( Index >= 0 ){ // can be -1
@@ -501,9 +487,7 @@ namespace JiveXML {
     DataMap[LArSampleIndexStr] = LArSampleIndexVec; // adcCounts
 
     //Be verbose
-    if (msgLvl(MSG::DEBUG)) {
-      msg(MSG::DEBUG) << dataTypeName() << " retrieved with " << phi.size() << " entries"<< endmsg;
-    }
+    ATH_MSG_DEBUG( dataTypeName() << " retrieved with " << phi.size() << " entries" );
 
     //All collections retrieved okay
     return DataMap;
diff --git a/Calorimeter/CaloRec/python/CaloTopoClusterConfig.py b/Calorimeter/CaloRec/python/CaloTopoClusterConfig.py
index 20f9aec6e030665f118198b800d9a53fac0b77ad..ca57806650a14ed39d9d92753515936eb037d1eb 100644
--- a/Calorimeter/CaloRec/python/CaloTopoClusterConfig.py
+++ b/Calorimeter/CaloRec/python/CaloTopoClusterConfig.py
@@ -2,6 +2,473 @@
 
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from AthenaCommon.SystemOfUnits import MeV
+from AthenaCommon.Constants import VERBOSE
+
+def caloTopoCoolFolderCfg(configFlags):
+    result=ComponentAccumulator()
+    from IOVDbSvc.IOVDbSvcConfig import addFolders, IOVDbSvcCfg
+    result.mergeAll(IOVDbSvcCfg(configFlags))
+    # rely on global tag for both MC and data; do not specify folder tags
+    # use CALO_OFL only for GEO>=18
+    hadCalibFolders = [
+        "HadCalibration2/CaloEMFrac",
+        "HadCalibration2/H1ClusterCellWeights",
+        "HadCalibration2/CaloOutOfCluster",
+        "HadCalibration2/CaloOutOfClusterPi0",
+        "HadCalibration2/CaloDMCorr2"
+        ]
+    hadCalibPrefix = "/CALO/"
+    hadCalibDB = "CALO_ONL"
+    if configFlags.Input.isMC:
+        hadCalibPrefix = "/CALO/Ofl/"
+        hadCalibDB = "CALO_OFL"
+    hadCalibFolders = [ hadCalibPrefix + foldername for foldername in hadCalibFolders ]
+    result.merge(addFolders(configFlags, hadCalibFolders, hadCalibDB, className="CaloLocalHadCoeff"))
+
+    return result
+
+def getTopoClusterLocalCalibTools(configFlags, theCaloNoiseTool):
+    from CaloUtils.CaloUtilsConf import CaloLCClassificationTool, CaloLCWeightTool, CaloLCOutOfClusterTool, CaloLCDeadMaterialTool
+    from CaloClusterCorrection.CaloClusterCorrectionConf import CaloClusterLocalCalib
+    # Local cell weights
+    LCClassify   = CaloLCClassificationTool("LCClassify")
+    LCClassify.ClassificationKey   = "EMFracClassify"
+    LCClassify.UseSpread = False
+    LCClassify.MaxProbability = 0.5
+    # add the moments EM_PROBABILITY, HAD_WEIGHT, OOC_WEIGHT, DM_WEIGHT to the AOD:
+    LCClassify.StoreClassificationProbabilityInAOD = True
+    LCClassify.WeightingOfNegClusters = configFlags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
+
+    LCWeight = CaloLCWeightTool("LCWeight")
+    LCWeight.CorrectionKey       = "H1ClusterCellWeights"
+    LCWeight.SignalOverNoiseCut  = 2.0
+    # *****
+    # Needs calo noise tool config
+    LCWeight.CaloNoiseTool       = theCaloNoiseTool
+    # *****
+    LCWeight.UseHadProbability   = True
+
+    LocalCalib = CaloClusterLocalCalib ("LocalCalib")
+    LocalCalib.ClusterClassificationTool     = [LCClassify]
+    LocalCalib.ClusterRecoStatus             = [1,2]
+    LocalCalib.LocalCalibTools               = [LCWeight]
+    LocalCalib.WeightingOfNegClusters = configFlags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
+
+    # Out-of-cluster corrections
+    LCOut     = CaloLCOutOfClusterTool("LCOut")
+    LCOut.CorrectionKey       = "OOCCorrection"
+    LCOut.UseEmProbability    = False
+    LCOut.UseHadProbability   = True
+
+    OOCCalib   = CaloClusterLocalCalib ("OOCCalib")
+    OOCCalib.ClusterRecoStatus   = [1,2]
+    OOCCalib.LocalCalibTools     = [LCOut]
+    OOCCalib.WeightingOfNegClusters = configFlags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
+
+    LCOutPi0  = CaloLCOutOfClusterTool("LCOutPi0")
+    LCOutPi0.CorrectionKey    = "OOCPi0Correction"
+    LCOutPi0.UseEmProbability  = True
+    LCOutPi0.UseHadProbability = False
+
+    OOCPi0Calib   = CaloClusterLocalCalib ("OOCPi0Calib")
+    OOCPi0Calib.ClusterRecoStatus   = [1,2]
+    OOCPi0Calib.LocalCalibTools     = [LCOutPi0]
+
+    OOCPi0Calib.WeightingOfNegClusters = configFlags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
+
+    # Dead material corrections
+    LCDeadMaterial   = CaloLCDeadMaterialTool("LCDeadMaterial")
+    LCDeadMaterial.HadDMCoeffKey       = "HadDMCoeff2"
+    LCDeadMaterial.ClusterRecoStatus   = 0
+    LCDeadMaterial.WeightModeDM        = 2 
+    LCDeadMaterial.UseHadProbability   = True
+    LCDeadMaterial.WeightingOfNegClusters = configFlags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
+
+    DMCalib    = CaloClusterLocalCalib ("DMCalib")
+    DMCalib.ClusterRecoStatus   = [1,2]
+    DMCalib.LocalCalibTools      = [LCDeadMaterial]
+
+    DMCalib.WeightingOfNegClusters = configFlags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
+
+    lccalibtools = [
+        LocalCalib,
+        OOCCalib,
+        OOCPi0Calib,
+        DMCalib]
+    return lccalibtools
+
+def getTopoMoments(configFlags,theCaloNoiseTool):
+    from CaloRec.CaloRecConf import CaloClusterMomentsMaker
+    TopoMoments = CaloClusterMomentsMaker ("TopoMoments")
+    TopoMoments.WeightingOfNegClusters = configFlags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
+    from AthenaCommon.SystemOfUnits import deg
+    TopoMoments.MaxAxisAngle = 20*deg
+    TopoMoments.CaloNoiseTool = theCaloNoiseTool
+    TopoMoments.UsePileUpNoise = True
+    TopoMoments.TwoGaussianNoise = configFlags.Calo.TopoCluster.doTwoGaussianNoise
+    TopoMoments.MinBadLArQuality = 4000
+    TopoMoments.MomentsNames = ["FIRST_PHI" 
+                                ,"FIRST_ETA"
+                                ,"SECOND_R" 
+                                ,"SECOND_LAMBDA"
+                                ,"DELTA_PHI"
+                                ,"DELTA_THETA"
+                                ,"DELTA_ALPHA" 
+                                ,"CENTER_X"
+                                ,"CENTER_Y"
+                                ,"CENTER_Z"
+                                ,"CENTER_MAG"
+                                ,"CENTER_LAMBDA"
+                                ,"LATERAL"
+                                ,"LONGITUDINAL"
+                                ,"FIRST_ENG_DENS" 
+                                ,"ENG_FRAC_EM" 
+                                ,"ENG_FRAC_MAX" 
+                                ,"ENG_FRAC_CORE" 
+                                ,"FIRST_ENG_DENS" 
+                                ,"SECOND_ENG_DENS" 
+                                ,"ISOLATION"
+                                ,"ENG_BAD_CELLS"
+                                ,"N_BAD_CELLS"
+                                ,"N_BAD_CELLS_CORR"
+                                ,"BAD_CELLS_CORR_E"
+                                ,"BADLARQ_FRAC"
+                                ,"ENG_POS"
+                                ,"SIGNIFICANCE"
+                                ,"CELL_SIGNIFICANCE"
+                                ,"CELL_SIG_SAMPLING"
+                                ,"AVG_LAR_Q"
+                                ,"AVG_TILE_Q"
+                                ,"PTD"
+                                ,"MASS"
+                                ]
+
+    # *****
+    # Is this still right?
+    # only add HV related moments if it is offline.
+    # from IOVDbSvc.CondDB import conddb
+    # if not conddb.isOnline:
+    from LArCellRec.LArCellRecConf import LArHVFraction
+    if configFlags.Input.isMC:
+        TopoMoments.LArHVFraction=LArHVFraction(HVScaleCorrKey="LArHVScaleCorr")
+    else:
+        TopoMoments.LArHVFraction=LArHVFraction(HVScaleCorrKey="LArHVScaleCorrRecomputed")
+    TopoMoments.MomentsNames += ["ENG_BAD_HV_CELLS"
+                                 ,"N_BAD_HV_CELLS"
+                                 ]
+
+    return TopoMoments
+
+# a.k.a. DigiTruth
+def getTopoTruthMoments(configFlags,theCaloNoiseTool):
+    from CaloRec.CaloRecConf import CaloClusterMomentsMaker
+    TopoMoments_Truth = CaloClusterMomentsMaker_DigiHSTruth ("TopoMoments_Truth")
+    from LArCellRec.LArCellRecConf import LArHVFraction
+    TopoMoments_Truth.LArHVFraction=LArHVFraction(HVScaleCorrKey="LArHVScaleCorr")
+    TopoMoments_Truth.WeightingOfNegClusters = configFlags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
+    from AthenaCommon.SystemOfUnits import deg
+    TopoMoments_Truth.MaxAxisAngle = 20*deg
+    TopoMoments_Truth.CaloNoiseTool = theCaloNoiseTool
+    TopoMoments_Truth.UsePileUpNoise = True
+    TopoMoments_Truth.TwoGaussianNoise = configFlags.Calo,TopoCluster.doTwoGaussianNoise
+    TopoMoments_Truth.MinBadLArQuality = 4000
+    TopoMoments_Truth.MomentsNames = ["FIRST_PHI_DigiHSTruth"
+                                      ,"FIRST_ETA_DigiHSTruth"
+                                      ,"SECOND_R_DigiHSTruth"
+                                      ,"SECOND_LAMBDA_DigiHSTruth"
+                                      ,"DELTA_PHI_DigiHSTruth"
+                                      ,"DELTA_THETA_DigiHSTruth"
+                                      ,"DELTA_ALPHA_DigiHSTruth"
+                                      ,"CENTER_X_DigiHSTruth"
+                                      ,"CENTER_Y_DigiHSTruth"
+                                      ,"CENTER_Z_DigiHSTruth"
+                                      ,"CENTER_MAG_DigiHSTruth"
+                                      ,"CENTER_LAMBDA_DigiHSTruth"
+                                      ,"LATERAL_DigiHSTruth"
+                                      ,"LONGITUDINAL_DigiHSTruth"
+                                      ,"ENG_FRAC_CORE_DigiHSTruth"
+                                      ,"FIRST_ENG_DENS_DigiHSTruth"
+                                      ,"SECOND_ENG_DENS_DigiHSTruth"
+                                      ,"ISOLATION_DigiHSTruth"
+                                      ,"BAD_CELLS_CORR_E_DigiHSTruth"
+                                      ,"ENG_POS_DigiHSTruth"
+                                      ,"SIGNIFICANCE_DigiHSTruth"
+                                      ,"CELL_SIGNIFICANCE_DigiHSTruth"
+                                      ,"CELL_SIG_SAMPLING_DigiHSTruth"
+                                      ,"AVG_LAR_Q_DigiHSTruth"
+                                      ,"AVG_TILE_Q_DigiHSTruth"
+                                      ,"ENERGY_DigiHSTruth"
+                                      ,"PHI_DigiHSTruth"
+                                      ,"ETA_DigiHSTruth"
+                                      ]
+    return TopoMoments_Truth
+
+def getTopoCalibMoments(configFlags):
+    from CaloCalibHitRec.CaloCalibHitRecConf import CaloCalibClusterMomentsMaker2
+    TopoCalibMoments = CaloCalibClusterMomentsMaker2 ("TopoCalibMoments")
+    TopoCalibMoments.MomentsNames = ["ENG_CALIB_TOT"
+                                     ,"ENG_CALIB_OUT_L"
+                                     #,"ENG_CALIB_OUT_M"
+                                     # ,"ENG_CALIB_OUT_T"
+                                     # ,"ENG_CALIB_DEAD_L"
+                                     # ,"ENG_CALIB_DEAD_M"
+                                     # ,"ENG_CALIB_DEAD_T"
+                                     ,"ENG_CALIB_EMB0"
+                                     ,"ENG_CALIB_EME0"
+                                     ,"ENG_CALIB_TILEG3"
+                                     ,"ENG_CALIB_DEAD_TOT"
+                                     ,"ENG_CALIB_DEAD_EMB0"
+                                     ,"ENG_CALIB_DEAD_TILE0"
+                                     ,"ENG_CALIB_DEAD_TILEG3"
+                                     ,"ENG_CALIB_DEAD_EME0"
+                                     ,"ENG_CALIB_DEAD_HEC0"
+                                     ,"ENG_CALIB_DEAD_FCAL"
+                                     ,"ENG_CALIB_DEAD_LEAKAGE"
+                                     ,"ENG_CALIB_DEAD_UNCLASS"
+                                     ,"ENG_CALIB_FRAC_EM"
+                                     ,"ENG_CALIB_FRAC_HAD"
+                                     ,"ENG_CALIB_FRAC_REST"]
+    
+    TopoCalibMoments.CalibrationHitContainerNames = ["LArCalibrationHitInactive"
+                                                     ,"LArCalibrationHitActive"
+                                                     ,"TileCalibHitActiveCell"
+                                                     ,"TileCalibHitInactiveCell"]
+    TopoCalibMoments.DMCalibrationHitContainerNames = ["LArCalibrationHitDeadMaterial"
+                                                       ,"TileCalibHitDeadMaterial"]
+    return TopoCalibMOments
+
+def caloTopoCoolFolderCfg(configFlags):
+    result=ComponentAccumulator()
+    from IOVDbSvc.IOVDbSvcConfig import addFolders, IOVDbSvcCfg
+    result.mergeAll(IOVDbSvcCfg(configFlags))
+    # rely on global tag for both MC and data; do not specify folder tags
+    # use CALO_OFL only for GEO>=18
+    hadCalibFolders = [
+        "HadCalibration2/CaloEMFrac",
+        "HadCalibration2/H1ClusterCellWeights",
+        "HadCalibration2/CaloOutOfCluster",
+        "HadCalibration2/CaloOutOfClusterPi0",
+        "HadCalibration2/CaloDMCorr2"
+        ]
+    hadCalibPrefix = "/CALO/"
+    hadCalibDB = "CALO_ONL"
+    if configFlags.Input.isMC:
+        hadCalibPrefix = "/CALO/Ofl/"
+        hadCalibDB = "CALO_OFL"
+    hadCalibFolders = [ hadCalibPrefix + foldername for foldername in hadCalibFolders ]
+    result.merge(addFolders(configFlags, hadCalibFolders, hadCalibDB, className="CaloLocalHadCoeff"))
+
+    return result
+
+def getTopoClusterLocalCalibTools(configFlags, theCaloNoiseTool):
+    from CaloUtils.CaloUtilsConf import CaloLCClassificationTool, CaloLCWeightTool, CaloLCOutOfClusterTool, CaloLCDeadMaterialTool
+    from CaloClusterCorrection.CaloClusterCorrectionConf import CaloClusterLocalCalib
+    # Local cell weights
+    LCClassify   = CaloLCClassificationTool("LCClassify")
+    LCClassify.ClassificationKey   = "EMFracClassify"
+    LCClassify.UseSpread = False
+    LCClassify.MaxProbability = 0.5
+    # add the moments EM_PROBABILITY, HAD_WEIGHT, OOC_WEIGHT, DM_WEIGHT to the AOD:
+    LCClassify.StoreClassificationProbabilityInAOD = True
+    LCClassify.WeightingOfNegClusters = configFlags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
+
+    LCWeight = CaloLCWeightTool("LCWeight")
+    LCWeight.CorrectionKey       = "H1ClusterCellWeights"
+    LCWeight.SignalOverNoiseCut  = 2.0
+    # *****
+    # Needs calo noise tool config
+    LCWeight.CaloNoiseTool       = theCaloNoiseTool
+    # *****
+    LCWeight.UseHadProbability   = True
+
+    LocalCalib = CaloClusterLocalCalib ("LocalCalib")
+    LocalCalib.ClusterClassificationTool     = [LCClassify]
+    LocalCalib.ClusterRecoStatus             = [1,2]
+    LocalCalib.LocalCalibTools               = [LCWeight]
+    LocalCalib.WeightingOfNegClusters = configFlags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
+
+    # Out-of-cluster corrections
+    LCOut     = CaloLCOutOfClusterTool("LCOut")
+    LCOut.CorrectionKey       = "OOCCorrection"
+    LCOut.UseEmProbability    = False
+    LCOut.UseHadProbability   = True
+
+    OOCCalib   = CaloClusterLocalCalib ("OOCCalib")
+    OOCCalib.ClusterRecoStatus   = [1,2]
+    OOCCalib.LocalCalibTools     = [LCOut]
+    OOCCalib.WeightingOfNegClusters = configFlags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
+
+    LCOutPi0  = CaloLCOutOfClusterTool("LCOutPi0")
+    LCOutPi0.CorrectionKey    = "OOCPi0Correction"
+    LCOutPi0.UseEmProbability  = True
+    LCOutPi0.UseHadProbability = False
+
+    OOCPi0Calib   = CaloClusterLocalCalib ("OOCPi0Calib")
+    OOCPi0Calib.ClusterRecoStatus   = [1,2]
+    OOCPi0Calib.LocalCalibTools     = [LCOutPi0]
+
+    OOCPi0Calib.WeightingOfNegClusters = configFlags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
+
+    # Dead material corrections
+    LCDeadMaterial   = CaloLCDeadMaterialTool("LCDeadMaterial")
+    LCDeadMaterial.HadDMCoeffKey       = "HadDMCoeff2"
+    LCDeadMaterial.ClusterRecoStatus   = 0
+    LCDeadMaterial.WeightModeDM        = 2 
+    LCDeadMaterial.UseHadProbability   = True
+    LCDeadMaterial.WeightingOfNegClusters = configFlags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
+
+    DMCalib    = CaloClusterLocalCalib ("DMCalib")
+    DMCalib.ClusterRecoStatus   = [1,2]
+    DMCalib.LocalCalibTools      = [LCDeadMaterial]
+
+    DMCalib.WeightingOfNegClusters = configFlags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
+
+    lccalibtools = [
+        LocalCalib,
+        OOCCalib,
+        OOCPi0Calib,
+        DMCalib]
+    return lccalibtools
+
+def getTopoMoments(configFlags,theCaloNoiseTool):
+    from CaloRec.CaloRecConf import CaloClusterMomentsMaker
+    TopoMoments = CaloClusterMomentsMaker ("TopoMoments")
+    TopoMoments.WeightingOfNegClusters = configFlags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
+    from AthenaCommon.SystemOfUnits import deg
+    TopoMoments.MaxAxisAngle = 20*deg
+    TopoMoments.CaloNoiseTool = theCaloNoiseTool
+    TopoMoments.UsePileUpNoise = True
+    TopoMoments.TwoGaussianNoise = configFlags.Calo.TopoCluster.doTwoGaussianNoise
+    TopoMoments.MinBadLArQuality = 4000
+    TopoMoments.MomentsNames = ["FIRST_PHI" 
+                                ,"FIRST_ETA"
+                                ,"SECOND_R" 
+                                ,"SECOND_LAMBDA"
+                                ,"DELTA_PHI"
+                                ,"DELTA_THETA"
+                                ,"DELTA_ALPHA" 
+                                ,"CENTER_X"
+                                ,"CENTER_Y"
+                                ,"CENTER_Z"
+                                ,"CENTER_MAG"
+                                ,"CENTER_LAMBDA"
+                                ,"LATERAL"
+                                ,"LONGITUDINAL"
+                                ,"FIRST_ENG_DENS" 
+                                ,"ENG_FRAC_EM" 
+                                ,"ENG_FRAC_MAX" 
+                                ,"ENG_FRAC_CORE" 
+                                ,"FIRST_ENG_DENS" 
+                                ,"SECOND_ENG_DENS" 
+                                ,"ISOLATION"
+                                ,"ENG_BAD_CELLS"
+                                ,"N_BAD_CELLS"
+                                ,"N_BAD_CELLS_CORR"
+                                ,"BAD_CELLS_CORR_E"
+                                ,"BADLARQ_FRAC"
+                                ,"ENG_POS"
+                                ,"SIGNIFICANCE"
+                                ,"CELL_SIGNIFICANCE"
+                                ,"CELL_SIG_SAMPLING"
+                                ,"AVG_LAR_Q"
+                                ,"AVG_TILE_Q"
+                                ,"PTD"
+                                ,"MASS"
+                                ]
+
+    # *****
+    # Is this still right?
+    # only add HV related moments if it is offline.
+    # from IOVDbSvc.CondDB import conddb
+    # if not conddb.isOnline:
+    from LArCellRec.LArCellRecConf import LArHVFraction
+    if configFlags.Input.isMC:
+        TopoMoments.LArHVFraction=LArHVFraction(HVScaleCorrKey="LArHVScaleCorr")
+    else:
+        TopoMoments.LArHVFraction=LArHVFraction(HVScaleCorrKey="LArHVScaleCorrRecomputed")
+    TopoMoments.MomentsNames += ["ENG_BAD_HV_CELLS"
+                                 ,"N_BAD_HV_CELLS"
+                                 ]
+
+    return TopoMoments
+
+# a.k.a. DigiTruth
+def getTopoTruthMoments(configFlags,theCaloNoiseTool):
+    from CaloRec.CaloRecConf import CaloClusterMomentsMaker
+    TopoMoments_Truth = CaloClusterMomentsMaker_DigiHSTruth ("TopoMoments_Truth")
+    from LArCellRec.LArCellRecConf import LArHVFraction
+    TopoMoments_Truth.LArHVFraction=LArHVFraction(HVScaleCorrKey="LArHVScaleCorr")
+    TopoMoments_Truth.WeightingOfNegClusters = configFlags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
+    from AthenaCommon.SystemOfUnits import deg
+    TopoMoments_Truth.MaxAxisAngle = 20*deg
+    TopoMoments_Truth.CaloNoiseTool = theCaloNoiseTool
+    TopoMoments_Truth.UsePileUpNoise = True
+    TopoMoments_Truth.TwoGaussianNoise = configFlags.Calo,TopoCluster.doTwoGaussianNoise
+    TopoMoments_Truth.MinBadLArQuality = 4000
+    TopoMoments_Truth.MomentsNames = ["FIRST_PHI_DigiHSTruth"
+                                      ,"FIRST_ETA_DigiHSTruth"
+                                      ,"SECOND_R_DigiHSTruth"
+                                      ,"SECOND_LAMBDA_DigiHSTruth"
+                                      ,"DELTA_PHI_DigiHSTruth"
+                                      ,"DELTA_THETA_DigiHSTruth"
+                                      ,"DELTA_ALPHA_DigiHSTruth"
+                                      ,"CENTER_X_DigiHSTruth"
+                                      ,"CENTER_Y_DigiHSTruth"
+                                      ,"CENTER_Z_DigiHSTruth"
+                                      ,"CENTER_MAG_DigiHSTruth"
+                                      ,"CENTER_LAMBDA_DigiHSTruth"
+                                      ,"LATERAL_DigiHSTruth"
+                                      ,"LONGITUDINAL_DigiHSTruth"
+                                      ,"ENG_FRAC_CORE_DigiHSTruth"
+                                      ,"FIRST_ENG_DENS_DigiHSTruth"
+                                      ,"SECOND_ENG_DENS_DigiHSTruth"
+                                      ,"ISOLATION_DigiHSTruth"
+                                      ,"BAD_CELLS_CORR_E_DigiHSTruth"
+                                      ,"ENG_POS_DigiHSTruth"
+                                      ,"SIGNIFICANCE_DigiHSTruth"
+                                      ,"CELL_SIGNIFICANCE_DigiHSTruth"
+                                      ,"CELL_SIG_SAMPLING_DigiHSTruth"
+                                      ,"AVG_LAR_Q_DigiHSTruth"
+                                      ,"AVG_TILE_Q_DigiHSTruth"
+                                      ,"ENERGY_DigiHSTruth"
+                                      ,"PHI_DigiHSTruth"
+                                      ,"ETA_DigiHSTruth"
+                                      ]
+    return TopoMoments_Truth
+
+def getTopoCalibMoments(configFlags):
+    from CaloCalibHitRec.CaloCalibHitRecConf import CaloCalibClusterMomentsMaker2
+    TopoCalibMoments = CaloCalibClusterMomentsMaker2 ("TopoCalibMoments")
+    TopoCalibMoments.MomentsNames = ["ENG_CALIB_TOT"
+                                     ,"ENG_CALIB_OUT_L"
+                                     #,"ENG_CALIB_OUT_M"
+                                     # ,"ENG_CALIB_OUT_T"
+                                     # ,"ENG_CALIB_DEAD_L"
+                                     # ,"ENG_CALIB_DEAD_M"
+                                     # ,"ENG_CALIB_DEAD_T"
+                                     ,"ENG_CALIB_EMB0"
+                                     ,"ENG_CALIB_EME0"
+                                     ,"ENG_CALIB_TILEG3"
+                                     ,"ENG_CALIB_DEAD_TOT"
+                                     ,"ENG_CALIB_DEAD_EMB0"
+                                     ,"ENG_CALIB_DEAD_TILE0"
+                                     ,"ENG_CALIB_DEAD_TILEG3"
+                                     ,"ENG_CALIB_DEAD_EME0"
+                                     ,"ENG_CALIB_DEAD_HEC0"
+                                     ,"ENG_CALIB_DEAD_FCAL"
+                                     ,"ENG_CALIB_DEAD_LEAKAGE"
+                                     ,"ENG_CALIB_DEAD_UNCLASS"
+                                     ,"ENG_CALIB_FRAC_EM"
+                                     ,"ENG_CALIB_FRAC_HAD"
+                                     ,"ENG_CALIB_FRAC_REST"]
+    
+    TopoCalibMoments.CalibrationHitContainerNames = ["LArCalibrationHitInactive"
+                                                     ,"LArCalibrationHitActive"
+                                                     ,"TileCalibHitActiveCell"
+                                                     ,"TileCalibHitInactiveCell"]
+    TopoCalibMoments.DMCalibrationHitContainerNames = ["LArCalibrationHitDeadMaterial"
+                                                       ,"TileCalibHitDeadMaterial"]
+    return TopoCalibMOments
 
 def CaloTopoClusterCfg(configFlags):
     result=ComponentAccumulator()
@@ -16,13 +483,22 @@ def CaloTopoClusterCfg(configFlags):
     from CaloClusterCorrection.CaloClusterCorrectionConf import CaloClusterCellWeightCalib
     from CaloRec.CaloRecConf import CaloTopoClusterMaker, CaloTopoClusterSplitter, CaloClusterMomentsMaker, CaloClusterMaker, CaloClusterSnapshot #, CaloClusterLockVars, CaloClusterPrinter
 
-    
     result.merge(LArGMCfg(configFlags))
+
+    from LArBadChannelTool.LArBadChannelConfig import LArBadChannelCfg
+    result.merge(LArBadChannelCfg(configFlags))
+    from LArCalibUtils.LArHVScaleConfig import LArHVScaleCfg
+    result.merge(LArHVScaleCfg(configFlags))
+
     result.merge(TileGMCfg(configFlags))
+    from TileConditions.TileConditionsConfig import tileCondCfg
+    result.merge(tileCondCfg(configFlags))
 
     #Get CaloNoiseTool
     acc,theCaloNoiseTool=CaloNoiseToolCfg(configFlags)
     result.merge(acc)
+    
+    theCaloClusterSnapshot=CaloClusterSnapshot(OutputName="CaloTopoCluster",SetCrossLinks=True)
 
     # maker tools
     TopoMaker = CaloTopoClusterMaker("TopoMaker")
@@ -92,10 +568,26 @@ def CaloTopoClusterCfg(configFlags):
         
 
     CaloTopoCluster=CaloClusterMaker("CaloTopoCluster")
-    CaloTopoCluster.ClustersOutputName="CaloCalTopoClusters"   
+    CaloTopoCluster.ClustersOutputName="CaloTopoClusters"
+    if configFlags.Calo.TopoCluster.doTopoClusterLocalCalib:
+        CaloTopoCluster.ClustersOutputName="CaloCalTopoClusters"
 
     CaloTopoCluster.ClusterMakerTools = [TopoMaker, TopoSplitter]
     
+    from CaloClusterCorrection.CaloClusterBadChannelListCorr import CaloClusterBadChannelListCorr
+    BadChannelListCorr = CaloClusterBadChannelListCorr()
+    CaloTopoCluster.ClusterCorrectionTools += [BadChannelListCorr]
+
+    CaloTopoCluster.ClusterCorrectionTools += [getTopoMoments(configFlags,theCaloNoiseTool)]
+
+    CaloTopoCluster.ClusterCorrectionTools += [theCaloClusterSnapshot]
+
+    if configFlags.Calo.TopoCluster.doTopoClusterLocalCalib:
+        CaloTopoCluster.ClustersOutputName="CaloCalTopoClusters"
+        CaloTopoCluster.ClusterCorrectionTools += getTopoClusterLocalCalibTools(configFlags,theCaloNoiseTool)
+
+        result.merge(caloTopoCoolFolderCfg(configFlags))
+
     return result,CaloTopoCluster
 
 
@@ -108,17 +600,24 @@ if __name__=="__main__":
     from AthenaCommon.Constants import DEBUG
     from AthenaConfiguration.AllConfigFlags import ConfigFlags
 
-    log.setLevel(DEBUG)
+    #log.setLevel(DEBUG)
+
+    ConfigFlags.Input.Files = ["myESD-data.pool.root"]
+#    ConfigFlags.Output.ESDFileName="esdOut.pool.root"
+
+    nThreads=1
+    ConfigFlags.Concurrency.NumThreads = nThreads
+    if nThreads>0:
+        ConfigFlags.Scheduler.ShowDataDeps = True
+        ConfigFlags.Scheduler.ShowDataFlow = True
+        ConfigFlags.Scheduler.ShowControlFlow = True
+        ConfigFlags.Concurrency.NumConcurrentEvents = nThreads
 
-    ConfigFlags.Input.isMC = False
-    ConfigFlags.Input.Files = ["myESD.pool.root"]
-    ConfigFlags.Output.ESDFileName="esdOut.pool.root"
     ConfigFlags.lock()
 
-    from AthenaConfiguration.MainServicesConfig import MainServicesSerialCfg 
+    from AthenaConfiguration.MainServicesConfig import MainServicesThreadedCfg 
     from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
-    #cfg=ComponentAccumulator()
-    cfg=MainServicesSerialCfg() 
+    cfg=MainServicesThreadedCfg(ConfigFlags)
     cfg.merge(PoolReadCfg(ConfigFlags))
     
     theKey="CaloCalTopoClustersNew"
@@ -130,14 +629,28 @@ if __name__=="__main__":
     cfg.addEventAlgo(topoAlg,sequenceName="AthAlgSeq")
 
     from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
-    cfg.merge(OutputStreamCfg(ConfigFlags,"ESD", ItemList=["xAOD::CaloClusterContainer#"+theKey,
-                                                            "xAOD::CaloClusterAuxContainer#"+theKey+"Aux.",
-                                                            "CaloClusterCellLinkContainer#"+theKey+"_links"]))
+    cfg.merge(OutputStreamCfg(ConfigFlags,"xAOD", ItemList=["xAOD::CaloClusterContainer#CaloCalTopoClusters*",#+theKey,
+                                                           "xAOD::CaloClusterAuxContainer#*CaloCalTopoClusters*Aux.",#+theKey+"Aux.",
+                                                           # "CaloClusterCellLinkContainer#"+theKey+"_links"
+                                                           ]))
+    cfg.getEventAlgo("OutputStreamxAOD").ForceRead=True
+
+    from AthenaServices.AthenaServicesConf import ThinningSvc, ThinningOutputTool
+    cfg.addService(ThinningSvc())
+    tot = ThinningOutputTool("Thin_xAOD",ThinningSvc = cfg.getService("ThinningSvc"))
+    cfg.getEventAlgo("OutputStreamxAOD").HelperTools += [tot]
 
+    from ThinningUtils.ThinningUtilsConf import ThinNegativeEnergyCaloClustersAlg
+    theNegativeEnergyCaloClustersThinner = ThinNegativeEnergyCaloClustersAlg(
+        "ThinNegativeEnergyCaloClustersAlg",
+        CaloClustersKey=theKey,
+        ThinNegativeEnergyCaloClusters = True,
+        )
+    cfg.addEventAlgo(theNegativeEnergyCaloClustersThinner,"AthAlgSeq")
   
-    cfg.getService("StoreGateSvc").Dump=True
+#    cfg.getService("StoreGateSvc").Dump=True
 
-    cfg.run()
+    cfg.run(10)
     #f=open("CaloTopoCluster.pkl","w")
     #cfg.store(f)
     #f.close()
diff --git a/Calorimeter/CaloTools/python/CaloNoiseToolConfig.py b/Calorimeter/CaloTools/python/CaloNoiseToolConfig.py
index d3e6c0010ed0e80cc1703777dc35915274b90312..3d9b79b0042b982d209038f8c7c70a941707d702 100644
--- a/Calorimeter/CaloTools/python/CaloNoiseToolConfig.py
+++ b/Calorimeter/CaloTools/python/CaloNoiseToolConfig.py
@@ -1,3 +1,4 @@
+
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from IOVDbSvc.IOVDbSvcConfig import addFolders
 from CaloTools.CaloToolsConf import CaloNoiseToolDB
@@ -18,7 +19,7 @@ def CaloNoiseToolCfg(configFlags):
     if configFlags.Common.isOnline:
         #online mode:
         folder  = "/CALO/Noise/CellNoise"
-        result.merge(addFolders(configFlags,inputFlags,folder,'CALO_ONL'))
+        result.merge(addFolders(configFlags,folder,'CALO_ONL'))
         caloNoiseToolDB.FolderNames=[folder,]
         if fixedLumi >= 0 :
             caloNoiseToolDB.Luminosity = fixedLumi
@@ -35,7 +36,7 @@ def CaloNoiseToolCfg(configFlags):
                 log.info("online mode: ignore pileup noise")
                 pass
         result.addPublicTool(caloNoiseToolDB)
-        return result
+        return result, caloNoiseToolDB
 
     #The not-online case:
     if isMC:
@@ -75,7 +76,7 @@ def CaloNoiseToolCfg(configFlags):
                 lumiFolder = '/TRIGGER/LUMI/LBLESTONL'
                 result.merge(addFolders(configFlags,lumiFolder,'TRIGGER_ONL'))
                 log.info("offline mode: use luminosity = f(Lumiblock) to scale pileup noise")
-                caloNoiseToolDB.LumiFolderName = lumiFolder
+            caloNoiseToolDB.LumiFolderName = lumiFolder
 
 
         folders=[("LAR_OFL","/LAR/NoiseOfl/CellNoise"),
@@ -85,8 +86,32 @@ def CaloNoiseToolCfg(configFlags):
         if configFlags.IOVDb.DatabaseInstance=="COMP200":
             folders.append(("CALO_OFL","/CALO/Ofl/Noise/CellNoise")),
         
-        #Fixme: Add rescaling of noise based on HV! 
+        if configFlags.IOVDb.DatabaseInstance=="CONDBR2" and configFlags.Calo.Cell.doLArHVCorr:
+            log.info("Run2 & doLArHVCorr=True: Will rescale noise automatically for HV trips")
+
+            from LArCalibUtils.LArHVScaleConfig import LArHVScaleCfg
+            result.merge( LArHVScaleCfg(configFlags) )
+
+            from LArCondUtils.LArCondUtilsConf import LArHVToolDB
+            theLArHVToolDB = LArHVToolDB("LArHVToolDB")
+            result.addPublicTool( theLArHVToolDB )
 
+            from LArRecUtils.LArRecUtilsConf import LArHVCorrTool
+            theLArHVCorrTool = LArHVCorrTool("LArHVCorrTool")
+            theLArHVCorrTool.keyOutput = "LArHVScaleCorr"
+            theLArHVCorrTool.folderName= "/LAR/ElecCalibFlat/HVScaleCorr"
+            theLArHVCorrTool.doTdrift = False
+            theLArHVCorrTool.DeltaTupdate = 0
+            theLArHVCorrTool.HVTool = theLArHVToolDB
+            result.addPublicTool( theLArHVCorrTool )
+
+            from LArCellRec.LArCellRecConf import LArCellHVCorr
+            theLArCellHVCorr = LArCellHVCorr("LArCellHVCorr")
+            theLArCellHVCorr.HVCorrTool = theLArHVCorrTool
+            result.addPublicTool( theLArCellHVCorr )
+
+            caloNoiseToolDB.RescaleForHV=True
+            caloNoiseToolDB.LArHVCellCorrTool = theLArCellHVCorr
 
         pass #end of real data case
     
@@ -96,7 +121,7 @@ def CaloNoiseToolCfg(configFlags):
     caloNoiseToolDB.FolderNames=[f[1] for f in folders]    
 
     result.addPublicTool(caloNoiseToolDB)
-    
+
     return result,caloNoiseToolDB
 
 if __name__ == "__main__":
diff --git a/Control/AthenaConfiguration/python/AllConfigFlags.py b/Control/AthenaConfiguration/python/AllConfigFlags.py
index cbcef7a4e36e3102c365909f8881a12c8fdf9334..3dbc6b7a75c84e0e220d291d95a834f3f65332ec 100644
--- a/Control/AthenaConfiguration/python/AllConfigFlags.py
+++ b/Control/AthenaConfiguration/python/AllConfigFlags.py
@@ -35,8 +35,9 @@ def _createCfgFlags():
 
     # replace global.Beam*
     acf.addFlag('Beam.BunchSpacing', 25) # former global.BunchSpacing
-    acf.addFlag("Beam.NumberOfCollisions",0) # former global.NumberOfCollisions
-    acf.addFlag('Beam.Type', 'collisions') # former global.BeamType
+    acf.addFlag('Beam.Type', lambda prevFlags : GetFileMD(prevFlags.Input.Files).get('beam_type','collisions') )# former global.BeamType
+    acf.addFlag("Beam.NumberOfCollisions", lambda prevFlags : (GetFileMD(prevFlags.Input.Files)["/Digitization/Parameters"]["numberOfCollisions"] if prevFlags.Input.isMC \
+                                                                   else (2. if prevFlags.Beam.Type=='collisions' else 0.))) # former global.NumberOfCollisions
     acf.addFlag('Beam.Energy', lambda prevFlags : GetFileMD(prevFlags.Input.Files).get('BeamEnergy',7*TeV)) # former global.BeamEnergy
     acf.addFlag('Beam.estimatedLuminosity', lambda prevFlags : ( 1E33*(prevFlags.Beam.NumberOfCollisions)/2.3 ) *\
         (25./prevFlags.Beam.BunchSpacing)) # former flobal.estimatedLuminosity
@@ -84,11 +85,14 @@ def _createCfgFlags():
 #CaloNoise Flags
     acf.addFlag("Calo.Noise.fixedLumiForNoise",-1)
     acf.addFlag("Calo.Noise.useCaloNoiseLumi",True)
-                
+
+#CaloCell flags
+    acf.addFlag("Calo.Cell.doLArHVCorr",False) # Disable for now as it is broken...
 
 #TopoCluster Flags:
     acf.addFlag("Calo.TopoCluster.doTwoGaussianNoise",True)
     acf.addFlag("Calo.TopoCluster.doTreatEnergyCutAsAbsolute",False)
+    acf.addFlag("Calo.TopoCluster.doTopoClusterLocalCalib",True)
 
 
     def __trigger():
diff --git a/Control/AthenaConfiguration/python/MainServicesConfig.py b/Control/AthenaConfiguration/python/MainServicesConfig.py
index e230efaf380c9bc0372131d7797a80100e89d1d5..b2f41bb149213242c1195c7bce4dfe3254d81b54 100644
--- a/Control/AthenaConfiguration/python/MainServicesConfig.py
+++ b/Control/AthenaConfiguration/python/MainServicesConfig.py
@@ -14,13 +14,32 @@ def MainServicesMiniCfg(LoopMgr='AthenaEventLoopMgr'):
     cfg.setAppProperty('JobOptionsPreAction', '')
     return cfg
 
+from AthenaConfiguration.AthConfigFlags import AthConfigFlags
 
-def MainServicesSerialCfg(LoopMgr='AthenaEventLoopMgr'):
+def MainServicesSerialCfg():
+    serialflags=AthConfigFlags()
+    serialflags.addFlag('Concurrency.NumProcs', 0)
+    serialflags.addFlag('Concurrency.NumThreads', 0)
+    serialflags.addFlag('Concurrency.NumConcurrentEvents', 0)
+    return MainServicesThreadedCfg(serialflags)
+
+def MainServicesThreadedCfg(cfgFlags):
+
+    # Run a serial job for threads=0
+    LoopMgr = 'AthenaEventLoopMgr'
+    if cfgFlags.Concurrency.NumThreads>0:
+        if cfgFlags.Concurrency.NumConcurrentEvents==0:
+            # In a threaded job this will mess you up because no events will be processed
+            raise Exception("Requested Concurrency.NumThreads>0 and Concurrency.NumConcurrentEvents==0, which will not process events!")
+
+        LoopMgr = "AthenaHiveEventLoopMgr"
+
+    ########################################################################
+    # Core components needed for serial and threaded jobs
     cfg=ComponentAccumulator("AthMasterSeq")
-    cfg.merge(MainServicesMiniCfg(LoopMgr))
+    cfg.merge( MainServicesMiniCfg(LoopMgr) )
     cfg.setAppProperty('TopAlg',['AthSequencer/AthMasterSeq'],overwrite=True)
-    cfg.setAppProperty('OutStreamType', 'AthenaOutputStream')    
-    
+    cfg.setAppProperty('OutStreamType', 'AthenaOutputStream')
 
     #Build standard sequences:
     cfg.addSequence(AthSequencer('AthAlgEvtSeq',Sequential=True, StopOverride=True),parentName="AthMasterSeq") 
@@ -29,9 +48,20 @@ def MainServicesSerialCfg(LoopMgr='AthenaEventLoopMgr'):
 
     cfg.addSequence(AthSequencer('AthBeginSeq',Sequential=True),parentName='AthAlgEvtSeq')
     cfg.addSequence(AthSequencer('AthAllAlgSeq'),parentName='AthAlgEvtSeq') 
-    cfg.addSequence(AthSequencer('AthAlgSeq',IgnoreFilterPassed=True,StopOverride=True),parentName='AthAllAlgSeq')
+
+    if cfgFlags.Concurrency.NumThreads==0:
+        # For serial execution, we need the CondAlgs to execute first.
+        cfg.addSequence(AthSequencer('AthCondSeq'),parentName='AthAllAlgSeq')
+        cfg.addSequence(AthSequencer('AthAlgSeq',IgnoreFilterPassed=True,StopOverride=True),parentName='AthAllAlgSeq')
+    else:
+        # In MT, the order of execution is irrelevant (determined by data deps).
+        # We add the conditions sequence later such that the CondInputLoader gets
+        # initialized after all other user Algorithms for MT, so the base classes
+        # of data deps can be correctly determined. 
+        cfg.addSequence(AthSequencer('AthAlgSeq',IgnoreFilterPassed=True,StopOverride=True),parentName='AthAllAlgSeq')
+        cfg.addSequence(AthSequencer('AthCondSeq'),parentName='AthAllAlgSeq')
+
     cfg.addSequence(AthSequencer('AthEndSeq',Sequential=True),parentName='AthAlgEvtSeq') 
-    cfg.addSequence(AthSequencer('AthCondSeq'),parentName='AthAllAlgSeq')
 
     #Set up incident firing:
     from AthenaServices.AthenaServicesConf import AthIncFirerAlg
@@ -47,97 +77,84 @@ def MainServicesSerialCfg(LoopMgr='AthenaEventLoopMgr'):
     from CLIDComps.CLIDCompsConf import ClassIDSvc
     cfg.addService(ClassIDSvc(CLIDDBFiles= ['clid.db',"Gaudi_clid.db" ]))
 
-
     from StoreGate.StoreGateConf import StoreGateSvc
     cfg.addService(StoreGateSvc())
     cfg.addService(StoreGateSvc("DetectorStore"))
     cfg.addService(StoreGateSvc("HistoryStore"))
     
     cfg.setAppProperty('InitializationLoopCheck',False)
-    return cfg
-    
 
-def MainServicesThreadedCfg(cfgFlags):
-    # Neater ways to set the loop manager? Can't be altered
-    # after setting up the 
-
-    # Run a serial job for threads=0
-    if cfgFlags.Concurrency.NumThreads==0:
-        return MainServicesSerialCfg()
-
-    if cfgFlags.Concurrency.NumConcurrentEvents==0:
-        # In a threaded job this will mess you up because no events will be processed
-        raise Exception("Requested Concurrency.NumThreads>0 and Concurrency.NumConcurrentEvents==0, which will not process events!")
-
-    cfg = MainServicesSerialCfg("AthenaHiveEventLoopMgr")
-
-    # Migrated code from AtlasThreadedJob.py
-    from GaudiCoreSvc.GaudiCoreSvcConf import MessageSvc
-    from GaudiSvc.GaudiSvcConf import StatusCodeSvc, AuditorSvc
-
-    msgsvc = MessageSvc()
-    msgsvc.defaultLimit = 0 
-    #msgFmt = "% F%40W%S%4W%e%s%7W%R%T %0W%M"
-    msgFmt = "% F%18W%S%7W%R%T %0W%M"
-    msgsvc.Format = msgFmt
-    cfg.addService(msgsvc)
-
-    scsvc = StatusCodeSvc()
-    scsvc.AbortOnError = False
-    cfg.addService(scsvc)
-    cfg.setAppProperty('StatusCodeCheck',False)
-
-    from StoreGate.StoreGateConf import SG__HiveMgrSvc
-    hivesvc = SG__HiveMgrSvc("EventDataSvc")
-    hivesvc.NSlots = cfgFlags.Concurrency.NumConcurrentEvents
-    cfg.addService( hivesvc )
-
-    from StoreGate.StoreGateConf import StoreGateSvc
-    cfg.addService( StoreGateSvc("ConditionStore") )
-
-    from GaudiHive.GaudiHiveConf import AlgResourcePool
-    from AthenaCommon.Constants import INFO
-    arp=AlgResourcePool( OutputLevel = INFO )
-    arp.TopAlg=["AthMasterSeq"] #this should enable control flow
-    cfg.addService( arp )
-
-    from GaudiHive.GaudiHiveConf import AvalancheSchedulerSvc
-    scheduler = AvalancheSchedulerSvc()
-    scheduler.CheckDependencies    = cfgFlags.Scheduler.CheckDependencies
-    scheduler.ShowDataDependencies = cfgFlags.Scheduler.ShowDataDeps
-    scheduler.ShowDataFlow         = cfgFlags.Scheduler.ShowDataFlow
-    scheduler.ShowControlFlow      = cfgFlags.Scheduler.ShowControlFlow
-    scheduler.ThreadPoolSize       = cfgFlags.Concurrency.NumThreads
-    cfg.addService(scheduler)
-
-    from SGComps.SGCompsConf import SGInputLoader
-    # FailIfNoProxy=False makes it a warning, not an error, if unmet data
-    # dependencies are not found in the store.  It should probably be changed
-    # to True eventually.
-    inputloader = SGInputLoader (FailIfNoProxy = False)
-    cfg.addEventAlgo( inputloader, "AthAlgSeq" )
-    scheduler.DataLoaderAlg = inputloader.getName()
-
-    from AthenaServices.AthenaServicesConf import AthenaHiveEventLoopMgr
-
-    elmgr = AthenaHiveEventLoopMgr()
-    elmgr.WhiteboardSvc = "EventDataSvc"
-    elmgr.SchedulerSvc = scheduler.getName()
-    cfg.addService( elmgr )
-
-    # enable timeline recording
-    from GaudiHive.GaudiHiveConf import TimelineSvc
-    cfg.addService( TimelineSvc( RecordTimeline = True, Partial = False ) )
-    
-    #
-    ## Setup SGCommitAuditor to sweep new DataObjects at end of Alg execute
-    #
-    
-    auditorsvc = AuditorSvc()
-    from SGComps.SGCompsConf import SGCommitAuditor
-    auditorsvc += SGCommitAuditor()
-    cfg.addService( auditorsvc )
-    cfg.setAppProperty("AuditAlgorithms", True)
+    ########################################################################
+    # Additional components needed for threaded jobs only
+    if cfgFlags.Concurrency.NumThreads>0:
+
+        # Migrated code from AtlasThreadedJob.py
+        from GaudiCoreSvc.GaudiCoreSvcConf import MessageSvc
+        from GaudiSvc.GaudiSvcConf import StatusCodeSvc, AuditorSvc
+
+        msgsvc = MessageSvc()
+        msgsvc.defaultLimit = 0 
+        #msgFmt = "% F%40W%S%4W%e%s%7W%R%T %0W%M"
+        msgFmt = "% F%18W%S%7W%R%T %0W%M"
+        msgsvc.Format = msgFmt
+        cfg.addService(msgsvc)
+
+        scsvc = StatusCodeSvc()
+        scsvc.AbortOnError = False
+        cfg.addService(scsvc)
+        cfg.setAppProperty('StatusCodeCheck',False)
+
+        from StoreGate.StoreGateConf import SG__HiveMgrSvc
+        hivesvc = SG__HiveMgrSvc("EventDataSvc")
+        hivesvc.NSlots = cfgFlags.Concurrency.NumConcurrentEvents
+        cfg.addService( hivesvc )
+
+        from StoreGate.StoreGateConf import StoreGateSvc
+        cfg.addService( StoreGateSvc("ConditionStore") )
+
+        from GaudiHive.GaudiHiveConf import AlgResourcePool
+        from AthenaCommon.Constants import INFO
+        arp=AlgResourcePool( OutputLevel = INFO )
+        arp.TopAlg=["AthMasterSeq"] #this should enable control flow
+        cfg.addService( arp )
+
+        from GaudiHive.GaudiHiveConf import AvalancheSchedulerSvc
+        scheduler = AvalancheSchedulerSvc()
+        scheduler.CheckDependencies    = cfgFlags.Scheduler.CheckDependencies
+        scheduler.ShowDataDependencies = cfgFlags.Scheduler.ShowDataDeps
+        scheduler.ShowDataFlow         = cfgFlags.Scheduler.ShowDataFlow
+        scheduler.ShowControlFlow      = cfgFlags.Scheduler.ShowControlFlow
+        scheduler.ThreadPoolSize       = cfgFlags.Concurrency.NumThreads
+        cfg.addService(scheduler)
+
+        from SGComps.SGCompsConf import SGInputLoader
+        # FailIfNoProxy=False makes it a warning, not an error, if unmet data
+        # dependencies are not found in the store.  It should probably be changed
+        # to True eventually.
+        inputloader = SGInputLoader (FailIfNoProxy = False)
+        cfg.addEventAlgo( inputloader, "AthAlgSeq" )
+        scheduler.DataLoaderAlg = inputloader.getName()
+
+        from AthenaServices.AthenaServicesConf import AthenaHiveEventLoopMgr
+
+        elmgr = AthenaHiveEventLoopMgr()
+        elmgr.WhiteboardSvc = "EventDataSvc"
+        elmgr.SchedulerSvc = scheduler.getName()
+        cfg.addService( elmgr )
+
+        # enable timeline recording
+        from GaudiHive.GaudiHiveConf import TimelineSvc
+        cfg.addService( TimelineSvc( RecordTimeline = True, Partial = False ) )
+
+        #
+        ## Setup SGCommitAuditor to sweep new DataObjects at end of Alg execute
+        #
+
+        auditorsvc = AuditorSvc()
+        from SGComps.SGCompsConf import SGCommitAuditor
+        auditorsvc += SGCommitAuditor()
+        cfg.addService( auditorsvc )
+        cfg.setAppProperty("AuditAlgorithms", True)
 
     return cfg
     
diff --git a/Control/CxxUtils/CxxUtils/CachedPointer.h b/Control/CxxUtils/CxxUtils/CachedPointer.h
index a0e29b666a60105c50c38ed22e0f545c229d6a6e..220cf6edbcfc8637ebe8ff65ed0f772c9bae354f 100644
--- a/Control/CxxUtils/CxxUtils/CachedPointer.h
+++ b/Control/CxxUtils/CxxUtils/CachedPointer.h
@@ -1,6 +1,6 @@
 // This file's extension implies that it's C, but it's really -*- C++ -*-.
 /*
- * Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration.
+ * Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration.
  */
 // $Id$
 /**
@@ -81,7 +81,7 @@ public:
 
 
   /// Store a new value to the element.
-  void store (pointer_t elt) const;
+  void store (pointer_t elt);
 
   
   /// Return the current value of the element.
diff --git a/Control/CxxUtils/CxxUtils/CachedPointer.icc b/Control/CxxUtils/CxxUtils/CachedPointer.icc
index 325d0ddb1a8a912c5082816cee2c5d1a6b09d781..2ad3b16436690a26d6b29cb2e349db34188907fe 100644
--- a/Control/CxxUtils/CxxUtils/CachedPointer.icc
+++ b/Control/CxxUtils/CxxUtils/CachedPointer.icc
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 // $Id$
 /**
@@ -88,7 +88,7 @@ void CachedPointer::set (pointer_t elt) const
  * @brief Store a new value to the element.
  */
 inline
-void CachedPointer::store (pointer_t elt) const
+void CachedPointer::store (pointer_t elt)
 {
   m_a.store (elt, std::memory_order_relaxed);
 }
diff --git a/Control/DataModelTest/DataModelRunTests/CMakeLists.txt b/Control/DataModelTest/DataModelRunTests/CMakeLists.txt
index 3a9761d10dbbc137a4fa62345d4e01fbc2947c44..47d1fa11d17978a44cd9b19ed8a25491b50a46f0 100644
--- a/Control/DataModelTest/DataModelRunTests/CMakeLists.txt
+++ b/Control/DataModelTest/DataModelRunTests/CMakeLists.txt
@@ -56,7 +56,7 @@ datamodel_run_test (xAODTestRead DEPENDS xAODTestWrite) #i:xaoddata.root o:xaodd
 datamodel_run_test (xAODTestRead2 DEPENDS xAODTestRead) #i:xaoddata2.root o:xaoddata2x.root
 datamodel_run_test (xAODTestTypelessRead DEPENDS xAODTestWrite)
 datamodel_run_test (xAODTestRead3 DEPENDS xAODTestTypelessRead)
-datamodel_run_test (xAODTestReadRename DEPENDS xaAODTestWrite)
+datamodel_run_test (xAODTestReadRename DEPENDS xAODTestWrite)
 datamodel_run_test (xAODTestReadRenameMT
                     COMMAND "athena.py --thread=1"
                     DEPENDS xAODTestWrite)
diff --git a/Control/DataModelTest/DataModelRunTests/test/post.sh b/Control/DataModelTest/DataModelRunTests/test/post.sh
index 7c177930a9fa98efcaa673c25523c23d0a231815..cc91e52a5e29546440861a9ef1ed38dd89dfd776 100755
--- a/Control/DataModelTest/DataModelRunTests/test/post.sh
+++ b/Control/DataModelTest/DataModelRunTests/test/post.sh
@@ -183,6 +183,7 @@ PP="$PP"'|^GUID: Class|^AthenaRootStr.* INFO|^Warning in .* found in .* is alrea
 PP="$PP"'|no dictionary for class|INFO eformat version|INFO event storage'
 PP="$PP"'|^RootDatabase.open *I[nN][fF][oO]'
 PP="$PP"'|Unable to locate catalog'
+PP="$PP"'|CLIDRegistry entries for module'
 
 # StoreGate INFO messages changed to VERBOSE
 PP="$PP"'|^(StoreGateSvc|DetectorStore|MetaDataStore|InputMetaDataStore|TagMetaDataStore) +(INFO|VERBOSE) (Stop|stop|Start)'
@@ -225,6 +226,7 @@ PP="$PP"'|INFO Found MetaDataTools'
 PP="$PP"'|INFO AthenaOutputStream'
 PP="$PP"'|^DbSession.*INFO'
 PP="$PP"'|^IOVDb(Svc|Folder).*INFO (Folder|Connection|Total payload|.*bytes in)'
+PP="$PP"'|Resolved path'
 
 # xAODMaker::EventInfoCnvAlg
 PP="$PP"'|^xAODMaker::Even.*(WARNING|INFO)'
diff --git a/Control/PileUpComps/CMakeLists.txt b/Control/PileUpComps/CMakeLists.txt
index 0447977975ae4d11ff038be44197cb0b6af768d4..18d80ceba95eac0a698a3a1ff458fe904cb988ac 100644
--- a/Control/PileUpComps/CMakeLists.txt
+++ b/Control/PileUpComps/CMakeLists.txt
@@ -15,7 +15,6 @@ atlas_depends_on_subdirs( PRIVATE
                           Event/EventInfoUtils
                           Event/xAOD/xAODEventInfo
                           Event/xAOD/xAODCnvInterfaces
-                          Event/xAOD/xAODEventInfoCnv
                           GaudiKernel )
 
 # External dependencies:
@@ -30,6 +29,6 @@ atlas_add_component( PileUpComps
                      LINK_LIBRARIES ${Boost_LIBRARIES}
                      ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel
                      PileUpToolsLib StoreGateLib SGtests EventInfo
-                     EventInfoUtils xAODEventInfo xAODEventInfoCnv GaudiKernel )
+                     EventInfoUtils xAODEventInfo GaudiKernel )
 
 
diff --git a/DataQuality/DataQualityTools/DataQualityTools/DQTNonCollBkg_ZDC.h b/DataQuality/DataQualityTools/DataQualityTools/DQTNonCollBkg_ZDC.h
index 01b593516219b7fffd3a0af1796bb023a27974d7..2f0222d474ee0f4ad21d3cb466c9e127773117cd 100644
--- a/DataQuality/DataQualityTools/DataQualityTools/DQTNonCollBkg_ZDC.h
+++ b/DataQuality/DataQualityTools/DataQualityTools/DQTNonCollBkg_ZDC.h
@@ -68,11 +68,6 @@
 #include "GaudiKernel/ITHistSvc.h"
 #include "GaudiKernel/ToolHandle.h"
 
-/*
-#include "EventInfo/EventInfo.h"
-#include "EventInfo/EventID.h"
-#include "EventInfo/TriggerInfo.h"
-*/
 #include "TrigDecisionTool/TrigDecisionTool.h"
 
 #include "ZdcIdentifier/ZdcID.h"
diff --git a/DetectorDescription/IdDict/IdDict/ATLAS_CHECK_THREAD_SAFETY b/DetectorDescription/IdDict/IdDict/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..8d4017a3d23ed6ac31d51ea0a2e377bfc8c1eb90
--- /dev/null
+++ b/DetectorDescription/IdDict/IdDict/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+DetectorDescription/IdDict
diff --git a/DetectorDescription/IdDict/IdDict/IdDictDefs.h b/DetectorDescription/IdDict/IdDict/IdDictDefs.h
index 71acce53fb7784cd64ee0db3aa8fb41096086618..dc3c36e3e9bb2cb2d57b1cef9f2dfea9cb7b5fa2 100755
--- a/DetectorDescription/IdDict/IdDict/IdDictDefs.h
+++ b/DetectorDescription/IdDict/IdDict/IdDictDefs.h
@@ -89,8 +89,8 @@ private:
     std::set<std::string> m_subdictionary_names; 
     bool                  m_resolved_references;
     bool                  m_generated_implementation;
-    mutable bool          m_do_checks;
-    mutable bool          m_do_neighbours;
+    bool                  m_do_checks;
+    bool                  m_do_neighbours;
 };  
   
 class IdDictDictionary  
@@ -310,8 +310,8 @@ private:
     std::string m_dict_tag;  
     //bool m_resolved_references;
     bool m_generated_implementation;
-    mutable bool  m_do_checks;
-    mutable bool  m_do_neighbours;
+    bool  m_do_checks;
+    bool  m_do_neighbours;
 };  
   
 class IdDictField 
diff --git a/DetectorDescription/IdDict/src/IdDictMgr.cxx b/DetectorDescription/IdDict/src/IdDictMgr.cxx
index f5daf711759d0dd82381f71430cc1d89ef339ee1..a6256fce4f876b70cdf9302d819032cf8db63515 100755
--- a/DetectorDescription/IdDict/src/IdDictMgr.cxx
+++ b/DetectorDescription/IdDict/src/IdDictMgr.cxx
@@ -8,65 +8,26 @@
 #include <iostream>  
  
 #include <stdio.h>
-#include <cstdlib>  
+#include <cstdlib>
+#include <atomic>
   
 #include "IdDict/IdDictDefs.h"  
  
 class Debugger 
 { 
-public: 
+public:
+  static bool get_debug_state()
+  {
+    if (::getenv ("IDDEBUG") != 0) {
+      return true;
+    }
+    return false; 
+  }
   static bool debug () 
   { 
-    static bool first = true; 
-    static bool debug_state = false; 
- 
-    if (first) 
-      { 
-	first = false; 
-	if (::getenv ("IDDEBUG") == 0) 
-	  { 
-	    debug_state = false; 
-	  } 
-	else 
-	  { 
-	    debug_state = true; 
-	  } 
-      } 
- 
-    return (debug_state); 
+    static const bool debug_state = get_debug_state();
+    return debug_state; 
   } 
- 
-  static void up () 
-  { 
-    level (1); 
-  } 
- 
-  static void down () 
-  { 
-    level (-1); 
-  } 
- 
-  static void tab (int nspaces = 0) 
-  { 
-    int n = (nspaces) ? nspaces : level (); 
- 
-    for (int i = 0; i < n; ++i) 
-      { 
-	std::cout << " "; 
-      } 
-  } 
- 
-private: 
- 
-  static int level (int d = 0) 
-  { 
-    static int n = 0; 
- 
-    n += d; 
- 
-    return (n); 
-  } 
- 
 }; 
 
 static bool isNumber(const std::string& str) 
@@ -98,14 +59,14 @@ class TypeId
 public:  
   operator int ()  
       {  
-        static int i = TypeIdBuilder::build_id ();  
+        static const int i = TypeIdBuilder::build_id ();  
         return (i);  
       }  
 };  
   
 int TypeIdBuilder::build_id ()  
 {  
-  static int i = 0;  
+  static std::atomic<int> i = 0;  
   i++;  
   return (i);  
 }  
@@ -172,7 +133,7 @@ const std::string&
 IdDictMgr::find_metadata           (const std::string& name) const
 {
     metadata_map::const_iterator it = m_metadata.find(name);
-    static std::string empty;
+    static const std::string empty;
     if (it != m_metadata.end()) return (it->second);
     else return empty;
 }
@@ -258,7 +219,7 @@ void IdDictMgr::generate_implementation (std::string tag)
 
   if (Debugger::debug ()) 
     { 
-      Debugger::tab (); std::cout << "IdDictMgr::generate_implementation>" << std::endl; 
+      std::cout << "IdDictMgr::generate_implementation>" << std::endl; 
     } 
 
   // Must reset the implementation for multiple passes, this resets
@@ -575,7 +536,6 @@ static void get_bits (const RV& regions, size_t level, const std::string& group)
     //
 
 
-//      Debugger::tab (level); 
 //      std::cout << " get_bits : level " << level;
 //      std::cout << " regions size " << regions.size() << std::endl;
 
@@ -616,7 +576,6 @@ static void get_bits (const RV& regions, size_t level, const std::string& group)
  
     RV mr = regions; 
  
-    //    Debugger::tab (level); 
     //    std::cout << " or-ing fields : level " << level;
     //    std::cout << " name " << mr[0]->m_implementation[level].m_range->m_field_name ; 
 
@@ -643,7 +602,7 @@ static void get_bits (const RV& regions, size_t level, const std::string& group)
   
     for (;;) { 
         if (mr.size () == 0)  { 
-            //Debugger::tab (level); std::cout << "empty RV" << std::endl; 
+            //std::cout << "empty RV" << std::endl; 
             break; 
         } 
  
@@ -664,7 +623,7 @@ static void get_bits (const RV& regions, size_t level, const std::string& group)
 //                std::cout << "k in level " << k << " " << level << std::endl;
 
 		/*
-		  Debugger::tab (level); std::cout << "Install the non empty Region : " <<  
+		  std::cout << "Install the non empty Region : " <<  
                   reference_region->m_index; 
                    
                   const IdDictFieldImplementation& f = reference_region->m_implementation[level]; 
@@ -689,7 +648,7 @@ static void get_bits (const RV& regions, size_t level, const std::string& group)
         if (reference_region == 0) break;
   
         if (overlapping.size () == 0) { 
-//              Debugger::tab (level); std::cout << "RV only contains empty Regions" << std::endl; 
+//              std::cout << "RV only contains empty Regions" << std::endl; 
             break; 
         } 
  
@@ -746,7 +705,7 @@ static void get_bits (const RV& regions, size_t level, const std::string& group)
  
                 if (region->m_implementation.size () <= level) continue; 
  
-//  	  Debugger::tab (level); std::cout << "Check a non empty Region : " << region->m_index; 
+//  	  std::cout << "Check a non empty Region : " << region->m_index; 
  
                 bool overlap = false; 
 
@@ -807,7 +766,7 @@ static void get_bits (const RV& regions, size_t level, const std::string& group)
         if (all_within_group) temp.clear();
 
 
-//        Debugger::tab (level); std::cout << "now we have " << overlapping.size () <<  
+//        std::cout << "now we have " << overlapping.size () <<  
 //                         " vs " <<  
 //                         temp.size () << " regions" << std::endl; 
 
@@ -831,7 +790,7 @@ void IdDictDictionary::generate_implementation (const IdDictMgr& idd,
 
   if (Debugger::debug ()) 
     { 
-      Debugger::tab (); std::cout << "IdDictDictionary::generate_implementation>" << std::endl; 
+      std::cout << "IdDictDictionary::generate_implementation>" << std::endl; 
     } 
   
   if (!m_generated_implementation) {
@@ -2356,7 +2315,7 @@ IdDictGroup::generate_implementation (const IdDictMgr& idd,
 {
   if (Debugger::debug ()) 
     { 
-      Debugger::tab (); std::cout << "IdDictGroup::generate_implementation>" << std::endl; 
+      std::cout << "IdDictGroup::generate_implementation>" << std::endl; 
     } 
 
   if (!m_generated_implementation) {
@@ -2659,7 +2618,7 @@ void IdDictRegion::generate_implementation (const IdDictMgr& idd,
 
   if (Debugger::debug ()) 
     { 
-      Debugger::tab (); std::cout << "IdDictRegion::generate_implementation>" << std::endl; 
+      std::cout << "IdDictRegion::generate_implementation>" << std::endl; 
     } 
   
 //    std::cout << "IdDictRegion::generate_implementation - name, tag " 
@@ -2875,7 +2834,7 @@ IdDictSubRegion::generate_implementation (const IdDictMgr& idd,
 
   if (Debugger::debug ()) 
     { 
-      Debugger::tab (); std::cout << "IdDictSubRegion::generate_implementation>" << std::endl; 
+      std::cout << "IdDictSubRegion::generate_implementation>" << std::endl; 
     } 
   
     // NOTE: we DO NOT protect this method with
@@ -3038,7 +2997,7 @@ void IdDictRange::generate_implementation (const IdDictMgr& /*idd*/,
 
   if (Debugger::debug ()) 
     { 
-      Debugger::tab (); std::cout << "IdDictRange::generate_implementation>" << std::endl; 
+      std::cout << "IdDictRange::generate_implementation>" << std::endl; 
     } 
 
 
@@ -3279,7 +3238,7 @@ void IdDictReference::generate_implementation (const IdDictMgr& idd,
 
   if (Debugger::debug ()) 
     { 
-      Debugger::tab (); std::cout << "IdDictReference::generate_implementation>" << std::endl; 
+      std::cout << "IdDictReference::generate_implementation>" << std::endl; 
     } 
   
   if (m_subregion != 0) m_subregion->generate_implementation (idd, dictionary, region, tag); 
diff --git a/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/IROBDataProviderSvc.h b/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/IROBDataProviderSvc.h
index f78e47850d28771a97e8339f4941ef51920b3dea..da4f888ce9a74eb085c97aaf42f9f01338c4381c 100755
--- a/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/IROBDataProviderSvc.h
+++ b/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/IROBDataProviderSvc.h
@@ -12,6 +12,7 @@
 #include <cstdint>
 #include <vector>
 #include <string>
+#include <string_view>
 #include <stdexcept>
 #include <functional>
 
@@ -32,7 +33,7 @@ public:
   DeclareInterfaceID(IROBDataProviderSvc, 1, 1);
 
    /// Add ROBFragments to cache for given ROB ids, ROB fragments may be retrieved with DataCollector
-   virtual void addROBData(const std::vector<uint32_t>& robIds, const std::string callerName="UNKNOWN") = 0 ;
+   virtual void addROBData(const std::vector<uint32_t>& robIds, const std::string_view callerName="UNKNOWN") = 0 ;
 
    /// Add a given LVL1/LVL2 ROBFragment to cache
    virtual void setNextEvent(const std::vector<ROBF>& result) = 0 ;
@@ -43,7 +44,7 @@ public:
 
 
    /// Retrieve ROBFragments for given ROB ids from cache
-   virtual void getROBData(const std::vector<uint32_t>& robIds, VROBFRAG& robFragments, const std::string callerName="UNKNOWN") = 0;
+   virtual void getROBData(const std::vector<uint32_t>& robIds, VROBFRAG& robFragments, const std::string_view callerName="UNKNOWN") = 0;
 
 
    /// Retrieve the whole event.
@@ -59,8 +60,8 @@ public:
 
 
    // variants for MT, it has an implementation for now in order not to require change in all implementations yet, they will all become pure virtual methods
-   virtual void addROBData(const EventContext& /*context*/, const std::vector<uint32_t>& /*robIds*/, const std::string callerName="UNKNOWN") { 
-     throw std::runtime_error( std::string( callerName+" is using unimplemented ") + __FUNCTION__ ) ; 
+   virtual void addROBData(const EventContext& /*context*/, const std::vector<uint32_t>& /*robIds*/, const std::string_view callerName="UNKNOWN") { 
+     throw std::runtime_error( std::string(callerName)+ std::string(" is using unimplemented ") + __FUNCTION__ ) ; 
    }
    virtual void setNextEvent(const EventContext& /*context*/, const std::vector<ROBF>& /*result*/) {
      throw std::runtime_error( std::string("Unimplemented ") + __FUNCTION__ ); 
@@ -68,8 +69,9 @@ public:
    virtual void setNextEvent( const EventContext& /*context*/, const RawEvent* /*re*/) {
      throw std::runtime_error(std::string("Unimplemented ") + __FUNCTION__ ); 
    }
-   virtual void getROBData(const EventContext& /*context*/, const std::vector<uint32_t>& /*robIds*/, VROBFRAG& /*robFragments*/, const std::string callerName="UNKNOWN") { 
-     throw std::runtime_error( std::string( callerName+" is using unimplemented ") + __FUNCTION__ ) ; 
+   virtual void getROBData(const EventContext& /*context*/, const std::vector<uint32_t>& /*robIds*/, VROBFRAG& /*robFragments*/, 
+			   const std::string_view callerName="UNKNOWN") { 
+     throw std::runtime_error( std::string(callerName)+ std::string(" is using unimplemented ") + __FUNCTION__ ) ; 
    }
    virtual const RawEvent* getEvent(const EventContext& /*context*/) {
      throw std::runtime_error(std::string("Unimplemented ") + __FUNCTION__ ); 
@@ -102,8 +104,8 @@ public:
   /// @brief Collect all data for an event from the ROS and put them into the cache
   /// @return value: number of ROBs which were retrieved to complete the event
   /// Optionally the name of the caller of this method can be specified for monitoring
-  virtual int collectCompleteEventData(const EventContext& /*context*/, const std::string callerName="UNKNOWN") {
-    throw std::runtime_error(std::string(callerName + " is using unimplemented ") + __FUNCTION__ );
+  virtual int collectCompleteEventData(const EventContext& /*context*/, const std::string_view callerName="UNKNOWN") {
+    throw std::runtime_error(std::string(callerName) + std::string(" is using unimplemented ") + __FUNCTION__ );
     return 0;
   }
 
diff --git a/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/ROBDataProviderSvc.h b/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/ROBDataProviderSvc.h
index bedb316f828554e7922b2885042e3f9d1065517b..fe62e9b69206e5280c63cce1cac4c21d088f7375 100755
--- a/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/ROBDataProviderSvc.h
+++ b/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/ROBDataProviderSvc.h
@@ -51,7 +51,7 @@ public:
    //   virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface);
 
    /// Add ROBFragments to cache for given ROB ids, ROB fragments may be retrieved with DataCollector
-   virtual void addROBData(const std::vector<uint32_t>& robIds, const std::string callerName="UNKNOWN") override;
+   virtual void addROBData(const std::vector<uint32_t>& robIds, const std::string_view callerName="UNKNOWN") override;
 
    /// Add a given LVL1/LVL2 ROBFragment to cache
    virtual void setNextEvent(const std::vector<ROBF>& result) override;
@@ -60,7 +60,7 @@ public:
    virtual void setNextEvent(const RawEvent* re) override;
 
    /// Retrieve ROBFragments for given ROB ids from cache
-   virtual void getROBData(const std::vector<uint32_t>& robIds, std::vector<const ROBF*>& robFragments, const std::string callerName="UNKNOWN") override;
+   virtual void getROBData(const std::vector<uint32_t>& robIds, std::vector<const ROBF*>& robFragments, const std::string_view callerName="UNKNOWN") override;
 
    /// Retrieve the whole event.
    virtual const RawEvent* getEvent() override;
@@ -73,10 +73,11 @@ public:
 
 
    /// MT variants 
-   virtual void addROBData(const EventContext& context, const std::vector<uint32_t>& robIds, const std::string callerName="UNKNOWN") override;
+   virtual void addROBData(const EventContext& context, const std::vector<uint32_t>& robIds, const std::string_view callerName="UNKNOWN") override;
    virtual void setNextEvent(const EventContext& context, const std::vector<OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment>& result) override;
    virtual void setNextEvent(const EventContext& context, const RawEvent* re) override;
-   virtual void getROBData(const EventContext& context, const std::vector<uint32_t>& robIds, VROBFRAG& robFragments, const std::string callerName="UNKNOWN") override;
+   virtual void getROBData(const EventContext& context, const std::vector<uint32_t>& robIds, VROBFRAG& robFragments, 
+			   const std::string_view callerName="UNKNOWN") override;
    virtual const RawEvent* getEvent(const EventContext& context) override;
    virtual void setEventStatus(const EventContext& context, uint32_t status) override;
    virtual uint32_t getEventStatus(const EventContext& context) override;
@@ -85,9 +86,7 @@ public:
 				  const std::function< void(const ROBF* )>& fn ) const override;
 
    virtual bool isEventComplete(const EventContext& /*context*/) const override { return true; }
-   virtual int collectCompleteEventData(const EventContext& /*context*/, const std::string /*callerName*/ ) override {  return 0; }
-
-
+   virtual int collectCompleteEventData(const EventContext& /*context*/, const std::string_view /*callerName*/ ) override {  return 0; }
 
 protected:
    /// vector of ROBFragment class
@@ -125,8 +124,6 @@ protected:
    BooleanProperty m_filterEmptyROB;
    bool m_maskL2EFModuleID = false;    
 
-
-
 private: // data
 
 private: //
diff --git a/Event/ByteStreamCnvSvcBase/src/ROBDataProviderSvc.cxx b/Event/ByteStreamCnvSvcBase/src/ROBDataProviderSvc.cxx
index 879cd668dec2e068e2887a84daa36db7a5366f2c..ab5c970fcdd662a9b5a6244c6a675f3310d9b126 100755
--- a/Event/ByteStreamCnvSvcBase/src/ROBDataProviderSvc.cxx
+++ b/Event/ByteStreamCnvSvcBase/src/ROBDataProviderSvc.cxx
@@ -170,12 +170,12 @@ StatusCode ROBDataProviderSvc::initialize() {
   
 
 
-void ROBDataProviderSvc::addROBData(const std::vector<uint32_t>& robIds, const std::string callerName) {
+void ROBDataProviderSvc::addROBData(const std::vector<uint32_t>& robIds, const std::string_view callerName) {
   const EventContext context{ Gaudi::Hive::currentContext() };
   return addROBData( context, robIds, callerName );
 }
 
-void ROBDataProviderSvc::addROBData(const EventContext& context, const std::vector<uint32_t>& robIds, const std::string callerName) {
+void ROBDataProviderSvc::addROBData(const EventContext& context, const std::vector<uint32_t>& robIds, const std::string_view callerName) {
     EventCache* cache = m_eventsCache.get( context );
 
    // Copy missing ROB ids to vector with pthread allocator
@@ -318,12 +318,13 @@ void ROBDataProviderSvc::setNextEvent( const EventContext& context, const RawEve
 }
 /** return ROBData for ROBID
  */
-void ROBDataProviderSvc::getROBData(const std::vector<uint32_t>& ids, std::vector<const ROBF*>& v, const std::string callerName) {
+void ROBDataProviderSvc::getROBData(const std::vector<uint32_t>& ids, std::vector<const ROBF*>& v, const std::string_view callerName) {
   const EventContext context{ Gaudi::Hive::currentContext() };
   return getROBData( context, ids, v, callerName );
 }
 
-void ROBDataProviderSvc::getROBData(const EventContext& context, const std::vector<uint32_t>& ids, std::vector<const ROBF*>& v, const std::string callerName) {
+void ROBDataProviderSvc::getROBData(const EventContext& context, const std::vector<uint32_t>& ids, std::vector<const ROBF*>& v, 
+				    const std::string_view callerName) {
   EventCache* cache = m_eventsCache.get( context );
   
    for (std::vector<uint32_t>::const_iterator it = ids.begin(), it_end = ids.end(); it != it_end; it++) {
diff --git a/Event/EventContainers/EventContainers/IdentifiableContainerMT.h b/Event/EventContainers/EventContainers/IdentifiableContainerMT.h
index f88270c4be598ae38636cf7694d7ebabad55821d..5324a8aa40aedf25a7c5b8060ffb7651e4f476c5 100644
--- a/Event/EventContainers/EventContainers/IdentifiableContainerMT.h
+++ b/Event/EventContainers/EventContainers/IdentifiableContainerMT.h
@@ -61,7 +61,7 @@ public:
            std::swap(a.m_atomic, b.m_atomic);
            std::swap(a.m_mut, b.m_mut);
         }
-        IDC_WriteHandle(IDC_WriteHandle&& other){
+        IDC_WriteHandle(IDC_WriteHandle&& other) : IDC_WriteHandle() {
            Swap(*this, other);
         }
         StatusCode addOrDelete(std::unique_ptr<T> ptr, bool &deleted){
diff --git a/Event/EventInfoUtils/CMakeLists.txt b/Event/EventInfoUtils/CMakeLists.txt
index 4aafaf0e65a7d8a02858c0f9a64b3796a8854859..3d2168afe775b906e32cf78989468469c337df13 100644
--- a/Event/EventInfoUtils/CMakeLists.txt
+++ b/Event/EventInfoUtils/CMakeLists.txt
@@ -11,7 +11,7 @@ atlas_depends_on_subdirs( PUBLIC
                           Control/StoreGate
                           PRIVATE
                           Control/SGTools
-                          Event/Eventinfo
+                          Event/EventInfo
                           Event/xAOD/xAODEventInfo
                           )
                           
diff --git a/Event/xAOD/xAODTrackingAthenaPool/src/xAODSCTRDOContainerCnv.cxx b/Event/xAOD/xAODTrackingAthenaPool/src/xAODSCTRDOContainerCnv.cxx
index f3d85fb051b5e8ca2174f88c1104f7cd52b93d70..8d74ff2d9ea6e7bfb627633b6325795e9eaf3a05 100644
--- a/Event/xAOD/xAODTrackingAthenaPool/src/xAODSCTRDOContainerCnv.cxx
+++ b/Event/xAOD/xAODTrackingAthenaPool/src/xAODSCTRDOContainerCnv.cxx
@@ -38,7 +38,7 @@ xAODSCTRDOContainerCnv::createPersistent( xAOD::SCTRawHitValidationContainer* tr
 
 xAOD::SCTRawHitValidationContainer* xAODSCTRDOContainerCnv::createTransient() {
    // The known ID(s) for this container:
-   static pool::Guid v1_guid( "BC8CE35A-5785-4F97-82B6-1E4A21A8C28F" );
+   const pool::Guid v1_guid( "BC8CE35A-5785-4F97-82B6-1E4A21A8C28F" );
 
    // Check if we're reading the most up to date type:
    if( compareClassGuid( v1_guid ) ) {
diff --git a/Event/xAOD/xAODTrigger/Root/TrigCompositeAuxContainer_v2.cxx b/Event/xAOD/xAODTrigger/Root/TrigCompositeAuxContainer_v2.cxx
index d6fdf943c3c83cf817a3029d6c74f86162652e55..a9ae9559fdfc0a3e7b0e7170c94c3fe98d315603 100644
--- a/Event/xAOD/xAODTrigger/Root/TrigCompositeAuxContainer_v2.cxx
+++ b/Event/xAOD/xAODTrigger/Root/TrigCompositeAuxContainer_v2.cxx
@@ -18,6 +18,8 @@ namespace xAOD {
       AUX_VARIABLE( linkColKeys );
       AUX_VARIABLE( linkColIndices );
       AUX_VARIABLE( linkColClids );
+
+      AUX_VARIABLE( decisions );
    }
 
 } // namespace xAOD
diff --git a/Event/xAOD/xAODTrigger/Root/TrigComposite_v1.cxx b/Event/xAOD/xAODTrigger/Root/TrigComposite_v1.cxx
index 50905d65e450824752caf6dcab3f24291161530e..c0603fb755d73a457b5927bf541d7f068f2cae46 100644
--- a/Event/xAOD/xAODTrigger/Root/TrigComposite_v1.cxx
+++ b/Event/xAOD/xAODTrigger/Root/TrigComposite_v1.cxx
@@ -47,6 +47,9 @@ namespace xAOD {
   AUXSTORE_OBJECT_SETTER_AND_GETTER( TrigComposite_v1, std::string,
                                       name, setName )
 
+  AUXSTORE_OBJECT_SETTER_AND_GETTER( TrigComposite_v1, std::vector<TrigCompositeUtils::DecisionID>,
+                                      decisions, setDecisions )
+
    //
    /////////////////////////////////////////////////////////////////////////////
 
@@ -97,6 +100,10 @@ namespace xAOD {
     if (newName == "") {
       newName = name;
     }
+    if (newName == "self") {
+      if (s_throwOnCopyError) throw std::runtime_error("It does not make sense for the 'self' link to be in a collection. There can be only one.");
+      return false;
+    }
     const std::string mangledName = name + s_collectionSuffix;
     const std::string mangledNewName = newName + s_collectionSuffix;
     if (other.hasObjectLink(mangledName)) {
@@ -123,8 +130,8 @@ namespace xAOD {
   bool TrigComposite_v1::copyAllLinksFrom(const xAOD::TrigComposite_v1& other) {
     bool didCopy = false;
     for (const std::string& name : other.linkColNames()) {
-      // Cannot copy any 'self' links as *this does not know its own location in its parent container
-      if (name == "self") continue;
+      // Cannot copy any 'self' link(s) as *this does not know its own location in its parent container
+      if (name == "self" || name == "self" + s_collectionSuffix) continue;
       // Check we don't have one (or more) entries with this raw name (raw = might be mangled).
       if (this->hasObjectLink(name)) continue;
       // Check if the link is for a single object or collection of objects by looking for the mangled suffix
@@ -173,6 +180,17 @@ namespace xAOD {
       return hasObjectLink( mangledName );
    }
 
+   bool TrigComposite_v1::hasObjectLinkExact(const std::string& name, const uint32_t key, const uint16_t index, const uint32_t clid) const {
+      for (size_t i = 0; i < this->linkColNames().size(); ++i) {
+         if (this->linkColNames().at(i) != name) continue;
+         if (this->linkColKeys().at(i) != key) continue;
+         if (this->linkColIndices().at(i) != index) continue;
+         if (this->linkColClids().at(i) != clid) continue;
+         return true;
+      } 
+      return false;
+   }
+
    AUXSTORE_OBJECT_GETTER( TrigComposite_v1, std::vector< std::string >,
                            linkColNames )
    AUXSTORE_OBJECT_GETTER( TrigComposite_v1, std::vector< uint32_t >,
@@ -209,7 +227,7 @@ namespace xAOD {
    void TrigComposite_v1::typelessSetObjectLink( const std::string& name, const uint32_t key, const uint32_t clid, const uint16_t beginIndex, const uint16_t endIndex ) {
 
      // Loop over collections
-     if ( endIndex - beginIndex > 1 ) {
+     if ( endIndex - beginIndex > 1 ) { // Adding a *collection* of links
 
        // Check uniqueness
        const std::string mangledName = name + s_collectionSuffix;
@@ -247,7 +265,7 @@ namespace xAOD {
          this->linkColClidsNC().push_back( clid );
        }
      }
-     else {
+     else { // Adding a *single* link
 
        // Check uniqueness
        if ( std::find( linkColNamesNC().begin(), linkColNamesNC().end(), name ) == linkColNamesNC().end() ) {
@@ -280,12 +298,19 @@ namespace xAOD {
 
 
 std::ostream& operator<<(std::ostream& os, const xAOD::TrigComposite_v1& tc) {
-  os << "TrigComposite_v1 '" << tc.name() << "' link: name, key, index, CLID" << std::endl;
+  os << "TrigComposite_v1 name:'" << tc.name() << "'" << std::endl;
+  os << "  N Lnks:" << tc.linkColNames().size();
   for (size_t i=0; i<tc.linkColNames().size(); ++i){
-    os << tc.linkColNames()[i] << ", ";
-    os << tc.linkColKeys()[i] << ", ";
-    os << tc.linkColIndices()[i] << ", ";
-    os << tc.linkColClids()[i] << std::endl;
+    if (!i) os << std::endl;
+    os << "    Link Name:"  << tc.linkColNames()[i];
+    os << ", Key:"   << tc.linkColKeys()[i];
+    os << ", Index:" << tc.linkColIndices()[i];
+    os << ", CLID:"  << tc.linkColClids()[i];
+    if (i != tc.linkColNames().size() - 1) os << std::endl;
+  }
+  if (tc.decisions().size()) {
+    os << std::endl << "  N Decisions: '" << tc.decisions().size() << std::endl << "    ";
+    for (const TrigCompositeUtils::DecisionID id : tc.decisions()) os << id << ", ";
   }
   return os;
 }
diff --git a/Event/xAOD/xAODTrigger/xAODTrigger/TrigComposite.h b/Event/xAOD/xAODTrigger/xAODTrigger/TrigComposite.h
index 32524ccb8d3133b433503338bf811cd71a1dcd2e..6fc5a85eec5a526e1af68657fd44b202c3c74789 100644
--- a/Event/xAOD/xAODTrigger/xAODTrigger/TrigComposite.h
+++ b/Event/xAOD/xAODTrigger/xAODTrigger/TrigComposite.h
@@ -11,8 +11,6 @@
 // Local include(s):
 #include "xAODTrigger/versions/TrigComposite_v1.h"
 
-#include <set>
-
 namespace xAOD{
    /// Declare the latest version of the class
    typedef TrigComposite_v1 TrigComposite;
@@ -20,9 +18,6 @@ namespace xAOD{
 
 namespace TrigCompositeUtils{ 
    typedef xAOD::TrigComposite Decision;
-
-   typedef unsigned int DecisionID;
-   typedef std::set<DecisionID> DecisionIDContainer;
 }
 
 // Declare a CLID for the type:
diff --git a/Event/xAOD/xAODTrigger/xAODTrigger/versions/TrigCompositeAuxContainer_v2.h b/Event/xAOD/xAODTrigger/xAODTrigger/versions/TrigCompositeAuxContainer_v2.h
index a930c557c246d21a8ce1ae5b7aa37d3da8c18465..fce55c86b240c21e0ed0c09e311e6487ed1aebcf 100644
--- a/Event/xAOD/xAODTrigger/xAODTrigger/versions/TrigCompositeAuxContainer_v2.h
+++ b/Event/xAOD/xAODTrigger/xAODTrigger/versions/TrigCompositeAuxContainer_v2.h
@@ -18,6 +18,8 @@ extern "C" {
 // xAOD include(s):
 #include "xAODCore/AuxContainerBase.h"
 
+#include "xAODTrigger/TrigComposite.h"
+
 namespace xAOD {
 
    /// Auxiliary store for TrigComposite containers
@@ -41,6 +43,8 @@ namespace xAOD {
       std::vector< std::vector< uint16_t > >    linkColIndices;
       std::vector< std::vector< uint32_t > >    linkColClids;
 
+      std::vector< std::vector< TrigCompositeUtils::DecisionID > >    decisions;
+
    }; // class TrigCompositeAuxContainer_v2
 
 } // namespace xAOD
diff --git a/Event/xAOD/xAODTrigger/xAODTrigger/versions/TrigComposite_v1.h b/Event/xAOD/xAODTrigger/xAODTrigger/versions/TrigComposite_v1.h
index b65c66e1b880f035c1d2cd9b6e3624d65b05836b..6b529cabc190dd0102630bb320c80a2a6ca45c79 100644
--- a/Event/xAOD/xAODTrigger/xAODTrigger/versions/TrigComposite_v1.h
+++ b/Event/xAOD/xAODTrigger/xAODTrigger/versions/TrigComposite_v1.h
@@ -14,12 +14,18 @@ extern "C" {
 }
 #include <string>
 #include <vector>
+#include <set>
 
 // EDM include(s):
 #include "AthContainers/AuxElement.h"
 #include "AthLinks/ElementLink.h"
 #include "AthLinks/ElementLinkVector.h"
 
+namespace TrigCompositeUtils{ 
+   typedef unsigned int DecisionID;
+   typedef std::set<DecisionID> DecisionIDContainer;
+}
+
 namespace xAOD {
 
    /// Class used to describe composite objects in the HLT
@@ -54,6 +60,11 @@ namespace xAOD {
       /// Set a human-readable name for the object
       void setName( const std::string& name );
 
+      /// Get positive HLT chain decisions associated with this TrigComposite. Navigation use
+      const std::vector<TrigCompositeUtils::DecisionID>& decisions() const;
+      /// Set positive HLT chain decisions associated with this TrigComposite. Navigation use
+      void setDecisions( const std::vector<TrigCompositeUtils::DecisionID>& decisions );
+
       /// @}
 
       /// @name Functions for accessing basic properties on the object
@@ -94,11 +105,11 @@ namespace xAOD {
       template< class OBJECT >
       const OBJECT* object( const std::string& name ) const;
 
-      /// Add a link to a single object within a collection
+      /// Add a link to a single object within a collection. Performs de-duplication
       template< class CONTAINER >
       bool addObjectCollectionLink( const std::string& collectionName,
                                     const ElementLink< CONTAINER >& link );
-      /// Add links to multiple objects within a collection
+      /// Add links to multiple objects within a collection.  Performs de-duplication
       template< class CONTAINER >
       bool addObjectCollectionLinks( const std::string& collectionName,
                                      const ElementLinkVector< CONTAINER >& links );
@@ -176,6 +187,9 @@ namespace xAOD {
       /// Raw access to the persistent link CLIDs (non-const)
       std::vector< uint32_t >& linkColClidsNC();
 
+      // Helper function, check for exact link match
+      bool hasObjectLinkExact(const std::string& name, const uint32_t key, const uint16_t index, const uint32_t clid) const;
+
       /// Helper function, copy one link into this object
       void copyLinkInternal(const xAOD::TrigComposite_v1& other, const size_t index, const std::string& newName);
 
diff --git a/Event/xAOD/xAODTrigger/xAODTrigger/versions/TrigComposite_v1.icc b/Event/xAOD/xAODTrigger/xAODTrigger/versions/TrigComposite_v1.icc
index 360664965ada39b4a054b1a6beaf1e6d3a60151e..598f26110174cef2457cc5c9481e81e35d5ed487 100644
--- a/Event/xAOD/xAODTrigger/xAODTrigger/versions/TrigComposite_v1.icc
+++ b/Event/xAOD/xAODTrigger/xAODTrigger/versions/TrigComposite_v1.icc
@@ -184,12 +184,14 @@ namespace xAOD {
     // No method currently provided to update or check for uniqueness of a link
     // being added to a container.
 
-    // Add a new object:
+    // Add a new object (unless it would duplicate an existing one):
     const std::string mangledName = collectionName + s_collectionSuffix;
-    linkColNamesNC().push_back( mangledName );
-    linkColKeysNC().push_back( link.key() );
-    linkColIndicesNC().push_back( link.index() );
-    linkColClidsNC().push_back( ClassID_traits< CONTAINER >::ID() );
+    if (!hasObjectLinkExact(mangledName, link.key(), link.index(), ClassID_traits< CONTAINER >::ID())) {
+      linkColNamesNC().push_back( mangledName );
+      linkColKeysNC().push_back( link.key() );
+      linkColIndicesNC().push_back( link.index() );
+      linkColClidsNC().push_back( ClassID_traits< CONTAINER >::ID() );
+    }
     return true;
   }
 
diff --git a/HLT/Trigger/TrigControl/TrigServices/CMakeLists.txt b/HLT/Trigger/TrigControl/TrigServices/CMakeLists.txt
index 90df1bb827479f4b16b52d6243e582543a598272..e778a7736a982b223e085bca97a4c56b21a02154 100644
--- a/HLT/Trigger/TrigControl/TrigServices/CMakeLists.txt
+++ b/HLT/Trigger/TrigControl/TrigServices/CMakeLists.txt
@@ -32,6 +32,7 @@ find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess )
 find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
 find_package( tdaq COMPONENTS omniORB4 omnithread ipc is owl )
 find_package( tdaq-common COMPONENTS CTPfragment eformat eformat_write hltinterface )
+find_package( TBB )
 
 # Component(s) in the package:
 atlas_add_library( TrigServicesLib
diff --git a/HLT/Trigger/TrigControl/TrigServices/python/TrigServicesConfig.py b/HLT/Trigger/TrigControl/TrigServices/python/TrigServicesConfig.py
index ab121e6cb5fa9c30003b50ab380385ba246b63d3..4f7f02252d2c028da54c2a435c08c49f4d327aae 100644
--- a/HLT/Trigger/TrigControl/TrigServices/python/TrigServicesConfig.py
+++ b/HLT/Trigger/TrigControl/TrigServices/python/TrigServicesConfig.py
@@ -41,7 +41,7 @@ def setupMessageSvc():
    MessageSvc = svcMgr.MessageSvc
    MessageSvc.OutputLevel = theApp.OutputLevel
 
-   MessageSvc.Format       = "%t  % F%35W%S%4W%e%s%7W%R%T %0W%M"
+   MessageSvc.Format       = "% F%40W%S%4W%e%s%7W%R%T %0W%M"
 
    # Message suppression
    MessageSvc.enableSuppression    = False
@@ -75,3 +75,34 @@ def setupMessageSvc():
    # publish message counts during RUNNING in histogram
    MessageSvc.publishStats = True
    MessageSvc.publishLevel = INFO
+
+# online ROB data provider service 
+from TrigServicesConf import HltROBDataProviderSvc as _HltROBDataProviderSvc
+class HltROBDataProviderSvc(_HltROBDataProviderSvc):
+   __slots__ = ()
+
+   def __init__(self, name='ROBDataProviderSvc'):
+      super(HltROBDataProviderSvc, self).__init__(name)
+      from AthenaMonitoring.GenericMonitoringTool import GenericMonitoringTool,defineHistogram
+      self.MonTool = GenericMonitoringTool('MonTool')
+      self.MonTool.Histograms = [ 
+         defineHistogram('TIME_ROBReserveData', path='EXPERT', type='TH1F',
+                         title='Time to reserve ROBs for later retrieval;time [ms]',
+                         xbins=100, xmin=0, xmax=100),
+         defineHistogram('NUMBER_ROBReserveData', path='EXPERT', type='TH1F',
+                         title='Number of reserved ROBs for later retrieval;number',
+                         xbins=100, xmin=0, xmax=500),
+         defineHistogram('TIME_ROBRequest', path='EXPERT', type='TH1F',
+                         title='Time for ROB retrievals;time [ms]',
+                         xbins=100, xmin=0, xmax=500),
+         defineHistogram('NUMBER_ROBRequest', path='EXPERT', type='TH1F',
+                         title='Number of retrieved ROBs;number',
+                         xbins=100, xmin=0, xmax=1000),
+         defineHistogram('TIME_CollectAllROBs', path='EXPERT', type='TH1F',
+                         title='Time for retrieving complete event data;time [ms]',
+                         xbins=100, xmin=0, xmax=1000),
+         defineHistogram('NUMBER_CollectAllROBs', path='EXPERT', type='TH1F',
+                         title='Number of received ROBs for collect call;number',
+                         xbins=100, xmin=0, xmax=2500)
+         ]
+      return
diff --git a/HLT/Trigger/TrigControl/TrigServices/python/TriggerUnixStandardSetup.py b/HLT/Trigger/TrigControl/TrigServices/python/TriggerUnixStandardSetup.py
index edee483270a46d0448bec4ece286421f975e8f14..8523783a3fa3c58edc6705bc4a4d44abc2630b06 100644
--- a/HLT/Trigger/TrigControl/TrigServices/python/TriggerUnixStandardSetup.py
+++ b/HLT/Trigger/TrigControl/TrigServices/python/TriggerUnixStandardSetup.py
@@ -65,6 +65,23 @@ def setupCommonServices():
     from PyUtils.Helpers import ROOT6Setup
     ROOT6Setup()
 
+    # Setup online THistSvc unless specifically configured otherwise
+    #    setup the THistSvc early and force the creation of the ThistSvc 
+    #    so that it can be used by infrastructure services to book histograms  
+    #    (to avoid problems e.g. with histograms in ROBDataProviderSvc)
+    if _Conf.useOnlineTHistSvc:
+        if hasattr(svcMgr, 'THistSvc'):
+            log.fatal("The offline histogramming THistSvc is already in place.")
+            raise RuntimeError("Cannot setup online histogramming TrigMonTHistSvc")
+        log.debug("Using online histogramming service (TrigMonTHistSvc)")
+        from TrigServices.TrigServicesConf import TrigMonTHistSvc
+        svcMgr += TrigMonTHistSvc("THistSvc")
+    else:
+        log.debug("Using offline histogramming service (THistSvc)")
+        from GaudiSvc.GaudiSvcConf import THistSvc
+        svcMgr += THistSvc()
+    theApp.CreateSvc += [ svcMgr.THistSvc.getFullName() ]
+
     # StoreGateSvc
     svcMgr.StoreGateSvc.ActivateHistory = False
     
@@ -109,18 +126,9 @@ def setupCommonServices():
     from TrigServices.TrigServicesConfig import TrigCOOLUpdateHelper
     svcMgr.HltEventLoopMgr.CoolUpdateTool = TrigCOOLUpdateHelper()
             
-    # Setup online THistSvc unless specifically configured otherwise
-    if _Conf.useOnlineTHistSvc:
-        if hasattr(svcMgr, 'THistSvc'):
-            log.fatal("The offline histogramming THistSvc is already in place.")
-            raise RuntimeError("Cannot setup online histogramming TrigMonTHistSvc")
-        log.debug("Using online histogramming service (TrigMonTHistSvc)")
-        from TrigServices.TrigServicesConf import TrigMonTHistSvc
-        svcMgr += TrigMonTHistSvc("THistSvc")
-    else:
-        log.debug("Using offline histogramming service (THistSvc)")
-        from GaudiSvc.GaudiSvcConf import THistSvc
-        svcMgr += THistSvc()
+    # Configure the online ROB data provider service
+    from TrigServices.TrigServicesConfig import HltROBDataProviderSvc
+    svcMgr += HltROBDataProviderSvc()  
 
     # Explicitly set a few OutputLevels (needed because some services are created in
     # different order when running with the PSC)
@@ -155,7 +163,6 @@ def setupCommonServicesEnd():
         if 1 not in [ o.count('EXPERT') for o in svcMgr.THistSvc.Output ]:
             svcMgr.THistSvc.Output += ["EXPERT DATAFILE='expert-monitoring.root' OPT='RECREATE'"]
 
-
     # Set default properties for some important services after all user job options
     log.info('Configure core services for online runnig')
 
diff --git a/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.h b/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.h
index 550eff3e3028a54b5cc5a4e379117750ea6e86d6..182d6a8f7a210d729cd079d99e065784a4e21831 100644
--- a/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.h
+++ b/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.h
@@ -241,7 +241,7 @@ private:
   /// "Event" context of current run (invalid event/slot)
   EventContext m_currentRunCtx;
   /// Event counter used for local bookkeeping; incremental per instance of HltEventLoopMgr, unrelated to global_id
-  size_t m_localEventNumber;
+  size_t m_localEventNumber{0};
   /// Event selector context
   IEvtSelector::Context* m_evtSelContext;
   /// Vector of top level algorithms
@@ -261,7 +261,7 @@ private:
   /// Flag set to false if timer thread should be stopped
   std::atomic<bool> m_runEventTimer;
   /// Counter of framework errors
-  int m_nFrameworkErrors;
+  int m_nFrameworkErrors{0};
   /// Application name
   std::string m_applicationName;
   /// Worker ID
diff --git a/HLT/Trigger/TrigControl/TrigServices/src/HltROBDataProviderSvc.cxx b/HLT/Trigger/TrigControl/TrigServices/src/HltROBDataProviderSvc.cxx
index a1451a407ebcb4bcda12fc7087f06b1ff4c428de..a796a8f58d3a423bd2e7e2dfb50c43fe4e3c2d78 100644
--- a/HLT/Trigger/TrigControl/TrigServices/src/HltROBDataProviderSvc.cxx
+++ b/HLT/Trigger/TrigControl/TrigServices/src/HltROBDataProviderSvc.cxx
@@ -1,137 +1,109 @@
 /*
   Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
-
-// Include files.
 #include "HltROBDataProviderSvc.h"
-#include "TrigMonitorBase/TrigLockedHist.h"
-#include "StoreGate/StoreGateSvc.h"
-#include "GaudiKernel/ISvcLocator.h"
-#include "GaudiKernel/ITHistSvc.h"
+#include "TrigKernel/HltExceptions.h"
+
+// Gaudi
 #include "GaudiKernel/IJobOptionsSvc.h"
-#include "GaudiKernel/Property.h"
-#include "GaudiKernel/IIncidentSvc.h"
-#include "GaudiKernel/IAlgContextSvc.h"
-#include "GaudiKernel/IAlgorithm.h"
+
+// hltinterface / data collector
 #include "hltinterface/DataCollector.h"
-#include "eformat/Version.h"
-
-#include <iostream>
-#include <sstream>
-#include <iomanip>
-#include <cassert> 
-#include <bitset> 
-#include <TH1F.h>
-#include <TH2F.h>
-
-#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0)
-#   define CAN_REBIN(hist)  hist->SetCanExtend(TH1::kAllAxes)
-#else
-#   define CAN_REBIN(hist)  hist->SetBit(TH1::kCanRebin)
-#endif
-
-namespace HltROBDataProviderConstants {
-  // reserve a number of ROB monitor collections
-  static const int Number_of_Rob_Monitor_Structs = 10;
-  // number of ROBs in an event, used to reserve space in an array
-  static const int Max_Number_Of_ROBs = 2000;
-}
 
-// Constructor.
-HltROBDataProviderSvc::HltROBDataProviderSvc(const std::string& name, ISvcLocator* svcloc)
-:ROBDataProviderSvc(name,svcloc),
- m_storeGateSvc( "StoreGateSvc", name ),
- m_algContextSvc(0),
- m_onlineRunning(false),
- m_removeEmptyROB(false),
- m_isEventComplete(false),
- m_callerName("UNKNOWN"),
- m_RobRequestInfo(0),
- m_histProp_requestedROBsPerCall(Gaudi::Histo1DDef("RequestedROBsPerCall" ,0,300,50)),
- m_histProp_receivedROBsPerCall(Gaudi::Histo1DDef("ReceivedROBsPerCall" ,0,300,50)),
- m_histProp_timeROBretrieval(Gaudi::Histo1DDef("TimeForROBretrieval" ,0.,500.,50)),
- m_hist_requestedROBsPerCall(0),
- m_hist_receivedROBsPerCall(0),
- m_hist_timeROBretrieval(0),
- m_hist_genericStatusForROB(0),
- m_hist_specificStatusForROB(0)
+// eformat
+#include "eformat/Status.h"
+#include "eformat/write/FullEventFragment.h" // max number of possible ROB fragments
+
+// Athena
+
+HltROBDataProviderSvc::HltROBDataProviderSvc(const std::string& name, ISvcLocator* pSvcLocator) :
+  base_class(name, pSvcLocator)
 {
-  declareProperty("ignoreROB", m_ignoreROB,"List of ROBs to ignore for retrieval");
-  declareProperty("enabledROBs", m_enabledROBs,"List of enabled detector ROBs");
-  declareProperty("LArMetROBs", m_enabledLArMetROBs,"List of enabled LAr MET ROBs");
-  declareProperty("TileMetROBs", m_enabledTileMetROBs,"List of enabled Tile MET ROBs");
-  declareProperty("readROBfromOKS", m_readROBfromOKS=true,"Read enabled ROBs from OKS");
-  declareProperty("doMonitoring", m_doMonitoring=false,"Enable histograms");
-  declareProperty("doDetailedROBMonitoring", m_doDetailedROBMonitoring=false,"Produce ROB cost data");
-  declareProperty("ROBDataMonitorCollectionSGName", m_ROBDataMonitorCollection_SG_Name="ROBDataMonitorCollection","Name of cost monitoring collection in SG");
-  declareProperty("HistRequestedROBsPerCall", m_histProp_requestedROBsPerCall,"Number of ROBs requested");
-  declareProperty("HistReceivedROBsPerCall", m_histProp_receivedROBsPerCall,"Number of ROBs received");
-  declareProperty("HistTimeROBretrieval", m_histProp_timeROBretrieval,"Timing for ROB retrieval");
-  declareProperty("ModuleIDGenericLArMetROB", m_genericLArMetModuleID=0xffff,"Generic module id for LAr MET ROB retrieval");  
-  declareProperty("ModuleIDGenericTileMetROB", m_genericTileMetModuleID=0xffff,"Generic module id for Tile MET ROB retrieval");
-  declareProperty("SeparateMETandDetROBRetrieval", m_separateMETandDetROBRetrieval=true,"Separate retrieval of MET and detector ROBs");
-
-  // fill map with generic status codes
-  m_map_GenericStatus[eformat::UNCLASSIFIED]      = "UNCLASSIFIED"; 
-  m_map_GenericStatus[eformat::BCID_CHECK_FAIL]   = "BCID_CHECK_FAIL"; 
-  m_map_GenericStatus[eformat::LVL1ID_CHECK_FAIL] = "LVL1ID_CHECK_FAIL"; 
-  m_map_GenericStatus[eformat::TIMEOUT]           = "TIMEOUT"; 
-  m_map_GenericStatus[eformat::DATA_CORRUPTION]   = "DATA_CORRUPTION"; 
-  m_map_GenericStatus[eformat::INTERNAL_OVERFLOW] = "INTERNAL_OVERFLOW"; 
-  m_map_GenericStatus[eformat::DUMMY_FRAGMENT]    = "DUMMY_FRAGMENT"; 
-
-  // fill vector with specific status codes
-  m_vec_SpecificStatus.reserve(16);
-  m_vec_SpecificStatus.push_back("TRIGGER_TYPE_SYNC_ERROR/DATAFLOW_DUMMY"); 
-  m_vec_SpecificStatus.push_back("FRAGMENT_SIZE_ERROR"); 
-  m_vec_SpecificStatus.push_back("DATABLOCK_ERROR"); 
-  m_vec_SpecificStatus.push_back("CTRL_WORD_ERROR"); 
-  m_vec_SpecificStatus.push_back("MISSING_BOF"); 
-  m_vec_SpecificStatus.push_back("MISSING_EOF"); 
-  m_vec_SpecificStatus.push_back("INVALID_HEADER_MARKER"); 
-  m_vec_SpecificStatus.push_back("FORMAT_ERROR"); 
-  m_vec_SpecificStatus.push_back("DUPLICATE_EVENT"); 
-  m_vec_SpecificStatus.push_back("SEQUENCE_ERROR"); 
-  m_vec_SpecificStatus.push_back("TRANSMISSION_ERROR"); 
-  m_vec_SpecificStatus.push_back("TRUNCATION"); 
-  m_vec_SpecificStatus.push_back("SHORT_FRAGMENT"); 
-  m_vec_SpecificStatus.push_back("FRAGMENT_LOST"); 
-  m_vec_SpecificStatus.push_back("FRAGMENT_PENDING"); 
-  m_vec_SpecificStatus.push_back("ROBIN_DISCARD_MODE"); 
 }
 
-// Destructor.
 HltROBDataProviderSvc::~HltROBDataProviderSvc()
 {
 }
 
-// Initialization 
 StatusCode HltROBDataProviderSvc::initialize()
 {
-  StatusCode sc = ROBDataProviderSvc::initialize();
-
-  ATH_MSG_INFO(" ---> HltROBDataProviderSvc = " << name() << " initialize "
-               << " - package version " << PACKAGE_VERSION);
-
-  // get Property filterEmptyROB from base class
-  if ( !sc.isSuccess() ) {
-    ATH_MSG_ERROR(" ROBDataProviderSvc::initialize() failed.");
-    return sc;
-  } else {
-    BooleanProperty filterEmptyROB;
-    filterEmptyROB.setName("filterEmptyROB");
-    if (filterEmptyROB.assign(getProperty("filterEmptyROB"))) {
-      m_removeEmptyROB = filterEmptyROB.value() ;
-      ATH_MSG_INFO(" ---> getProperty('filterEmptyROB')       = " << filterEmptyROB);
-    } else {
-      ATH_MSG_WARNING(" ROBDataProviderSvc::getProperty('filterEmptyROB') failed.");
+  ATH_MSG_INFO("HltROBDataProviderSvc::" << __FUNCTION__ << ": name = " << name());
+//===================================================================  
+//      The filtering of ROBs can be configured with job options as:
+//
+//      for individual ROBs as :
+//      ------------------------
+//      ROBDataProviderSvc.filterRobWithStatus = [ (ROB SourceId, StatusCode to remove),
+//                                                 (ROB SourceId 2, StatusCode to remove 2), ... ]
+//      and:
+//      ROBDataProviderSvc.filterRobWithStatus += [ (ROB SourceId n, StatusCode to remove n) ]
+//
+//      Example:
+//      ROBDataProviderSvc.filterRobWithStatus  = [ (0x42002a,0x0000000f), (0x42002e,0x00000008) ]
+//      ROBDataProviderSvc.filterRobWithStatus += [ (0x42002b,0x00000000) ]
+//
+//      for all ROBs of a given sub detector as :
+//      -----------------------------------------
+//      ROBDataProviderSvc.filterSubDetWithStatus = [ (Sub Det Id, StatusCode to remove),
+//                                                    (Sub Det Id 2, StatusCode to remove 2), ... ]
+//      and:
+//      ROBDataProviderSvc.filterSubDetWithStatus += [ (Sub Det Id n, StatusCode to remove n) ]
+//
+//      Example:
+//      ROBDataProviderSvc.filterSubDetWithStatus  = [ (0x41,0x00000000), (0x42,0x00000000) ]
+//      ROBDataProviderSvc.filterSubDetWithStatus += [ (0x41,0xcb0002) ]
+//
+//      For valid ROB Source Ids, Sub Det Ids and ROB Status elements see the event format
+//      document ATL-D-ES-0019 (EDMS)
+//===================================================================   
+  // get list of ROBs to filter out by status code
+  for (unsigned int i = 0; i < m_filterRobWithStatus.value().size(); i++) {
+    eformat::helper::SourceIdentifier tmpsrc(m_filterRobWithStatus.value()[i].first);
+    if (tmpsrc.human_detector() != "UNKNOWN") {
+      m_filterRobMap[tmpsrc.code()].push_back(m_filterRobWithStatus.value()[i].second);
+    }
+  }
+   
+  // get list of subdetectors to filter out by status code
+  for (unsigned int i = 0; i < m_filterSubDetWithStatus.value().size(); i++) {
+    eformat::helper::SourceIdentifier tmpsrc((eformat::SubDetector)m_filterSubDetWithStatus.value()[i].first, 0);
+    if (tmpsrc.human_detector() != "UNKNOWN") {
+      m_filterSubDetMap[tmpsrc.subdetector_id()].push_back(m_filterSubDetWithStatus.value()[i].second);
+    }
+  }
+  ATH_MSG_INFO(" ---> Filter out empty ROB fragments                               = " << m_filterEmptyROB);
+
+  // print list of ROBs to filter out by status code
+  ATH_MSG_INFO(" ---> Filter out specific ROBs by Status Code: # ROBs              = " << m_filterRobMap.size());
+  for (auto it : m_filterRobMap) {
+    eformat::helper::SourceIdentifier tmpsrc(it.first);
+    ATH_MSG_INFO("      RobId=0x" << MSG::hex << it.first << " -> in Sub Det = " << tmpsrc.human_detector());
+
+    for (auto it_status: it.second) { 
+      eformat::helper::Status tmpstatus(it_status);
+      ATH_MSG_INFO("         Status Code=0x"
+		   << MSG::hex << std::setfill( '0' ) << std::setw(8) << tmpstatus.code()
+		   << " Generic Part=0x" << std::setw(4) << tmpstatus.generic()
+		   << " Specific Part=0x" << std::setw(4) << tmpstatus.specific() << MSG::dec);
+    }
+  }
+
+  // print list of subdetectors to filter out by status code
+  ATH_MSG_INFO(" ---> Filter out Sub Detector ROBs by Status Code: # Sub Detectors = " << m_filterSubDetMap.size());
+  for (auto it : m_filterSubDetMap) {
+    eformat::helper::SourceIdentifier tmpsrc(it.first, 0);
+    ATH_MSG_INFO("      SubDetId=0x" << MSG::hex << it.first << " -> " << tmpsrc.human_detector());
+    for (auto it_status : it.second) {
+      eformat::helper::Status tmpstatus(it_status);
+      ATH_MSG_INFO("         Status Code=0x"
+		   << MSG::hex << std::setfill( '0' ) << std::setw(8) << tmpstatus.code()
+		   << " Generic Part=0x" << std::setw(4) << tmpstatus.generic()
+		   << " Specific Part=0x" << std::setw(4) << tmpstatus.specific() << MSG::dec);
     }
   }
 
   // get the list of enabled ROBs from OKS
   bool robOKSconfigFound = false;
-  bool robLArMetOKSconfigFound = false;
-  bool robTileMetOKSconfigFound = false;
 
   if ( m_readROBfromOKS.value() ) {
     ServiceHandle<IJobOptionsSvc> p_jobOptionsSvc("JobOptionsSvc", name());
@@ -148,1136 +120,516 @@ StatusCode HltROBDataProviderSvc::initialize()
           if ( cur->name() == "DF_Enabled_ROB_IDs" ) {
             if (m_enabledROBs.assign(*cur)) {
               robOKSconfigFound = true;
-              ATH_MSG_INFO(" ---> Read from OKS                       = " << m_enabledROBs.value().size() << " enabled ROB IDs.");
+	      ATH_MSG_INFO(" ---> Read from OKS                                                = "
+			   << MSG::dec << m_enabledROBs.value().size() << " enabled ROB IDs.");
             } else {
               ATH_MSG_WARNING(" Could not set Property 'enabledROBs' from OKS.");
             }
           }
-
-          // the LAr MET ROB list is found
-          if ( cur->name() == "DF_LAr_MET_ROB_IDs" ) {
-            if (m_enabledLArMetROBs.assign(*cur)) {
-              robLArMetOKSconfigFound = true;
-              ATH_MSG_INFO(" ---> Read from OKS                       = " << m_enabledLArMetROBs.value().size() << " LAr MET ROB IDs.");
-            } else {
-              ATH_MSG_WARNING(" Could not set Property 'LArMetROBs' from OKS.");
-            }
-          }
-
-          // the Tile MET ROB list is found
-          if ( cur->name() == "DF_Tile_MET_ROB_IDs" ) {
-            if (m_enabledTileMetROBs.assign(*cur)) {
-              robTileMetOKSconfigFound = true;
-              ATH_MSG_INFO(" ---> Read from OKS                       = " << m_enabledTileMetROBs.value().size() << " Tile MET ROB IDs.");
-            } else {
-              ATH_MSG_WARNING(" Could not set Property 'TileMetROBs' from OKS.");
-            }
-          }
         }
       }
       p_jobOptionsSvc.release().ignore();
     }
   }
 
-  ATH_MSG_INFO(" ---> HltROBDataProviderSvc               = " << name() << " special properties <---");
-  ATH_MSG_INFO(" ---> Filter out empty ROB fragments      = " << m_removeEmptyROB);
-  ATH_MSG_INFO(" ---> Fill monitoring histograms          = " << m_doMonitoring);
-  ATH_MSG_INFO("        Hist:RequestedROBsPerCall         = " << m_histProp_requestedROBsPerCall);
-  ATH_MSG_INFO("        Hist:ReceivedROBsPerCall          = " << m_histProp_receivedROBsPerCall);
-  ATH_MSG_INFO("        Hist:TimeROBretrieval             = " << m_histProp_timeROBretrieval);
-  ATH_MSG_INFO(" ---> Do detailed ROB monitoring          = " << m_doDetailedROBMonitoring);
-  ATH_MSG_INFO(" ---> SG name for ROB monitoring collect. = " << m_ROBDataMonitorCollection_SG_Name);
-  ATH_MSG_INFO(" ---> Read list of enabled ROBs from OKS  = " << m_readROBfromOKS);
+  // print list of enabled ROBs, read from OKS
+  ATH_MSG_INFO(" ---> Read list of enabled ROBs from OKS                           = " << m_readROBfromOKS);
   if (m_enabledROBs.value().size() == 0) {
-    ATH_MSG_INFO(" ---> The list of enabled ROBs has size   = 0. No check will be performed ");
+    ATH_MSG_INFO(" ---> The list of enabled ROBs has size                            = 0. No check will be performed ");
   } else {
     if (m_readROBfromOKS.value() && robOKSconfigFound) {
-      ATH_MSG_INFO(" ---> The list of enabled ROBs has size   = " << m_enabledROBs.value().size() 
-                   << ". It was read from the partition database." );
-    } else {
-      ATH_MSG_INFO(" ---> The list of enabled ROBs has size   = " << m_enabledROBs.value().size() 
-                   << ". It was read from job options." );
-    }
-  }
-
-  ATH_MSG_INFO(" ---> Generic Module ID for LAr MET ROB   = " << m_genericLArMetModuleID);
-  if (m_enabledLArMetROBs.value().size() == 0) {
-    ATH_MSG_INFO(" ---> The list of LAr MET ROBs has size   = 0. No LAr MET ROB access will be done.");
-  } else {
-    if (m_readROBfromOKS.value() && robLArMetOKSconfigFound) {
-      ATH_MSG_INFO(" ---> The list of LAr MET ROBs has size   = " << m_enabledLArMetROBs.value().size() 
+      ATH_MSG_INFO(" ---> The list of enabled ROBs has size                            = " << MSG::dec << m_enabledROBs.value().size() 
                    << ". It was read from the partition database." );
     } else {
-      ATH_MSG_INFO(" ---> The list of LAr MET ROBs has size   = " << m_enabledLArMetROBs.value().size() 
+      ATH_MSG_INFO(" ---> The list of enabled ROBs has size                            = " << MSG::dec << m_enabledROBs.value().size() 
                    << ". It was read from job options." );
     }
   }
 
-  ATH_MSG_INFO(" ---> Generic Module ID for Tile MET ROB  = " << m_genericTileMetModuleID);
-  if (m_enabledTileMetROBs.value().size() == 0) {
-    ATH_MSG_INFO(" ---> The list of Tile MET ROBs has size  = 0. No Tile MET ROB access will be done.");
-  } else {
-    if (m_readROBfromOKS.value() && robTileMetOKSconfigFound) {
-      ATH_MSG_INFO(" ---> The list of Tile MET ROBs has size  = " << m_enabledTileMetROBs.value().size() 
-                   << ". It was read from the partition database." );
-    } else {
-      ATH_MSG_INFO(" ---> The list of Tile MET ROBs has size  = " << m_enabledTileMetROBs.value().size() 
-                   << ". It was read from job options." );
-    }
-  }
+  // Setup the slot specific cache
+  m_eventsCache = SG::SlotSpecificObj<EventCache>( SG::getNSlots() );
 
-  ATH_MSG_INFO(" ---> Separate MET and Det ROB Retrieval  = " << m_separateMETandDetROBRetrieval);
+  // Retrieve the monitoring tool
+  if (!m_monTool.empty()) ATH_CHECK(m_monTool.retrieve());
 
-  if (m_ignoreROB.value().size() == 0) {
-    ATH_MSG_INFO(" ---> The list of ROBs to ignore has size = 0. No check will be performed ");
-  } else {
-    ATH_MSG_INFO(" ---> The list of ROBs to ignore has size = " << m_ignoreROB.value().size());
-  }
-
-  for (unsigned int i=0; i<m_ignoreROB.value().size(); i++) {
-    ATH_MSG_INFO(" ---> do not retrieve ROB[" << i << "]: hex(id)=0x"
-                 << MSG::hex << m_ignoreROB.value()[i]<<MSG::dec
-                 << " dec(id)="<< m_ignoreROB.value()[i]);
-  }
-
-  // register incident handler for begin run
-  ServiceHandle<IIncidentSvc> incidentSvc("IncidentSvc", name());
-  ATH_CHECK(incidentSvc.retrieve());
+  return(StatusCode::SUCCESS);
+}
 
-  long int pri=100;
-  incidentSvc->addListener(this,"BeginRun",pri);
-  incidentSvc.release().ignore();
+StatusCode HltROBDataProviderSvc::finalize()
+{
+  ATH_CHECK(m_monTool.release());
+  return StatusCode::SUCCESS;
+}
 
-  // Setup the StoreGateSvc
-  ATH_CHECK(m_storeGateSvc.retrieve());
+/// --- Implementation of IROBDataProviderSvc interface ---
+/// --- Legacy interface (depricated) ---
 
-  return sc;
+/// Signal ROB fragments which should be considered for prefetching in online running
+void HltROBDataProviderSvc::addROBData(const std::vector<uint32_t>& robIds, 
+					 const std::string_view callerName)
+{
+  const EventContext context{ Gaudi::Hive::currentContext() };
+  return addROBData( context, robIds, callerName );
 }
 
-// Initialization 
-StatusCode HltROBDataProviderSvc::finalize()
+/// Start a new event with a set of ROB fragments, e.g. from LVL1 result, in online and add the fragments to the ROB cache
+void HltROBDataProviderSvc::setNextEvent(const std::vector<ROBF>& result)
 {
-  StatusCode sc = ROBDataProviderSvc::finalize();
-  if ( !sc.isSuccess() ) {
-    ATH_MSG_ERROR(" ROBDataProviderSvc::finalize() failed.");
-  }
-
-  // release the AlgContextSvc if used
-  if ( m_algContextSvc ) m_algContextSvc->release();
+  const EventContext context{ Gaudi::Hive::currentContext() };
+  return setNextEvent( context, result );
+}
 
-  return sc;
+/// Start a new event with a full event fragment and add all ROB fragments in to the ROB cache
+void HltROBDataProviderSvc::setNextEvent(const RawEvent* re)
+{
+  const EventContext context{ Gaudi::Hive::currentContext() };
+  return setNextEvent( context, re );
 }
 
-/// Query interface
-StatusCode HltROBDataProviderSvc::queryInterface(const InterfaceID& riid, void** ppvInterface)
+/// Retrieve ROB fragments for given ROB ids from the ROB cache
+void HltROBDataProviderSvc::getROBData(const std::vector<uint32_t>& robIds, std::vector<const ROBF*>& robFragments, 
+				       const std::string_view callerName)
 {
-  if ( IROBDataProviderSvc::interfaceID().versionMatch(riid) )  {
-    *ppvInterface = (IROBDataProviderSvc*)this;
-  } else if ( ITrigROBDataProviderSvc::interfaceID().versionMatch(riid) )  {
-    *ppvInterface = (ITrigROBDataProviderSvc*)this;
-  } else if ( ITrigROBDataProviderSvcPrefetch::interfaceID().versionMatch(riid) )  {
-    *ppvInterface = (ITrigROBDataProviderSvcPrefetch*)this;
-  } else if ( IIncidentListener::interfaceID().versionMatch(riid) )  {
-    *ppvInterface = (IIncidentListener*)this;
-  } else {
-    return Service::queryInterface(riid, ppvInterface);
-  } 
-  addRef(); 
-  return StatusCode::SUCCESS; 
+  const EventContext context{ Gaudi::Hive::currentContext() };
+  return getROBData( context, robIds, robFragments, callerName );
 }
 
-/** - in online add ROB fragments for given ROB ids to the map
-      call the DataCollector to retrieve the ROB fragments 
-
-    - in offline only check that given ROB ids are in the map, issue an
-      error if not
- */
-void HltROBDataProviderSvc::addROBData(const std::vector<uint32_t>& robIds, const std::string callerName)
-{ 
-  //-------------------
-  // remove empty calls
-  //-------------------
-  if (robIds.size() == 0) return;
-
-  //--------------------
-  // set the caller name
-  //--------------------
-  if (callerName != "UNKNOWN") m_callerName = callerName;
-
-  //--------------------
-  // make unique ROB IDs
-  //--------------------
-  std::vector<uint32_t>::iterator remove_duplicate;
-  std::vector<uint32_t> robIdsUnique(robIds);
-
-  sort(robIdsUnique.begin(), robIdsUnique.end()); 
-  remove_duplicate = unique(robIdsUnique.begin(), robIdsUnique.end()); 
-  robIdsUnique.erase(remove_duplicate, robIdsUnique.end());
-
-  //------------------------------------------------------------------
-  // Replace the generic MET ROB ID with the full list of all MET ROBs
-  //------------------------------------------------------------------
-  // LAr MET ROBs
-  uint32_t generic_LAr_MET_id = eformat::helper::SourceIdentifier(eformat::TDAQ_LAR_MET,m_genericLArMetModuleID.value()).code();
-  std::vector<uint32_t>::iterator rob_LAr_Met_it = std::find(robIdsUnique.begin(), robIdsUnique.end(), generic_LAr_MET_id);
-  if (rob_LAr_Met_it != robIdsUnique.end()) {
-    robIdsUnique.erase(rob_LAr_Met_it);
-    if (m_enabledLArMetROBs.value().size() != 0) robIdsUnique.insert(robIdsUnique.end(),m_enabledLArMetROBs.value().begin(),m_enabledLArMetROBs.value().end());
-  }
+/// Retrieve the full event fragment
+const RawEvent* HltROBDataProviderSvc::getEvent() 
+{
+  const EventContext context{ Gaudi::Hive::currentContext() };
+  return getEvent( context );
+}
 
-  // Tile MET ROBs
-  uint32_t generic_Tile_MET_id = eformat::helper::SourceIdentifier(eformat::TDAQ_TILE_MET,m_genericTileMetModuleID.value()).code();
-  std::vector<uint32_t>::iterator rob_Tile_Met_it = std::find(robIdsUnique.begin(), robIdsUnique.end(), generic_Tile_MET_id);
-  if (rob_Tile_Met_it != robIdsUnique.end()) {
-    robIdsUnique.erase(rob_Tile_Met_it);
-    if (m_enabledTileMetROBs.value().size() != 0) robIdsUnique.insert(robIdsUnique.end(),m_enabledTileMetROBs.value().begin(),m_enabledTileMetROBs.value().end());
-  }
+/// Store the status for the event.
+void HltROBDataProviderSvc::setEventStatus(uint32_t status)
+{
+  const EventContext context{ Gaudi::Hive::currentContext() };
+  setEventStatus( context, status );
+}
 
-  //-------------------
-  //--- offline running
-  //-------------------
-  if (!m_onlineRunning) {
-
-    // for offline running all requested ROBs should be found in cache
-    // if not issue error
-    ROBDataProviderSvc::addROBData(robIdsUnique);
-    //------------------
-    //--- online running
-    //------------------
-  } else {
-    // detailed ROB monitoring
-    //------------------------
-    // Create a ROB monitoring collection and register it to StoreGate
-    ROBDataMonitorCollection* p_robMonCollection(0); 
-    if ( m_doDetailedROBMonitoring.value() ) {
-      if ( !(m_storeGateSvc->transientContains<ROBDataMonitorCollection>(m_ROBDataMonitorCollection_SG_Name.value())) ) {
-        p_robMonCollection = new ROBDataMonitorCollection;
-        if ( p_robMonCollection ) {
-          p_robMonCollection->reserve( HltROBDataProviderConstants::Number_of_Rob_Monitor_Structs ) ;
-          if ( (m_storeGateSvc->record(p_robMonCollection, m_ROBDataMonitorCollection_SG_Name.value(), true)).isFailure() ) {
-            ATH_MSG_WARNING(" Registering ROB Monitoring collection in StoreGate failed.");
-            delete p_robMonCollection;
-            p_robMonCollection = 0;
-          }
-        }
-      } else {
-        if ( m_storeGateSvc->retrieve(p_robMonCollection).isFailure() ) {
-          ATH_MSG_WARNING(" Retrieval of ROB Monitoring collection from StoreGate failed.");
-          p_robMonCollection = 0;
-        }
-      }
-    }
+/// Retrieve the status for the event.
+uint32_t HltROBDataProviderSvc::getEventStatus() 
+{
+  const EventContext context{ Gaudi::Hive::currentContext() };
+  return getEventStatus( context );
+}
 
-    // create a new ROBDataMonitorStruct and fill it
-    robmonitor::ROBDataMonitorStruct* p_robMonStruct(0);
-    if ( p_robMonCollection ) {
-      // caller name
-      std::string caller_name("UNKNOWN");
-      if (callerName != "UNKNOWN") {
-        caller_name = callerName;
-      } else if ((callerName == "UNKNOWN") && (m_callerName != "UNKNOWN")) {
-        caller_name = m_callerName;
-      } else {
-        IAlgorithm* alg(0);
-        if ( m_algContextSvc ) {
-          alg = m_algContextSvc->currentAlg();
-          caller_name = (alg ? alg->name() : "<NONE>");
-        }
-      }
+/// --- Implementation of IROBDataProviderSvc interface ---
+/// --- Context aware interface for MT ---
 
-      // initialize new ROBDataMonitorStruct
-      p_robMonStruct = new robmonitor::ROBDataMonitorStruct(m_currentLvl1ID, robIdsUnique, caller_name);
+/// Signal ROB fragments which should be considered for prefetching in online running
+void HltROBDataProviderSvc::addROBData(const EventContext& context, const std::vector<uint32_t>& robIds, 
+				       const std::string_view callerName)
+{
+  ATH_MSG_VERBOSE("start of " << __FUNCTION__ << ": Number of ROB Ids to add = " << robIds.size() 
+		  << " caller name = " << callerName);
+  EventCache* cache = m_eventsCache.get( context );
+
+  // allocate vector of missing ROB Ids
+  std::vector<uint32_t> robIds_missing ;
+  robIds_missing.reserve( robIds.size() ) ;
+
+  // allocate vector with existing ROB fragments in cache
+  std::vector<const ROBF*> robFragments_inCache ;
+  robFragments_inCache.reserve( robIds.size() ) ;
+
+  // check input ROB list against cache
+  eventCache_checkRobListToCache(cache,robIds, robFragments_inCache, robIds_missing ) ;
+
+  // call data collector
+  if (robIds_missing.size() > 0) {
+    ATH_MSG_DEBUG( __FUNCTION__ << ": Number of ROB Ids to reserve with DCM = " << robIds_missing.size()); 
+    // reserve the ROBs in the DCM
+    try {  
+      auto mon_robres_t = Monitored::Timer("TIME_ROBReserveData");
+      hltinterface::DataCollector::instance()->reserveROBData(cache->globalEventNumber, robIds_missing);
+      mon_robres_t.stop();
+      // Fill monitoring histograms
+      auto mon_robres_nROBs = Monitored::Scalar("NUMBER_ROBReserveData",robIds_missing.size());
+      auto mon = Monitored::Group(m_monTool, mon_robres_t, mon_robres_nROBs);
+    } catch (const std::exception& ex) {
+      ATH_MSG_ERROR( __FUNCTION__ << ":" << __LINE__ 
+		     << "Failed to reserve ROB data, caught an unexpected exception: " << ex.what());
+    } catch (...) {
+      ATH_MSG_ERROR( __FUNCTION__ << ":" << __LINE__ 
+		     << "Failed to reserve ROB data, caught an unexpected exception."); 
     }
+  }
+}
 
-    // for online running the requested ROBs should be not found in cache
-    // ------------------------------------------------------------------
-    // vector with missing ROB ids for DataCollector
-    std::vector<uint32_t> vRobIds;
-    vRobIds.reserve( robIdsUnique.size() ) ;
-
-    // find missing ROB ids which should be retrieved  
-    ATH_MSG_DEBUG(" ---> addROBData: Number of ROB Ids requested : " << robIdsUnique.size());
-
-    for (uint32_t id : robIdsUnique) {
-
-      // check if ROB is already in cache
-      ONLINE_ROBMAP::iterator map_it = m_online_robmap.find(id) ;
-      if(map_it != m_online_robmap.end()) {
-        ATH_MSG_DEBUG(" ---> addROBData: Found   ROB Id : 0x" << MSG::hex << (*map_it).second.source_id());
-        continue;
-      } 
-
-      // check if ROB should be ignored
-      if (m_ignoreROB.value().size() != 0) {
-        std::vector<uint32_t>::const_iterator rob_ignore_it =
-            std::find(m_ignoreROB.value().begin(), m_ignoreROB.value().end(),id);
-        if(rob_ignore_it != m_ignoreROB.value().end()) {
-          ATH_MSG_DEBUG(" ---> addROBData: ROB Id : 0x" << MSG::hex << id << MSG::dec << " will be not retrieved, since it is on the veto list.");
-          continue;
-        }
-      }
+/// Start a new event with a set of ROB fragments, e.g. from LVL1 result, in online and add the fragments to the ROB cache
+void HltROBDataProviderSvc::setNextEvent(const EventContext& context, const std::vector<ROBF>& result)
+{
+  ATH_MSG_FATAL("Obsolete method HltROBDataProviderSvc::setNextEvent(const EventContext& context, const std::vector<ROBF>& result) called "
+		<< "\n context = " << context << " number of ROB fragments = " << result.size() );
+}
 
-      // check if ROB is actually enabled for readout
-      // do not perform this check for MET ROBs
-      if ( (m_enabledROBs.value().size() != 0) && 
-          (eformat::helper::SourceIdentifier(id).subdetector_id() != eformat::TDAQ_LAR_MET) &&
-          (eformat::helper::SourceIdentifier(id).subdetector_id() != eformat::TDAQ_TILE_MET) ){
-        std::vector<uint32_t>::const_iterator rob_enabled_it =
-            std::find(m_enabledROBs.value().begin(), m_enabledROBs.value().end(),id);
-        if(rob_enabled_it == m_enabledROBs.value().end()) {
-          ATH_MSG_DEBUG(" ---> addROBData: ROB Id : 0x" << MSG::hex << id << MSG::dec
-                        << " will be not retrieved, since it is not on the list of enabled ROBs.");
-          continue;
-        }
-      }
-      // Only Monitor SCHEDULED ROBs
-      if ( p_robMonStruct ) {
-        (p_robMonStruct->requested_ROBs)[id].rob_history = robmonitor::SCHEDULED;
-      }
+/// Start a new event with a full event fragment and add all ROB fragments in to the ROB cache
+void HltROBDataProviderSvc::setNextEvent(const EventContext& context, const RawEvent* re)
+{
+  ATH_MSG_VERBOSE("start of " << __FUNCTION__);
+  EventCache* cache = m_eventsCache.get( context );
+  
+  // clear the event cache of the previous event
+  eventCache_clear( cache );
 
-      // the ROB should be retrieved from the ROS
-      ATH_MSG_DEBUG(" ---> addROBData: Request ROB Id : 0x" << MSG::hex << id <<" from ROS ");
-      vRobIds.push_back( id ) ;
-    } // end loop over requested input ROBs
-
-    if (vRobIds.size() == 0) {
-      ATH_MSG_DEBUG(" ---> addROBData: either all requested ROBs are found in cache for running mode ONLINE, \n"
-                    << "      or input ROB Id list was empty, \n"
-                    << "      or all requested ROBs were not retrieved due to the veto list.\n"
-                    << "      Number of requested ROB Ids = " << robIdsUnique.size() << "\n"
-                    << "      Lvl1 id                     = " << m_currentLvl1ID);
-      // Set ROB request time also in the case when no DataCollector request is necessary 
-      // to allow correlation with RoI request times
-      // start and stop times will be equal
-      if ( p_robMonStruct ) {
-        struct timeval time_start;
-        struct timeval time_stop;
-
-        gettimeofday(&time_start, 0);
-        gettimeofday(&time_stop, 0);
-
-        p_robMonStruct->start_time_of_ROB_request    = time_start;
-        p_robMonStruct->end_time_of_ROB_request      = time_stop;
-      }
-    } else {
-      //
-      // Tell the DCM that these ROBs may be needed
-      // ---------------------------------------------------------------
-      //
-      if (msgLvl(MSG::DEBUG)) {
-        std::ostringstream ost;
-        ost << "      Number of scheduled ROB Ids = " << vRobIds.size() << "\n" ;
-        unsigned int rob_counter = 1;
-        for (uint32_t rob : vRobIds) {
-          ost << "       # = "<< std::setw(5) << rob_counter++ << " ROB id = 0x" << std::hex << rob << std::dec << "\n";
-        }
-        ATH_MSG_DEBUG(" ---> addROBData: The following ROB Ids are scheduled for retrieval and are reserved in the DCM: \n"
-                      << "      Lvl1 id                     = " << m_currentLvl1ID << "\n"
-                      << ost.str());                      
-      }
-      // reserve the ROBs in the DCM
-      hltinterface::DataCollector::instance()->reserveROBData(m_currentLvl1ID, vRobIds);
-    }
+  //----------------------------------------------+
+  // Fill the event cache with the new event data |
+  //----------------------------------------------+
 
-    // add the ROB monitoring structure to the collection
-    if ( p_robMonCollection && p_robMonStruct ) p_robMonCollection->push_back( p_robMonStruct );
-  } // end online running   
+  // store the pointer to the event
+  cache->event = re;
+  // set the LVL1 id
+  cache->currentLvl1ID = re->lvl1_id();
+  // set the global event number
+  cache->globalEventNumber = re->global_id();
+  // set flag for masking L2/EF module ID, this is only necessary for the separate L2 and EF systems from Run 1 
+  m_maskL2EFModuleID = (re->nlvl2_trigger_info() != 0);
+
+  //--------------------+
+  // Fill the ROB cache |
+  //--------------------+
+
+  // get all the ROBFragments
+  OFFLINE_FRAGMENTS_NAMESPACE::PointerType robF[eformat::write::MAX_UNCHECKED_FRAGMENTS];
+  size_t number_robs = re->children(robF,eformat::write::MAX_UNCHECKED_FRAGMENTS);
+  if (number_robs == eformat::write::MAX_UNCHECKED_FRAGMENTS) {
+    ATH_MSG_ERROR("ROB buffer overflow: ROBs found = " << number_robs 
+		  << " Max. number of ROBs allowed = " << eformat::write::MAX_UNCHECKED_FRAGMENTS);
+  }
+  std::vector<ROBF> rob_fragments;
+  rob_fragments.reserve(number_robs);
+  // loop over all ROBs
+  for (size_t irob = 0; irob < number_robs; irob++) {
+    rob_fragments.push_back(ROBF(robF[irob]));
+  }
+  // add the ROBs to the cache/rob map
+  eventCache_addRobData(cache, rob_fragments) ;
+
+  ATH_MSG_DEBUG(" ---> setNextEvent for                " << name() );
+  ATH_MSG_DEBUG("      current [global id, LVL1 id] = [" << cache->globalEventNumber << "," << cache->currentLvl1ID << "]" );
+  ATH_MSG_DEBUG("      number of received ROBs      =  " << rob_fragments.size() );
+  ATH_MSG_DEBUG("      size of ROB cache            =  " << cache->robmap.size() );
   return;
 }
 
-/** - in online add the LVL1/HLT result
-    - rebuild the map
-    - set flag for online running
- */
-void HltROBDataProviderSvc::setNextEvent(const std::vector<ROBF>& result)
-{ 
-  // clear the ROB map
-  m_online_robmap.clear(); 
-  m_currentLvl1ID = 0;
-
-  // set the online flag
-  m_onlineRunning = true ;
+/// Retrieve ROB fragments for given ROB ids from the ROB cache
+void HltROBDataProviderSvc::getROBData(const EventContext& context, 
+				       const std::vector<uint32_t>& robIds, std::vector<const ROBF*>& robFragments, 
+				       const std::string_view callerName)
+{
+  ATH_MSG_VERBOSE("start of " << __FUNCTION__ << ": Number of ROB Ids to get = " << robIds.size() 
+		  << " caller name = " << callerName);
+  EventCache* cache = m_eventsCache.get( context );
 
-  // set the complete event flag
-  m_isEventComplete = false;
+  // allocate vector of missing ROB Ids
+  std::vector<uint32_t> robIds_missing ;
+  robIds_missing.reserve( robIds.size() ) ;
 
-  // clear the ROB info object from steering
-  if (m_RobRequestInfo) m_RobRequestInfo->clearRequestScheduledRobIDs();
+  // check input ROB list against cache
+  eventCache_checkRobListToCache(cache, robIds, robFragments, robIds_missing) ;
 
-  if ( result.size() == 0 ) {
-    ATH_MSG_ERROR(" ---> setNextEvent online for "<< name() 
-                  <<" failed: Size of received vector of ROB fragments = " << result.size());
+  //  missing ROB fragments from the DCM and add them to the cache
+  if (robIds_missing.size() == 0) {
+    ATH_MSG_DEBUG( __FUNCTION__ << ": All requested ROB Ids were found in the cache. "); 
     return;
   }
 
-  // set the LVL1 id
-  m_currentLvl1ID = result[0].rod_lvl1_id();
-
-  // add fragments to map
-  std::vector<ROBF>::const_iterator it_robf     = result.begin();
-  std::vector<ROBF>::const_iterator it_robf_end = result.end();
-  for(; it_robf!=it_robf_end; ++it_robf) {
-    uint32_t id = it_robf->source_id() ;
-    // check current L1 ID against CTP fragment when possible
-    if ( (eformat::helper::SourceIdentifier(id).subdetector_id() == eformat::TDAQ_CTP) &&
-         (it_robf->rod_lvl1_id() != m_currentLvl1ID) ) {
-      ATH_MSG_ERROR(" ---> Lvl1 ID mismatch for CTP fragment with SourceId = 0x" << MSG::hex << id << MSG::dec
-                    << " and L1 Id = " << it_robf->rod_lvl1_id()
-                    << " to currently used L1 Id = " << m_currentLvl1ID
-                    << " -> Use CTP version from now on.");
-      m_currentLvl1ID = it_robf->rod_lvl1_id() ;
-    }
-    // remove empty ROB fragments or ones with bad status, if requested
-    if ((it_robf->rod_ndata() == 0) && (m_removeEmptyROB)) { 
-      ATH_MSG_DEBUG(" ---> Empty ROB Id = 0x" << MSG::hex << id << MSG::dec
-                    << " removed for L1 Id = " << m_currentLvl1ID);
-    } else if ( ROBDataProviderSvc::filterRobWithStatus(&*it_robf) ) {
-      if (msgLvl(MSG::DEBUG) && (it_robf->nstatus() > 0)) {
-        const uint32_t* it_status;
-        it_robf->status(it_status);
-        eformat::helper::Status tmpstatus( (*it_status) ) ;
-        ATH_MSG_DEBUG(" ---> ROB Id = 0x" << MSG::hex << id
-                      << std::setfill( '0' )
-                      << " with Generic Status Code = 0x" << std::setw(4) << tmpstatus.generic()
-                      << " and Specific Status Code = 0x" << std::setw(4) << tmpstatus.specific()
-                      << MSG::dec
-                      << " removed for L1 Id = " << m_currentLvl1ID);
-      }
-    } else {
-      m_online_robmap[id]= (*it_robf) ;
-    }
-
-    //* fill monitoring histogram for ROB generic status
-    if ( ( m_hist_genericStatusForROB ) && ( it_robf->nstatus() != 0 ) ) {
-      const uint32_t* it_status;
-      it_robf->status(it_status);
-      if ((*it_status) != 0) {
-        scoped_lock_histogram lock;
-        m_hist_genericStatusForROB->Fill(eformat::helper::SourceIdentifier(it_robf->source_id()).human_detector().c_str(),
-            m_map_GenericStatus[eformat::helper::Status(*it_status).generic()].c_str(),1.);
-      }
-    }
+  // There were missing ROB fragments retrieve them from the DCM and add them to the cache
+  ATH_MSG_DEBUG( __FUNCTION__ << ": Number of ROB Ids to retrieve with DCM = " << robIds_missing.size()); 
 
-    //* fill monitoring histogram for ROB specific status
-    if ( ( m_hist_specificStatusForROB ) && ( it_robf->nstatus() != 0 ) ) {
-      const uint32_t* it_status;
-      it_robf->status(it_status);
-      if ((*it_status) != 0) {
-        scoped_lock_histogram lock;
-        std::bitset<16> specificBits(eformat::helper::Status(*it_status).specific());
-        for (unsigned int index=0; index < 16; ++index) {
-          if (specificBits[index]) m_hist_specificStatusForROB->Fill(eformat::helper::SourceIdentifier(it_robf->source_id()).human_detector().c_str(),
-              m_vec_SpecificStatus[index].c_str(),1.);
-        }
-      }
-    }
-  }
+  typedef std::vector<hltinterface::DCM_ROBInfo> ROBInfoVec;
+  ROBInfoVec vRobInfos ;
 
-  if(msgLvl(MSG::DEBUG)) {
-    msg() << MSG::DEBUG << " ---> setNextEvent online for "<< name() << endmsg; 
-    msg() << MSG::DEBUG << "      online running    = " << m_onlineRunning << endmsg;
-    msg() << MSG::DEBUG << "      current LVL1 id   = " << m_currentLvl1ID << endmsg;
-    msg() << MSG::DEBUG << "      # LVL1 ROBs       = " << result.size() << endmsg;
-    msg() << MSG::DEBUG << "      size of ROB cache = " << m_online_robmap.size() << endmsg;
-    msg() << MSG::DEBUG << dumpROBcache() << endmsg; 
-  }
-  return; 
+  // Get ROB Fragments with DataCollector
+  vRobInfos.reserve( robIds_missing.size() ) ;
+  try {
+    auto mon_rob_t = Monitored::Timer("TIME_ROBRequest");
+    hltinterface::DataCollector::instance()->collect(vRobInfos, cache->globalEventNumber, robIds_missing);
+    mon_rob_t.stop();
+    // Fill monitoring histograms
+    auto mon_rob_nROBs = Monitored::Scalar("NUMBER_ROBRequest",vRobInfos.size());
+    auto mon = Monitored::Group(m_monTool, mon_rob_t, mon_rob_nROBs);
+  } catch (const std::exception& ex) {
+    ATH_MSG_ERROR( __FUNCTION__ << ":" << __LINE__ 
+		   << "Failed to collect ROBs, caught an unexpected exception: " << ex.what()
+		   << ". Throwing hltonl::Exception::EventSourceCorrupted" );
+    throw hltonl::Exception::EventSourceCorrupted();
+  } catch (...) {
+    ATH_MSG_ERROR( __FUNCTION__ << ":" << __LINE__ 
+		   << "Failed to collect ROBs, caught an unexpected exception. "
+		   << "Throwing hltonl::Exception::EventSourceCorrupted" );
+    throw hltonl::Exception::EventSourceCorrupted();
+  }
+
+  // Store retrieved ROB data in the cache 
+  std::vector<ROBF> robFragments_missing;
+  robFragments_missing.reserve( vRobInfos.size() );
+  for(ROBInfoVec::const_iterator it=vRobInfos.begin(); it!=vRobInfos.end(); ++it) {
+    ATH_MSG_DEBUG(__FUNCTION__ << " ROB Id = 0x" << MSG::hex << it->robFragment.source_id() << MSG::dec
+		    << " retrieved from DCM for (global Id, L1 Id) = (" << cache->globalEventNumber << "," << cache->currentLvl1ID <<")" );
+    robFragments_missing.push_back( it->robFragment );
+  }
+  // add the ROBs to the cache/rob map
+  eventCache_addRobData(cache, robFragments_missing) ;
+
+  // return all the requested ROB fragments from the cache
+  robFragments.clear() ;
+  eventCache_checkRobListToCache(cache, robIds, robFragments, robIds_missing) ;
 }
 
-/** - add a new Raw event
-    - rebuild the map
-    - set flag for offline running
- */
-void HltROBDataProviderSvc::setNextEvent(const RawEvent* re)
-{ 
-  // set the offline flag
-  m_onlineRunning = false ;
-  
-  // set the event complete flag
-  m_isEventComplete = true ;
-
-  ROBDataProviderSvc::setNextEvent(re);
-  return ;
+/// Retrieve the full event fragment
+const RawEvent* HltROBDataProviderSvc::getEvent(const EventContext& context)
+{
+  ATH_MSG_VERBOSE("start of " << __FUNCTION__);
+  return m_eventsCache.get( context )->event;
 }
 
-/** return ROBData for ROBID
- */ 
-void HltROBDataProviderSvc::getROBData(const std::vector<uint32_t>& robIds, std::vector<const ROBF*>& robFragments, std::string callerName)
+/// Store the status for the event.
+void HltROBDataProviderSvc::setEventStatus(const EventContext& context, uint32_t status)
 {
-  //--------------------
-  // set the caller name
-  //--------------------
-  if (callerName != "UNKNOWN") m_callerName = callerName;
-
-  //-------------------
-  //--- offline running
-  //-------------------
-  if (!m_onlineRunning) {
-    ROBDataProviderSvc::getROBData(robIds,robFragments);
-    //------------------
-    //--- online running
-    //------------------
-  } else {
-    // ---------------------------------------------------------------------------------------------
-    // make sure that all ROB prefetching information is taken into account before the ROB retrieval
-    // ---------------------------------------------------------------------------------------------
-    if (m_RobRequestInfo) {
-      // add ROBs in the info object to the prefetching list
-      addROBData(m_RobRequestInfo->requestScheduledRobIDs()); 
-      m_RobRequestInfo->clearRequestScheduledRobIDs();
-    }
-
-    //--------------------
-    // make unique ROB IDs
-    //--------------------
-    std::vector<uint32_t>::iterator remove_duplicate;
-    std::vector<uint32_t> robIdsUnique(robIds);
-
-    sort(robIdsUnique.begin(), robIdsUnique.end()); 
-    remove_duplicate = unique(robIdsUnique.begin(), robIdsUnique.end()); 
-    robIdsUnique.erase(remove_duplicate, robIdsUnique.end());
-
-    //------------------------------------------------------------------
-    // Replace the generic MET ROB ID with the full list of all MET ROBs
-    //------------------------------------------------------------------
-    // LAr MET ROBs
-    uint32_t generic_LAr_MET_id = eformat::helper::SourceIdentifier(eformat::TDAQ_LAR_MET,m_genericLArMetModuleID.value()).code();
-    std::vector<uint32_t>::iterator rob_LAr_Met_it = std::find(robIdsUnique.begin(), robIdsUnique.end(), generic_LAr_MET_id);
-    if (rob_LAr_Met_it != robIdsUnique.end()) {
-      robIdsUnique.erase(rob_LAr_Met_it);
-      if (m_enabledLArMetROBs.value().size() != 0) robIdsUnique.insert(robIdsUnique.end(),m_enabledLArMetROBs.value().begin(),m_enabledLArMetROBs.value().end());
-    }
-
-    // Tile MET ROBs
-    uint32_t generic_Tile_MET_id = eformat::helper::SourceIdentifier(eformat::TDAQ_TILE_MET,m_genericTileMetModuleID.value()).code();
-    std::vector<uint32_t>::iterator rob_Tile_Met_it = std::find(robIdsUnique.begin(), robIdsUnique.end(), generic_Tile_MET_id);
-    if (rob_Tile_Met_it != robIdsUnique.end()) {
-      robIdsUnique.erase(rob_Tile_Met_it);
-      if (m_enabledTileMetROBs.value().size() != 0) robIdsUnique.insert(robIdsUnique.end(),m_enabledTileMetROBs.value().begin(),m_enabledTileMetROBs.value().end());
-    }
-
-    // detailed ROB monitoring
-    //------------------------
-    // Create a ROB monitoring collection and register it to StoreGate
-    ROBDataMonitorCollection* p_robMonCollection(0); 
-    if ((m_doDetailedROBMonitoring.value()) && (robIdsUnique.size() != 0)) {
-      if ( !(m_storeGateSvc->transientContains<ROBDataMonitorCollection>(m_ROBDataMonitorCollection_SG_Name.value())) ) {
-	p_robMonCollection = new ROBDataMonitorCollection;
-	if ( p_robMonCollection ) {
-	  p_robMonCollection->reserve( HltROBDataProviderConstants::Number_of_Rob_Monitor_Structs ) ;
-	  if ( (m_storeGateSvc->record(p_robMonCollection, m_ROBDataMonitorCollection_SG_Name.value(), true)).isFailure() ) {
-	    ATH_MSG_WARNING(" getROBData: Registering ROB Monitoring collection in StoreGate failed.");
-	    delete p_robMonCollection;
-	    p_robMonCollection = 0;
-	  }
-	}
-      } else {
-	if ( m_storeGateSvc->retrieve(p_robMonCollection).isFailure() ) {
-	  ATH_MSG_WARNING(" getROBData: Retrieval of ROB Monitoring collection from StoreGate failed.");
-	  p_robMonCollection = 0;
-	}
-      }
-    }
-
-    // create a new ROBDataMonitorStruct and fill it
-    robmonitor::ROBDataMonitorStruct* p_robMonStruct(0);
-    if ( p_robMonCollection ) {
-      // caller name
-      std::string caller_name("UNKNOWN");
-      if (callerName != "UNKNOWN") {
-	caller_name = callerName;
-      } else if ((callerName == "UNKNOWN") && (m_callerName != "UNKNOWN")) {
-	caller_name = m_callerName;
-      } else {
-	IAlgorithm* alg(0);
-	if ( m_algContextSvc ) {
-	  alg = m_algContextSvc->currentAlg();
-	  caller_name = (alg ? alg->name() : "<NONE>");
-	}
-      }
-
-      // initialize new ROBDataMonitorStruct
-      
-      p_robMonStruct = new robmonitor::ROBDataMonitorStruct(m_currentLvl1ID, robIdsUnique, caller_name);
-    }
-
-    //--------------------------
-    // update internal ROB cache
-    //--------------------------
-    addROBDataToCache(robIdsUnique, p_robMonStruct);
-
-    // add the ROB monitoring structure to the collection
-    if ( p_robMonCollection && p_robMonStruct ) p_robMonCollection->push_back( p_robMonStruct );
-
-
-    //------------------------------------------------------------------
-    // Return requested ROBs from internal cache
-    //------------------------------------------------------------------
-    for(std::vector<uint32_t>::const_iterator it = robIdsUnique.begin(); it != robIdsUnique.end(); ++it){
-      uint32_t id = (*it); 
-      ONLINE_ROBMAP::iterator map_it = m_online_robmap.find(id) ; 
-      if(map_it != m_online_robmap.end()) {      
-        robFragments.push_back( &((*map_it).second) );
-      } else {
-        ATH_MSG_DEBUG(" ---> getROBData: Failed to find ROB for id 0x"
-                      << MSG::hex << id << MSG::dec);
-        ATH_MSG_VERBOSE(dumpROBcache());
-      }
-    }
-  }
-
-  return ; 
+  ATH_MSG_VERBOSE("start of " << __FUNCTION__);
+  m_eventsCache.get(context)->eventStatus = status;
 }
 
-/// Retrieve the whole event.
-const RawEvent* HltROBDataProviderSvc::getEvent(){
-  if (m_onlineRunning) return 0;
-  return ROBDataProviderSvc::getEvent(); 
+/// Retrieve the status for the event.
+uint32_t HltROBDataProviderSvc::getEventStatus(const EventContext& context)
+{
+  ATH_MSG_VERBOSE("start of " << __FUNCTION__);
+  return m_eventsCache.get( context )->eventStatus;
 }
 
-/// Return vector with all ROBFragments stored in the cache 
-void HltROBDataProviderSvc::getAllROBData(std::vector<const ROBF*>& robFragments)
+/// Apply a function to all ROBs in the cache
+void HltROBDataProviderSvc::processCachedROBs(const EventContext& context, const std::function< void(const ROBF* )>& fn) const
 {
-  //------------------
-  //--- online running
-  //------------------
-  if (m_onlineRunning) {
-    for(ONLINE_ROBMAP::iterator it=m_online_robmap.begin(); it!=m_online_robmap.end(); ++it) {
-      robFragments.push_back( &((*it).second) ); 
-    } 
-  }
-  return ; 
+  ATH_MSG_VERBOSE("start of " << __FUNCTION__);
+  for ( const auto& el : m_eventsCache.get( context )->robmap )
+    {
+      fn( &el.second );
+    }
 }
 
-// Dump ROB cache
-std::string HltROBDataProviderSvc::dumpROBcache() const {
-
-  ONLINE_ROBMAP::const_iterator cache_it  = m_online_robmap.begin() ; 
-  ONLINE_ROBMAP::const_iterator cache_end = m_online_robmap.end() ;
-  int nrob = 0;
-
-  std::ostringstream ost;
-  ost << " --- Dump of ROB cache ids --- total size = "
-      << m_online_robmap.size() <<"\n";  
-  for(; cache_it!=cache_end; ++cache_it){
-    ++nrob;
-    ost <<" # = "<< std::setw(5) << nrob << " cache id = 0x" << std::hex << (*cache_it).first 
-        << " hex: source id = 0x" << std::hex << (*cache_it).second.source_id()
-        << std::dec << "  decimal: source id = " << (*cache_it).second.source_id() << "\n";
-  }
-  std::string ret(ost.str());
-  return ret;
+/// Flag to check if all event data have been retrieved
+bool HltROBDataProviderSvc::isEventComplete(const EventContext& context) const
+{
+  ATH_MSG_VERBOSE("start of " << __FUNCTION__);
+  return m_eventsCache.get( context )->isEventComplete;
 }
 
-/// Collect all data for an event from the ROS and put them into the cache
-/// Return value: number of ROBs which were retrieved to complete event
-int HltROBDataProviderSvc::collectCompleteEventData(const std::string callerName) {
+/// retrieve in online running all ROBs for the event from the readout system. Only those ROBs are retrieved which are not already in the cache
+int HltROBDataProviderSvc::collectCompleteEventData(const EventContext& context, const std::string_view callerName)
+{
+  ATH_MSG_VERBOSE("start of " << __FUNCTION__  << " caller name = " << callerName);
 
-  // return if call was already issued
-  if (m_isEventComplete) return 0;
+  EventCache* cache = m_eventsCache.get( context );
 
-  //--------------------
-  // set the caller name
-  //--------------------
-  if (callerName != "UNKNOWN") m_callerName = callerName;
+  // return if event is already complete 
+  if (cache->isEventComplete) return 0;
 
   typedef std::vector<hltinterface::DCM_ROBInfo> ROBInfoVec;
   ROBInfoVec vRobInfos ;
   if (m_enabledROBs.value().size() != 0) {
     vRobInfos.reserve( m_enabledROBs.value().size() ) ;
   } else {
-    vRobInfos.reserve( HltROBDataProviderConstants::Max_Number_Of_ROBs ) ;
+    vRobInfos.reserve( eformat::write::MAX_UNCHECKED_FRAGMENTS ) ;
   }
 
-  struct timeval time_start;
-  struct timeval time_stop;
-  if ( m_doMonitoring || m_doDetailedROBMonitoring.value() ) gettimeofday(&time_start, 0);
-
   // Get ROB Fragments for complete event with DataCollector
-  hltinterface::DataCollector::instance()->collect(vRobInfos, m_currentLvl1ID);
-
-  if ( m_doMonitoring || m_doDetailedROBMonitoring.value() ) gettimeofday(&time_stop, 0);
-
-  if (msgLvl(MSG::DEBUG)) {
-    std::ostringstream ost;
-    unsigned int rob_counter = 1;
-    for (const auto& rob : vRobInfos) {
-      ost << "       # = "<< std::setw(5) << rob_counter++ << " ROB id = 0x" 
-          << std::hex << rob.robFragment.source_id() << std::dec << "\n" ; 
-    }
-    ATH_MSG_DEBUG(" ---> collectCompleteEventData: The following ROB Ids were received from DataCollector : \n"
-                  << "      Lvl1 id                                             = " << m_currentLvl1ID << "\n"
-                  << "      Number of actually received ROB Ids                 = " << vRobInfos.size() << "\n"
-                  << ost.str());
-  }
-    
-    
-  // detailed ROB monitoring
-  //------------------------
-  // Create a ROB monitoring collection and register it to StoreGate
-  ROBDataMonitorCollection* p_robMonCollection(0); 
-  if ( m_doDetailedROBMonitoring.value() ) {
-    if ( !(m_storeGateSvc->transientContains<ROBDataMonitorCollection>(m_ROBDataMonitorCollection_SG_Name.value())) ) {
-      p_robMonCollection = new ROBDataMonitorCollection;
-      if ( p_robMonCollection ) {
-        p_robMonCollection->reserve( HltROBDataProviderConstants::Number_of_Rob_Monitor_Structs ) ;
-        if ( (m_storeGateSvc->record(p_robMonCollection, m_ROBDataMonitorCollection_SG_Name.value(), true)).isFailure() ) {
-          ATH_MSG_WARNING(" Registering ROB Monitoring collection in StoreGate failed.");
-          delete p_robMonCollection;
-          p_robMonCollection = 0;
-        }
-      }
-    } else {
-      if ( m_storeGateSvc->retrieve(p_robMonCollection).isFailure() ) {
-        ATH_MSG_WARNING(" Retrieval of ROB Monitoring collection from StoreGate failed.");
-        p_robMonCollection = 0;
-      }
-    }
-  }
-  
-  // create a new ROBDataMonitorStruct and fill it
-  robmonitor::ROBDataMonitorStruct* p_robMonStruct(0);
-  if ( p_robMonCollection ) {
-    // caller name
-    std::string caller_name("UNKNOWN");
-    if (callerName != "UNKNOWN") {
-      caller_name = callerName;
-    } else if ((callerName == "UNKNOWN") && (m_callerName != "UNKNOWN")) {
-      caller_name = m_callerName;
-    } else {
-      IAlgorithm* alg(0);
-      if ( m_algContextSvc ) {
-        alg = m_algContextSvc->currentAlg();
-        caller_name = (alg ? alg->name() : "<NONE>");
-      }
-    }
-
-    // get ROB Ids
-    std::vector<uint32_t> robIds;
-    robIds.reserve(vRobInfos.size());
-    for(ROBInfoVec::const_iterator it=vRobInfos.begin(); it!=vRobInfos.end(); ++it) {
-      robIds.push_back( it->robFragment.source_id() ) ;
-    }
-
-    // initialize new ROBDataMonitorStruct
-    p_robMonStruct = new robmonitor::ROBDataMonitorStruct(m_currentLvl1ID, robIds, caller_name);
-  }
-
-  if ( m_doMonitoring || p_robMonStruct ) {
-    int secs = 0 ;
-    if (time_stop.tv_sec >= time_start.tv_sec)
-      secs = time_stop.tv_sec - time_start.tv_sec;
-
-    int usecs = time_stop.tv_usec - time_start.tv_usec;
-    float mtime = static_cast<float>(secs)*1000 + static_cast<float>(usecs)/1000;
-
-    //* timing histogram
-    if (m_hist_timeROBretrieval) {
-      scoped_lock_histogram lock;
-      m_hist_timeROBretrieval->Fill(mtime);
-      m_hist_timeROBretrieval->LabelsDeflate("X");
-    }
-    //* number of received ROBs
-    if ( m_hist_receivedROBsPerCall ) {
-      scoped_lock_histogram lock;
-      m_hist_receivedROBsPerCall->Fill(vRobInfos.size());
-      m_hist_receivedROBsPerCall->LabelsDeflate("X");
-    }
-
-    //* detailed monitoring
-    if ( p_robMonStruct ) {
-      p_robMonStruct->start_time_of_ROB_request    = time_start;
-      p_robMonStruct->end_time_of_ROB_request      = time_stop;
-    }
-  }
-
-  // add ROBs to cache
-  updateROBDataCache(vRobInfos,p_robMonStruct);
-
-  // add the ROB monitoring structure to the collection
-  if ( p_robMonCollection && p_robMonStruct ) p_robMonCollection->push_back( p_robMonStruct );
+  try {
+    auto mon_col_t = Monitored::Timer("TIME_CollectAllROBs");
+    hltinterface::DataCollector::instance()->collect(vRobInfos, cache->globalEventNumber);
+    mon_col_t.stop();
+    ATH_MSG_DEBUG( __FUNCTION__ << ": Number of received ROB Ids = " << vRobInfos.size() );
+    // Fill monitoring histograms
+    auto mon_col_nROBs = Monitored::Scalar("NUMBER_CollectAllROBs",vRobInfos.size());
+    auto mon = Monitored::Group(m_monTool, mon_col_t, mon_col_nROBs);
+  } catch (const std::exception& ex) {
+    ATH_MSG_ERROR( __FUNCTION__ << ":" << __LINE__ 
+		   << "Failed to collect complete event, caught an unexpected exception: " << ex.what()
+		   << ". Throwing hltonl::Exception::EventSourceCorrupted" );
+    throw hltonl::Exception::EventSourceCorrupted();
+  } catch (...) {
+    ATH_MSG_ERROR( __FUNCTION__ << ":" << __LINE__ 
+		   << "Failed to collect complete event, caught an unexpected exception. "
+		   << "Throwing hltonl::Exception::EventSourceCorrupted" );
+    throw hltonl::Exception::EventSourceCorrupted();
+  }
+
+  // Store retrieved ROB data in the cache 
+  std::vector<ROBF> robFragments_missing;
+  robFragments_missing.reserve( vRobInfos.size() );
+  for(ROBInfoVec::const_iterator it=vRobInfos.begin(); it!=vRobInfos.end(); ++it) {
+    ATH_MSG_VERBOSE(__FUNCTION__ << " ROB Id = 0x" << MSG::hex << it->robFragment.source_id() << MSG::dec
+		    << " retrieved from DCM for (global Id, L1 Id) = (" << cache->globalEventNumber << "," << cache->currentLvl1ID <<")" );
+    robFragments_missing.push_back( it->robFragment );
+  }
+  // add the ROBs to the cache/rob map
+  eventCache_addRobData(cache, robFragments_missing) ;
 
   // update event complete flag
-  m_isEventComplete = true;
+  cache->isEventComplete = true;
 
   return vRobInfos.size();
-} // end int collectCompleteEventData(...)
-
-/// set the name of the program which uses the ROBDataProviderSvc
-void HltROBDataProviderSvc::setCallerName(const std::string callerName) {
-  m_callerName = callerName;
 }
 
-// handler for BeginRun
-void HltROBDataProviderSvc::handle(const Incident& incident) {
-  if (incident.type()!="BeginRun") return;
-  ATH_MSG_DEBUG("In BeginRun incident.");
-
-  // if detailed ROB monitoring is requested, check if the AlgContextSvc is running, 
-  // if yes use it to obtain the calling algorithm name
-  if ( m_doDetailedROBMonitoring.value() ) {
-    if ( service("AlgContextSvc", m_algContextSvc, /*createIf=*/ false).isFailure() ) {
-      ATH_MSG_ERROR("Error retrieving AlgContextSvc."  
-                    << "Calling algorithm name not available in detailed ROB monitoring");
-      m_algContextSvc=0;
-    }
-  }
-
-  // define histograms if monitoring is requested
-  if ( !m_doMonitoring.value() ) return;
-
-  // find histogramming service
-  ServiceHandle<ITHistSvc> rootHistSvc("THistSvc", name());
-  if ((rootHistSvc.retrieve()).isFailure()) {
-    ATH_MSG_ERROR("Unable to locate THistSvc");
-    rootHistSvc.release().ignore();
-    return;
-  }
-
-  // *-- booking path
-  std::string path = std::string("/EXPERT/") + name() + "/";
-
-  // *-- number of bins for sub detector plots (55 SubDet max.)
-  uint32_t n_bins_partEBSubDet = eformat::helper::SubDetectorDictionary.size();
-
-  // *-- number of requested ROBs per call
-  m_hist_requestedROBsPerCall = new TH1F (m_histProp_requestedROBsPerCall.value().title().c_str(),
-      (m_histProp_requestedROBsPerCall.value().title()+";number of ROBs").c_str(),
-      m_histProp_requestedROBsPerCall.value().bins(),
-      m_histProp_requestedROBsPerCall.value().lowEdge(),
-      m_histProp_requestedROBsPerCall.value().highEdge());
-  if (m_hist_requestedROBsPerCall) {
-    CAN_REBIN(m_hist_requestedROBsPerCall);
-    if( rootHistSvc->regHist(path + m_hist_requestedROBsPerCall->GetName(), m_hist_requestedROBsPerCall).isFailure() ) {
-      ATH_MSG_WARNING("Can not register monitoring histogram: " << m_hist_requestedROBsPerCall->GetName());
-    }
-  }
-
-  // *-- number of received ROBs per call
-  m_hist_receivedROBsPerCall  = new TH1F (m_histProp_receivedROBsPerCall.value().title().c_str(),
-      (m_histProp_receivedROBsPerCall.value().title()+";number of ROBs").c_str(),
-      m_histProp_receivedROBsPerCall.value().bins(),
-      m_histProp_receivedROBsPerCall.value().lowEdge(),
-      m_histProp_receivedROBsPerCall.value().highEdge());
-  if (m_hist_receivedROBsPerCall) {
-    CAN_REBIN(m_hist_receivedROBsPerCall);
-    if( rootHistSvc->regHist(path + m_hist_receivedROBsPerCall->GetName(), m_hist_receivedROBsPerCall).isFailure() ) {
-      ATH_MSG_WARNING("Can not register monitoring histogram: " << m_hist_receivedROBsPerCall->GetName());
-    }
-  }
-
-  // *-- timing of ROB retrieval
-  m_hist_timeROBretrieval     = new TH1F (m_histProp_timeROBretrieval.value().title().c_str(),
-      (m_histProp_timeROBretrieval.value().title()+";time [ms]").c_str(),
-      m_histProp_timeROBretrieval.value().bins(),
-      m_histProp_timeROBretrieval.value().lowEdge(),
-      m_histProp_timeROBretrieval.value().highEdge());
-  if (m_hist_timeROBretrieval) {
-    CAN_REBIN(m_hist_timeROBretrieval);
-    if( rootHistSvc->regHist(path + m_hist_timeROBretrieval->GetName(), m_hist_timeROBretrieval).isFailure() ) {
-      ATH_MSG_WARNING("Can not register monitoring histogram: " << m_hist_timeROBretrieval->GetName());
-    }
-  }
-
-  // *-- Generic Status for ROBs per sub detector
-  m_hist_genericStatusForROB = new TH2F ("GenericStatusForROBsFromSubDetectors",
-      "GenericStatusForROBsFromSubDetectors;;",
-      n_bins_partEBSubDet,0.,(float) n_bins_partEBSubDet,
-      m_map_GenericStatus.size(),0., (float) m_map_GenericStatus.size());
-  if (m_hist_genericStatusForROB) {
-    uint32_t n_tmp_bin = 1;
-    for (eformat::helper::EnumClass<eformat::SubDetector>::const_iterator it_sub=eformat::helper::SubDetectorDictionary.begin();
-        it_sub != eformat::helper::SubDetectorDictionary.end(); ++it_sub ) {
-      m_hist_genericStatusForROB->GetXaxis()->SetBinLabel( n_tmp_bin, (it_sub->second).c_str() );
-      n_tmp_bin++;
-    }
+/// method to filter ROBs with given Status code
+bool HltROBDataProviderSvc::robmap_filterRobWithStatus(const ROBF* rob)
+{
+  // No filter criteria defined
+  if ((m_filterRobMap.size() == 0) && (m_filterSubDetMap.size() == 0)) {
+    return(false);
+  }
+
+  // There should be at least one status element if there was an error
+  // in case there are 0 status elements then there was no known error
+  // (see event format document ATL-D-ES-0019 (EDMS))
+  const uint32_t* rob_it_status;
+  const uint32_t null_status(0);
+  // The ROB has no status elements
+  if (rob->nstatus() == 0) {
+    rob_it_status = &null_status;
+  } else {
+  // The ROB has at least one status element, access it via an iterator
+    rob->status(rob_it_status);
+  }  
 
-    n_tmp_bin = 1;
-    for (std::map<eformat::GenericStatus, std::string>::const_iterator it = m_map_GenericStatus.begin();it != m_map_GenericStatus.end();++it) {
-      m_hist_genericStatusForROB->GetYaxis()->SetBinLabel( n_tmp_bin, (*it).second.c_str() );
-      n_tmp_bin++;
-    }
-    if( rootHistSvc->regHist(path + m_hist_genericStatusForROB->GetName(), m_hist_genericStatusForROB).isFailure() ) {
-      ATH_MSG_WARNING("Can not register monitoring histogram: " << m_hist_genericStatusForROB->GetName());
+  // Build the full ROB Sourceidentifier
+  eformat::helper::SourceIdentifier tmpsrc(rob->rob_source_id());
+  
+  // Check if there is a ROB specific filter rule defined for this ROB Id and match the status code
+  FilterRobMap::iterator map_it_rob = m_filterRobMap.find(tmpsrc.code());
+  if (map_it_rob != m_filterRobMap.end()) {
+    for (auto it_status: (*map_it_rob).second) {
+      if (*rob_it_status == it_status) {
+	ATH_MSG_VERBOSE(__FUNCTION__ << " ROB Id = 0x" << MSG::hex << tmpsrc.code() 
+			<< " with status = 0x" << *rob_it_status  << MSG::dec
+			<< " removed due to ROB filter rule.");
+	return(true);
+      }
     }
   }
 
-  // *-- Specific Status Bits for ROBs per sub detector
-  m_hist_specificStatusForROB = new TH2F ("SpecificStatusBitsForROBsFromSubDetectors",
-      "SpecificStatusBitsForROBsFromSubDetectors;;",
-      n_bins_partEBSubDet,0.,(float) n_bins_partEBSubDet,
-      m_vec_SpecificStatus.size(),0., (float) m_vec_SpecificStatus.size());
-  if (m_hist_specificStatusForROB) {
-    uint32_t n_tmp_bin = 1;
-    for (eformat::helper::EnumClass<eformat::SubDetector>::const_iterator it_sub=eformat::helper::SubDetectorDictionary.begin();
-        it_sub != eformat::helper::SubDetectorDictionary.end(); ++it_sub ) {
-      m_hist_specificStatusForROB->GetXaxis()->SetBinLabel( n_tmp_bin, (it_sub->second).c_str() );
-      n_tmp_bin++;
-    }
-
-    n_tmp_bin = 1;
-    for (std::vector<std::string>::const_iterator it = m_vec_SpecificStatus.begin();it != m_vec_SpecificStatus.end();++it) {
-      m_hist_specificStatusForROB->GetYaxis()->SetBinLabel( n_tmp_bin, (*it).c_str() );
-      n_tmp_bin++;
-    }
-    if( rootHistSvc->regHist(path + m_hist_specificStatusForROB->GetName(), m_hist_specificStatusForROB).isFailure() ) {
-      ATH_MSG_WARNING("Can not register monitoring histogram: " << m_hist_specificStatusForROB->GetName());
+  // Check if there is a sub detector specific filter rule defined for this ROB Id and match the status code
+  FilterSubDetMap::iterator map_it_subdet = m_filterSubDetMap.find(tmpsrc.subdetector_id());
+  if (map_it_subdet != m_filterSubDetMap.end()) {
+    for (auto it_status: (*map_it_subdet).second) {
+      if (*rob_it_status == it_status) {
+	ATH_MSG_VERBOSE(__FUNCTION__ << " ROB Id = 0x" << MSG::hex << tmpsrc.code() 
+			<< " with status = 0x" << *rob_it_status  << MSG::dec
+			<< " removed due to SubDet filter rule.");
+	return(true);
+      }
     }
   }
+  return(false);
+}
 
-  // release histogramming service
-  rootHistSvc.release().ignore();
-} // end handler for BeginRun
-
-// helper function to retrieve ROB fragments over the network and to add them to the cache 
-void HltROBDataProviderSvc::addROBDataToCache(std::vector<uint32_t>& robIdsForRetrieval,
-					      robmonitor::ROBDataMonitorStruct* p_robMonStruct) {
-
-  struct timeval time_start;
-  struct timeval time_stop;
+void HltROBDataProviderSvc::eventCache_clear(EventCache* cache)
+{
+  ATH_MSG_VERBOSE("start of " << __FUNCTION__);
+  cache->event             = nullptr;
+  cache->currentLvl1ID     = 0; 
+  cache->globalEventNumber = 0;
+  cache->eventStatus       = 0;    
+  cache->isEventComplete   = false;    
+  cache->robmap.clear();
+}
 
-  ATH_MSG_DEBUG(" ---> addROBDataToCache: Number of ROB Ids requested for retrieval : " 
-                << robIdsForRetrieval.size() << ", Lvl1 id = " << m_currentLvl1ID);
+void HltROBDataProviderSvc::eventCache_checkRobListToCache(EventCache* cache, const std::vector<uint32_t>& robIds_toCheck, 
+							     std::vector<const ROBF*>& robFragments_inCache, 
+							     std::vector<uint32_t>& robIds_missing )
+{
+  ATH_MSG_VERBOSE("start of " << __FUNCTION__ << " number of ROB Ids to check = " << robIds_toCheck.size());
 
-  // return if no ROBs are requested
-  if (robIdsForRetrieval.size() == 0) return;
+  for (uint32_t id : robIds_toCheck) {
 
-  
-  std::vector<uint32_t> vRobIds, vMETRobIds;
-  vRobIds.reserve( robIdsForRetrieval.size() );
-  vMETRobIds.reserve( robIdsForRetrieval.size() );
-
-  // Check requested ROBs
-  for (std::vector<uint32_t>::const_iterator rob_it=robIdsForRetrieval.begin(); rob_it!=robIdsForRetrieval.end(); ++rob_it) {
-    uint32_t id =  (*rob_it);
-    
-    // check first if ROB is already in cache
-    ONLINE_ROBMAP::iterator map_it = m_online_robmap.find(*rob_it) ;
-    if(map_it != m_online_robmap.end()) {
-      ATH_MSG_DEBUG(" ---> addROBDataToCache: Found   ROB Id : 0x" << MSG::hex << (*map_it).second.source_id() 
-                    << MSG::dec <<" in cache ");
-      if ( p_robMonStruct ) {
-      	
-        (p_robMonStruct->requested_ROBs)[id].rob_history = robmonitor::CACHED;
-        (p_robMonStruct->requested_ROBs)[id].rob_size    = ((*map_it).second).fragment_size_word();
-        if ( (*map_it).second.nstatus() != 0 ) {
-          const uint32_t* it_status;
-          (*map_it).second.status(it_status);
-          for (uint32_t k=0; k < (*map_it).second.nstatus(); k++) {
-            (p_robMonStruct->requested_ROBs)[id].rob_status_words.push_back( *(it_status+k) );
-          }
-        }
-      }
+    // check if ROB is already in cache
+    ROBMAP::const_iterator map_it = cache->robmap.find(id);
+    if (map_it != cache->robmap.end()) {
+      ATH_MSG_VERBOSE(__FUNCTION__ << " ROB Id 0x" << MSG::hex << id << MSG::dec
+		      << " found for (global Id, L1 Id) = (" << cache->globalEventNumber << "," << cache->currentLvl1ID <<")" );
+      robFragments_inCache.push_back( &(map_it->second) );
       continue;
-    } 
+    }
 
     // check if ROB is actually enabled for readout
-    // do not perform this check for MET ROBs
-    if (m_enabledROBs.value().size() != 0) { 
-      if ( (eformat::helper::SourceIdentifier(*rob_it).subdetector_id() != eformat::TDAQ_LAR_MET) &&
-           (eformat::helper::SourceIdentifier(*rob_it).subdetector_id() != eformat::TDAQ_TILE_MET) ){
-        std::vector<uint32_t>::const_iterator rob_enabled_it =
-          std::find(m_enabledROBs.value().begin(), m_enabledROBs.value().end(),(*rob_it));
-        if(rob_enabled_it == m_enabledROBs.value().end()) {
-          ATH_MSG_DEBUG(" ---> addROBDataToCache: ROB Id : 0x" << MSG::hex << (*rob_it) << MSG::dec
-                        << " will be not retrieved, since it is not on the list of enabled ROBs.");
-          if ( p_robMonStruct ) {
-            (p_robMonStruct->requested_ROBs)[id].rob_history = robmonitor::DISABLED;
-          }
-          continue;
-        }
+    if (m_enabledROBs.value().size() != 0) {
+      std::vector<uint32_t>::const_iterator rob_enabled_it =
+	std::find(m_enabledROBs.value().begin(), m_enabledROBs.value().end(),id);
+      if(rob_enabled_it == m_enabledROBs.value().end()) {
+	ATH_MSG_VERBOSE(__FUNCTION__ << " ROB Id : 0x" << MSG::hex << id << MSG::dec
+		      << " will be not added, since it is not on the list of enabled ROBs.");
+	continue;
       }
     }
-    
-    if (m_ignoreROB.value().size() != 0) {
-      std::vector<uint32_t>::const_iterator rob_ignore_it =
-        std::find(m_ignoreROB.value().begin(), m_ignoreROB.value().end(),id);
-      if(rob_ignore_it != m_ignoreROB.value().end()) {
-        ATH_MSG_DEBUG(" ---> addROBDataToCache: ROB Id : 0x" << MSG::hex << id << MSG::dec
-                      << " will be not retrieved, since it is on the veto list.");
-        if ( p_robMonStruct ) {
-          (p_robMonStruct->requested_ROBs)[id].rob_history = robmonitor::IGNORED;
-        }
-        continue;
-      }
-    }
-    
-    // separate MET and detector ROBs if requested
-    if ( (m_separateMETandDetROBRetrieval.value()) &&
-	 ( (eformat::helper::SourceIdentifier(*rob_it).subdetector_id() == eformat::TDAQ_LAR_MET) || 
-	   (eformat::helper::SourceIdentifier(*rob_it).subdetector_id() == eformat::TDAQ_TILE_MET) ) )  {
-      vMETRobIds.push_back( *rob_it ) ;
-    } else {
-      vRobIds.push_back( *rob_it );
-    }
-  }
 
-  typedef std::vector<hltinterface::DCM_ROBInfo> ROBInfoVec;
-  ROBInfoVec vRobInfos ;
+    // the ROB is not in the cache and should be eventually added
+    ATH_MSG_VERBOSE(__FUNCTION__ << " ROB Id : 0x" << MSG::hex << id << MSG::dec <<" is missing ");
+    robIds_missing.push_back( id ) ;
+  } // end loop over input ROB Ids to check
+}
 
-  // Get ROB Fragments with DataCollector
-  if ( m_doMonitoring || p_robMonStruct ) gettimeofday(&time_start, 0);
-  if ( vRobIds.size() != 0 ) {
-    vRobInfos.reserve( vRobIds.size() ) ;
-    hltinterface::DataCollector::instance()->collect(vRobInfos, m_currentLvl1ID, vRobIds);
-  }
+void HltROBDataProviderSvc::eventCache_addRobData(EventCache* cache, const std::vector<ROBF>& robFragments)
+{
+  ATH_MSG_VERBOSE("start of " << __FUNCTION__ << " number of ROB fragments to add = " << robFragments.size());
 
-  // Do a separate data collect call for MET ROBs if required
-  if ( (m_separateMETandDetROBRetrieval.value()) && (vMETRobIds.size() != 0) ) {
-    ROBInfoVec vMETRobInfos;
-    vMETRobInfos.reserve( vMETRobIds.size() ) ;
-    // retrieve MET ROBs
-    hltinterface::DataCollector::instance()->collect(vMETRobInfos, m_currentLvl1ID, vMETRobIds);
-    // add MET ROBs to Det ROBs
-    vRobInfos.insert( vRobInfos.end(), vMETRobInfos.begin(), vMETRobInfos.end() );
+  for (auto rob : robFragments) {
 
-    
-  }
+    // Source ID
+    uint32_t id = rob.source_id();
+    ATH_MSG_VERBOSE(__FUNCTION__ << " Id = 0x" << std::hex << id << std::dec );
 
-  if(msgLvl(MSG::DEBUG) && ((vRobIds.size()!=0) || (vMETRobIds.size()!=0))) {
-    std::ostringstream ost;
-    unsigned int rob_counter = 1;
-    for (const auto& rob : vRobInfos) {
-      ost << "       # = "<< std::setw(5) << rob_counter++ << " ROB id = 0x" << std::hex 
-          << rob.robFragment.source_id() << std::dec << "\n" ; 
+    // mask off the module ID for L2 and EF result for Run 1 data
+    if ( (eformat::helper::SourceIdentifier(id).module_id() != 0) &&
+	 (eformat::helper::SourceIdentifier(id).subdetector_id() == eformat::TDAQ_LVL2) ) {
+      id = eformat::helper::SourceIdentifier(eformat::helper::SourceIdentifier(id).subdetector_id(),0).code();
+      if (!m_maskL2EFModuleID) {
+	ATH_MSG_ERROR(__FUNCTION__ << " Inconsistent flag for masking L2/EF module IDs");
+	m_maskL2EFModuleID=true;
+      }
+    } else if ( (eformat::helper::SourceIdentifier(id).module_id() != 0) && 
+		(eformat::helper::SourceIdentifier(id).subdetector_id() == eformat::TDAQ_EVENT_FILTER) &&
+		(m_maskL2EFModuleID) ) {
+      id = eformat::helper::SourceIdentifier(eformat::helper::SourceIdentifier(id).subdetector_id(),0).code();
     }
-    ATH_MSG_DEBUG(" ---> addROBDataToCache: The following ROB Ids were received from DataCollector : \n"
-                  << "      Lvl1 id                                             = " << m_currentLvl1ID << "\n"
-                  << "      Number of detector ROB Ids requested for retrieval  = " << vRobIds.size() << "\n"
-                  << "      Number of MET ROB Ids requested for retrieval       = " << vMETRobIds.size() << "\n"
-                  << "      Number of actually received ROB Ids                 = " << vRobInfos.size() << "\n"
-                  << ost.str());
-  }
-
-  if ( m_doMonitoring || p_robMonStruct ) {
-    gettimeofday(&time_stop, 0);
-    int secs = 0 ;
-    if (time_stop.tv_sec >= time_start.tv_sec)
-      secs = time_stop.tv_sec - time_start.tv_sec;
 
-    int usecs = time_stop.tv_usec - time_start.tv_usec;
-    float mtime = static_cast<float>(secs)*1000 + static_cast<float>(usecs)/1000;
-
-    //* timing histogram
-    if (m_hist_timeROBretrieval) {
-      scoped_lock_histogram lock;
-      m_hist_timeROBretrieval->Fill(mtime);
-      m_hist_timeROBretrieval->LabelsDeflate("X");
+    // check if ROB is already in cache
+    ROBMAP::const_iterator it = cache->robmap.find(id);
+    if (it != cache->robmap.end()) {
+      ATH_MSG_VERBOSE(__FUNCTION__ << " Duplicate ROB Id 0x" << MSG::hex << id << MSG::dec
+		      << " found for (global Id, L1 Id) = (" << cache->globalEventNumber << "," << cache->currentLvl1ID <<")" );
+      continue;
     }
 
-    //* detailed monitoring
-    if ( p_robMonStruct ) {
-      p_robMonStruct->start_time_of_ROB_request    = time_start;
-      p_robMonStruct->end_time_of_ROB_request      = time_stop;
-    }
-  }
-
-  //* histograms for number of requested/received ROBs
-  if ( m_hist_requestedROBsPerCall ) {
-    scoped_lock_histogram lock;
-    m_hist_requestedROBsPerCall->Fill(robIdsForRetrieval.size());
-    m_hist_requestedROBsPerCall->LabelsDeflate("X");
-  }
-  if ( m_hist_receivedROBsPerCall ) {
-    scoped_lock_histogram lock;
-    m_hist_receivedROBsPerCall->Fill(vRobInfos.size());
-    m_hist_receivedROBsPerCall->LabelsDeflate("X");
-  }
-
-  // add ROBs to cache
-  updateROBDataCache(vRobInfos,p_robMonStruct);
-
-  return;
-} // end void addROBDataToCache(...)
-
-
-// helper function to put retrieved ROB fragments into the local cache and update the monitoring records 
-void HltROBDataProviderSvc::updateROBDataCache(std::vector<hltinterface::DCM_ROBInfo>& vRobInfo,
-					      robmonitor::ROBDataMonitorStruct* p_robMonStruct) {
-
-  ATH_MSG_DEBUG(" ---> updateROBDataCache: Number of ROB Info records for cache update : " 
-                << vRobInfo.size() << ", Lvl1 id = " << m_currentLvl1ID);
+    // check for ROBs with no data 
+    if ((rob.rod_ndata() == 0) && (m_filterEmptyROB)) {
+      ATH_MSG_VERBOSE(__FUNCTION__ << " Empty ROB Id = 0x" << MSG::hex << id << MSG::dec
+		      << " removed for (global Id, L1 Id) = (" << cache->globalEventNumber << "," << cache->currentLvl1ID <<")" );
+      continue;
+    } 
 
-  // return if no ROB Info records are available
-  if (vRobInfo.size() == 0) return;
-  
-  // add ROBs to cache
-  typedef std::vector<hltinterface::DCM_ROBInfo> ROBInfoVec;
-  for(ROBInfoVec::const_iterator it=vRobInfo.begin(); it!=vRobInfo.end(); ++it) {
-    uint32_t id = it->robFragment.source_id() ;
-    
-    // check first if ROB is already in cache (for full event requests)
-    ONLINE_ROBMAP::iterator map_it = m_online_robmap.find(id) ;
-    if(map_it != m_online_robmap.end()) continue;
-
-    if ((it->robFragment.rod_ndata() == 0) && (m_removeEmptyROB)) {
-      ATH_MSG_DEBUG(" ---> addROBDataToCache: Empty ROB Id = 0x" << MSG::hex << id << MSG::dec
-                    << " removed for L1 Id = " << m_currentLvl1ID);
-      if ( p_robMonStruct ) {
-        (p_robMonStruct->requested_ROBs)[id].rob_history = robmonitor::IGNORED;
-      }
-    } else if ( ROBDataProviderSvc::filterRobWithStatus(&it->robFragment)) {
-      if (msgLvl(MSG::DEBUG) && (it->robFragment.nstatus() > 0)) {
-        const uint32_t* it_status;
-        it->robFragment.status(it_status);
-        eformat::helper::Status tmpstatus( (*it_status) ) ;
-        ATH_MSG_DEBUG(" ---> addROBDataToCache: ROB Id = 0x" << MSG::hex << id
-                      << std::setfill( '0' )
-                      << " with Generic Status Code = 0x" << std::setw(4) << tmpstatus.generic()
-                      << " and Specific Status Code = 0x" << std::setw(4) << tmpstatus.specific()
-                      << MSG::dec
-                      << " removed for L1 Id = " << m_currentLvl1ID);
-      }
-      if ( p_robMonStruct ) {
-      	 (p_robMonStruct->requested_ROBs)[id].rob_history = robmonitor::IGNORED;
-        }
-    } else if ((m_ignoreROB.value().size() != 0) &&
-	       (std::find(m_ignoreROB.value().begin(), m_ignoreROB.value().end(),id) != m_ignoreROB.value().end())) {
-      ATH_MSG_DEBUG(" ---> addROBDataToCache: ROB Id : 0x" << MSG::hex << id << MSG::dec
-		    << " removed for L1 Id = " << m_currentLvl1ID);
-      if ( p_robMonStruct ) {
-	(p_robMonStruct->requested_ROBs)[id].rob_history = robmonitor::IGNORED;
-      }
-    } else {
-      m_online_robmap[id]= (it->robFragment);
-      //* detailed monitoring
-      if ( p_robMonStruct ) {
-        (p_robMonStruct->requested_ROBs)[id].rob_history = robmonitor::RETRIEVED;
-        (p_robMonStruct->requested_ROBs)[id].rob_size    = it->robFragment.fragment_size_word();
-        if ( it->robFragment.nstatus() != 0 ) {
-          const uint32_t* it_status;
-          it->robFragment.status(it_status);
-          for (uint32_t k=0; k < it->robFragment.nstatus(); k++) {
-            (p_robMonStruct->requested_ROBs)[id].rob_status_words.push_back( *(it_status+k) );
-          }
-        }
-      } // end detailed monitoring
-    }
-    
-    //* fill monitoring histogram for ROB generic status
-    if ( ( m_hist_genericStatusForROB ) && ( it->robFragment.nstatus() != 0 ) ) {
-      const uint32_t* it_status;
-      it->robFragment.status(it_status);
-      if ((*it_status) != 0) {
-        scoped_lock_histogram lock;
-        m_hist_genericStatusForROB->Fill(eformat::helper::SourceIdentifier(it->robFragment.source_id()).human_detector().c_str(),
-            m_map_GenericStatus[eformat::helper::Status(*it_status).generic()].c_str(),1.);
+    // filter ROBs with external criteria 
+    if (robmap_filterRobWithStatus(&rob)) {
+      if (rob.nstatus() > 0) {
+	const uint32_t* it_status;
+	rob.status(it_status);
+	eformat::helper::Status tmpstatus(*it_status);
+	ATH_MSG_VERBOSE(__FUNCTION__ << " ROB Id = 0x" << MSG::hex << id << std::setfill('0')
+			<< " with Generic Status Code = 0x" << std::setw(4) << tmpstatus.generic()
+			<< " and Specific Status Code = 0x" << std::setw(4) << tmpstatus.specific() << MSG::dec
+			<< " removed for (global Id, L1 Id) = (" << cache->globalEventNumber << "," << cache->currentLvl1ID <<")" );
       }
+      continue;
     }
 
-    //* fill monitoring histogram for ROB specific status
-    if ( ( m_hist_specificStatusForROB ) && ( it->robFragment.nstatus() != 0 ) ) {
-      const uint32_t* it_status;
-      it->robFragment.status(it_status);
-      if ((*it_status) != 0) {
-        scoped_lock_histogram lock;
-        std::bitset<16> specificBits(eformat::helper::Status(*it_status).specific());
-        for (unsigned int index=0; index < 16; ++index) {
-          if (specificBits[index]) m_hist_specificStatusForROB->Fill(eformat::helper::SourceIdentifier(it->robFragment.source_id()).human_detector().c_str(),
-								     m_vec_SpecificStatus[index].c_str(),1.);
-        }
-      }
-    }
-  }   // end loop over ROBInfo records
-  return;
-} // end void updateROBDataCache(...)
+    // add ROB to map
+    cache->robmap[id] = rob;
+  }
+}
+
+HltROBDataProviderSvc::EventCache::~EventCache()
+{
+  //  delete event;
+  robmap.clear();
+}
diff --git a/HLT/Trigger/TrigControl/TrigServices/src/HltROBDataProviderSvc.h b/HLT/Trigger/TrigControl/TrigServices/src/HltROBDataProviderSvc.h
index a9e37fbdcfb8ed8494f87087583c0c2606c4ea53..56f09782d28546e3df66f5f4d51d8000309e547c 100644
--- a/HLT/Trigger/TrigControl/TrigServices/src/HltROBDataProviderSvc.h
+++ b/HLT/Trigger/TrigControl/TrigServices/src/HltROBDataProviderSvc.h
@@ -1,251 +1,200 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
-
 #ifndef TRIGSERVICES_HLTROBDATAPROVIDERSVC_H
 #define TRIGSERVICES_HLTROBDATAPROVIDERSVC_H
-
-/** ===============================================================
- *     HltROBDataProviderSvc.h
- *  ===============================================================
- *    Description:  ROBDataProvider class for accessing ROBData
- *                  To be used for Offline/Online
- *
- *    Requirements: define a ROBData class in the scope
- *                  provide a method
- *       void getROBData(const vector<uint>& ids, vector<ROBData*>& v)
- *    Implementation: Use an interal map to store all ROBs
- *                    We can not assume any ROB/ROS relationship, no easy 
- *                    way to search.
- * 
- *    Created:      Sept 19, 2002
- *         By:      Hong Ma 
- *    Modified:     Aug. 18  2003 (common class for Online/Offline)
- *         By:      Werner Wiedenmann 
- *    Modified:     Apr  21  2005 (implementation for online)
- *         By:      Werner Wiedenmann
- *    Modified:     Jun. 02 2006 (added monitoring horograms)
- *         By:      Tomasz Bold
- *    Modified:     May  21  2007 (updates for release 13)
- *         By:      Werner Wiedenmann
- *    Modified:     Nov. 10  2008 (updates for L2/EF result node ID handling)   
- *         By:      Werner Wiedenmann
- *    Modified:     Mar. 05, 2013 (adapted from L2 for merged HLT)
- *         By:      Ricardo Abreu
- *    Modified:     Nov. 04, 2013 (implement complete hltinterface definitions)
- *         By:      Werner Wiedenmann
- */ 
-#include "GaudiKernel/Service.h"
-#include "GaudiKernel/ISvcLocator.h"
-#include "GaudiKernel/StatusCode.h"
-#include "GaudiKernel/IIncidentListener.h"
-#include "GaudiKernel/ServiceHandle.h"
-#include "GaudiKernel/HistoProperty.h"
-#include "GaudiKernel/Property.h"
-#include "TrigROBDataProviderSvc/ITrigROBDataProviderSvc.h"
-#include "TrigROBDataProviderSvc/ITrigROBDataProviderSvcPrefetch.h"
-#include "ByteStreamCnvSvcBase/ROBDataProviderSvc.h"
+/**
+ * @file   HltROBDataProviderSvc.h
+ * @brief  Service to serve ROB data in online environment
+ * @author Werner Wiedenmann
+ */
+
+// Package includes
+#include "ByteStreamCnvSvcBase/IROBDataProviderSvc.h"
 #include "ByteStreamData/RawEvent.h"
-#include "TrigDataAccessMonitoring/ROBDataMonitor.h"
-#include "TrigSteeringEvent/RobRequestInfo.h"
-#include "eformat/Status.h"
-#include "hltinterface/DCM_ROBInfo.h"
-#include <vector>
-#include <map>
+#include "eformat/SourceIdentifier.h"
 
-// Forward declarations
-class StoreGateSvc;  
-class IAlgContextSvc;
-class TH1F;   /// for monitoring purposes
-class TH2F;   /// for monitoring purposes
-
-class HltROBDataProviderSvc : public ROBDataProviderSvc,
-			       virtual public ITrigROBDataProviderSvc,
-			       virtual public ITrigROBDataProviderSvcPrefetch,
-			       virtual public IIncidentListener
-{
-public:
-
-    typedef OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment ROBF ; 
+// Framework includes
+#include "AthenaBaseComps/AthService.h"
+#include "AthenaKernel/SlotSpecificObj.h"
+#include "AthenaMonitoring/Monitored.h"
 
-    HltROBDataProviderSvc(const std::string& name, ISvcLocator* svcloc);
-
-    virtual ~HltROBDataProviderSvc(void);
-  
-    virtual StatusCode initialize();
+// STL includes
+#include <string>
+#include <string_view>
+#include <vector>
+#include <map>
 
-    virtual StatusCode finalize();
+// TBB includes
+#include "tbb/concurrent_unordered_map.h"
 
-    virtual StatusCode queryInterface( const InterfaceID& riid, void** ppvInterface );
+/**
+ * @class HltROBDataProviderSvc
+ * @brief ROBDataProvider service for retrieving and serving ROB data in HLT online
+ **/
+class HltROBDataProviderSvc : public extends<AthService, IROBDataProviderSvc> {
+public:
+  /// ROB Fragment class
+  typedef OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment ROBF;
 
-    /// --- Implementation of IROBDataProviderSvc interface ---    
+  HltROBDataProviderSvc(const std::string& name, ISvcLocator* pSvcLocator);
+  virtual ~HltROBDataProviderSvc() override;
+  virtual StatusCode initialize() override;
+  virtual StatusCode finalize() override;
 
-    /// Add ROBFragments to cache for given ROB ids, ROB fragments may be retrieved with DataCollector 
-    virtual void addROBData(const EventContext& /*ctx*/,
-                            const std::vector<uint32_t>& robIds,
-			    const std::string callerName="UNKNOWN")
-    {
-      addROBData(robIds, callerName);
-    }
-    virtual void addROBData(const std::vector<uint32_t>& robIds,
-			    const std::string callerName="UNKNOWN");
+  /// --- Implementation of IROBDataProviderSvc interface ---
+  /// --- Legacy interface (deprecated) ---
 
-    /// Add a given LVL1/HLT ROBFragment to cache
-    virtual void setNextEvent(const EventContext& /*ctx*/,
-                              const std::vector<ROBF>& result)
-    { setNextEvent (result); }
-    virtual void setNextEvent(const std::vector<ROBF>& result);
+  /// Signal ROB fragments which should be considered for prefetching in online running
+  virtual void addROBData(const std::vector<uint32_t>& /*robIds*/, 
+			  const std::string_view callerName="UNKNOWN") override;
 
-    /// Add all ROBFragments of a RawEvent to cache 
-    virtual void setNextEvent(const EventContext& /*ctx*/, const RawEvent* re)
-    { setNextEvent(re); }
-    virtual void setNextEvent(const RawEvent* re);
+  /// Start a new event with a set of ROB fragments, e.g. from LVL1 result, in online and add the fragments to the ROB cache
+  virtual void setNextEvent(const std::vector<ROBF>& /*result*/) override;
 
-    /// Retrieve ROBFragments for given ROB ids from cache 
-    virtual void getROBData(const EventContext& /*ctx*/,
-                            const std::vector<uint32_t>& robIds, 
-			    std::vector<const ROBF*>& robFragments,
-			    const std::string callerName="UNKNOWN")
-    {
-      getROBData (robIds, robFragments, callerName);
-    }
-    virtual void getROBData(const std::vector<uint32_t>& robIds, 
-			    std::vector<const ROBF*>& robFragments,
-			    const std::string callerName="UNKNOWN");
- 
-    /// Retrieve the whole event.
-    virtual const RawEvent* getEvent(const EventContext& /*ctx*/)
-    { return getEvent(); }
-    virtual const RawEvent* getEvent();
+  /// Start a new event with a full event fragment and add all ROB fragments in to the ROB cache
+  virtual void setNextEvent(const RawEvent* /*re*/) override;
 
-    /// --- Implementation of ITrigROBDataProviderSvc interface ---
+  /// Retrieve ROB fragments for given ROB ids from the ROB cache
+  virtual void getROBData(const std::vector<uint32_t>& /*robIds*/, std::vector<const ROBF*>& /*robFragments*/, 
+			  const std::string_view callerName="UNKNOWN") override;
 
-    /// Return vector with all ROBFragments stored in the cache 
-    virtual void getAllROBData(std::vector<const ROBF*>& robFragments) ;
+  /// Retrieve the full event fragment
+  virtual const RawEvent* getEvent() override;
 
-    // Dump ROB cache
-    virtual std::string dumpROBcache() const ;
+  /// Store the status for the event.
+  virtual void setEventStatus(uint32_t /*status*/) override;
 
-    /// Return size of ROBFragments cache 
-    virtual int sizeROBCache() { return m_online_robmap.size(); }
+  /// Retrieve the status for the event.
+  virtual uint32_t getEventStatus() override;
 
-    /// iterators over cache entries
-    virtual std::map<uint32_t, ROBF>::iterator beginROBCache() { return m_online_robmap.begin(); }
-    virtual std::map<uint32_t, ROBF>::iterator endROBCache()   { return m_online_robmap.end(); }
+  /// --- Implementation of IROBDataProviderSvc interface ---
+  /// --- Context aware interface for MT ---
 
-    /// Flag to check if complete event data are already in cache
-    virtual bool isEventComplete(const EventContext& /*ctx*/) const { return m_isEventComplete; }
-    virtual bool isEventComplete() { return m_isEventComplete; }
+  /// Signal ROB fragments which should be considered for prefetching in online running
+  virtual void addROBData(const EventContext& /*context*/, const std::vector<uint32_t>& /*robIds*/, 
+			  const std::string_view callerName="UNKNOWN") override;
 
-    /// Collect all data for an event from the ROS and put them into the cache
-    /// Return value: number of ROBs which were retrieved to complete the event
-    /// Optinonally the name of the caller of this method can be specified for cost monitoring
-    virtual int collectCompleteEventData(const EventContext& /*ctx*/,
-                                         const std::string callerName="UNKNOWN")
-    {
-      return collectCompleteEventData(callerName);
-    }
-    virtual int collectCompleteEventData(const std::string callerName="UNKNOWN");
+  /// Start a new event with a set of ROB fragments, e.g. from LVL1 result, in online and add the fragments to the ROB cache
+  virtual void setNextEvent(const EventContext& /*context*/, const std::vector<ROBF>& /*result*/) override;
 
-    /// set the name of the program which uses the ROBDataProviderSvc
-    virtual void setCallerName(const std::string);
+  /// Start a new event with a full event fragment and add all ROB fragments in to the ROB cache
+  virtual void setNextEvent(const EventContext& /*context*/, const RawEvent* /*re*/) override;
 
-    /// get the name of the program which is presently registered in the ROBDataProviderSvc
-    virtual std::string getCallerName() { return m_callerName; };
+  /// Retrieve ROB fragments for given ROB ids from the ROB cache
+  virtual void getROBData(const EventContext& /*context*/, 
+			  const std::vector<uint32_t>& /*robIds*/, std::vector<const ROBF*>& /*robFragments*/, 
+			  const std::string_view callerName="UNKNOWN") override;
 
-    /// --- Implementation of ITrigROBDataProviderSvcPrefetch interface ---
+  /// Retrieve the full event fragment
+  virtual const RawEvent* getEvent(const EventContext& /*context*/) override;
 
-    /// Set access to ROB prefetching information from steering
-    virtual void setRobRequestInfo(HLT::RobRequestInfo* robInfo) { m_RobRequestInfo = robInfo; } ;
+  /// Store the status for the event.
+  virtual void setEventStatus(const EventContext& /*context*/, uint32_t /*status*/) override;
 
-    /// Get access to ROB prefetching information from steering
-    virtual HLT::RobRequestInfo* robRequestInfo() const { return m_RobRequestInfo; };
+  /// Retrieve the status for the event.
+  virtual uint32_t getEventStatus(const EventContext& /*context*/) override;
 
-    /// --- Implementation of IIncidentListener interface ---
+  /// Apply a function to all ROBs in the cache
+  virtual void processCachedROBs(const EventContext& /*context*/, const std::function< void(const ROBF* )>& /*fn*/) const override;
 
-    // handler for BeginRun actions
-    void handle(const Incident& incident);
+  /// Flag to check if all event data have been retrieved
+  virtual bool isEventComplete(const EventContext& /*context*/) const override;
 
+  /// retrieve in online running all ROBs for the event from the readout system. Only those ROBs are retrieved which are not already in the cache
+  virtual int collectCompleteEventData(const EventContext& /*context*/, 
+				       const std::string_view callerName="UNKNOWN") override;
 
 private:
-    typedef ServiceHandle<StoreGateSvc> StoreGateSvc_t;
-    /// Reference to StoreGateSvc;
-    StoreGateSvc_t         m_storeGateSvc;
-    
-    /// Pointer to AlgContextSvc 
-    IAlgContextSvc*        m_algContextSvc;
-
-    typedef SimpleProperty< std::vector<uint32_t> > Uint32ArrayProperty;
-    typedef SimpleProperty< std::map<int,int> >     IntegerMapProperty;
-
-    // flag indicates if running in online/offline 
-    bool m_onlineRunning ;
-
-    // read enabled ROBs from OKS when possible
-    BooleanProperty m_readROBfromOKS;
-
-    // list of all enabled ROBs which can be retrieved    
-    Uint32ArrayProperty m_enabledROBs;
-
-    // list of ROBs which should be ignored for retrieval    
-    Uint32ArrayProperty m_ignoreROB;
-
-    // list of all LAr MET ROBs which can be retrieved    
-    Uint32ArrayProperty m_enabledLArMetROBs ;
-    UnsignedIntegerProperty m_genericLArMetModuleID ;
-
-    // list of all Tile MET ROBs which can be retrieved    
-    Uint32ArrayProperty m_enabledTileMetROBs;
-    UnsignedIntegerProperty m_genericTileMetModuleID ;
-
-    // Separate data collector calls to ROS for normal ROBs and MET ROBs
-    BooleanProperty m_separateMETandDetROBRetrieval ;
-
-    // Filter out empty ROB fragments which are send by the ROS
-    bool m_removeEmptyROB;
-
-    // map for all the ROB fragments (cache for ROB data so that they are 
-    // not deleted when local containers go out of scope)
-    typedef std::map<uint32_t, ROBF> ONLINE_ROBMAP;
-    ONLINE_ROBMAP m_online_robmap; 
-
-    // helper function to retrieve ROB fragments over the network and to add them to the cache 
-    void addROBDataToCache(std::vector<uint32_t>& robIdsForRetrieval,         // vector of ROBs to retrieve 
-			   robmonitor::ROBDataMonitorStruct* p_robMonStruct); // pointer to ROB monitoring structure for retrieval
-
-    // helper function to put retrieved ROB fragments into the local cache and update the monitoring records 
-    void updateROBDataCache(std::vector<hltinterface::DCM_ROBInfo>& vRobInfo,  // vector of ROB Info records with retrieved fragments 
-			    robmonitor::ROBDataMonitorStruct* p_robMonStruct); // pointer to ROB monitoring structure
-
-    // Flag to indicate if all event data are already in the cache
-    bool m_isEventComplete;
-
-    // name of the program which presently uses the ROBDataProviderSvc
-    std::string m_callerName;
-
-    // ROB prefetching info
-    HLT::RobRequestInfo* m_RobRequestInfo;
-
-    // monitoring
-    std::map<eformat::GenericStatus, std::string> m_map_GenericStatus;
-    std::vector<std::string>                      m_vec_SpecificStatus;
-
-    BooleanProperty m_doMonitoring;
-    BooleanProperty m_doDetailedROBMonitoring;
-    StringProperty  m_ROBDataMonitorCollection_SG_Name;
-
-    Histo1DProperty m_histProp_requestedROBsPerCall;
-    Histo1DProperty m_histProp_receivedROBsPerCall;
-    Histo1DProperty m_histProp_timeROBretrieval;
-
-    TH1F* m_hist_requestedROBsPerCall;
-    TH1F* m_hist_receivedROBsPerCall;
-    TH1F* m_hist_timeROBretrieval;
-    TH2F* m_hist_genericStatusForROB;
-    TH2F* m_hist_specificStatusForROB;
-
-    // Temporary hack to make this version compile in master
-    uint32_t m_currentLvl1ID;
+  /*--------------+
+   *  Event cache |
+   *--------------+ 
+   */
+  /// map for all the ROB fragments
+  typedef tbb::concurrent_unordered_map<uint32_t, ROBF> ROBMAP;
+
+  /// struct which provides the event cache for each slot
+  struct EventCache {
+    ~EventCache();
+    const RawEvent* event      = 0;
+    uint32_t currentLvl1ID     = 0; 
+    uint64_t globalEventNumber = 0;
+    uint32_t eventStatus       = 0;    
+    bool     isEventComplete   = false;    
+    ROBMAP   robmap;
+  };
+
+  /// An event cache for each slot
+  SG::SlotSpecificObj<EventCache> m_eventsCache;
+
+  /*------------------------------+
+   * Attributes for configuration |
+   *------------------------------+ 
+   */
+  /// vector of Source ids and status words to be ignored for the ROB map
+  typedef std::vector< std::pair<int, int> > ArrayPairIntType;
+  Gaudi::Property< ArrayPairIntType > m_filterRobWithStatus{
+    this, "filterRobWithStatus", {} , "List of ROBs with status code to remove"};
+  Gaudi::Property< ArrayPairIntType > m_filterSubDetWithStatus{
+    this, "filterSubDetWithStatus", {} , "List of SubDets with status code to remove"};
+
+  /// map of full ROB Source ids and status words to be ignored for the ROB map
+  typedef std::map<uint32_t, std::vector<uint32_t> > FilterRobMap;
+  FilterRobMap          m_filterRobMap;
+  /// map of Sub Det Source ids and status words to be ignored for the ROB map
+  typedef std::map<eformat::SubDetector, std::vector<uint32_t> > FilterSubDetMap;
+  FilterSubDetMap       m_filterSubDetMap;
+
+  /// Filter out empty ROB fragments which are send by the ROS
+  Gaudi::Property<bool> m_filterEmptyROB{
+    this, "filterEmptyROB", false , "Filter out empty ROB fragments"};
+
+  /// For Run 1 the module ID for the Lvl2/EF result contained the machine ID and nedded to
+  /// be filtered out to access these result records transparently
+  bool m_maskL2EFModuleID = false;    
+
+  // read enabled ROBs from OKS when possible
+  Gaudi::Property<bool> m_readROBfromOKS{
+    this, "readROBfromOKS", true , "Read enabled ROBs from OKS"};
+
+  // list of all enabled ROBs which can be retrieved    
+  Gaudi::Property< std::vector<uint32_t> > m_enabledROBs{
+    this, "enabledROBs", {} , "Enabled ROBs for retrieval"};
+
+  /*------------------------+
+   * Methods acting on ROBs |
+   *------------------------+ 
+   */
+  /// method to filter ROBs with given Status code
+  bool robmap_filterRobWithStatus(const ROBF*);
+
+  /*------------------------------+
+   * Methods acting on EventCache |
+   *------------------------------+ 
+   */
+  /// method to clear an event cache in a slot
+  /// input:
+  ///     pointer to cache
+  void eventCache_clear(EventCache*);
+
+  /// method to compare a list of ROB Ids to the ones in an event cache in a slot
+  /// input:
+  ///     pointer to cache
+  ///     vector of ROB Ids to compare to existing ones in cache
+  /// output:
+  ///     vector of ROB fragments available already in cache
+  ///     vector of ROB Ids missing in cache
+  void eventCache_checkRobListToCache(EventCache*, const std::vector<uint32_t>&, 
+				      std::vector<const ROBF*>&, std::vector<uint32_t>& );
+
+  /// method to add ROB fragments to an event cache in a slot
+  /// input:
+  ///     pointer to cache
+  ///     vector of ROB fragments to add to the cache
+  void eventCache_addRobData(EventCache*, const std::vector<ROBF>&) ;
+
+  /// Monitoring tool
+  ToolHandle<GenericMonitoringTool> m_monTool{this, "MonTool", "", "Monitoring tool"};
 };
 
-#endif
+#endif // TRIGSERVICES_HLTROBDATAPROVIDERSVC_H
diff --git a/InnerDetector/InDetCalibAlgs/InDetBeamSpotFinder/src/InDetBeamSpotReader.cxx b/InnerDetector/InDetCalibAlgs/InDetBeamSpotFinder/src/InDetBeamSpotReader.cxx
index bdd0ef2c8497342d9ede62875f5e1d63a102f025..69ba8b91c1e5006e410c4165af1261f722cdd491 100644
--- a/InnerDetector/InDetCalibAlgs/InDetBeamSpotFinder/src/InDetBeamSpotReader.cxx
+++ b/InnerDetector/InDetCalibAlgs/InDetBeamSpotFinder/src/InDetBeamSpotReader.cxx
@@ -1,15 +1,9 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetBeamSpotReader.h"
-
 #include "VxVertex/VxCandidate.h"
-//#include "TrkEventPrimitives/VertexType.h"
-
-#include "EventInfo/EventID.h"
-
-
 
 InDet::InDetBeamSpotReader::InDetBeamSpotReader(const std::string& name, ISvcLocator* pSvcLocator):
   AthReentrantAlgorithm(name, pSvcLocator)
@@ -32,9 +26,8 @@ StatusCode InDet::InDetBeamSpotReader::execute(const EventContext& ctx) const {
 
   //get the set of 
   SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey, ctx };
-  SG::ReadHandle<EventInfo> eventInfo(m_eventInfo, ctx);
-  EventID* eventID = eventInfo->event_ID();
-    ATH_MSG_INFO( "In event " << (*eventID) );
+  SG::ReadHandle<xAOD::EventInfo> eventInfo(m_eventInfo, ctx);
+    ATH_MSG_INFO( "In event " << (*eventInfo) );
     ATH_MSG_INFO("BeamSpot Position: \n "
 		   << beamSpotHandle->beamPos() );
     ATH_MSG_INFO("BeamSpot Sigma\n\t"
diff --git a/InnerDetector/InDetCalibAlgs/InDetBeamSpotFinder/src/InDetBeamSpotReader.h b/InnerDetector/InDetCalibAlgs/InDetBeamSpotFinder/src/InDetBeamSpotReader.h
index 8533e0c824744c74b09df77476c8d93de6858144..ee83cf1be1d4c30f1f0ff206e867ef536d7f7c08 100644
--- a/InnerDetector/InDetCalibAlgs/InDetBeamSpotFinder/src/InDetBeamSpotReader.h
+++ b/InnerDetector/InDetCalibAlgs/InDetBeamSpotFinder/src/InDetBeamSpotReader.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef INDET_INDETBEAMSPOTREADER_H
@@ -13,7 +13,7 @@
 #include "AthenaBaseComps/AthReentrantAlgorithm.h"
 #include "StoreGate/ReadHandleKey.h"
 #include "VxVertex/VxContainer.h"
-#include "EventInfo/EventInfo.h"
+#include "xAODEventInfo/EventInfo.h"
 #include "BeamSpotConditionsData/BeamSpotData.h"
 
 namespace InDet {
@@ -34,7 +34,7 @@ namespace InDet {
   private:
     SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" };
 
-    SG::ReadHandleKey<EventInfo> m_eventInfo
+    SG::ReadHandleKey<xAOD::EventInfo> m_eventInfo
       {this, "EvtInfo", "EventInfo", "EventInfo name"};
     SG::ReadHandleKey<VxContainer> m_vxContainer
       {this, "VxContainer", "VxPrimaryCandidate", "Vertex container name"};
diff --git a/InnerDetector/InDetCalibAlgs/InDetBeamSpotFinder/src/InDetBeamSpotRooFit.cxx b/InnerDetector/InDetCalibAlgs/InDetBeamSpotFinder/src/InDetBeamSpotRooFit.cxx
index dc21a4702438f92b20e5b1948e170691e7b764bc..f658c6308e7f95113f636078d516c4bea09c3f29 100644
--- a/InnerDetector/InDetCalibAlgs/InDetBeamSpotFinder/src/InDetBeamSpotRooFit.cxx
+++ b/InnerDetector/InDetCalibAlgs/InDetBeamSpotFinder/src/InDetBeamSpotRooFit.cxx
@@ -1,11 +1,9 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetBeamSpotRooFit.h"
 #include "GaudiKernel/ITHistSvc.h"
-#include "EventInfo/EventInfo.h"
-#include "EventInfo/EventID.h"
 #include "VxVertex/VxCandidate.h"
 #include "VxVertex/VxContainer.h"
 #include <RooRealVar.h>
diff --git a/InnerDetector/InDetCalibAlgs/InDetBeamSpotFinder/src/InDetBeamSpotVertex.cxx b/InnerDetector/InDetCalibAlgs/InDetBeamSpotFinder/src/InDetBeamSpotVertex.cxx
index ac58270dba17951ecbf7abc4009320c4d49322a9..bfcd4dc9eaed141e535d307270802df9ca14a5fa 100644
--- a/InnerDetector/InDetCalibAlgs/InDetBeamSpotFinder/src/InDetBeamSpotVertex.cxx
+++ b/InnerDetector/InDetCalibAlgs/InDetBeamSpotFinder/src/InDetBeamSpotVertex.cxx
@@ -1,13 +1,9 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetBeamSpotVertex.h"
-
-
 #include "GaudiKernel/ITHistSvc.h"
-#include "EventInfo/EventInfo.h"
-#include "EventInfo/EventID.h"
 
 #include "VxVertex/VxCandidate.h"
 #include "VxVertex/VxContainer.h"
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ISCT_CalibEvtInfo.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ISCT_CalibEvtInfo.h
index 2f4b3812bc2bed633d047e33bf99971d3dca6b68..a3b3cca59e9214dfb51713e98c3e27702bced568 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ISCT_CalibEvtInfo.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ISCT_CalibEvtInfo.h
@@ -1,14 +1,14 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /**
-* @file ISCT_CalibEvtInfo.h
-* interface for SCT_CalibEvtInfo
-* 
-* author Shaun Roe
-*
-**/
+ * @file ISCT_CalibEvtInfo.h
+ * interface for SCT_CalibEvtInfo
+ * 
+ * author Shaun Roe
+ *
+ **/
 
 #ifndef ISCT_CalibEvtInfo_H
 #define ISCT_CalibEvtInfo_H
@@ -20,49 +20,47 @@
 #include <string>
 
 /**
-*  @class ISCTCalib_EvtInfo
-*  Interface to class to deal with run/event information for SCTCalib
-**/
+ *  @class ISCTCalib_EvtInfo
+ *  Interface to class to deal with run/event information for SCTCalib
+ **/
 
 class ISCT_CalibEvtInfo: virtual public IAlgTool{
-  public:
-    /// no-op c/tor
-    ISCT_CalibEvtInfo(){}
-    /// no-op destructor
-    virtual ~ISCT_CalibEvtInfo(){}
-    /// interfaceID re-implemented from IInterface
-    static const InterfaceID & interfaceID();
-    /// specific methods for this class
-    //virtual void setOptions(const bool useBytestream, const bool useTrkVal, const bool sortChain, const bool readHist)=0;
-    virtual void setTimeStamp(const std::string & begin, const std::string & end)=0;
-    virtual void setTimeStamp(const int begin, const int end)=0;
-    virtual void setTimeStamp(const int ts)=0;
+ public:
+  /// no-op c/tor
+  ISCT_CalibEvtInfo(){}
+  /// no-op destructor
+  virtual ~ISCT_CalibEvtInfo() = default;
+  /// interfaceID re-implemented from IInterface
+  static const InterfaceID& interfaceID();
+  /// specific methods for this class
+  virtual void setTimeStamp(const int begin, const int end)=0;
+  virtual void setTimeStamp(const std::string& begin, const std::string& end)=0;
+  virtual void setTimeStamp(const int ts)=0;
+  virtual void getTimeStamps(int& begin, int& end) const =0;
+  virtual void getTimeStamps(std::string& begin, std::string& end) const =0;
+  virtual int timeStamp() const =0;
+  virtual int duration() const =0;
     
-    virtual void setSource(const std::string source)=0;
+  virtual void setSource(const std::string source)=0;
     
-    virtual void getLumiBlock(int & begin, int & end) const=0;
-    virtual void setLumiBlock(const int begin, const int end)=0;
-    virtual void setLumiBlock(const int lb)=0;
+  virtual void setLumiBlock(const int begin, const int end)=0;
+  virtual void setLumiBlock(const int lb)=0;
+  virtual void getLumiBlock(int& begin, int& end) const =0;
+  virtual int lumiBlock() const =0;
+  virtual int numLumiBlocks() const =0;
     
-    virtual void setRunNumber(const int rn)=0;
-    virtual void setBunchCrossing(const int bc)=0;
-    virtual void setCounter(const int counterVal)=0;
-    virtual void incrementCounter()=0;
+  virtual void setRunNumber(const int rn)=0;
+  virtual int runNumber() const =0;
 
-    virtual void getTimeStamps(int & begin, int & end) const=0;
-    virtual void getTimeStamps(std::string & begin, std::string & end) const=0;
-
-    virtual int timeStamp()const=0;
-    virtual int lumiBlock() const=0;
-    virtual int runNumber() const=0;
-    virtual int counter() const =0;
-    virtual int duration() const=0;
-    virtual int numLumiBlocks() const=0;
+  virtual void setCounter(const int counterVal)=0;
+  virtual void incrementCounter()=0;
+  virtual int counter() const =0;
 
+  virtual void setBunchCrossing(const int bc)=0;
 };
 
-inline const InterfaceID & ISCT_CalibEvtInfo::interfaceID(){
-  static const InterfaceID IID("ISCT_CalibEvtInfo",1,0);
+inline const InterfaceID& ISCT_CalibEvtInfo::interfaceID() {
+  static const InterfaceID IID{"ISCT_CalibEvtInfo", 1, 0};
   return IID;
 }
 
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ISCT_CalibHistoTool.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ISCT_CalibHistoTool.h
index eaa5fd3122c06d947ab30dd9cde7d5fa1841ea5c..bd16f81542b940aeefcc988e293d3294d935a2e9 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ISCT_CalibHistoTool.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ISCT_CalibHistoTool.h
@@ -6,7 +6,7 @@
  * @file ISCT_CalibHistoTool.h
  * Header file to interface class for histograms in the SCT_CalibAlgs package
  * @author Shaun Roe
-**/
+ **/
 
 #ifndef ISCT_CalibHistoTool_h
 #define ISCT_CalibHistoTool_h
@@ -26,61 +26,57 @@ class ITHistSvc;
 class SCT_ID;
 
 class ISCT_CalibHistoTool: virtual public IAlgTool {
-   public:
-      ISCT_CalibHistoTool();
-      /// no-op destructor
-      virtual ~ISCT_CalibHistoTool() = default;
-      /// interfaceID re-implemented from IInterface
-      static const InterfaceID & interfaceID();
-      /// book histograms
-      virtual bool book()=0;
-      /// read histograms
-      virtual bool read(const std::string & fileName)=0;
-      /// fill histograms from simulation
-      virtual bool fill(const bool fromData=false)=0;
-      /// fill histograms from data
-      virtual bool fillFromData()=0;
-      /// get number of events in a specific bin
-      virtual int getNumberOfEventsInBin(const int nbin) const;
-      /// get total number of entries in the number of events histo
-      int size() const;
-      /// get bin content for bin in specific histogram
-      double getBinForHistogramIndex(const int bin, const int histogramIndex) const;
-      /// get the number of entries in a given histogram
-      int size(const int histogramIndex) const;
-      void binHistograms(const int nLbMerged);
-      /// set number of lumiblocks
-      void setNumberOfLb(const int nLb);
-      /// get number of lumiblocks
-      int numberOfLb();
-      /// set number of lumiblocks
-      void setLbToMerge(const int nLbMerge);
-      /// get number of lumiblocks
-      int LbToMerge();
-   protected:
-      std::vector<TH1F *> m_phistoVector;
-      std::vector<TH2F *> m_phistoVector2D;
-      TH1I * m_numberOfEventsHisto;
-      ITHistSvc * m_thistSvc;
-      //need to implement retrieval for these
-      //ServiceHandle<StoreGateSvc> m_detStore;
-      //ServiceHandle<StoreGateSvc> m_evtStore;
-      const SCT_ID* m_pSCTHelper;
-      int m_nLb;
-      int m_nLbMerge;
-      //
-      bool init();
-      template<class T>
-      std::pair<std::string, bool> retrievedTool(T & tool) {
-         if (tool.retrieve().isFailure() ) return std::make_pair(std::string("Unable to retrieve ")+tool.name(), false);
-         return std::make_pair("",true);
-      }
+ public:
+  ISCT_CalibHistoTool();
+  /// no-op destructor
+  virtual ~ISCT_CalibHistoTool() = default;
+  /// interfaceID re-implemented from IInterface
+  static const InterfaceID& interfaceID();
+  /// book histograms
+  virtual bool book()=0;
+  /// read histograms
+  virtual bool read(const std::string& fileName)=0;
+  /// fill histograms from simulation
+  virtual bool fill(const bool fromData=false)=0;
+  /// fill histograms from data
+  virtual bool fillFromData()=0;
+  /// get number of events in a specific bin
+  virtual int getNumberOfEventsInBin(const int nbin) const;
+  /// get total number of entries in the number of events histo
+  int size() const;
+  /// get bin content for bin in specific histogram
+  double getBinForHistogramIndex(const int bin, const int histogramIndex) const;
+  /// get the number of entries in a given histogram
+  int size(const int histogramIndex) const;
+  void binHistograms(const int nLbMerged);
+  /// set number of lumiblocks
+  void setNumberOfLb(const int nLb);
+  /// get number of lumiblocks
+  int numberOfLb() const;
+  /// set number of lumiblocks
+  void setLbToMerge(const int nLbMerge);
+  /// get number of lumiblocks
+  int LbToMerge() const;
+ protected:
+  std::vector<TH1F*> m_phistoVector;
+  std::vector<TH2F*> m_phistoVector2D;
+  TH1I* m_numberOfEventsHisto;
+  ITHistSvc* m_thistSvc;
+  const SCT_ID* m_pSCTHelper;
+  int m_nLb;
+  int m_nLbMerge;
+  //
+  bool init();
+  template<class T>
+    std::pair<std::string, bool> retrievedTool(T& tool) const {
+    if (tool.retrieve().isFailure() ) return std::make_pair(std::string{"Unable to retrieve "}+tool.name(), false);
+    return std::make_pair("", true);
+  }
 };
 
-
-inline const InterfaceID & ISCT_CalibHistoTool::interfaceID() {
-   static const InterfaceID IID("ISCT_CalibHistoTool",1,0);
-   return IID;
+inline const InterfaceID& ISCT_CalibHistoTool::interfaceID() {
+  static const InterfaceID IID{"ISCT_CalibHistoTool", 1, 0};
+  return IID;
 }
 
 #endif
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ISCT_CalibModuleListTool.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ISCT_CalibModuleListTool.h
index 761348143382502d3fff990ddd39da50f9b36b90..e8c0d1d733de747020d5b77f81d874ac8fd7df64 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ISCT_CalibModuleListTool.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ISCT_CalibModuleListTool.h
@@ -1,16 +1,22 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /**
-* @file SCT_CalibModuleListTool.h
-* Header file for the SCT_CalibModuleListTool class
-* @author Shaun Roe
-**/
+ * @file SCT_CalibModuleListTool.h
+ * Header file for the SCT_CalibModuleListTool class
+ * @author Shaun Roe
+ **/
 
 #ifndef ISCT_CalibModuleListTool_h
 #define ISCT_CalibModuleListTool_h
 
+#include "Identifier/Identifier.h"
+
+#include "GaudiKernel/IInterface.h"
+#include "GaudiKernel/IAlgTool.h"
+#include "GaudiKernel/ToolHandle.h"
+
 // STL and boost headers
 #include <string>
 #include <vector>
@@ -18,33 +24,26 @@
 #include <map>
 #include <utility>
 
-#include "GaudiKernel/IInterface.h"
-#include "GaudiKernel/IAlgTool.h"
-#include "GaudiKernel/ToolHandle.h"
-#include "Identifier/Identifier.h"
-
 class ISCT_CalibModuleListTool : virtual public IAlgTool {
-   public:
-      //@name Service methods, reimplemented
-      //@{
-      ISCT_CalibModuleListTool() {/**nop**/};
-      virtual ~ISCT_CalibModuleListTool() {/**nop**/};
-      //virtual StatusCode initialize()=0;
-      //virtual StatusCode finalize()=0;
-      static const InterfaceID & interfaceID();
-      //@}
-      virtual StatusCode readModuleList( std::map< Identifier, std::set<Identifier> >& moduleList )=0;
-
-   protected:
-      template<class T>
-      std::pair<std::string, bool> retrievedTool(T & tool) {
-         if (tool.retrieve().isFailure() ) return std::make_pair(std::string("Unable to retrieve ")+tool.name(), false);
-         return std::make_pair("",true);
-      }
+ public:
+  //@name Service methods, reimplemented
+  //@{
+  ISCT_CalibModuleListTool() {/**nop**/};
+  virtual ~ISCT_CalibModuleListTool() = default;
+  static const InterfaceID& interfaceID();
+  //@}
+  virtual StatusCode readModuleList(std::map<Identifier, std::set<Identifier>>& moduleList) const =0;
+
+ protected:
+  template<class T>
+    std::pair<std::string, bool> retrievedTool(T& tool) const {
+    if (tool.retrieve().isFailure()) return std::make_pair(std::string{"Unable to retrieve "}+tool.name(), false);
+    return std::make_pair("", true);
+  }
 };
 
-inline const InterfaceID & ISCT_CalibModuleListTool::interfaceID() {
-   static const InterfaceID IID("ISCT_CalibModuleListTool",1,0);
-   return IID;
+inline const InterfaceID& ISCT_CalibModuleListTool::interfaceID() {
+  static const InterfaceID IID{"ISCT_CalibModuleListTool", 1, 0};
+  return IID;
 }
 #endif
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/SCTCalib.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/SCTCalib.h
index c353f51b28e530676acf183347f534e63bb21205..961ecac85a5dcbea42c779bfd3e03f40f45853be 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/SCTCalib.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/SCTCalib.h
@@ -3,17 +3,17 @@
 */
 
 /**
-* @file SCTCalib.h
-*
-* Header file for the SCTCalib class
-*
-* @author Jose E. Garcia, jose.enrique.garcia@cern.ch
-* @author Peter Vankov,   peter.vankov@cern.ch
-* @author Kazu Hanagaki,  kazunori.hanagaki@cern.ch
-* @author Minoru Hirose,  minoru.hirose@cern.ch
-* @author Tim Andeen,     timothy.robert.andeen@cern.ch
-* @author Junji Tojo,     junji.tojo@cern.ch
-**/
+ * @file SCTCalib.h
+ *
+ * Header file for the SCTCalib class
+ *
+ * @author Jose E. Garcia, jose.enrique.garcia@cern.ch
+ * @author Peter Vankov,   peter.vankov@cern.ch
+ * @author Kazu Hanagaki,  kazunori.hanagaki@cern.ch
+ * @author Minoru Hirose,  minoru.hirose@cern.ch
+ * @author Tim Andeen,     timothy.robert.andeen@cern.ch
+ * @author Junji Tojo,     junji.tojo@cern.ch
+ **/
 
 #ifndef SCTCalib_H
 #define SCTCalib_H
@@ -65,261 +65,261 @@ class StatusCode;
 
 class SCTCalib : public AthAlgorithm {
 
-   public:
-      SCTCalib( const std::string &name, ISvcLocator *pSvcLocator ) ;
-      ~SCTCalib() = default;
-      virtual StatusCode initialize() override;
-      virtual StatusCode beginRun() override;
-      virtual StatusCode execute() override;
-      virtual StatusCode endRun() override;
-      virtual StatusCode finalize() override;
-
-   private:
-      // SCT specific numbers
-      enum { nbins       = 6*128, firstStrip     =  0, lastStrip     = nbins-1,
-             ntimeBins   =     3, firstTimeBin   =  0, lastTimeBin   =  2,
-             n_hitBins   =    50, first_hitBin   =  0, last_hitBin   = 50,
-             n_etaBins   =    13, first_etaBin   = -6, last_etaBin   =  6,
-             n_phiBins   =    56, first_phiBin   =  0, last_phiBin   = 55,
-             n_barrels   =     4, first_barrel   =  0, last_barrel   =  3,
-             n_disks     =     9, first_disk     =  0, last_disk     =  8,
-             n_etaBinsEC =     3, first_etaBinEC =  0, last_etaBinEC =  2,
-             n_phiBinsEC =    52, first_phiBinEC =  0, last_phiBinEC = 51
-           };
-
-      // Additional info on SCT specific numbers
-      enum { n_chipPerSide = 6, n_chipPerModule = 12, n_stripPerChip = 128, n_etaInBarrel = 12,
-             n_phiBinsB0 = 32, n_phiBinsB1 = 40, n_phiBinsB2 = 48, n_phiBinsB3 = 56,
-             n_phiBinsECShort = 40, n_phiBinsECMiddle = 40, n_phiBinsECOuter = 52, n_elements=8176,
-             n_BSErrorType = 15, firstBSErrorType = 0, lastBSErrorType = 14
-           };
-
-      const SCT_ID*                                               m_pSCTHelper;
-      SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"};
-      SG::ReadHandleKey<EventInfo>                                m_eventInfoKey{this, "EventInfoKey", "ByteStreamEventInfo"};
-
-      ToolHandle<SCTCalibWriteTool>                   m_pCalibWriteTool{this, "SCTCalibWriteTool", "SCTCalibWriteTool", "Tool to write out data from calibration loop"};
-      ToolHandle<ISCT_ConfigurationConditionsTool>    m_ConfigurationConditionsTool{this, "SCT_ConfigurationConditionsTool", "SCT_ConfigurationConditionsTool/InDetSCT_ConfigurationConditionsTool", "Tool to retrieve SCT Configuration"};
-      ToolHandle<ISCT_ReadCalibDataTool>              m_ReadCalibDataTool{this, "SCT_ReadCalibDataTool", "SCT_ReadCalibDataTool/InDetSCT_ReadCalibDataTool", "Tool to retrieve SCT calibration data"};
-      ToolHandle<ISCT_DetectorLevelConditionsTool>    m_MajorityConditionsTool{this, "SCT_MajorityConditionsTool", "SCT_MajorityConditionsTool", "Tool to retrieve the majority conditions of SCT"};
-      ToolHandle<ISCT_CablingTool>                    m_CablingTool{this, "SCT_CablingTool", "SCT_CablingTool", "Tool to retrieve SCT Cabling"};
-      ToolHandle<ISCT_CalibHistoTool>                 m_calibHitmapTool{this, "SCT_CalibHitMapTool", "SCT_CalibHitMapTool", "Tool for reading and writing HitMap histograms"};
-      ToolHandle<ISCT_CalibHistoTool>                 m_calibLbTool{this, "SCT_CalibLbTool", "SCT_CalibLbTool", "Tool for reading and writing Lb dependent HitMap histograms"};
-      ToolHandle<ISCT_CalibHistoTool>                 m_calibBsErrTool{this, "SCT_CalibBsErrTool", "SCT_CalibBsErrTool", "Tool for reading and writing BS error histograms"};
-      ToolHandle<ISCT_CalibModuleListTool>            m_calibModuleListTool{this, "SCT_CalibModuleListTool", "SCT_CalibModuleListTool", "Tool for handling list of modules"};
-      ToolHandle<ISCT_CalibEvtInfo>                   m_calibEvtInfoTool{this, "SCT_CalibEvtInfo", "SCT_CalibEvtInfo", "Tool for handling event info"};
-
-      // For ntuple sorting
-      // For HV trips
-      std::vector< std::vector< std::pair<int, int> > > m_summarytrips;
-      std::vector< std::vector< std::pair<int, int> > > m_summarytripslb;
-
-      std::ofstream m_gofile;
-
-      // output files (for dead search & MONP200 related things )
-      std::ofstream m_outDeadStrips;
-      std::ofstream m_outDeadChips;
-      std::ofstream m_outDeadSummary;
-      std::ofstream m_outNOSummary;
-      std::ofstream m_outROSummary;
-      std::ofstream m_outEffSummary;
-      std::ofstream m_outBSErrSummary;
-      std::ofstream m_outBSErrModule;
-      std::ofstream m_outLASummary;
-
-      // Properties configurable from jobO
-      IntegerProperty m_runNumber{this, "RunNumber", -1};
-
-      StringProperty m_runStartTime{this, "RunStartTime", "", "from runInfo.txt"};
-      StringProperty m_runEndTime{this, "RunEndTime", "", "from runInfo.txt"};
-      StringProperty m_LBMax{this, "LBMax", "1000", "from runInfo.txt"};
-
-      BooleanProperty m_useConfiguration{this, "UseConfiguration", true};
-      BooleanProperty m_useCalibration{this, "UseCalibration", true};
-      BooleanProperty m_useMajority{this, "UseMajority", true};
-      BooleanProperty m_useBSError{this, "UseBSError", false};
-
-      StringArrayProperty m_input_hist{this, "InputHist", {}, "list of HIST (assuming 1 file)"};
-
-      BooleanProperty m_readBS{this, "ReadBS", false, "True if BS is used"};
-      BooleanProperty m_histBefore2010{this, "HistBefore2010", false, "True if HIST is from 2009 or earlier"};
-
-      BooleanProperty m_doHitMaps{this, "DoHitMaps", true};
-      IntegerProperty m_nLbsMerged{this, "LbsPerWindow", 20};
-      BooleanProperty m_readHitMaps{this, "ReadHitMaps", false};
-      BooleanProperty m_doBSErrors{this, "DoBSErrors", false};
-      BooleanProperty m_doNoisyStrip{this, "DoNoisyStrip", true};
-      BooleanProperty m_doNoisyLB{this, "DoNoisyLB", true};
-      BooleanProperty m_doHV{this, "DoHV", false};
-      BooleanProperty m_doDeadStrip{this, "DoDeadStrip", false};
-      BooleanProperty m_doDeadChip{this, "DoDeadChip", false};
-      BooleanProperty m_doNoiseOccupancy{this, "DoNoiseOccupancy", false};
-      BooleanProperty m_doRawOccupancy{this, "DoRawOccupancy", false};
-      BooleanProperty m_doEfficiency{this, "DoEfficiency", false};
-      BooleanProperty m_doBSErrorDB{this, "DoBSErrorDB", false};
-      BooleanProperty m_doLorentzAngle{this, "DoLorentzAngle", false};
-      BooleanProperty m_writeToCool{this, "WriteToCool", true};
-
-      BooleanProperty m_noisyUpdate{this, "NoisyUpdate", true};
-      BooleanProperty m_noisyUploadTest{this, "NoisyUploadTest", true};
-      FloatProperty   m_noisyModuleAverageInDB{this, "NoisyModuleAverageInDB", -1., "Average number of modules with at least 1 noisy strip in COOL"};
-      IntegerProperty m_noisyStripLastRunInDB{this, "NoisyStripLastRunInDB", -999, "Number of noisy strips of the last run uploaded to COOL"};
-      FloatProperty   m_noisyStripAverageInDB{this, "NoisyStripAverageInDB", -999., "Number of noisy strips of the last run uploaded to COOL"};
-      IntegerProperty m_noisyModuleList{this, "NoisyModuleList", 200};
-      FloatProperty   m_noisyModuleDiff{this, "NoisyModuleDiff", 0.200};
-      FloatProperty   m_noisyStripDiff{this, "NoisyStripDiff", 128.};
-
-      UnsignedIntegerProperty m_noisyMinStat{this, "NoisyMinStat", 50000};
-      BooleanProperty         m_noisyStripAll{this, "NoisyStripAll", true};
-      BooleanProperty         m_noisyStripThrDef{this, "NoisyStripThrDef", true};
-      FloatProperty           m_noisyStripThrOffline{this, "NoisyStripThrOffline", 1.500E-2};
-      FloatProperty           m_noisyStripThrOnline{this, "NoisyStripThrOnline", 1.500E-3};
-      BooleanProperty         m_noisyWaferFinder{this, "NoisyWaferFinder", true};
-      BooleanProperty         m_noisyWaferWrite{this, "NoisyWaferWrite", true};
-      BooleanProperty         m_noisyWaferAllStrips{this, "NoisyWaferAllStrips", true};
-      FloatProperty           m_noisyWaferThrBarrel{this, "NoisyWaferThrBarrel", 1.000E-4};
-      FloatProperty           m_noisyWaferThrECA{this, "NoisyWaferThrECA", 1.000E-4};
-      FloatProperty           m_noisyWaferThrECC{this, "NoisyWaferThrECC", 1.000E-4};
-      FloatProperty           m_noisyWaferFraction{this, "NoisyWaferFraction", 0.500};
-      FloatProperty           m_noisyChipFraction{this, "NoisyChipFraction", 0.500};
-
-      IntegerProperty m_maxtbins{this, "HVBinWidth", 5};
-
-      UnsignedIntegerProperty m_deadStripMinStat{this, "DeadStripMinStat", 200000};
-      UnsignedIntegerProperty m_deadStripMinStatBusy{this, "DeadStripMinStatBusy", 1600000};
-      UnsignedIntegerProperty m_deadChipMinStat{this, "DeadChipMinStat", 200000};
-      UnsignedIntegerProperty m_deadStripSignificance{this, "DeadStripSignificance", 10};
-      UnsignedIntegerProperty m_deadChipSignificance{this, "DeadChipSignificance", 10};
-      FloatProperty           m_busyThr4DeadFinding{this, "BusyThr4DeadFinding", 1E-4};
-      FloatProperty           m_noisyThr4DeadFinding{this, "NoisyThr4DeadFinding", 1.500E-3};
-      BooleanProperty         m_deadChipUploadTest{this, "DeadChipUploadTest", true};
-      BooleanProperty         m_deadStripUploadTest{this, "DeadStripUploadTest", true};
-
-      BooleanProperty         m_noiseOccupancyTriggerAware{this, "NoiseOccupancyTriggerAware", true};
-      UnsignedIntegerProperty m_noiseOccupancyMinStat{this, "NoiseOccupancyMinStat", 50000};
-      UnsignedIntegerProperty m_rawOccupancyMinStat{this, "RawOccupancyMinStat", 50000};
-      UnsignedIntegerProperty m_efficiencyMinStat{this, "EfficiencyMinStat", 50000};
-      UnsignedIntegerProperty m_BSErrorDBMinStat{this, "BSErrorDBMinStat", 50000};
-      UnsignedIntegerProperty m_LorentzAngleMinStat{this, "LorentzAngleMinStat", 50000};
-
-      BooleanProperty  m_LorentzAngleDebugMode{this, "LorentzAngleDebugMode", true};
-
-      StringProperty m_tagID4NoisyStrips{this, "TagID4NoisyStrips", "SctDerivedMonitoring-001-00"};
-      StringProperty m_tagID4DeadStrips{this, "TagID4DeadStrips", "SctDerivedDeadStrips-001-00"};
-      StringProperty m_tagID4DeadChips{this, "TagID4DeadChips", "SctDerivedDeadChips-001-00"};
-      StringProperty m_tagID4NoiseOccupancy{this,  "TagID4NoiseOccupancy", "SctDerivedNoiseOccupancy-001-00"};
-
-      StringProperty m_badStripsAllFile{this, "BadStripsAllFile", "BadStripsAllFile.xml", "Output XML for all noisy strips"};
-      StringProperty m_badStripsNewFile{this, "BadStripsNewFile", "BadStripsNewFile.xml", "Output XML for newly found noisy strips (i.e. not in config/calib data)"};
-      StringProperty m_badStripsSummaryFile{this, "BadStripsSummaryFile", "BadStripsSummaryFile.xml", "Output XML for summary info from noisy strip search"};
-
-      StringProperty m_badModulesFile{this, "BadModulesFile", "BadModulesFile.xml", "Output XML for HV trips"};
-
-      StringProperty m_deadStripsFile{this, "DeadStripsFile", "DeadStripsFile.xml", "Output XML for dead strips"};
-      StringProperty m_deadChipsFile{this, "DeadChipsFile", "DeadChipsFile.xml", "Output XML for dead chips"};
-      StringProperty m_deadSummaryFile{this, "DeadSummaryFile", "DeadSummaryFile.xml", "Output XML for summary of Dead Finding"};
-
-      StringProperty m_noiseOccupancyFile{this, "NoiseOccupancyFile", "NoiseOccupancyFile.xml", "Output XML for noise occupancy"};
-      StringProperty m_noiseOccupancySummaryFile{this, "NoiseOccupancySummaryFile", "NoiseOccupancySummaryFile.xml", "Output XML for summary of noise occupancy"};
-      StringProperty m_rawOccupancySummaryFile{this,"RawOccupancySummaryFile", "RawOccupancySummaryFile.xml", "Output XML for summary of raw occupancy"};
-      StringProperty m_efficiencySummaryFile{this, "EfficiencySummaryFile", "EfficiencySummaryFile.xml", "Output XML for summary of efficiency"};
-      StringProperty m_efficiencyModuleFile{this, "EfficiencyModuleFile", "EfficiencyModuleSummary.xml", "Output XML for efficiency"};
-      StringProperty m_BSErrorSummaryFile{this, "BSErrorSummaryFile", "BSErrorSummaryFile.xml", "Output XML for summary of BS Errors"};
-      StringProperty m_BSErrorModuleFile{this, "BSErrorModuleFile", "BSErrorModuleSummary.xml", "Output XML for summary of BS Errors"};
-      StringProperty m_LorentzAngleFile{this, "LorentzAngleFile", "LorentzAngleFile.xml", "Output XML for noise occupancy"};
-      StringProperty m_LorentzAngleSummaryFile{this, "LorentzAngleSummaryFile", "LorentzAngleSummaryFile.xml", "Output XML for summary of lorentz angle"};
-
-      // Event related
-      int             m_numOfLBsProcessed;
-      unsigned long long m_numberOfEvents;
-      unsigned long long m_numberOfEventsHist; // For number of events from HIST
-      std::string        m_utcBegin;
-      std::string        m_utcEnd;
-      int                m_LBRange;
-      IOVTime            m_iovStart;
-      IOVTime            m_iovStop;
-
-      // Input
-      TFile*  m_inputHist;    // Monitoring histograms
-      bool    m_readHIST;   // True if HIST is used
-
-      // Histograms
-      std::vector<TProfile2D *> m_pnoiseoccupancymapHistoVector;
-      std::vector<TProfile2D *> m_pnoiseoccupancymapHistoVectorECp;
-      std::vector<TProfile2D *> m_pnoiseoccupancymapHistoVectorECm;
-      std::vector<TProfile *>   m_h_phiVsNstripsSideHistoVector;
-
-      // Book histograms
-
-      // Methods implemented
-      StatusCode prepareHV();
-      StatusCode doHVPrintXML(const std::pair<int, int> & timeInterval, const std::pair<int, int> & lbRange, Identifier);
-
-      bool       notEnoughStatistics(const int required, const int obtained, const std::string & histogramName="HIST") const;
-
-      StatusCode getNoisyStrip();
-      StatusCode getDeadStrip();
-      StatusCode getNoiseOccupancy();
-      StatusCode getRawOccupancy();
-      StatusCode getEfficiency();
-      StatusCode getBSErrors();
-      StatusCode getLorentzAngle();
-
-      // To handle XML file for DB
-      StatusCode openXML4DB( std::ofstream&, const char*, const char*, IOVTime, IOVTime ) const;
-      StatusCode closeXML4DB( std::ofstream& ) const;
-      StatusCode addToXML4DB( std::ofstream&, const Identifier&, const char*, float, const char* ) const;
-
-      // To handle XML file for Summary
-      StatusCode openXML4MonSummary( std::ofstream&, const char* ) const;
-      StatusCode openXML4DeadSummary( std::ofstream& file, const char* type, int n_Module=0, int n_Link=0, int n_Chip=0, int n_Strip=0 ) const;
-      StatusCode wrapUpXML4Summary( std::ofstream&, const char*, std::ostringstream& ) const;
-      StatusCode addToSummaryStr( std::ostringstream&, const Identifier&, const char*, const char*, const char* ) const;
-
-      template<class S>
-      bool retrievedService(S & service) {
-         if (service.retrieve().isFailure() ) {
-            ATH_MSG_ERROR("Unable to retrieve "<<service.name());
-            return false;
-         }
-         return true;
-      }
-      std::string
-      xmlChannelNoiseOccDataString(const Identifier & waferId,  const float occupancy, const SCT_SerialNumber & serial) const;
-
-      std::string
-      xmlChannelEfficiencyDataString(const Identifier & waferId,  const float efficiency, const SCT_SerialNumber & serial) const;
-
-      std::pair<int, bool>
-      getNumNoisyStrips( const Identifier& waferId ) const;
-
-      StatusCode
-      addStripsToList( Identifier& waferId, std::set<Identifier>& stripIdList, bool isNoisy, bool isNew );
-
-      StatusCode
-      writeModuleListToCool( const std::map< Identifier, std::set<Identifier> >& moduleListAll,
-                             const std::map< Identifier, std::set<Identifier> >& moduleListNew,
-                             const std::map< Identifier, std::set<Identifier> >& moduleListRef );
-      std::string
-      getStripList( const std::set<Identifier>& stripIdList ) const;
-
-      StatusCode
-      noisyStripsToXml( const std::map< Identifier, std::set<Identifier> >& moduleList, const std::string& badStripsFile ) const;
-
-      StatusCode
-      noisyStripsToSummaryXml( const std::map< Identifier, std::set<Identifier> >& moduleListAll,
-                               const std::map< Identifier, std::set<Identifier> >& moduleListNew,
-                               const std::map< Identifier, std::set<Identifier> >& moduleListRef,
-                               const std::string& badStripsFile) const;
-
-      std::set<int>
-      getNoisyChips( const std::set<Identifier>& stripIdList ) const;
-
-      std::pair< std::string, float >
-      getNoisyLB( const Identifier& moduleId, int& chipId ) const;
-
-      std::string
-      getLBList( const std::set<int>& LBList ) const;
+ public:
+  SCTCalib( const std::string &name, ISvcLocator* pSvcLocator ) ;
+  ~SCTCalib() = default;
+  virtual StatusCode initialize() override;
+  virtual StatusCode beginRun() override;
+  virtual StatusCode execute() override;
+  virtual StatusCode endRun() override;
+  virtual StatusCode finalize() override;
+
+ private:
+  // SCT specific numbers
+  enum { nbins       = 6*128, firstStrip     =  0, lastStrip     = nbins-1,
+         ntimeBins   =     3, firstTimeBin   =  0, lastTimeBin   =  2,
+         n_hitBins   =    50, first_hitBin   =  0, last_hitBin   = 50,
+         n_etaBins   =    13, first_etaBin   = -6, last_etaBin   =  6,
+         n_phiBins   =    56, first_phiBin   =  0, last_phiBin   = 55,
+         n_barrels   =     4, first_barrel   =  0, last_barrel   =  3,
+         n_disks     =     9, first_disk     =  0, last_disk     =  8,
+         n_etaBinsEC =     3, first_etaBinEC =  0, last_etaBinEC =  2,
+         n_phiBinsEC =    52, first_phiBinEC =  0, last_phiBinEC = 51
+  };
+
+  // Additional info on SCT specific numbers
+  enum { n_chipPerSide = 6, n_chipPerModule = 12, n_stripPerChip = 128, n_etaInBarrel = 12,
+         n_phiBinsB0 = 32, n_phiBinsB1 = 40, n_phiBinsB2 = 48, n_phiBinsB3 = 56,
+         n_phiBinsECShort = 40, n_phiBinsECMiddle = 40, n_phiBinsECOuter = 52, n_elements=8176,
+         n_BSErrorType = 15, firstBSErrorType = 0, lastBSErrorType = 14
+  };
+
+  const SCT_ID*                                               m_pSCTHelper;
+  SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"};
+  SG::ReadHandleKey<EventInfo>                                m_eventInfoKey{this, "EventInfoKey", "ByteStreamEventInfo"};
+
+  ToolHandle<SCTCalibWriteTool>                   m_pCalibWriteTool{this, "SCTCalibWriteTool", "SCTCalibWriteTool", "Tool to write out data from calibration loop"};
+  ToolHandle<ISCT_ConfigurationConditionsTool>    m_ConfigurationConditionsTool{this, "SCT_ConfigurationConditionsTool", "SCT_ConfigurationConditionsTool/InDetSCT_ConfigurationConditionsTool", "Tool to retrieve SCT Configuration"};
+  ToolHandle<ISCT_ReadCalibDataTool>              m_ReadCalibDataTool{this, "SCT_ReadCalibDataTool", "SCT_ReadCalibDataTool/InDetSCT_ReadCalibDataTool", "Tool to retrieve SCT calibration data"};
+  ToolHandle<ISCT_DetectorLevelConditionsTool>    m_MajorityConditionsTool{this, "SCT_MajorityConditionsTool", "SCT_MajorityConditionsTool", "Tool to retrieve the majority conditions of SCT"};
+  ToolHandle<ISCT_CablingTool>                    m_CablingTool{this, "SCT_CablingTool", "SCT_CablingTool", "Tool to retrieve SCT Cabling"};
+  ToolHandle<ISCT_CalibHistoTool>                 m_calibHitmapTool{this, "SCT_CalibHitMapTool", "SCT_CalibHitMapTool", "Tool for reading and writing HitMap histograms"};
+  ToolHandle<ISCT_CalibHistoTool>                 m_calibLbTool{this, "SCT_CalibLbTool", "SCT_CalibLbTool", "Tool for reading and writing Lb dependent HitMap histograms"};
+  ToolHandle<ISCT_CalibHistoTool>                 m_calibBsErrTool{this, "SCT_CalibBsErrTool", "SCT_CalibBsErrTool", "Tool for reading and writing BS error histograms"};
+  ToolHandle<ISCT_CalibModuleListTool>            m_calibModuleListTool{this, "SCT_CalibModuleListTool", "SCT_CalibModuleListTool", "Tool for handling list of modules"};
+  ToolHandle<ISCT_CalibEvtInfo>                   m_calibEvtInfoTool{this, "SCT_CalibEvtInfo", "SCT_CalibEvtInfo", "Tool for handling event info"};
+
+  // For ntuple sorting
+  // For HV trips
+  std::vector<std::vector<std::pair<int, int>>> m_summarytrips;
+  std::vector<std::vector<std::pair<int, int>>> m_summarytripslb;
+
+  std::ofstream m_gofile;
+
+  // output files (for dead search & MONP200 related things )
+  std::ofstream m_outDeadStrips;
+  std::ofstream m_outDeadChips;
+  std::ofstream m_outDeadSummary;
+  std::ofstream m_outNOSummary;
+  std::ofstream m_outROSummary;
+  std::ofstream m_outEffSummary;
+  std::ofstream m_outBSErrSummary;
+  std::ofstream m_outBSErrModule;
+  std::ofstream m_outLASummary;
+
+  // Properties configurable from jobO
+  IntegerProperty m_runNumber{this, "RunNumber", -1};
+
+  StringProperty m_runStartTime{this, "RunStartTime", "", "from runInfo.txt"};
+  StringProperty m_runEndTime{this, "RunEndTime", "", "from runInfo.txt"};
+  StringProperty m_LBMax{this, "LBMax", "1000", "from runInfo.txt"};
+
+  BooleanProperty m_useConfiguration{this, "UseConfiguration", true};
+  BooleanProperty m_useCalibration{this, "UseCalibration", true};
+  BooleanProperty m_useMajority{this, "UseMajority", true};
+  BooleanProperty m_useBSError{this, "UseBSError", false};
+
+  StringArrayProperty m_input_hist{this, "InputHist", {}, "list of HIST (assuming 1 file)"};
+
+  BooleanProperty m_readBS{this, "ReadBS", false, "True if BS is used"};
+  BooleanProperty m_histBefore2010{this, "HistBefore2010", false, "True if HIST is from 2009 or earlier"};
+
+  BooleanProperty m_doHitMaps{this, "DoHitMaps", true};
+  IntegerProperty m_nLbsMerged{this, "LbsPerWindow", 20};
+  BooleanProperty m_readHitMaps{this, "ReadHitMaps", false};
+  BooleanProperty m_doBSErrors{this, "DoBSErrors", false};
+  BooleanProperty m_doNoisyStrip{this, "DoNoisyStrip", true};
+  BooleanProperty m_doNoisyLB{this, "DoNoisyLB", true};
+  BooleanProperty m_doHV{this, "DoHV", false};
+  BooleanProperty m_doDeadStrip{this, "DoDeadStrip", false};
+  BooleanProperty m_doDeadChip{this, "DoDeadChip", false};
+  BooleanProperty m_doNoiseOccupancy{this, "DoNoiseOccupancy", false};
+  BooleanProperty m_doRawOccupancy{this, "DoRawOccupancy", false};
+  BooleanProperty m_doEfficiency{this, "DoEfficiency", false};
+  BooleanProperty m_doBSErrorDB{this, "DoBSErrorDB", false};
+  BooleanProperty m_doLorentzAngle{this, "DoLorentzAngle", false};
+  BooleanProperty m_writeToCool{this, "WriteToCool", true};
+
+  BooleanProperty m_noisyUpdate{this, "NoisyUpdate", true};
+  BooleanProperty m_noisyUploadTest{this, "NoisyUploadTest", true};
+  FloatProperty   m_noisyModuleAverageInDB{this, "NoisyModuleAverageInDB", -1., "Average number of modules with at least 1 noisy strip in COOL"};
+  IntegerProperty m_noisyStripLastRunInDB{this, "NoisyStripLastRunInDB", -999, "Number of noisy strips of the last run uploaded to COOL"};
+  FloatProperty   m_noisyStripAverageInDB{this, "NoisyStripAverageInDB", -999., "Number of noisy strips of the last run uploaded to COOL"};
+  IntegerProperty m_noisyModuleList{this, "NoisyModuleList", 200};
+  FloatProperty   m_noisyModuleDiff{this, "NoisyModuleDiff", 0.200};
+  FloatProperty   m_noisyStripDiff{this, "NoisyStripDiff", 128.};
+
+  UnsignedIntegerProperty m_noisyMinStat{this, "NoisyMinStat", 50000};
+  BooleanProperty         m_noisyStripAll{this, "NoisyStripAll", true};
+  BooleanProperty         m_noisyStripThrDef{this, "NoisyStripThrDef", true};
+  FloatProperty           m_noisyStripThrOffline{this, "NoisyStripThrOffline", 1.500E-2};
+  FloatProperty           m_noisyStripThrOnline{this, "NoisyStripThrOnline", 1.500E-3};
+  BooleanProperty         m_noisyWaferFinder{this, "NoisyWaferFinder", true};
+  BooleanProperty         m_noisyWaferWrite{this, "NoisyWaferWrite", true};
+  BooleanProperty         m_noisyWaferAllStrips{this, "NoisyWaferAllStrips", true};
+  FloatProperty           m_noisyWaferThrBarrel{this, "NoisyWaferThrBarrel", 1.000E-4};
+  FloatProperty           m_noisyWaferThrECA{this, "NoisyWaferThrECA", 1.000E-4};
+  FloatProperty           m_noisyWaferThrECC{this, "NoisyWaferThrECC", 1.000E-4};
+  FloatProperty           m_noisyWaferFraction{this, "NoisyWaferFraction", 0.500};
+  FloatProperty           m_noisyChipFraction{this, "NoisyChipFraction", 0.500};
+
+  IntegerProperty m_maxtbins{this, "HVBinWidth", 5};
+
+  UnsignedIntegerProperty m_deadStripMinStat{this, "DeadStripMinStat", 200000};
+  UnsignedIntegerProperty m_deadStripMinStatBusy{this, "DeadStripMinStatBusy", 1600000};
+  UnsignedIntegerProperty m_deadChipMinStat{this, "DeadChipMinStat", 200000};
+  UnsignedIntegerProperty m_deadStripSignificance{this, "DeadStripSignificance", 10};
+  UnsignedIntegerProperty m_deadChipSignificance{this, "DeadChipSignificance", 10};
+  FloatProperty           m_busyThr4DeadFinding{this, "BusyThr4DeadFinding", 1E-4};
+  FloatProperty           m_noisyThr4DeadFinding{this, "NoisyThr4DeadFinding", 1.500E-3};
+  BooleanProperty         m_deadChipUploadTest{this, "DeadChipUploadTest", true};
+  BooleanProperty         m_deadStripUploadTest{this, "DeadStripUploadTest", true};
+
+  BooleanProperty         m_noiseOccupancyTriggerAware{this, "NoiseOccupancyTriggerAware", true};
+  UnsignedIntegerProperty m_noiseOccupancyMinStat{this, "NoiseOccupancyMinStat", 50000};
+  UnsignedIntegerProperty m_rawOccupancyMinStat{this, "RawOccupancyMinStat", 50000};
+  UnsignedIntegerProperty m_efficiencyMinStat{this, "EfficiencyMinStat", 50000};
+  UnsignedIntegerProperty m_BSErrorDBMinStat{this, "BSErrorDBMinStat", 50000};
+  UnsignedIntegerProperty m_LorentzAngleMinStat{this, "LorentzAngleMinStat", 50000};
+
+  BooleanProperty  m_LorentzAngleDebugMode{this, "LorentzAngleDebugMode", true};
+
+  StringProperty m_tagID4NoisyStrips{this, "TagID4NoisyStrips", "SctDerivedMonitoring-001-00"};
+  StringProperty m_tagID4DeadStrips{this, "TagID4DeadStrips", "SctDerivedDeadStrips-001-00"};
+  StringProperty m_tagID4DeadChips{this, "TagID4DeadChips", "SctDerivedDeadChips-001-00"};
+  StringProperty m_tagID4NoiseOccupancy{this,  "TagID4NoiseOccupancy", "SctDerivedNoiseOccupancy-001-00"};
+
+  StringProperty m_badStripsAllFile{this, "BadStripsAllFile", "BadStripsAllFile.xml", "Output XML for all noisy strips"};
+  StringProperty m_badStripsNewFile{this, "BadStripsNewFile", "BadStripsNewFile.xml", "Output XML for newly found noisy strips (i.e. not in config/calib data)"};
+  StringProperty m_badStripsSummaryFile{this, "BadStripsSummaryFile", "BadStripsSummaryFile.xml", "Output XML for summary info from noisy strip search"};
+
+  StringProperty m_badModulesFile{this, "BadModulesFile", "BadModulesFile.xml", "Output XML for HV trips"};
+
+  StringProperty m_deadStripsFile{this, "DeadStripsFile", "DeadStripsFile.xml", "Output XML for dead strips"};
+  StringProperty m_deadChipsFile{this, "DeadChipsFile", "DeadChipsFile.xml", "Output XML for dead chips"};
+  StringProperty m_deadSummaryFile{this, "DeadSummaryFile", "DeadSummaryFile.xml", "Output XML for summary of Dead Finding"};
+
+  StringProperty m_noiseOccupancyFile{this, "NoiseOccupancyFile", "NoiseOccupancyFile.xml", "Output XML for noise occupancy"};
+  StringProperty m_noiseOccupancySummaryFile{this, "NoiseOccupancySummaryFile", "NoiseOccupancySummaryFile.xml", "Output XML for summary of noise occupancy"};
+  StringProperty m_rawOccupancySummaryFile{this,"RawOccupancySummaryFile", "RawOccupancySummaryFile.xml", "Output XML for summary of raw occupancy"};
+  StringProperty m_efficiencySummaryFile{this, "EfficiencySummaryFile", "EfficiencySummaryFile.xml", "Output XML for summary of efficiency"};
+  StringProperty m_efficiencyModuleFile{this, "EfficiencyModuleFile", "EfficiencyModuleSummary.xml", "Output XML for efficiency"};
+  StringProperty m_BSErrorSummaryFile{this, "BSErrorSummaryFile", "BSErrorSummaryFile.xml", "Output XML for summary of BS Errors"};
+  StringProperty m_BSErrorModuleFile{this, "BSErrorModuleFile", "BSErrorModuleSummary.xml", "Output XML for summary of BS Errors"};
+  StringProperty m_LorentzAngleFile{this, "LorentzAngleFile", "LorentzAngleFile.xml", "Output XML for noise occupancy"};
+  StringProperty m_LorentzAngleSummaryFile{this, "LorentzAngleSummaryFile", "LorentzAngleSummaryFile.xml", "Output XML for summary of lorentz angle"};
+
+  // Event related
+  int m_numOfLBsProcessed;
+  unsigned long long m_numberOfEvents;
+  unsigned long long m_numberOfEventsHist; // For number of events from HIST
+  std::string        m_utcBegin;
+  std::string        m_utcEnd;
+  int                m_LBRange;
+  IOVTime            m_iovStart;
+  IOVTime            m_iovStop;
+
+  // Input
+  TFile*  m_inputHist;    // Monitoring histograms
+  bool    m_readHIST;   // True if HIST is used
+
+  // Histograms
+  std::vector<TProfile2D*> m_pnoiseoccupancymapHistoVector;
+  std::vector<TProfile2D*> m_pnoiseoccupancymapHistoVectorECp;
+  std::vector<TProfile2D*> m_pnoiseoccupancymapHistoVectorECm;
+  std::vector<TProfile*>   m_h_phiVsNstripsSideHistoVector;
+
+  // Book histograms
+
+  // Methods implemented
+  StatusCode prepareHV();
+  StatusCode doHVPrintXML(const std::pair<int, int>& timeInterval, const std::pair<int, int>& lbRange, Identifier);
+
+  bool       notEnoughStatistics(const int required, const int obtained, const std::string& histogramName="HIST") const;
+
+  StatusCode getNoisyStrip();
+  StatusCode getDeadStrip();
+  StatusCode getNoiseOccupancy();
+  StatusCode getRawOccupancy();
+  StatusCode getEfficiency();
+  StatusCode getBSErrors();
+  StatusCode getLorentzAngle();
+
+  // To handle XML file for DB
+  StatusCode openXML4DB(std::ofstream&, const char*, const char*, IOVTime, IOVTime) const;
+  StatusCode closeXML4DB(std::ofstream&) const;
+  StatusCode addToXML4DB(std::ofstream&, const Identifier&, const char*, float, const char*) const;
+
+  // To handle XML file for Summary
+  StatusCode openXML4MonSummary(std::ofstream&, const char*) const;
+  StatusCode openXML4DeadSummary(std::ofstream& file, const char* type, int n_Module=0, int n_Link=0, int n_Chip=0, int n_Strip=0) const;
+  StatusCode wrapUpXML4Summary(std::ofstream&, const char*, std::ostringstream&) const;
+  StatusCode addToSummaryStr(std::ostringstream&, const Identifier&, const char*, const char*, const char*) const;
+
+  template<class S>
+    bool retrievedService(S& service) const {
+    if (service.retrieve().isFailure()) {
+      ATH_MSG_ERROR("Unable to retrieve "<<service.name());
+      return false;
+    }
+    return true;
+  }
+  std::string
+    xmlChannelNoiseOccDataString(const Identifier& waferId, const float occupancy, const SCT_SerialNumber& serial) const;
+
+  std::string
+    xmlChannelEfficiencyDataString(const Identifier& waferId, const float efficiency, const SCT_SerialNumber& serial) const;
+
+  std::pair<int, bool>
+    getNumNoisyStrips(const Identifier& waferId) const;
+
+  StatusCode
+    addStripsToList(Identifier& waferId, std::set<Identifier>& stripIdList, bool isNoisy, bool isNew) const;
+
+  StatusCode
+    writeModuleListToCool(const std::map<Identifier, std::set<Identifier>>& moduleListAll,
+                          const std::map<Identifier, std::set<Identifier>>& moduleListNew,
+                          const std::map<Identifier, std::set<Identifier>>& moduleListRef) const;
+  std::string
+    getStripList(const std::set<Identifier>& stripIdList) const;
+
+  StatusCode
+    noisyStripsToXml(const std::map< Identifier, std::set<Identifier> >& moduleList, const std::string& badStripsFile) const;
+
+  StatusCode
+    noisyStripsToSummaryXml(const std::map<Identifier, std::set<Identifier>>& moduleListAll,
+                            const std::map<Identifier, std::set<Identifier>>& moduleListNew,
+                            const std::map<Identifier, std::set<Identifier>>& moduleListRef,
+                            const std::string& badStripsFile) const;
+
+  std::set<int>
+    getNoisyChips(const std::set<Identifier>& stripIdList) const;
+
+  std::pair<std::string, float>
+    getNoisyLB(const Identifier& moduleId, int& chipId) const;
+
+  std::string
+    getLBList(const std::set<int>& LBList) const;
 }; // end of class
 
 #endif // SCTCalib_H
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/SCTCalibWriteTool.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/SCTCalibWriteTool.h
index e1bf6cbb1c4f81b9611b4b2686213c429e43fb7f..4906150408653ea4ee297fa8f506f32b4e453e61 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/SCTCalibWriteTool.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/SCTCalibWriteTool.h
@@ -5,12 +5,12 @@
 */
 
 /*
-* @file SCTCalibWriteTool.h
-*
-* @brief Header file for the SCTCalibWriteTool class
-*
-* @author Jose E. Garcia
-**/
+ * @file SCTCalibWriteTool.h
+ *
+ * @brief Header file for the SCTCalibWriteTool class
+ *
+ * @author Jose E. Garcia
+ **/
 
 #ifndef SCTCalibWriteTool_H
 #define SCTCalibWriteTool_H
@@ -48,188 +48,171 @@ class CondAttrListCollection;
 class StoreGateSvc;
 
 /**
-** Algorithm to test writing conditions data and reading them back.
-**/
+ ** Algorithm to test writing conditions data and reading them back.
+ **/
 class SCTCalibWriteTool : public AthAlgTool {
 
-   public:
-      // Constructor
-      SCTCalibWriteTool(const std::string& type, const std::string& name, const IInterface* parent);
-      // Destructor
-      virtual ~SCTCalibWriteTool() = default;
-
-      // overloading functions
-      virtual StatusCode initialize();
-      virtual StatusCode finalize();
-      static const InterfaceID & interfaceID();
-      virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvIF);
-
-      ///Manually get the data in the structure before proceding
-      virtual StatusCode fillData();
-
-      //I'm going to fill this from job options, so the callback version of fillData is not needed.
-      virtual StatusCode fillData(int& /*i */, std::list<std::string>& /*l*/) { //comment out unused parameters to prevent compiler warning
-         return StatusCode::FAILURE;
-      }
-
-      std::string
-      addDefect(const std::string& defectlist,const int defectBeginChannel,const int defectEndChannel) const;
-
-      std::string
-      addNumber(const std::string numStr,const unsigned long long number) const;
-
-      std::string
-      createDefectString(const int defectBeginChannel,const int defectEndChannel) const;
-
-      StatusCode
-      createCondObjects( const Identifier& wafer_id,const SCT_ID* m_sctId,const int samplesize,const std::string& defectType,const float threshold,const std::string& defectList ) const;
-
-      StatusCode createListStrip( const Identifier& wafer_id,
-                                  const SCT_ID* m_sctId,
-                                  const int samplesize,
-                                  const std::string& defectType,
-                                  const float threshold,
-                                  const std::string& defectList ) const;
-
-      StatusCode createListChip( const Identifier& wafer_id,
-                                 const SCT_ID* m_sctId,
-                                 const int samplesize,
-                                 const std::string& defectType,
-                                 const float threshold,
-                                 const std::string& defectList ) const;
-
-      StatusCode createListEff( const Identifier& wafer_id,
-                                const SCT_ID* m_sctId,
-                                const int samplesize,
-                                const float eff ) const;
-
-      StatusCode createListNO( const Identifier& wafer_id,
+public:
+  // Constructor
+  SCTCalibWriteTool(const std::string& type, const std::string& name, const IInterface* parent);
+  // Destructor
+  virtual ~SCTCalibWriteTool() = default;
+
+  // overloading functions
+  virtual StatusCode initialize();
+  virtual StatusCode finalize();
+  static const InterfaceID& interfaceID();
+  virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvIF);
+
+  std::string
+  addDefect(const std::string& defectlist,const int defectBeginChannel,const int defectEndChannel) const;
+
+  std::string
+  addNumber(const std::string numStr,const unsigned long long number) const;
+
+  std::string
+  createDefectString(const int defectBeginChannel,const int defectEndChannel) const;
+
+  StatusCode
+  createCondObjects(const Identifier& wafer_id, const SCT_ID* m_sctId, const int samplesize, const std::string& defectType, const float threshold, const std::string& defectList) const;
+
+  StatusCode createListStrip(const Identifier& wafer_id,
+                             const SCT_ID* m_sctId,
+                             const int samplesize,
+                             const std::string& defectType,
+                             const float threshold,
+                             const std::string& defectList) const;
+
+  StatusCode createListChip(const Identifier& wafer_id,
+                            const SCT_ID* m_sctId,
+                            const int samplesize,
+                            const std::string& defectType,
+                            const float threshold,
+                            const std::string& defectList) const;
+
+  StatusCode createListEff(const Identifier& wafer_id,
+                           const SCT_ID* m_sctId,
+                           const int samplesize,
+                           const float eff) const;
+
+  StatusCode createListNO(const Identifier& wafer_id,
+                          const SCT_ID* m_sctId,
+                          const int samplesize,
+                          const float noise_occ) const;
+
+  StatusCode createListRawOccu(const Identifier& wafer_id,
                                const SCT_ID* m_sctId,
                                const int samplesize,
-                               const float noise_occ ) const;
-
-      StatusCode createListRawOccu( const Identifier& wafer_id,
-                                    const SCT_ID* m_sctId,
-                                    const int samplesize,
-                                    const float raw_occu ) const;
-
-      StatusCode createListBSErr(const Identifier& wafer_id,
-                                 const SCT_ID* m_sctId,
-                                 const int samplesize,
-                                 const std::string & errorList,
-                                 const std::string & probList) const ;
-
-      StatusCode createListLA(const Identifier& wafer_id,
-                              const SCT_ID* m_sctId,
-                              const int samplesize,
-                              const int module,
-                              const float lorentz,
-                              const float err_lorentz,
-                              const float chisq,
-                              const float fitParam_a,
-                              const float err_a,
-                              const float fitParam_b,
-                              const float err_b,
-                              const float fitParam_sigma,
-                              const float err_sigma,
-                              const float MCW,
-                              const float err_MCW ) const;
-
-      StatusCode wrapUpNoisyChannel();
-      StatusCode wrapUpDeadStrips();
-      StatusCode wrapUpDeadChips();
-      StatusCode wrapUpEfficiency();
-      StatusCode wrapUpNoiseOccupancy();
-      StatusCode wrapUpRawOccupancy();
-      StatusCode wrapUpBSErrors();
-      StatusCode wrapUpLorentzAngle();
-
-   private:
-      StoreGateSvc* m_detStore;
-      SG::ReadHandleKey<EventInfo> m_eventInfoKey;
-
-      StatusCode registerIOV(const CLID& clid);
-      int stringToInt(const std::string& s) const;
-
-      StatusCode streamOutCondObjects(const std::string & foldername);
-      StatusCode streamOutCondObjectsWithErrMsg(const std::string & foldername);
-
-      StatusCode registerCondObjects(const std::string & foldername,const std::string & tagname);
-      StatusCode recordAndStream(const CondAttrListCollection* pCollection,const std::string & foldername, bool & flag);
-      StatusCode registerCondObjectsWithErrMsg(const std::string& foldername,const std::string& tagname);
-
-      coral::AttributeListSpecification* createBasicDbSpec(const bool capsFormat) const;
-      void setBasicValues(coral::AttributeList & attrList, const Identifier& wafer_id, const int samplesize,const SCT_ID* m_sctId, const bool capsFormat) const;
-      // small helper function
-      unsigned int computeIstrip4moncond(const Identifier& elementId) const;
-
-      const CondAttrListCollection* getAttrListCollectionByFolder(const std::string&) const;
-
-      // would it make sense to change the strings to properties?
-      // that would be a fairly simple fix
-      static const std::string s_separator;
-      static const std::string s_defectFolderName;
-      static const std::string s_deadStripFolderName;
-      static const std::string s_deadChipFolderName;
-      static const std::string s_effFolderName;
-      static const std::string s_noFolderName;
-      static const std::string s_RawOccuFolderName;
-      static const std::string s_BSErrFolderName;
-      static const std::string s_LAFolderName;
-
-      // cache for the Collections, access by foldername
-      mutable std::mutex m_mutex;
-      mutable std::map<const std::string, const CondAttrListCollection*>  m_attrListCollectionMap ATLAS_THREAD_SAFE; // Guarded by m_mutex
-      CondAttrListCollection*      m_attrListColl;
-      CondAttrListCollection*      m_attrListColl_deadStrip;
-      CondAttrListCollection*      m_attrListColl_deadChip;
-      CondAttrListCollection*      m_attrListColl_eff;
-      CondAttrListCollection*      m_attrListColl_no;
-      CondAttrListCollection*      m_attrListColl_RawOccu;
-      CondAttrListCollection*      m_attrListColl_BSErr;
-      CondAttrListCollection*      m_attrListColl_LA;
-      BooleanProperty              m_writeCondObjs;
-      BooleanProperty              m_regIOV;
-      BooleanProperty              m_readWriteCool;
-      BooleanProperty              m_twoStepWriteReg;
-      BooleanProperty              m_manualiov;
-      /*IntegerProperty              m_regTime;*/
-      IntegerProperty              m_version;
-      /*IntegerProperty              m_nhits_noisychip;*/
-      /*IntegerProperty              m_nhits_noisywafer;*/
-      /*IntegerProperty              m_nhits_noisymodule;*/
-      IntegerProperty              m_beginRun;
-      IntegerProperty              m_endRun;
-      StringProperty               m_streamName;
-      std::string                  m_tagID4NoisyStrips;
-      std::string                  m_tagID4DeadStrips;
-      std::string                  m_tagID4DeadChips;
-      std::string                  m_tagID4Efficiency;
-      std::string                  m_tagID4NoiseOccupancy;
-      std::string                  m_tagID4RawOccupancy;
-      std::string                  m_tagID4BSErrors;
-      std::string                  m_tagID4LorentzAngle;
-
-      IIOVRegistrationSvc*         m_regSvc;
-      IAthenaOutputStreamTool*     m_streamer;
-      //ToolHandle<IAthenaOutputStreamTool> m_streamer;
-
-      //StringArrayProperty          m_badElements; unused list of bad detector elements (= module sides)
-      std::set<Identifier>         m_badIds;
-      bool                         m_defectRecorded;
-      bool                         m_deadStripRecorded;
-      bool                         m_deadChipRecorded;
-      bool                         m_effRecorded;
-      bool                         m_noRecorded;
-      bool                         m_RawOccuRecorded;
-      bool                         m_BSErrRecorded;
-      bool                         m_LARecorded;
-      const SCT_ID*                m_pHelper;
+                               const float raw_occu) const;
+
+  StatusCode createListBSErr(const Identifier& wafer_id,
+                             const SCT_ID* m_sctId,
+                             const int samplesize,
+                             const std::string& errorList,
+                             const std::string& probList) const ;
+
+  StatusCode createListLA(const Identifier& wafer_id,
+                          const SCT_ID* m_sctId,
+                          const int samplesize,
+                          const int module,
+                          const float lorentz,
+                          const float err_lorentz,
+                          const float chisq,
+                          const float fitParam_a,
+                          const float err_a,
+                          const float fitParam_b,
+                          const float err_b,
+                          const float fitParam_sigma,
+                          const float err_sigma,
+                          const float MCW,
+                          const float err_MCW) const;
+
+  StatusCode wrapUpNoisyChannel();
+  StatusCode wrapUpDeadStrips();
+  StatusCode wrapUpDeadChips();
+  StatusCode wrapUpEfficiency();
+  StatusCode wrapUpNoiseOccupancy();
+  StatusCode wrapUpRawOccupancy();
+  StatusCode wrapUpBSErrors();
+  StatusCode wrapUpLorentzAngle();
+
+private:
+  SG::ReadHandleKey<EventInfo> m_eventInfoKey;
+
+  int stringToInt(const std::string& s) const;
+
+  StatusCode streamOutCondObjects(const std::string& foldername);
+  StatusCode streamOutCondObjectsWithErrMsg(const std::string& foldername);
+
+  StatusCode registerCondObjects(const std::string& foldername,const std::string& tagname) const;
+  StatusCode recordAndStream(const CondAttrListCollection* pCollection,const std::string& foldername, bool& flag);
+  StatusCode registerCondObjectsWithErrMsg(const std::string& foldername,const std::string& tagname) const;
+
+  coral::AttributeListSpecification* createBasicDbSpec(const bool capsFormat) const;
+  void setBasicValues(coral::AttributeList& attrList, const Identifier& wafer_id, const int samplesize,const SCT_ID* m_sctId, const bool capsFormat) const;
+  // small helper function
+  unsigned int computeIstrip4moncond(const Identifier& elementId) const;
+
+  const CondAttrListCollection* getAttrListCollectionByFolder(const std::string&) const;
+
+  // would it make sense to change the strings to properties?
+  // that would be a fairly simple fix
+  static const std::string s_separator;
+  static const std::string s_defectFolderName;
+  static const std::string s_deadStripFolderName;
+  static const std::string s_deadChipFolderName;
+  static const std::string s_effFolderName;
+  static const std::string s_noFolderName;
+  static const std::string s_RawOccuFolderName;
+  static const std::string s_BSErrFolderName;
+  static const std::string s_LAFolderName;
+
+  // cache for the Collections, access by foldername
+  mutable std::mutex m_mutex;
+  mutable std::map<const std::string, const CondAttrListCollection*>  m_attrListCollectionMap ATLAS_THREAD_SAFE; // Guarded by m_mutex
+  CondAttrListCollection*      m_attrListColl;
+  CondAttrListCollection*      m_attrListColl_deadStrip;
+  CondAttrListCollection*      m_attrListColl_deadChip;
+  CondAttrListCollection*      m_attrListColl_eff;
+  CondAttrListCollection*      m_attrListColl_no;
+  CondAttrListCollection*      m_attrListColl_RawOccu;
+  CondAttrListCollection*      m_attrListColl_BSErr;
+  CondAttrListCollection*      m_attrListColl_LA;
+  BooleanProperty              m_writeCondObjs;
+  BooleanProperty              m_regIOV;
+  BooleanProperty              m_readWriteCool;
+  BooleanProperty              m_twoStepWriteReg;
+  BooleanProperty              m_manualiov;
+  IntegerProperty              m_version;
+  IntegerProperty              m_beginRun;
+  IntegerProperty              m_endRun;
+  StringProperty               m_streamName;
+  std::string                  m_tagID4NoisyStrips;
+  std::string                  m_tagID4DeadStrips;
+  std::string                  m_tagID4DeadChips;
+  std::string                  m_tagID4Efficiency;
+  std::string                  m_tagID4NoiseOccupancy;
+  std::string                  m_tagID4RawOccupancy;
+  std::string                  m_tagID4BSErrors;
+  std::string                  m_tagID4LorentzAngle;
+
+  IIOVRegistrationSvc*         m_regSvc;
+  IAthenaOutputStreamTool*     m_streamer;
+
+  bool                         m_defectRecorded;
+  bool                         m_deadStripRecorded;
+  bool                         m_deadChipRecorded;
+  bool                         m_effRecorded;
+  bool                         m_noRecorded;
+  bool                         m_RawOccuRecorded;
+  bool                         m_BSErrRecorded;
+  bool                         m_LARecorded;
+  const SCT_ID*                m_pHelper;
 };
 
-inline const InterfaceID & SCTCalibWriteTool::interfaceID() {
-   static const InterfaceID IID("SCTCalibWriteTool",1,0);
-   return IID;
+inline const InterfaceID& SCTCalibWriteTool::interfaceID() {
+  static const InterfaceID IID{"SCTCalibWriteTool", 1, 0};
+  return IID;
 }
 
 #endif // SCTCalibWriteTool.h
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/SCT_LorentzAngleFunc.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/SCT_LorentzAngleFunc.h
index 6f71c74312ec83326c251f049ba22a5db0fefccf..5bb3931d9859ff29b214aa31300fe4802a838175 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/SCT_LorentzAngleFunc.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/SCT_LorentzAngleFunc.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 //For SCT Lorentz Angle
@@ -7,19 +7,19 @@
 #include "TMath.h"
 
 Double_t
-LA_func(Double_t *x, Double_t *par) {
-   const Int_t    n     = 1000; // number of integration step
-   const Double_t xmin = x[0] - 5.0*par[3];
-   const Double_t xmax = x[0] + 5.0*par[3];
-   const Double_t h    = (xmax - xmin)/(n - 1);
-   const Double_t pi = 3.14159265;
-   Double_t sum = 0;
-   Double_t x_  = xmin;
-   Double_t LA_sum = 0;
-   for (Int_t i=1; i<n; i++) {
-      LA_sum= par[0]*TMath::Abs(TMath::Tan(x_*pi/180)-TMath::Tan(par[1]*pi/180))+par[2];
-      sum  += LA_sum * 0.017455/TMath::Sqrt(2*pi)/(par[3]*pi/180)*TMath::Exp(-(x[0]*pi/180 - x_*pi/180 )*(x[0]*pi/180 - x_*pi/180 )/(2*par[3]*pi/180*par[3]*pi/180))*h;
-      x_ += h;
-   }
-   return   sum;
+LA_func(Double_t* x, Double_t* par) {
+  const Int_t n{1000}; // number of integration step
+  const Double_t xmin{x[0] - 5.0*par[3]};
+  const Double_t xmax{x[0] + 5.0*par[3]};
+  const Double_t h{(xmax - xmin)/(n - 1)};
+  Double_t sum{0.};
+  Double_t x_{xmin};
+  Double_t LA_sum{0.};
+  for (Int_t i{1}; i<n; i++) {
+    LA_sum = par[0]*TMath::Abs(TMath::Tan(x_*TMath::Pi()/180.)-TMath::Tan(par[1]*TMath::Pi()/180.))+par[2];
+    sum += LA_sum * 0.017455/TMath::Sqrt(2.*TMath::Pi())/(par[3]*TMath::Pi()/180.)
+      * TMath::Exp(-(x[0]*TMath::Pi()/180. - x_*TMath::Pi()/180. )*(x[0]*TMath::Pi()/180. - x_*TMath::Pi()/180. )/(2*par[3]*TMath::Pi()/180.*par[3]*TMath::Pi()/180.)) * h;
+    x_ += h;
+  }
+  return sum;
 }
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/IElementStreamer.cxx b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/IElementStreamer.cxx
index 8531a1de42237a2612c90217a262c225b083656d..5cccb7a98aaab4790b6b959ff6ae320dc1516e74 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/IElementStreamer.cxx
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/IElementStreamer.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 /*
  *  IElementStreamer.cpp
@@ -12,33 +12,34 @@
 
 namespace SCT_CalibAlgs {
 
-IElementStreamer::IElementStreamer(const std::string & name, const std::map<std::string, std::string> & attributeMap, std::ostream & os):
-  m_name(name), m_os(os), m_depth(0), m_nodeIndex(0), m_nodeId(m_nodeIndex) {
-   std::map<std::string, std::string>::const_iterator i(attributeMap.begin());
-   std::map<std::string, std::string>::const_iterator end(attributeMap.end());
-   for(; i!=end; ++i) {
+  IElementStreamer::IElementStreamer(const std::string& name, const std::map<std::string, std::string>& attributeMap, std::ostream& os):
+    m_name{name}, m_os{os}, m_depth{0}, m_nodeIndex{0}, m_nodeId{m_nodeIndex} {
+    std::map<std::string, std::string>::const_iterator i{attributeMap.begin()};
+    std::map<std::string, std::string>::const_iterator end{attributeMap.end()};
+    for (; i!=end; ++i) {
       m_attributeNames.push_back(i->first);
       m_attributeValues.push_back(i->second);
-   }
-   ++m_depth;
-   ++m_nodeIndex;
-}
+    }
+    ++m_depth;
+    ++m_nodeIndex;
+  }
+  
+  IElementStreamer::IElementStreamer(const std::string& name, const std::vector<std::string>& attributeNames, const std::vector<std::string>& attributeValues, std::ostream& os):
+    m_name{name}, m_attributeNames{attributeNames}, m_attributeValues{attributeValues}, m_os{os}, m_nodeId{m_nodeIndex} {
+    ++m_depth;
+    ++m_nodeIndex;
+    } 
 
-IElementStreamer::IElementStreamer(const std::string & name, const std::vector<std::string> & attributeNames, const std::vector<std::string> & attributeValues, std::ostream & os):
-   m_name(name), m_attributeNames(attributeNames), m_attributeValues(attributeValues),m_os(os),m_nodeId(m_nodeIndex) {
-   ++m_depth;
-   ++m_nodeIndex;
-}
+  IElementStreamer::IElementStreamer(const std::string& name, const std::string& attributeName, const std::string& attributeValue, std::ostream& os):
+    m_name{name}, m_os{os}, m_nodeId{m_nodeIndex} {
+    m_attributeNames.push_back(attributeName);
+    m_attributeValues.push_back(attributeValue);
+    ++m_depth;
+    ++m_nodeIndex;
+  }
 
-IElementStreamer::IElementStreamer(const std::string & name, const std::string & attributeName, const std::string & attributeValue, std::ostream & os):m_name(name),m_os(os), m_nodeId(m_nodeIndex) {
-   m_attributeNames.push_back(attributeName);
-   m_attributeValues.push_back(attributeValue);
-   ++m_depth;
-   ++m_nodeIndex;
-}
-
-IElementStreamer::~IElementStreamer() {
-   --m_depth;
-}
+  IElementStreamer::~IElementStreamer() {
+    --m_depth;
+  }
 
 }
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/IElementStreamer.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/IElementStreamer.h
index a1708e2aa281d11b960b38ae3fd985000397c80d..67c2db5b67d353654de15e890c189f33c5d34a59 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/IElementStreamer.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/IElementStreamer.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 /*
  *  IElementStreamer.h
@@ -16,27 +16,27 @@
 #include <vector>
 namespace SCT_CalibAlgs {
 
-class IElementStreamer {
+  class IElementStreamer {
 
-   protected:
-      std::string m_name;
-      std::vector<std::string> m_attributeNames;
-      std::vector<std::string> m_attributeValues;
-      std::ostream & m_os;
-      unsigned int m_depth;
-      unsigned int m_nodeIndex;
-      unsigned int m_nodeId;
+  protected:
+    std::string m_name;
+    std::vector<std::string> m_attributeNames;
+    std::vector<std::string> m_attributeValues;
+    std::ostream& m_os;
+    unsigned int m_depth;
+    unsigned int m_nodeIndex;
+    unsigned int m_nodeId;
 
-   public:
-      IElementStreamer(const std::string & name, const std::map<std::string, std::string> & attributeMap, std::ostream & os=std::cout);
-      IElementStreamer(const std::string & name, const std::string & attributeName, const std::string & attributeValue, std::ostream & os=std::cout);
-      IElementStreamer(const std::string & name, const std::vector<std::string> & attributeNames, const std::vector<std::string> & attributeValues, std::ostream & os=std::cout);
-      ~IElementStreamer();
-      template<class T>
-      void value(const T & v) {
-         m_os<<v;
-      }
-};
+  public:
+    IElementStreamer(const std::string& name, const std::map<std::string, std::string>& attributeMap, std::ostream& os=std::cout);
+    IElementStreamer(const std::string& name, const std::string& attributeName, const std::string& attributeValue, std::ostream& os=std::cout);
+    IElementStreamer(const std::string& name, const std::vector<std::string>& attributeNames, const std::vector<std::string>& attributeValues, std::ostream& os=std::cout);
+    ~IElementStreamer();
+    template<class T>
+      void value(const T& v) {
+      m_os<<v;
+    }
+  };
 
 }
 #endif
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/ISCT_CalibHistoTool.cxx b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/ISCT_CalibHistoTool.cxx
index dcf0375ba0c41d9201bea6f2df19fc518aed8c8d..9670b6aabe97f84337b97c54ff345361502f41d5 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/ISCT_CalibHistoTool.cxx
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/ISCT_CalibHistoTool.cxx
@@ -7,7 +7,7 @@
  * @file ISCT_CalibHistoTool.cxx
  * Implementation file to interface class for histograms in the SCT_CalibAlgs package
  * @author Shaun Roe
-**/
+ **/
 #include "SCT_CalibAlgs/ISCT_CalibHistoTool.h"
 #include "TH1I.h"
 #include "TH1F.h"
@@ -15,84 +15,80 @@
 #include "TMath.h"
 #include <stdexcept> // out_of_range exception
 
-ISCT_CalibHistoTool::ISCT_CalibHistoTool():m_numberOfEventsHisto(0),m_thistSvc(0),m_pSCTHelper(0),
-                                           m_nLb(0), m_nLbMerge(0) {
-   //std::cout<<"Instantiation of ISCT_CalibHistoTool"<<std::endl;
-   //nop
+ISCT_CalibHistoTool::ISCT_CalibHistoTool():
+  m_numberOfEventsHisto{0},
+  m_thistSvc{nullptr},
+  m_pSCTHelper{nullptr},
+  m_nLb{0},
+  m_nLbMerge{0} {
+  //nop
 }
 
 int
 ISCT_CalibHistoTool::getNumberOfEventsInBin(const int nbin) const {
-   if (m_numberOfEventsHisto) return m_numberOfEventsHisto->GetBinContent(nbin);
-   std::cout << "ERROR: a histogram pointer, m_numberOfEventsHisto, is zero" << std::endl;
-   return 0;
+  if (m_numberOfEventsHisto) return m_numberOfEventsHisto->GetBinContent(nbin);
+  std::cout << "ERROR: a histogram pointer, m_numberOfEventsHisto, is zero" << std::endl;
+  return 0;
 }
 
 int
 ISCT_CalibHistoTool::size() const {
-   return m_numberOfEventsHisto->GetEntries();
+  return m_numberOfEventsHisto->GetEntries();
 }
 
-
 int
 ISCT_CalibHistoTool::size(const int histogramIndex) const {
-   TH1F* pHisto=0;
-   int result=0;
-   try {
-      pHisto=m_phistoVector.at(histogramIndex);
-      result = pHisto->GetEntries();
-   } catch (const std::out_of_range& outOfRange) {
-      //do nothing, result is zero if the vector<>.at() throws
-   }
-   return result;
+  TH1F* pHisto{nullptr};
+  int result{0};
+  try {
+    pHisto = m_phistoVector.at(histogramIndex);
+    result = pHisto->GetEntries();
+  } catch (const std::out_of_range& outOfRange) {
+    //do nothing, result is zero if the vector<>.at() throws
+  }
+  return result;
 }
 
 double
 ISCT_CalibHistoTool::getBinForHistogramIndex(const int bin, const int histogramIndex) const {
-   TH1F* pHisto=0;
-   double result=0.0;
-   try {
-      pHisto=m_phistoVector.at(histogramIndex);
-      result = pHisto->GetBinContent(bin);
-   } catch (const std::out_of_range& outOfRange) {
-      //do nothing, result is zero if the vector<>.at() throws
-   }
-   return result;
+  TH1F* pHisto{nullptr};
+  double result{0.0};
+  try {
+    pHisto = m_phistoVector.at(histogramIndex);
+    result = pHisto->GetBinContent(bin);
+  } catch (const std::out_of_range& outOfRange) {
+    //do nothing, result is zero if the vector<>.at() throws
+  }
+  return result;
 }
 
 void
-//ISCT_CalibHistoTool::binHistograms(const int eventsPerWindow){
 ISCT_CalibHistoTool::binHistograms(const int nLbMerged) {
+  int nLb{numberOfLb()};
+  int yAxisBins{static_cast<int>(TMath::Ceil(1.0*nLb/nLbMerged))};
 
-   int nLb = numberOfLb();
-   int yAxisBins = TMath::Ceil(1.0*nLb/nLbMerged);
-   //  int totalEventNumber = m_numberOfEventsHisto->GetEntries();
-
-   //  int yAxisBins = TMath::Ceil(1.0*totalEventNumber/eventsPerWindow);
-   for (std::vector<TH2F *>::iterator it = m_phistoVector2D.begin() ; it != m_phistoVector2D.end(); ++it) {
-      (*it)->SetBins(768, -0.5, 768+0.5,yAxisBins,0.5,nLbMerged*yAxisBins+0.5);
-   }
-   //   std::cout<<eventsPerWindow<<std::endl;
+  for (std::vector<TH2F*>::iterator it{m_phistoVector2D.begin()}; it != m_phistoVector2D.end(); ++it) {
+    (*it)->SetBins(768, -0.5, 768+0.5, yAxisBins, 0.5, nLbMerged*yAxisBins+0.5);
+  }
 
 }
 
 void
 ISCT_CalibHistoTool::setNumberOfLb(const int nLb) {
-   m_nLb=nLb;
+  m_nLb=nLb;
 }
 
 int
-ISCT_CalibHistoTool::numberOfLb() {
-   return m_nLb;
+ISCT_CalibHistoTool::numberOfLb() const {
+  return m_nLb;
 }
 
 void
 ISCT_CalibHistoTool::setLbToMerge(const int nLbMerge) {
-   m_nLbMerge=nLbMerge;
+  m_nLbMerge = nLbMerge;
 }
 
 int
-ISCT_CalibHistoTool::LbToMerge() {
-   return m_nLbMerge;
+ISCT_CalibHistoTool::LbToMerge() const {
+  return m_nLbMerge;
 }
-
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalib.cxx b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalib.cxx
index a9537e5ab47c1bd87b221d3f973dad26d5dac638..c8b5ddfbe8eaeabe3a040526fbeac5bbac32c5d7 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalib.cxx
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalib.cxx
@@ -4,29 +4,24 @@
 
 
 /**
-* @file SCTCalib.cxx
-*
-* Find noisy strips, HV trips and dead strips/chips
-* Upload NoiseOccupancy and BSErrors from monitoring histograms
-*
-* @author Jose E. Garcia,  jose.enrique.garcia@cern.ch
-* @author Peter Vankov,    peter.vankov@cern.ch
-* @author Kazu Hanagaki,   kazunori.hanagaki@cern.ch
-* @author Minoru Hirose,   minoru.hirose@cern.ch
-* @author Tim Andeen,      timothy.robert.andeen@cern.ch
-* @author Junji Tojo,      junji.tojo@cern.ch
-* @author Peter Rosendahl, peter.lundgaard.rosendahl@cern.ch
-**/
+ * @file SCTCalib.cxx
+ *
+ * Find noisy strips, HV trips and dead strips/chips
+ * Upload NoiseOccupancy and BSErrors from monitoring histograms
+ *
+ * @author Jose E. Garcia,  jose.enrique.garcia@cern.ch
+ * @author Peter Vankov,    peter.vankov@cern.ch
+ * @author Kazu Hanagaki,   kazunori.hanagaki@cern.ch
+ * @author Minoru Hirose,   minoru.hirose@cern.ch
+ * @author Tim Andeen,      timothy.robert.andeen@cern.ch
+ * @author Junji Tojo,      junji.tojo@cern.ch
+ * @author Peter Rosendahl, peter.lundgaard.rosendahl@cern.ch
+ **/
 
 #include "SCT_CalibAlgs/SCTCalib.h"
 #include "SCT_CalibAlgs/SCT_LorentzAngleFunc.h"
-#include "SCT_CalibUtilities.h"
-#include "SCT_CalibBsErrorTool.h"
-#include "SCT_CalibLbTool.h"
-#include "SCT_CalibModuleListTool.h"
-#include "SCT_CalibEventInfo.h"
-#include "SCT_CalibHitmapTool.h"
 
+#include "SCT_CalibUtilities.h"
 #include "XmlHeader.h"
 #include "XmlStreamer.h"
 
@@ -57,274 +52,267 @@ using namespace SCT_CalibAlgs;
 using namespace std;
 
 namespace {
-enum Bec { ENDCAP_C = -2, BARREL = 0, ENDCAP_A = 2 };
-// String names for the detector parts
-const std::string detectorNames[] = { "negativeEndcap", "Barrel", "positiveEndcap" };
-// String names for the detector parts
-const std::string shortNames[] = { "EndCapC", "Barrel", "EndCapA" };
-// Path names to become part of the histogram paths
-const std::string detectorPaths[] = { "SCTEC", "SCTB", "SCTEA" };
-
-bool areConsecutiveIntervals(const std::pair<int, int> &i1, const std::pair<int, int> &i2, const int withinLimits) {
-   return i1.second <= (i2.first + withinLimits);
-}
-/**
-void
-initQueue(std::queue<int> & q, const int numvals, const int setval){
-  for (int i(0);i<numvals;++i) q.push(setval);
-}
-**/
-const std::string xmlHeader("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
-const std::string linefeed("\n");
-std::string
-associateStylesheet(const std::string &stylesheetName) {
-   return std::string("<?xml-stylesheet type=\"text/xsl\" href=\"")+stylesheetName+"\"?>";
-}
-template <class T>
-std::string
-xmlPartData(const Bec bec, const int layer, const int eta, const std::string & dataName, const T data) {
-   //agrohsje added spaces for proper output format
-   ostringstream os;
-   const std::string thisPart=shortNames[bec2Index(bec)];
-   os<<"    <parts>"<<endl
-     <<"    "<<xmlValue("part",thisPart)<<endl
-     <<"    "<<xmlValue("layer", layer)<<endl
-     <<"    ";
-   std::string barrelEtaXml=xmlValue("eta", "all");
-   std::string endcapEtaXml=xmlValue("eta",eta);
-   if (bec==BARREL) os<<barrelEtaXml;
-   else            os<<endcapEtaXml;
-   os<<endl
-     <<"    "<<xmlValue(dataName, data)<<endl
-     <<"    </parts>"<<endl;
-   return os.str();
-}
-
-template <class T>
-std::string
-xmlModuleData(const Bec bec, const int layer, const int side, const int phi, const int eta, const std::string & dataName, const T data, const std::string & serial,const std::string & listOfErrors) {
-   //xmlModuleData(const Bec bec, const int layer, const int side, const int phi, const int eta, const std::string & dataName, const T data, const std::string & serial, const ostringstream listOfErrors){
-   //agasconb added to generate BSErrors file for individual modules
-   ostringstream os;
-   os<<"    <module>"<<endl
-     <<"    "<<xmlValue("SN", serial)<<endl;
-
-   if (bec==ENDCAP_C) os<<"    "<<xmlValue("barrel_endcap","-2")<<endl;
-   else if (bec==BARREL) os<<"    "<<xmlValue("barrel_endcap","0")<<endl;
-   else if (bec==ENDCAP_A) os<<"    "<<xmlValue("barrel_endcap","2")<<endl;
-   os<<"    "<<xmlValue("layer", layer)<<endl
-     <<"    "<<xmlValue("side", side)<<endl
-     <<"    "<<xmlValue("eta", eta)<<endl
-     <<"    "<<xmlValue("phi", phi)<<endl
-     <<"    "<<xmlValue(dataName, data)<<endl;
-   os<<listOfErrors;
-   os<<"    </module>"<<endl;
-   return os.str();
-}
-
-std::string
-normalizeList( const std::string& strList ) {
-   std::string str = strList;
-   if ( !str.empty() ) {
+  enum Bec {ENDCAP_C = -2, BARREL = 0, ENDCAP_A = 2};
+  // String names for the detector parts
+  const std::string detectorNames[] = {"negativeEndcap", "Barrel", "positiveEndcap"};
+  // String names for the detector parts
+  const std::string shortNames[] = {"EndCapC", "Barrel", "EndCapA"};
+  // Path names to become part of the histogram paths
+  const std::string detectorPaths[] = {"SCTEC", "SCTB", "SCTEA"};
+
+  bool areConsecutiveIntervals(const std::pair<int, int>& i1, const std::pair<int, int>& i2, const int withinLimits) {
+    return i1.second <= (i2.first + withinLimits);
+  }
+  const std::string xmlHeader{"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"};
+  const std::string linefeed{"\n"};
+  std::string
+  associateStylesheet(const std::string& stylesheetName) {
+    return std::string("<?xml-stylesheet type=\"text/xsl\" href=\"")+stylesheetName+"\"?>";
+  }
+  template <class T>
+  std::string
+  xmlPartData(const Bec bec, const int layer, const int eta, const std::string& dataName, const T data) {
+    //agrohsje added spaces for proper output format
+    ostringstream os;
+    const std::string thisPart{shortNames[bec2Index(bec)]};
+    os << "    <parts>" << endl
+       << "    " << xmlValue("part", thisPart) << endl
+       << "    " << xmlValue("layer", layer) << endl
+       << "    ";
+    std::string barrelEtaXml{xmlValue("eta", "all")};
+    std::string endcapEtaXml{xmlValue("eta", eta)};
+    if (bec==BARREL) os << barrelEtaXml;
+    else             os << endcapEtaXml;
+    os << endl
+       << "    " << xmlValue(dataName, data) << endl
+       << "    </parts>" << endl;
+    return os.str();
+  }
+
+  template <class T>
+  std::string
+  xmlModuleData(const Bec bec, const int layer, const int side, const int phi, const int eta, const std::string& dataName, const T data, const std::string& serial, const std::string& listOfErrors) {
+    //agasconb added to generate BSErrors file for individual modules
+    ostringstream os;
+    os << "    <module>" << endl
+       << "    " << xmlValue("SN", serial) << endl;
+
+    if (bec==ENDCAP_C) os << "    " << xmlValue("barrel_endcap", "-2") << endl;
+    else if (bec==BARREL) os << "    " << xmlValue("barrel_endcap", "0") << endl;
+    else if (bec==ENDCAP_A) os << "    " << xmlValue("barrel_endcap", "2") << endl;
+    os << "    " << xmlValue("layer", layer) << endl
+       << "    " << xmlValue("side", side) << endl
+       << "    " << xmlValue("eta", eta) << endl
+       << "    " << xmlValue("phi", phi) << endl
+       << "    " << xmlValue(dataName, data) << endl;
+    os << listOfErrors;
+    os << "    </module>" << endl;
+    return os.str();
+  }
+
+  std::string
+  normalizeList(const std::string& strList) {
+    std::string str{strList};
+    if (!str.empty()) {
       //--- Remove 1st & last space
-      str = str.substr( 1, str.length()-2 );
+      str = str.substr(1, str.length()-2);
       //--- Replace double space to single space
-      std::string strSingleSpace = " ";
-      std::string strDoubleSpace = "  ";
-      std::string::size_type pos = 0;
-      while ( pos =str.find( strDoubleSpace, pos), pos != std::string::npos ) {
-         str.erase( pos, strSingleSpace.length() );
-         pos += strSingleSpace.length();
-      }
-   }
-   return str;
-}
+      std::string strSingleSpace{" "};
+      std::string strDoubleSpace{"  "};
+      std::string::size_type pos{0};
+      while (pos =str.find(strDoubleSpace, pos), pos != std::string::npos) {
+        str.erase(pos, strSingleSpace.length());
+        pos += strSingleSpace.length();
+      }
+    }
+    return str;
+  }
 }
 
 //////////////////////////////////////////////////////////////////////////////////////
 // Constructor
 //////////////////////////////////////////////////////////////////////////////////////
 
-SCTCalib::SCTCalib( const std::string& name, ISvcLocator* pSvcLocator ) :
-   AthAlgorithm( name, pSvcLocator ),
-   m_pSCTHelper(nullptr),
-   m_numOfLBsProcessed(0),
-   m_numberOfEvents(0),
-   m_numberOfEventsHist(0),
-   m_LBRange(-999),
-   m_inputHist(nullptr)
+SCTCalib::SCTCalib(const std::string& name, ISvcLocator* pSvcLocator) :
+  AthAlgorithm(name, pSvcLocator), 
+  m_pSCTHelper{nullptr}, 
+          m_numOfLBsProcessed{0}, 
+          m_numberOfEvents{0}, 
+          m_numberOfEventsHist{0}, 
+          m_LBRange{-999}, 
+          m_inputHist{nullptr}
 {
-   m_readHIST = m_doNoiseOccupancy || m_doRawOccupancy || m_doEfficiency || m_doBSErrorDB || m_doLorentzAngle;
+  m_readHIST = m_doNoiseOccupancy or m_doRawOccupancy or m_doEfficiency or m_doBSErrorDB or m_doLorentzAngle;
 }
 
 ////////////////////////////////////////////////////////////////////////////////////
 // Initialization
 ////////////////////////////////////////////////////////////////////////////////////
 StatusCode SCTCalib::initialize() {
-   if ( detStore()->retrieve( m_pSCTHelper, "SCT_ID").isFailure()) {
-      ATH_MSG_ERROR("Unable to retrieve SCTHelper");
-      return StatusCode::FAILURE;
-   }
-
-   if ( not retrievedService(m_pCalibWriteTool)) return StatusCode::FAILURE;
-   if ( m_doHV) ATH_MSG_FATAL("Not yet properly implemented and tested!");
-
-   ATH_CHECK(m_ConfigurationConditionsTool.retrieve( EnableTool {m_useConfiguration} ) );
-
-   if ( !m_useCalibration ) {
-      ATH_MSG_DEBUG( "ReadCalibDataTool was removed in initialization" );
-      m_ReadCalibDataTool.disable();
-   } else {
-      if (m_ReadCalibDataTool.retrieve().isFailure()) return StatusCode::FAILURE;
-   }
-
-   if ( !m_useMajority ) {
-      ATH_MSG_DEBUG( "MajorityConditionsTool was removed in initialization" );
-   } else {
-      if (m_MajorityConditionsTool.retrieve().isFailure()) return StatusCode::FAILURE;
-   }
-
-   if ( not retrievedService(m_calibHitmapTool)) return StatusCode::FAILURE;
-
-   if ( not retrievedService(m_calibModuleListTool)) return StatusCode::FAILURE;
-
-   if ( not retrievedService(m_calibEvtInfoTool)) return StatusCode::FAILURE;
-
-   if ( !m_useBSError ) {
-      ATH_MSG_DEBUG( "ByteStreamErrorsSvc was removed in initialization" );
-   } else {
-      if ( not retrievedService(m_calibBsErrTool)) return StatusCode::FAILURE;
-   }
-   if ( not retrievedService(m_calibLbTool) ) return StatusCode::FAILURE;
-
-   ATH_CHECK(m_CablingTool.retrieve());
-
-   //--- LB range
-   try {
-      m_LBRange = std::stoi( m_LBMax );
-      m_calibHitmapTool->setNumberOfLb(m_LBRange);
-      m_calibLbTool->setNumberOfLb(m_LBRange);
-      m_calibBsErrTool->setNumberOfLb(m_LBRange);
-   } catch (...) {
-      ATH_MSG_ERROR( "Couldn't cast m_LBMax=\""<< m_LBMax <<"\" to m_LBRange...");
-      m_LBRange = 0;
-   }
-
-   m_calibHitmapTool->setLbToMerge(m_nLbsMerged);
-   m_calibLbTool->setLbToMerge(m_nLbsMerged);
-   m_calibBsErrTool->setLbToMerge(m_nLbsMerged);
-
-   m_readHIST = m_doNoiseOccupancy || m_doRawOccupancy || m_doEfficiency || m_doBSErrorDB || m_doLorentzAngle;
-
-   if ( m_readBS  && m_readHIST ) {
-      ATH_MSG_ERROR( "Both BS and HIST are set to be read. Choose either of BS or HIST." );
+  if (detStore()->retrieve(m_pSCTHelper, "SCT_ID").isFailure()) {
+    ATH_MSG_ERROR("Unable to retrieve SCTHelper");
+    return StatusCode::FAILURE;
+  }
+
+  if (not retrievedService(m_pCalibWriteTool)) return StatusCode::FAILURE;
+  if (m_doHV) ATH_MSG_FATAL("Not yet properly implemented and tested!");
+
+  ATH_CHECK(m_ConfigurationConditionsTool.retrieve(EnableTool {m_useConfiguration}));
+
+  if (not m_useCalibration) {
+    ATH_MSG_DEBUG("ReadCalibDataTool was removed in initialization");
+    m_ReadCalibDataTool.disable();
+  } else {
+    if (m_ReadCalibDataTool.retrieve().isFailure()) return StatusCode::FAILURE;
+  }
+
+  if (not m_useMajority) {
+    ATH_MSG_DEBUG("MajorityConditionsTool was removed in initialization");
+  } else {
+    if (m_MajorityConditionsTool.retrieve().isFailure()) return StatusCode::FAILURE;
+  }
+
+  if (not retrievedService(m_calibHitmapTool)) return StatusCode::FAILURE;
+
+  if (not retrievedService(m_calibModuleListTool)) return StatusCode::FAILURE;
+
+  if (not retrievedService(m_calibEvtInfoTool)) return StatusCode::FAILURE;
+
+  if (not m_useBSError) {
+    ATH_MSG_DEBUG("ByteStreamErrorsSvc was removed in initialization");
+  } else {
+    if (not retrievedService(m_calibBsErrTool)) return StatusCode::FAILURE;
+  }
+  if (not retrievedService(m_calibLbTool)) return StatusCode::FAILURE;
+
+  ATH_CHECK(m_CablingTool.retrieve());
+
+  //--- LB range
+  try {
+    m_LBRange = std::stoi(m_LBMax);
+    m_calibHitmapTool->setNumberOfLb(m_LBRange);
+    m_calibLbTool->setNumberOfLb(m_LBRange);
+    m_calibBsErrTool->setNumberOfLb(m_LBRange);
+  } catch (...) {
+    ATH_MSG_ERROR("Couldn't cast m_LBMax=\"" << m_LBMax << "\" to m_LBRange...");
+    m_LBRange = 0;
+  }
+
+  m_calibHitmapTool->setLbToMerge(m_nLbsMerged);
+  m_calibLbTool->setLbToMerge(m_nLbsMerged);
+  m_calibBsErrTool->setLbToMerge(m_nLbsMerged);
+
+  m_readHIST = m_doNoiseOccupancy or m_doRawOccupancy or m_doEfficiency or m_doBSErrorDB or m_doLorentzAngle;
+
+  if (m_readBS and m_readHIST) {
+    ATH_MSG_ERROR("Both BS and HIST are set to be read. Choose either of BS or HIST.");
+    return StatusCode::FAILURE;
+  }
+
+  //--- Open BS
+  if (m_readBS) {
+    ATH_MSG_INFO("------------> Reading from ByteStream <-------------");
+    m_calibEvtInfoTool->setSource("BS");
+    ATH_CHECK(m_eventInfoKey.initialize());
+  }
+
+
+  //--- Open HIST
+  if (m_readHIST) {
+    ATH_MSG_INFO("------------> Reading from HIST <-------------");
+    m_calibEvtInfoTool->setSource("HIST");
+    //--- List of HIST
+    std::string hist{""};
+    std::vector<std::string> histCollection{m_input_hist.value()};
+    ATH_MSG_INFO("The input histogram name is : " << m_input_hist);
+    if (not histCollection.empty()) {
+      hist=histCollection.back();
+      if (histCollection.size() > 1) ATH_MSG_WARNING("The Histogram collection contains more than one histogram; using the last one.");
+    } else {
+      ATH_MSG_ERROR("The input histogram collection property is empty");
       return StatusCode::FAILURE;
-   }
-
-   //--- Open BS
-   if ( m_readBS ) {
-      ATH_MSG_INFO( "------------> Reading from ByteStream <-------------");
-      m_calibEvtInfoTool->setSource("BS");
-      ATH_CHECK(m_eventInfoKey.initialize());
-   }
-
-
-   //--- Open HIST
-   if ( m_readHIST ) {
-      ATH_MSG_INFO( "------------> Reading from HIST <-------------" );
-      m_calibEvtInfoTool->setSource("HIST");
-      //--- List of HIST
-      std::string hist("");
-      std::vector<std::string> histCollection = m_input_hist.value();
-      ATH_MSG_INFO( "The input histogram name is : " << m_input_hist );
-      if (not histCollection.empty()) {
-         hist=histCollection.back();
-         if (histCollection.size() > 1) ATH_MSG_WARNING("The Histogram collection contains more than one histogram; using the last one.");
-      } else {
-         ATH_MSG_ERROR("The input histogram collection property is empty");
-         return StatusCode::FAILURE;
-      }
-
-      //in case of DeadStrip or DeadChip, change open from EOS to
-      //copy and open locally. Delete the file after processing
-      m_inputHist = TFile::Open( hist.c_str() );
-
-      ATH_MSG_INFO( "opening HIST file : " << hist.c_str() );
-
-      if (m_inputHist) {
-         //--- Check run number
-         const std::string os=std::to_string(m_runNumber.value());
-         ATH_MSG_INFO( "Getting HIST directory : " << m_runNumber.value() );
-         if ( not m_inputHist->GetDirectory( "/run_"+TString(os) ) ) {
-           ATH_MSG_ERROR("RunNumber in HIST is inconsistent with jobO : " << os);
-           return StatusCode::FAILURE ;
-         }
-         ATH_MSG_INFO( "Getting Number of events: " << m_calibEvtInfoTool->counter() );
-         //--- Read number of events : Get an entry of "tier0ESD" in "/GLOBAL/DQTDataFlow/events_lb"
-         std::string osHist= std::string( "/run_") + std::to_string(m_runNumber.value())+"/GLOBAL/DQTDataFlow/events_lb";
-         TH1I* hist_events = dynamic_cast<TH1I*>(m_inputHist->Get( osHist.c_str() ));
-         m_numberOfEventsHist = hist_events->GetBinContent( 6 ); // Entry in "tier0ESD"
-         if ( hist_events->GetBinContent( 4 ) > m_numberOfEventsHist) m_numberOfEventsHist = hist_events->GetBinContent( 4 ); // Entry in "tier0"
-         //m_numberOfEventsHist = 13902;
-      } else {
-         ATH_MSG_WARNING( "can not open HIST : " << hist.c_str() );
-      }
-
-
-      ATH_MSG_INFO( "Initialization of TimeStamp/LB, taken from runInfo.txt" );
-      //--- Initialization of TimeStamp/LB, taken from runInfo.txt
-      m_calibEvtInfoTool->setSource("HIST");
-      m_calibEvtInfoTool->setTimeStamp(m_runStartTime,m_runEndTime);
-      m_calibEvtInfoTool->setRunNumber(m_runNumber);
-   }
-
-   //--- Booking histograms for hitmaps
-   if ( m_doHitMaps ) m_calibHitmapTool->book();
-   //--- Reading histograms for hitmaps
-   if ( ( not m_doHitMaps && not m_doNoisyLB) && m_readHitMaps) {
-      m_calibEvtInfoTool->setSource("HIST");
-      m_calibHitmapTool->read("./SCTHitMaps.root");
-      m_numberOfEventsHist = m_calibHitmapTool->size();
-      m_calibEvtInfoTool->setTimeStamp(m_runStartTime,m_runEndTime);
-      m_calibEvtInfoTool->setRunNumber(m_runNumber);
-      m_calibLbTool->read("./SCTLB.root");
-   }
-   //--- Booking histograms for BSErrors
-   if ( m_doBSErrors ) m_calibBsErrTool->book();
-   //--- Hit-vs-LB for LBs in noisy links/chips
-   if ( m_doNoisyLB ) m_calibLbTool->book();
-
-   //--- Check statistics for NoiseOccupancy
-   if ( m_doNoiseOccupancy and notEnoughStatistics(m_noiseOccupancyMinStat, m_numberOfEventsHist)) return StatusCode::FAILURE;
-   //--- Check statistics for RawOccupancy
-   if ( m_doRawOccupancy and notEnoughStatistics(m_rawOccupancyMinStat,m_numberOfEventsHist)) return StatusCode::FAILURE;
-   //--- Check statistics for Efficiency
-   if ( m_doEfficiency and notEnoughStatistics(m_efficiencyMinStat,m_numberOfEventsHist)) return StatusCode::FAILURE;
-   //--- Check statistics for BSError
-   if ( m_doBSErrorDB and notEnoughStatistics(m_BSErrorDBMinStat, m_numberOfEventsHist )) return StatusCode::FAILURE;
-   //--- Check statistics for LorentzAngle
-   if ( m_doLorentzAngle and notEnoughStatistics(m_LorentzAngleMinStat, m_numberOfEventsHist)) return StatusCode::FAILURE;
-   //
-   return StatusCode::SUCCESS;
+    }
+
+    //in case of DeadStrip or DeadChip, change open from EOS to
+    //copy and open locally. Delete the file after processing
+    m_inputHist = TFile::Open(hist.c_str());
+
+    ATH_MSG_INFO("opening HIST file : " << hist.c_str());
+
+    if (m_inputHist) {
+      //--- Check run number
+      const std::string os{std::to_string(m_runNumber.value())};
+      ATH_MSG_INFO("Getting HIST directory : " << m_runNumber.value());
+      if (not m_inputHist->GetDirectory("/run_"+TString{os})) {
+        ATH_MSG_ERROR("RunNumber in HIST is inconsistent with jobO : " << os);
+        return StatusCode::FAILURE ;
+      }
+      ATH_MSG_INFO("Getting Number of events: " << m_calibEvtInfoTool->counter());
+      //--- Read number of events : Get an entry of "tier0ESD" in "/GLOBAL/DQTDataFlow/events_lb"
+      std::string osHist{std::string{"/run_"} + std::to_string(m_runNumber.value())+"/GLOBAL/DQTDataFlow/events_lb"};
+      TH1I* hist_events{dynamic_cast<TH1I*>(m_inputHist->Get(osHist.c_str()))};
+      m_numberOfEventsHist = hist_events->GetBinContent(6); // Entry in "tier0ESD"
+      if (hist_events->GetBinContent(4) > m_numberOfEventsHist) m_numberOfEventsHist = hist_events->GetBinContent(4); // Entry in "tier0"
+      //m_numberOfEventsHist = 13902;
+    } else {
+      ATH_MSG_WARNING("can not open HIST : " << hist.c_str());
+    }
+
+
+    ATH_MSG_INFO("Initialization of TimeStamp/LB, taken from runInfo.txt");
+    //--- Initialization of TimeStamp/LB, taken from runInfo.txt
+    m_calibEvtInfoTool->setSource("HIST");
+    m_calibEvtInfoTool->setTimeStamp(m_runStartTime, m_runEndTime);
+    m_calibEvtInfoTool->setRunNumber(m_runNumber);
+  }
+
+  //--- Booking histograms for hitmaps
+  if (m_doHitMaps) m_calibHitmapTool->book();
+  //--- Reading histograms for hitmaps
+  if ((not m_doHitMaps and not m_doNoisyLB) and m_readHitMaps) {
+    m_calibEvtInfoTool->setSource("HIST");
+    m_calibHitmapTool->read("./SCTHitMaps.root");
+    m_numberOfEventsHist = m_calibHitmapTool->size();
+    m_calibEvtInfoTool->setTimeStamp(m_runStartTime, m_runEndTime);
+    m_calibEvtInfoTool->setRunNumber(m_runNumber);
+    m_calibLbTool->read("./SCTLB.root");
+  }
+  //--- Booking histograms for BSErrors
+  if (m_doBSErrors) m_calibBsErrTool->book();
+  //--- Hit-vs-LB for LBs in noisy links/chips
+  if (m_doNoisyLB) m_calibLbTool->book();
+
+  //--- Check statistics for NoiseOccupancy
+  if (m_doNoiseOccupancy and notEnoughStatistics(m_noiseOccupancyMinStat, m_numberOfEventsHist)) return StatusCode::FAILURE;
+  //--- Check statistics for RawOccupancy
+  if (m_doRawOccupancy and notEnoughStatistics(m_rawOccupancyMinStat, m_numberOfEventsHist)) return StatusCode::FAILURE;
+  //--- Check statistics for Efficiency
+  if (m_doEfficiency and notEnoughStatistics(m_efficiencyMinStat, m_numberOfEventsHist)) return StatusCode::FAILURE;
+  //--- Check statistics for BSError
+  if (m_doBSErrorDB and notEnoughStatistics(m_BSErrorDBMinStat, m_numberOfEventsHist)) return StatusCode::FAILURE;
+  //--- Check statistics for LorentzAngle
+  if (m_doLorentzAngle and notEnoughStatistics(m_LorentzAngleMinStat, m_numberOfEventsHist)) return StatusCode::FAILURE;
+  //
+  return StatusCode::SUCCESS;
 }
 
 bool
-SCTCalib::notEnoughStatistics(const int required, const int obtained, const std::string & histogramName) const {
-   if (obtained<required) {
-      ATH_MSG_ERROR("Number of events in "<<histogramName<<": "<<obtained<<" is less than the required minimum number of events " <<required);
-      return true;
-   }
-   return false;
+SCTCalib::notEnoughStatistics(const int required, const int obtained, const std::string& histogramName) const {
+  if (obtained<required) {
+    ATH_MSG_ERROR("Number of events in " << histogramName << ": " << obtained << " is less than the required minimum number of events " << required);
+    return true;
+  }
+  return false;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////
-/// beginRun - process after initialize() and  before execute()
+/// beginRun - process after initialize() and before execute()
 ///////////////////////////////////////////////////////////////////////////////////
 
 StatusCode SCTCalib::beginRun() {
-   ATH_MSG_INFO ("----- in beginRun() -----" );
-   //--- Check if calibration data is available or not
-   return StatusCode::SUCCESS;
+  ATH_MSG_INFO ("----- in beginRun() -----");
+  //--- Check if calibration data is available or not
+  return StatusCode::SUCCESS;
 }
 
 //////////////////////////////////////////////////////////////////////////////////
@@ -332,43 +320,43 @@ StatusCode SCTCalib::beginRun() {
 //////////////////////////////////////////////////////////////////////////////////
 
 StatusCode SCTCalib::execute() {
-   if ( m_readBS ) {
-      SG::ReadHandle<EventInfo> evt(m_eventInfoKey);
-      if (not evt.isValid()) {
-         ATH_MSG_FATAL("Unable to get the EventInfo");
-         return StatusCode::FAILURE;
-      }
-      const EventInfo* evt_ptr = &(*evt);
-      ATH_MSG_VERBOSE(SCT_CalibAlgs::eventInfoAsString(evt_ptr));
-      //--- TimeStamp/LB range analyzed
-      const int timeStamp = evt->event_ID()->time_stamp();
-      const int lumiBlock = evt->event_ID()->lumi_block();
-      int timeStampBeginOld;
-      int timeStampEndOld;
-      m_calibEvtInfoTool->getTimeStamps(timeStampBeginOld, timeStampEndOld);
-      m_calibEvtInfoTool->setTimeStamp(std::min(timeStamp, timeStampBeginOld), std::max(timeStamp, timeStampEndOld));
-      int lbBeginOld;
-      int lbEndOld;
-      m_calibEvtInfoTool->getLumiBlock(lbBeginOld, lbEndOld);
-      m_calibEvtInfoTool->setLumiBlock(std::min(lumiBlock, lbBeginOld), std::max(lumiBlock, lbEndOld));
-      m_calibEvtInfoTool->setLumiBlock(lumiBlock);
-      m_calibEvtInfoTool->setTimeStamp(timeStamp);
-   }
-
-   const bool majorityIsGoodOrUnused=( m_useMajority and m_MajorityConditionsTool->isGood() ) or !m_useMajority;
-   //--- Fill histograms for (1) Number of events and (2) Hitmaps
-   if ( m_doHitMaps  and majorityIsGoodOrUnused ) m_calibHitmapTool->fill(m_readBS);
-
-   //--- Fill histograms for (1) Number of events and (2) Hits as a function of LB
-   if ( m_doNoisyLB and majorityIsGoodOrUnused ) m_calibLbTool->fill(m_readBS);
-
-   //--- Fill histograms for (1) Number of events and (2) BSErrors
-   if ( m_doBSErrors ) m_calibBsErrTool->fill(m_readBS);
-
-   //--- Increment event counter : to be ready for the next event loop
-   m_calibEvtInfoTool->incrementCounter();
-
-   return StatusCode::SUCCESS;
+  if (m_readBS) {
+    SG::ReadHandle<EventInfo> evt{m_eventInfoKey};
+    if (not evt.isValid()) {
+      ATH_MSG_FATAL("Unable to get the EventInfo");
+      return StatusCode::FAILURE;
+    }
+    const EventInfo* evt_ptr{&(*evt)};
+    ATH_MSG_VERBOSE(SCT_CalibAlgs::eventInfoAsString(evt_ptr));
+    //--- TimeStamp/LB range analyzed
+    const int timeStamp{static_cast<int>(evt->event_ID()->time_stamp())};
+    const int lumiBlock{static_cast<int>(evt->event_ID()->lumi_block())};
+    int timeStampBeginOld;
+    int timeStampEndOld;
+    m_calibEvtInfoTool->getTimeStamps(timeStampBeginOld, timeStampEndOld);
+    m_calibEvtInfoTool->setTimeStamp(std::min(timeStamp, timeStampBeginOld), std::max(timeStamp, timeStampEndOld));
+    int lbBeginOld;
+    int lbEndOld;
+    m_calibEvtInfoTool->getLumiBlock(lbBeginOld, lbEndOld);
+    m_calibEvtInfoTool->setLumiBlock(std::min(lumiBlock, lbBeginOld), std::max(lumiBlock, lbEndOld));
+    m_calibEvtInfoTool->setLumiBlock(lumiBlock);
+    m_calibEvtInfoTool->setTimeStamp(timeStamp);
+  }
+
+  const bool majorityIsGoodOrUnused{(m_useMajority and m_MajorityConditionsTool->isGood()) or !m_useMajority};
+  //--- Fill histograms for (1) Number of events and (2) Hitmaps
+  if (m_doHitMaps and majorityIsGoodOrUnused) m_calibHitmapTool->fill(m_readBS);
+
+  //--- Fill histograms for (1) Number of events and (2) Hits as a function of LB
+  if (m_doNoisyLB and majorityIsGoodOrUnused) m_calibLbTool->fill(m_readBS);
+
+  //--- Fill histograms for (1) Number of events and (2) BSErrors
+  if (m_doBSErrors) m_calibBsErrTool->fill(m_readBS);
+
+  //--- Increment event counter : to be ready for the next event loop
+  m_calibEvtInfoTool->incrementCounter();
+
+  return StatusCode::SUCCESS;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////
@@ -376,109 +364,106 @@ StatusCode SCTCalib::execute() {
 ///////////////////////////////////////////////////////////////////////////////////
 
 StatusCode SCTCalib::endRun() {
-   ATH_MSG_INFO( "----- in endRun() ----- " );
-   //--- Number of events processed
-   m_numberOfEvents = (m_readHIST || (!m_doHitMaps && m_readHitMaps)) ? m_numberOfEventsHist : m_calibEvtInfoTool->counter();
-   m_calibEvtInfoTool->getTimeStamps(m_utcBegin,m_utcEnd);
-
-
-   //  if ( m_doNoisyLB ) m_calibLbTool->binHistograms(m_nLbsMerged);
-
-   //--- IOV range defined by RunNumber and LB
-   unsigned int beginRun = static_cast<unsigned int>(m_runNumber.value());
-   unsigned int endRun   = static_cast<unsigned int>(m_runNumber.value());
-   unsigned int beginLB  = IOVTime::MINEVENT;
-   unsigned int endLB    = IOVTime::MAXEVENT;
-   m_iovStart.setRunEvent( static_cast<unsigned long>(beginRun), static_cast<unsigned long>(beginLB) );
-   m_iovStop.setRunEvent( static_cast<unsigned long>(endRun), static_cast<unsigned long>(endLB) );
-
-   //--- Find noisy strips from hitmaps
-   const bool doNoisyStripAnalysis = ( ( !m_doHitMaps && m_readHitMaps ) || !m_readHitMaps ) && m_doNoisyStrip;
-   if ( doNoisyStripAnalysis and getNoisyStrip().isFailure() ) {
-      ATH_MSG_ERROR("Failed to run getNoisyStrip()");
-      return StatusCode::FAILURE;
-   }
-
-   //--- Upload hv
-   if ( m_doHV ) {
-      m_gofile.open(m_badModulesFile.value().c_str(),std::ios::out);
-      if (not m_gofile) ATH_MSG_ERROR("Problem opening "<<m_badModulesFile);
-      //
-      XmlHeader myXml(m_gofile);
-      XmlStreamer root("modules", m_gofile);
-      SCT_ID::const_id_iterator waferItr  = m_pSCTHelper->wafer_begin();
-      SCT_ID::const_id_iterator waferItrE = m_pSCTHelper->wafer_end();
-      const unsigned int onlyDummy(1);
-      pair<int, int> timeInterval(0,0);
-      pair<int, int> lbRange(0,0);
-      const int withinLimits(m_maxtbins);
-      //
-      for ( ; waferItr not_eq waferItrE; ++waferItr ) {
-         const Identifier waferId=*waferItr ;
-         IdentifierHash   waferHash = m_pSCTHelper->wafer_hash( waferId );
-         const vector< pair<int,int> > & tvec= m_summarytrips.at(waferHash.value());
-         const vector< pair<int,int> > & tlbn= m_summarytripslb.at(waferHash.value());
-         //tvec is a pair of times in general, although the very first one is a dummy
-         const unsigned int numberOfElements=tvec.size();
-         if (numberOfElements > onlyDummy) {
-            //only care if something happened in this module
-            timeInterval=tvec.at(1);
-            lbRange=tlbn.at(1);
-            for (unsigned int itrip(2); itrip != numberOfElements; ++itrip) { //skip 0 since that is just the dummy pair.
-               if (areConsecutiveIntervals(tvec[itrip],timeInterval,withinLimits)) {
-                  timeInterval.second  =  tvec.at(itrip).second;
-                  lbRange.second = tlbn.at(itrip).second;
-               } else {
-                  //not consecutive, so first print out the old one
-                  doHVPrintXML(timeInterval,lbRange,waferId);
-                  timeInterval =  tvec.at(itrip);
-                  lbRange =  tlbn.at(itrip);
-               }
-            } // end loop over times
-            doHVPrintXML(timeInterval,lbRange,waferId );
-         }
-      } // end loop over wafers
-   }
-
-   //--- Find dead strips/chips from hitmaps
-   if ( (m_doDeadStrip or m_doDeadChip ) and getDeadStrip().isFailure() ) {
-      ATH_MSG_ERROR("Failed to run getDeadStrip()");
-      return StatusCode::FAILURE;
-   }
-
-   //--- Upload noise occupancy
-   if ( m_doNoiseOccupancy  and getNoiseOccupancy().isFailure() ) {
-      ATH_MSG_ERROR("Failed to run getNoiseOccupancy()");
-      return StatusCode::FAILURE;
-   }
-
-   //--- Upload raw occupancy
-   if ( m_doRawOccupancy and getRawOccupancy().isFailure() ) {
-      ATH_MSG_ERROR("Failed to run getRawOccupancy()");
-      return StatusCode::FAILURE;
-   }
-
-   //--- Upload efficiency
-   if ( m_doEfficiency and getEfficiency().isFailure() ) {
-      ATH_MSG_ERROR("Failed to run getEfficiency()");
-      return StatusCode::FAILURE;
-   }
-
-   //--- Upload ByteStream Errors
-   if ( m_doBSErrorDB and getBSErrors().isFailure() ) {
-      ATH_MSG_ERROR("Failed to run getBSErrors()");
-      return StatusCode::FAILURE;
-   }
-
-   //--- Upload Lorentz Angle
-   if ( m_doLorentzAngle  and getLorentzAngle().isFailure() ) {
-      ATH_MSG_ERROR("Failed to run getLorentzAngle()");
-      return StatusCode::FAILURE;
-   }
-
-   //--- Close HIST
-   if ( m_readHIST ) m_inputHist->Close();
-   return StatusCode::SUCCESS;
+  ATH_MSG_INFO("----- in endRun() ----- ");
+  //--- Number of events processed
+  m_numberOfEvents = (m_readHIST or (!m_doHitMaps and m_readHitMaps)) ? m_numberOfEventsHist : m_calibEvtInfoTool->counter();
+  m_calibEvtInfoTool->getTimeStamps(m_utcBegin, m_utcEnd);
+
+  //--- IOV range defined by RunNumber and LB
+  unsigned int beginRun{static_cast<unsigned int>(m_runNumber.value())};
+  unsigned int endRun{static_cast<unsigned int>(m_runNumber.value())};
+  unsigned int beginLB{IOVTime::MINEVENT};
+  unsigned int endLB{IOVTime::MAXEVENT};
+  m_iovStart.setRunEvent(static_cast<unsigned long>(beginRun), static_cast<unsigned long>(beginLB));
+  m_iovStop.setRunEvent(static_cast<unsigned long>(endRun), static_cast<unsigned long>(endLB));
+
+  //--- Find noisy strips from hitmaps
+  const bool doNoisyStripAnalysis{((!m_doHitMaps and m_readHitMaps) or !m_readHitMaps) and m_doNoisyStrip};
+  if (doNoisyStripAnalysis and getNoisyStrip().isFailure()) {
+    ATH_MSG_ERROR("Failed to run getNoisyStrip()");
+    return StatusCode::FAILURE;
+  }
+
+  //--- Upload hv
+  if (m_doHV) {
+    m_gofile.open(m_badModulesFile.value().c_str(), std::ios::out);
+    if (not m_gofile) ATH_MSG_ERROR("Problem opening " << m_badModulesFile);
+    //
+    XmlHeader myXml{m_gofile};
+    XmlStreamer root{"modules", m_gofile};
+    SCT_ID::const_id_iterator waferItr{m_pSCTHelper->wafer_begin()};
+    SCT_ID::const_id_iterator waferItrE{m_pSCTHelper->wafer_end()};
+    const unsigned int onlyDummy{1};
+    pair<int, int> timeInterval{0, 0};
+    pair<int, int> lbRange{0, 0};
+    const int withinLimits{m_maxtbins};
+    //
+    for (; waferItr not_eq waferItrE; ++waferItr) {
+      const Identifier waferId{*waferItr};
+      IdentifierHash waferHash{m_pSCTHelper->wafer_hash(waferId)};
+      const vector<pair<int, int>>& tvec{m_summarytrips.at(waferHash.value())};
+      const vector<pair<int, int>>& tlbn{m_summarytripslb.at(waferHash.value())};
+      //tvec is a pair of times in general, although the very first one is a dummy
+      const unsigned int numberOfElements{static_cast<unsigned int>(tvec.size())};
+      if (numberOfElements > onlyDummy) {
+        //only care if something happened in this module
+        timeInterval=tvec.at(1);
+        lbRange=tlbn.at(1);
+        for (unsigned int itrip{2}; itrip != numberOfElements; ++itrip) { //skip 0 since that is just the dummy pair.
+          if (areConsecutiveIntervals(tvec[itrip], timeInterval, withinLimits)) {
+            timeInterval.second = tvec.at(itrip).second;
+            lbRange.second = tlbn.at(itrip).second;
+          } else {
+            //not consecutive, so first print out the old one
+            doHVPrintXML(timeInterval, lbRange, waferId);
+            timeInterval = tvec.at(itrip);
+            lbRange = tlbn.at(itrip);
+          }
+        } // end loop over times
+        doHVPrintXML(timeInterval, lbRange, waferId);
+      }
+    } // end loop over wafers
+  }
+
+  //--- Find dead strips/chips from hitmaps
+  if ((m_doDeadStrip or m_doDeadChip) and getDeadStrip().isFailure()) {
+    ATH_MSG_ERROR("Failed to run getDeadStrip()");
+    return StatusCode::FAILURE;
+  }
+
+  //--- Upload noise occupancy
+  if (m_doNoiseOccupancy and getNoiseOccupancy().isFailure()) {
+    ATH_MSG_ERROR("Failed to run getNoiseOccupancy()");
+    return StatusCode::FAILURE;
+  }
+
+  //--- Upload raw occupancy
+  if (m_doRawOccupancy and getRawOccupancy().isFailure()) {
+    ATH_MSG_ERROR("Failed to run getRawOccupancy()");
+    return StatusCode::FAILURE;
+  }
+
+  //--- Upload efficiency
+  if (m_doEfficiency and getEfficiency().isFailure()) {
+    ATH_MSG_ERROR("Failed to run getEfficiency()");
+    return StatusCode::FAILURE;
+  }
+
+  //--- Upload ByteStream Errors
+  if (m_doBSErrorDB and getBSErrors().isFailure()) {
+    ATH_MSG_ERROR("Failed to run getBSErrors()");
+    return StatusCode::FAILURE;
+  }
+
+  //--- Upload Lorentz Angle
+  if (m_doLorentzAngle and getLorentzAngle().isFailure()) {
+    ATH_MSG_ERROR("Failed to run getLorentzAngle()");
+    return StatusCode::FAILURE;
+  }
+
+  //--- Close HIST
+  if (m_readHIST) m_inputHist->Close();
+  return StatusCode::SUCCESS;
 }
 
 
@@ -487,10 +472,10 @@ StatusCode SCTCalib::endRun() {
 ///////////////////////////////////////////////////////////////////////////////////
 
 StatusCode SCTCalib::finalize() {
-   ATH_MSG_INFO("----- in finalize() ----- ");
+  ATH_MSG_INFO("----- in finalize() ----- ");
 
-   ATH_MSG_INFO("Thank-you for using SCT_CalibAlgs, version "<<PACKAGE_VERSION);
-   return StatusCode::SUCCESS;
+  ATH_MSG_INFO("Thank-you for using SCT_CalibAlgs, version " << PACKAGE_VERSION);
+  return StatusCode::SUCCESS;
 }
 
 
@@ -498,36 +483,36 @@ StatusCode SCTCalib::finalize() {
 /// doHVPrintXML()
 /// Prints XML file for hv modules
 ///////////////////////////////////////////////////////////////////////////////////
-StatusCode SCTCalib::doHVPrintXML(const std::pair<int, int> & timeInterval, const std::pair<int,int> & lbRange, Identifier waferId) {
-   const IdentifierHash   waferHash = m_pSCTHelper->wafer_hash( waferId );
-   const SCT_SerialNumber sn        = m_CablingTool->getSerialNumberFromHash( waferHash );
-
-   XmlStreamer mod("module", m_gofile);
-   {
-      XmlStreamer v("value","name","SN", m_gofile);
-      m_gofile<<sn.str();
-   }
-   {
-      XmlStreamer v("value", "name", "BecLayerPhiEta", m_gofile);
-      m_gofile<< formatPosition(waferId, m_pSCTHelper,".",false);
-   }
-   {
-      XmlStreamer v("value","name", "StartTime", m_gofile);
-      m_gofile<<timeInterval.first;
-   }
-   {
-      XmlStreamer v("value","name","EndTime",m_gofile);
-      m_gofile<< timeInterval.second;
-   }
-   {
-      XmlStreamer v("value","name", "StartLBN", m_gofile);
-      m_gofile<<lbRange.first;
-   }
-   {
-      XmlStreamer v("value","name","EndLBN",m_gofile);
-      m_gofile<< lbRange.second;
-   }
-   return StatusCode::SUCCESS;
+StatusCode SCTCalib::doHVPrintXML(const std::pair<int, int>& timeInterval, const std::pair<int, int>& lbRange, Identifier waferId) {
+  const IdentifierHash waferHash{m_pSCTHelper->wafer_hash(waferId)};
+  const SCT_SerialNumber sn{m_CablingTool->getSerialNumberFromHash(waferHash)};
+
+  XmlStreamer mod{"module", m_gofile};
+  {
+    XmlStreamer v{"value", "name", "SN", m_gofile};
+    m_gofile << sn.str();
+  }
+  {
+    XmlStreamer v{"value", "name", "BecLayerPhiEta", m_gofile};
+    m_gofile << formatPosition(waferId, m_pSCTHelper, ".", false);
+  }
+  {
+    XmlStreamer v{"value", "name", "StartTime", m_gofile};
+    m_gofile << timeInterval.first;
+  }
+  {
+    XmlStreamer v{"value", "name", "EndTime", m_gofile};
+    m_gofile << timeInterval.second;
+  }
+  {
+    XmlStreamer v{"value", "name", "StartLBN", m_gofile};
+    m_gofile << lbRange.first;
+  }
+  {
+    XmlStreamer v{"value", "name", "EndLBN", m_gofile};
+    m_gofile << lbRange.second;
+  }
+  return StatusCode::SUCCESS;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////
@@ -535,110 +520,110 @@ StatusCode SCTCalib::doHVPrintXML(const std::pair<int, int> & timeInterval, cons
 /// Find noisy strips from hitmaps and write out into xml/db formats
 ///////////////////////////////////////////////////////////////////////////////////
 StatusCode SCTCalib::getNoisyStrip() {
-   enum Categories {ALL, NEW, REF, N_CATEGORIES};
-   //--- Check statistics
-   //ATH_MSG_INFO(m_calibEvtInfoTool->counter() << "   " <<m_calibHitmapTool->size());
-   //int numOfEventsProcessed=m_calibEvtInfoTool->counter();
-   //sroe: This looks like a bug, so I change the code here
-
-   // if ( noisyStripsToSummaryXmlFake( m_badStripsSummaryFile ).isFailure() ) {
-   //   ATH_MSG_ERROR("Could not write XML file");
-   //   return StatusCode::FAILURE;
-   // }
-
-   ATH_MSG_INFO( "----- in getNoisyStrip() ----- " );
-
-   //--- Number of LBs processed
-   m_numOfLBsProcessed = 0;
-   for ( int iLB = 0; iLB != m_LBRange; ++iLB ) {
-      if ( m_calibLbTool and m_calibLbTool->getNumberOfEventsInBin( iLB + 1 ) > 0 ) ++m_numOfLBsProcessed;
-   }
-
-   //--- Choice of threshold
-   //three module lists: all, new, ref
-   typedef std::map< Identifier, std::set<Identifier> > ModuleList_t;
-   ModuleList_t moduleLists[N_CATEGORIES];
-   //Reading data from COOL
-   // original code switched on this :if (m_noisyUpdate)
-   if (m_calibModuleListTool->readModuleList(moduleLists[REF]).isFailure()) {
-      ATH_MSG_ERROR("Could not read moduleList");
-      return StatusCode::FAILURE;
-   }
-
-   //two bad strip lists: all, new
-   typedef std::set<Identifier> StripList_t;
-   StripList_t stripIdLists[2];
-
-   //--- Loop over wafers
-   SCT_ID::const_id_iterator waferItr  = m_pSCTHelper->wafer_begin();
-   SCT_ID::const_id_iterator waferItrE = m_pSCTHelper->wafer_end();
-   int numNoisyWafers(0);
-   for ( ; waferItr not_eq waferItrE; ++waferItr ) {
-      //--- Identifier/SN
-      Identifier       waferId   = *waferItr;
-      Identifier       moduleId  = m_pSCTHelper->module_id( waferId );
-      //--- Initialization in *module*
-      if ( m_pSCTHelper->side( waferId ) == 0 ) {
-         stripIdLists[ALL].clear();
-         stripIdLists[NEW].clear();
-      }
-      std::pair<int, bool> noisy=getNumNoisyStrips(waferId);
-      const int  numNoisyStripsInWafer=noisy.first;
-      const bool isNoisyWafer=noisy.second;
-      if (numNoisyStripsInWafer!=0) {
-         if ( m_noisyWaferFinder && isNoisyWafer ) { //in noisy wafer
-            ++numNoisyWafers;
-            if (not m_noisyWaferWrite) break;
-            if (m_noisyWaferAllStrips) { //write out all strips
-               if ( addStripsToList( waferId, stripIdLists[ALL], false, false ).isFailure() or  addStripsToList( waferId, stripIdLists[NEW], false, true ).isFailure() ) {
-                  ATH_MSG_ERROR("Could not add stripIds to the list");
-                  return StatusCode::FAILURE;
-               }
-               break;
-            } else {
-               //only noisy strips in noisy wafer
-               if ( addStripsToList( waferId, stripIdLists[ALL], true, false ).isFailure() or addStripsToList( waferId, stripIdLists[NEW], true, true  ).isFailure() ) {
-                  ATH_MSG_ERROR("Could not add stripIds to the list");
-                  return StatusCode::FAILURE;
-               }
-            }
-         } else { // not in noisy wafer
-            if ( addStripsToList( waferId, stripIdLists[ALL], true, false ).isFailure() or addStripsToList( waferId, stripIdLists[NEW], true, true  ).isFailure() ) {
-               ATH_MSG_ERROR("Could not add stripIds to the list");
-               return StatusCode::FAILURE;
-            }
-         }
-      }//endif numnoisystrips!=0
-      //--- Create objects for a module
-      if ( m_pSCTHelper->side( waferId ) == 1 ) {
-         if ( !stripIdLists[ALL].empty() ) moduleLists[ALL].insert( map< Identifier, std::set<Identifier> >::value_type( moduleId, stripIdLists[ALL] ) );
-         if ( !stripIdLists[NEW].empty() ) moduleLists[NEW].insert( map< Identifier, std::set<Identifier> >::value_type( moduleId, stripIdLists[NEW] ) );
-      }
-   }//end loop over wafers
+  enum Categories {ALL, NEW, REF, N_CATEGORIES};
+  //--- Check statistics
+  //ATH_MSG_INFO(m_calibEvtInfoTool->counter() << "   " << m_calibHitmapTool->size());
+  //int numOfEventsProcessed=m_calibEvtInfoTool->counter();
+  //sroe: This looks like a bug, so I change the code here
+
+  // if (noisyStripsToSummaryXmlFake(m_badStripsSummaryFile).isFailure()) {
+  //   ATH_MSG_ERROR("Could not write XML file");
+  //   return StatusCode::FAILURE;
+  // }
+
+  ATH_MSG_INFO("----- in getNoisyStrip() ----- ");
+
+  //--- Number of LBs processed
+  m_numOfLBsProcessed = 0;
+  for (int iLB{0}; iLB != m_LBRange; ++iLB) {
+    if (m_calibLbTool and m_calibLbTool->getNumberOfEventsInBin(iLB + 1) > 0) ++m_numOfLBsProcessed;
+  }
+
+  //--- Choice of threshold
+  //three module lists: all, new, ref
+  typedef std::map< Identifier, std::set<Identifier> > ModuleList_t;
+  ModuleList_t moduleLists[N_CATEGORIES];
+  //Reading data from COOL
+  // original code switched on this :if (m_noisyUpdate)
+  if (m_calibModuleListTool->readModuleList(moduleLists[REF]).isFailure()) {
+    ATH_MSG_ERROR("Could not read moduleList");
+    return StatusCode::FAILURE;
+  }
+
+  //two bad strip lists: all, new
+  typedef std::set<Identifier> StripList_t;
+  StripList_t stripIdLists[2];
+
+  //--- Loop over wafers
+  SCT_ID::const_id_iterator waferItr{m_pSCTHelper->wafer_begin()};
+  SCT_ID::const_id_iterator waferItrE{m_pSCTHelper->wafer_end()};
+  int numNoisyWafers{0};
+  for (; waferItr not_eq waferItrE; ++waferItr) {
+    //--- Identifier/SN
+    Identifier waferId{*waferItr};
+    Identifier moduleId{m_pSCTHelper->module_id(waferId)};
+    //--- Initialization in *module*
+    if (m_pSCTHelper->side(waferId) == 0) {
+      stripIdLists[ALL].clear();
+      stripIdLists[NEW].clear();
+    }
+    std::pair<int, bool> noisy{getNumNoisyStrips(waferId)};
+    const int numNoisyStripsInWafer{noisy.first};
+    const bool isNoisyWafer{noisy.second};
+    if (numNoisyStripsInWafer!=0) {
+      if (m_noisyWaferFinder and isNoisyWafer) { //in noisy wafer
+        ++numNoisyWafers;
+        if (not m_noisyWaferWrite) break;
+        if (m_noisyWaferAllStrips) { //write out all strips
+          if (addStripsToList(waferId, stripIdLists[ALL], false, false).isFailure() or  addStripsToList(waferId, stripIdLists[NEW], false, true).isFailure()) {
+            ATH_MSG_ERROR("Could not add stripIds to the list");
+            return StatusCode::FAILURE;
+          }
+          break;
+        } else {
+          //only noisy strips in noisy wafer
+          if (addStripsToList(waferId, stripIdLists[ALL], true, false).isFailure() or addStripsToList(waferId, stripIdLists[NEW], true, true).isFailure()) {
+            ATH_MSG_ERROR("Could not add stripIds to the list");
+            return StatusCode::FAILURE;
+          }
+        }
+      } else { // not in noisy wafer
+        if (addStripsToList(waferId, stripIdLists[ALL], true, false).isFailure() or addStripsToList(waferId, stripIdLists[NEW], true, true).isFailure()) {
+          ATH_MSG_ERROR("Could not add stripIds to the list");
+          return StatusCode::FAILURE;
+        }
+      }
+    }//endif numnoisystrips!=0
+    //--- Create objects for a module
+    if (m_pSCTHelper->side(waferId) == 1) {
+      if (!stripIdLists[ALL].empty()) moduleLists[ALL].insert(map< Identifier, std::set<Identifier> >::value_type(moduleId, stripIdLists[ALL]));
+      if (!stripIdLists[NEW].empty()) moduleLists[NEW].insert(map< Identifier, std::set<Identifier> >::value_type(moduleId, stripIdLists[NEW]));
+    }
+  }//end loop over wafers
 
    //--- Local sqlite files here
-   ATH_MSG_DEBUG( "------ Before writing into COOL ------" );
-   if ( m_writeToCool ) {
-      if ( writeModuleListToCool( moduleLists[ALL], moduleLists[NEW], moduleLists[REF] ).isFailure() ) {
-         ATH_MSG_ERROR("Could not write NoisyStrips into COOL");
-         return StatusCode::FAILURE;
-      }
-   }
-   //--- XML outputs
-   if ( noisyStripsToXml( moduleLists[ALL], m_badStripsAllFile ).isFailure() ) {
-      ATH_MSG_ERROR("Could not write XML file");
-      return StatusCode::FAILURE;
-   }
-   if ( noisyStripsToXml( moduleLists[NEW], m_badStripsNewFile ).isFailure() ) {
-      ATH_MSG_ERROR("Could not write XML file");
-      return StatusCode::FAILURE;
-   }
-   if ( noisyStripsToSummaryXml( moduleLists[ALL], moduleLists[NEW], moduleLists[REF], m_badStripsSummaryFile ).isFailure() ) {
-      ATH_MSG_ERROR("Could not write XML file");
+  ATH_MSG_DEBUG("------ Before writing into COOL ------");
+  if (m_writeToCool) {
+    if (writeModuleListToCool(moduleLists[ALL], moduleLists[NEW], moduleLists[REF]).isFailure()) {
+      ATH_MSG_ERROR("Could not write NoisyStrips into COOL");
       return StatusCode::FAILURE;
-   }
-
-   return StatusCode::SUCCESS;
+    }
+  }
+  //--- XML outputs
+  if (noisyStripsToXml(moduleLists[ALL], m_badStripsAllFile).isFailure()) {
+    ATH_MSG_ERROR("Could not write XML file");
+    return StatusCode::FAILURE;
+  }
+  if (noisyStripsToXml(moduleLists[NEW], m_badStripsNewFile).isFailure()) {
+    ATH_MSG_ERROR("Could not write XML file");
+    return StatusCode::FAILURE;
+  }
+  if (noisyStripsToSummaryXml(moduleLists[ALL], moduleLists[NEW], moduleLists[REF], m_badStripsSummaryFile).isFailure()) {
+    ATH_MSG_ERROR("Could not write XML file");
+    return StatusCode::FAILURE;
+  }
+
+  return StatusCode::SUCCESS;
 
 }
 
@@ -647,522 +632,521 @@ StatusCode SCTCalib::getNoisyStrip() {
 //                           SCTCalib :: getDeadStrip
 //====================================================================================================
 StatusCode SCTCalib::getDeadStrip() {
-   //Function to identify and print out the dead strips.
-   ATH_MSG_INFO( "getDeadStrip() called" );
-
-   // Bad Mods
-   const std::set<Identifier>* badMods = m_ConfigurationConditionsTool->badModules();
-   std::set<Identifier>::const_iterator ModItr(badMods->begin());
-   std::set<Identifier>::const_iterator ModEnd(badMods->end());
-   // Bad links
-   const std::map<IdentifierHash, std::pair<bool, bool> >* badLinks = m_ConfigurationConditionsTool->badLinks();
-   std::map<IdentifierHash, std::pair<bool, bool> >::const_iterator linkItr(badLinks->begin());
-   std::map<IdentifierHash, std::pair<bool, bool> >::const_iterator linkEnd(badLinks->end());
-   // Bad chips
-   const std::map<Identifier, unsigned int>* badChips = m_ConfigurationConditionsTool->badChips();
-   std::map<Identifier, unsigned int>::const_iterator chipItr(badChips->begin());
-   std::map<Identifier, unsigned int>::const_iterator chipEnd(badChips->end());
-   // Bad strips (w/o bad modules and chips)
-   std::set<Identifier> badStripsExclusive;
-   m_ConfigurationConditionsTool->badStrips(badStripsExclusive, true, true);
-   //std::set<Identifier>::const_iterator stripItr(badStripsExclusive.begin());
-   std::set<Identifier>::const_iterator stripEnd(badStripsExclusive.end());
-   //To get #(Enabled Modules)
-   int numEnabledModules_B[n_barrels]= {n_phiBinsB0*n_etaInBarrel,n_phiBinsB1*n_etaInBarrel,n_phiBinsB2*n_etaInBarrel,n_phiBinsB3*n_etaInBarrel};
-   int numEnabledModules_EC[n_disks][n_etaBinsEC]= { {0}, {0} };
-   for (int i=0; i<n_disks; i++) {
-      for (int j=0; j<n_etaBinsEC; j++) {
-         if (!((i==0&&j==2)||(i==6&&j==2)||(i==7&&j==2)||(i==8&&j==1)||(i==8&&j==2))) {
-            numEnabledModules_EC[i][j] = j==0 ? n_phiBinsECOuter*2 : n_phiBinsECMiddle*2;
-         }
-      }
-   }
-   for (; ModItr!=ModEnd; ++ModItr) {
-      Identifier moduleId = *ModItr;
-      if (m_pSCTHelper->barrel_ec(moduleId)==BARREL) numEnabledModules_B[m_pSCTHelper->layer_disk(moduleId)]--;
-      else numEnabledModules_EC[m_pSCTHelper->layer_disk(moduleId)][m_pSCTHelper->eta_module(moduleId)]--;
-   }
-   //calculate meanOccupancy of layer etc...
-   double meanOccupancy_Barrel[n_barrels]= {0};
-   double meanOccupancy_EC[n_disks][n_etaBinsEC]= { {0}, {0} };
-   SCT_ID::const_id_iterator waferItr  = m_pSCTHelper->wafer_begin();
-   SCT_ID::const_id_iterator waferItrE = m_pSCTHelper->wafer_end();
-   for ( ; waferItr != waferItrE; ++waferItr ) {
-      Identifier     waferId   = *waferItr;
-      //    Identifier     moduleId  = m_pSCTHelper->module_id(waferId);
-      IdentifierHash waferHash = m_pSCTHelper->wafer_hash(waferId);
-      for (int j=0; j<n_stripPerChip*n_chipPerSide; j++) {
-         double n_hits = m_calibHitmapTool->getBinForHistogramIndex( j+1, waferHash.value());
-         if (n_hits/m_numberOfEvents<m_noisyThr4DeadFinding) {
-            if (m_pSCTHelper->barrel_ec(waferId)==BARREL) {
-               meanOccupancy_Barrel[m_pSCTHelper->layer_disk(waferId)]+=m_calibHitmapTool->getBinForHistogramIndex( j+1, waferHash.value());
-            } else {
-               meanOccupancy_EC[m_pSCTHelper->layer_disk(waferId)][m_pSCTHelper->eta_module(waferId)]+=m_calibHitmapTool->getBinForHistogramIndex( j+1, waferHash.value());
-            }
-         }
-      }
-   }
-
-   for (int i=0; i<n_barrels; i++) {
-      meanOccupancy_Barrel[i]/=static_cast<double>(m_numberOfEvents*nbins*2*numEnabledModules_B[i]);
-      ATH_MSG_INFO("Barrel : layer="<<i<<", meanOccupancy="<<meanOccupancy_Barrel[i]<<", #enabledModule="<<numEnabledModules_B[i]);
-   }
-
-   for (int i=0; i<n_disks; i++) {
-      for (int j=0; j<n_etaBinsEC; j++) {
-         if (numEnabledModules_EC[i][j]!=0) {
-            meanOccupancy_EC[i][j]/=static_cast<double>(m_numberOfEvents*nbins*2*numEnabledModules_EC[i][j]);
-            ATH_MSG_INFO("EndCap : disk="<<i<<", eta="<<j<<", meanOccupancy="<<meanOccupancy_EC[i][j]<<", #enabledModule="<<numEnabledModules_EC[i][j]);
-         }
-      }
-   }
-   bool busyStream = meanOccupancy_Barrel[3]>m_busyThr4DeadFinding ? true : false;
-   unsigned int minStat = busyStream ? static_cast<unsigned int>(m_deadStripMinStatBusy) : static_cast<unsigned int>(m_deadStripMinStat);
-   if (m_doDeadStrip && m_numberOfEvents<minStat) {
-      ATH_MSG_WARNING("required minimum statistics is "<<minStat/1E3<<"k events for DeadStrip search with this stream");
-      m_doDeadStrip = false;
-   }
-   if (m_doDeadChip && m_numberOfEvents<m_deadChipMinStat) {
-     ATH_MSG_WARNING("required minimum statistics is "<<static_cast<unsigned int>(m_deadChipMinStat)<<" events for DeadChip search");
-      m_doDeadChip = false;
-   }
-   if (m_doDeadStrip==false && m_doDeadChip==false) {
-      ATH_MSG_ERROR("Number of events "  << m_numberOfEvents<< " is less than the required minimum number of events... exit getDeadStrip()");
+  //Function to identify and print out the dead strips.
+  ATH_MSG_INFO("getDeadStrip() called");
+
+  // Bad Mods
+  const std::set<Identifier>* badMods{m_ConfigurationConditionsTool->badModules()};
+  std::set<Identifier>::const_iterator ModItr{badMods->begin()};
+  std::set<Identifier>::const_iterator ModEnd{badMods->end()};
+  // Bad links
+  const std::map<IdentifierHash, std::pair<bool, bool> >* badLinks{m_ConfigurationConditionsTool->badLinks()};
+  std::map<IdentifierHash, std::pair<bool, bool> >::const_iterator linkItr{badLinks->begin()};
+  std::map<IdentifierHash, std::pair<bool, bool> >::const_iterator linkEnd{badLinks->end()};
+  // Bad chips
+  const std::map<Identifier, unsigned int>* badChips{m_ConfigurationConditionsTool->badChips()};
+  std::map<Identifier, unsigned int>::const_iterator chipItr{badChips->begin()};
+  std::map<Identifier, unsigned int>::const_iterator chipEnd{badChips->end()};
+  // Bad strips (w/o bad modules and chips)
+  std::set<Identifier> badStripsExclusive;
+  m_ConfigurationConditionsTool->badStrips(badStripsExclusive, true, true);
+  //std::set<Identifier>::const_iterator stripItr(badStripsExclusive.begin());
+  std::set<Identifier>::const_iterator stripEnd(badStripsExclusive.end());
+  //To get #(Enabled Modules)
+  int numEnabledModules_B[n_barrels] = {n_phiBinsB0*n_etaInBarrel, n_phiBinsB1*n_etaInBarrel, n_phiBinsB2*n_etaInBarrel, n_phiBinsB3*n_etaInBarrel};
+  int numEnabledModules_EC[n_disks][n_etaBinsEC] = {{0}, {0}};
+  for (int i{0}; i<n_disks; i++) {
+    for (int j{0}; j<n_etaBinsEC; j++) {
+      if (!((i==0 and j==2) or (i==6 and j==2) or (i==7 and j==2) or (i==8 and j==1) or (i==8 and j==2))) {
+        numEnabledModules_EC[i][j] = j==0 ? n_phiBinsECOuter*2 : n_phiBinsECMiddle*2;
+      }
+    }
+  }
+  for (; ModItr!=ModEnd; ++ModItr) {
+    Identifier moduleId{*ModItr};
+    if (m_pSCTHelper->barrel_ec(moduleId)==BARREL) numEnabledModules_B[m_pSCTHelper->layer_disk(moduleId)]--;
+    else numEnabledModules_EC[m_pSCTHelper->layer_disk(moduleId)][m_pSCTHelper->eta_module(moduleId)]--;
+  }
+  //calculate meanOccupancy of layer etc...
+  double meanOccupancy_Barrel[n_barrels] = {0};
+  double meanOccupancy_EC[n_disks][n_etaBinsEC] = {{0}, {0}};
+  SCT_ID::const_id_iterator waferItr{m_pSCTHelper->wafer_begin()};
+  SCT_ID::const_id_iterator waferItrE{m_pSCTHelper->wafer_end()};
+  for (; waferItr != waferItrE; ++waferItr) {
+    Identifier     waferId{*waferItr};
+    IdentifierHash waferHash{m_pSCTHelper->wafer_hash(waferId)};
+    for (int j{0}; j<n_stripPerChip*n_chipPerSide; j++) {
+      double n_hits{m_calibHitmapTool->getBinForHistogramIndex(j+1, waferHash.value())};
+      if (n_hits/m_numberOfEvents<m_noisyThr4DeadFinding) {
+        if (m_pSCTHelper->barrel_ec(waferId)==BARREL) {
+          meanOccupancy_Barrel[m_pSCTHelper->layer_disk(waferId)]+=m_calibHitmapTool->getBinForHistogramIndex(j+1, waferHash.value());
+        } else {
+          meanOccupancy_EC[m_pSCTHelper->layer_disk(waferId)][m_pSCTHelper->eta_module(waferId)]+=m_calibHitmapTool->getBinForHistogramIndex(j+1, waferHash.value());
+        }
+      }
+    }
+  }
+
+  for (int i{0}; i<n_barrels; i++) {
+    meanOccupancy_Barrel[i]/=static_cast<double>(m_numberOfEvents*nbins*2*numEnabledModules_B[i]);
+    ATH_MSG_INFO("Barrel : layer=" << i << ", meanOccupancy=" << meanOccupancy_Barrel[i] << ", #enabledModule=" << numEnabledModules_B[i]);
+  }
+
+  for (int i{0}; i<n_disks; i++) {
+    for (int j{0}; j<n_etaBinsEC; j++) {
+      if (numEnabledModules_EC[i][j]!=0) {
+        meanOccupancy_EC[i][j]/=static_cast<double>(m_numberOfEvents*nbins*2*numEnabledModules_EC[i][j]);
+        ATH_MSG_INFO("EndCap : disk=" << i << ", eta=" << j << ", meanOccupancy=" << meanOccupancy_EC[i][j] << ", #enabledModule=" << numEnabledModules_EC[i][j]);
+      }
+    }
+  }
+  bool busyStream{meanOccupancy_Barrel[3]>m_busyThr4DeadFinding ? true : false};
+  unsigned int minStat{busyStream ? static_cast<unsigned int>(m_deadStripMinStatBusy) : static_cast<unsigned int>(m_deadStripMinStat)};
+  if (m_doDeadStrip and m_numberOfEvents<minStat) {
+    ATH_MSG_WARNING("required minimum statistics is " << minStat/1E3 << "k events for DeadStrip search with this stream");
+    m_doDeadStrip = false;
+  }
+  if (m_doDeadChip and m_numberOfEvents<m_deadChipMinStat) {
+    ATH_MSG_WARNING("required minimum statistics is " << static_cast<unsigned int>(m_deadChipMinStat) << " events for DeadChip search");
+    m_doDeadChip = false;
+  }
+  if (m_doDeadStrip==false and m_doDeadChip==false) {
+    ATH_MSG_ERROR("Number of events "  << m_numberOfEvents << " is less than the required minimum number of events... exit getDeadStrip()");
+    return StatusCode::FAILURE;
+  }
+  //create XML files
+  if (m_doDeadStrip) {
+    if (openXML4DB(m_outDeadStrips, "DeadStrip", m_tagID4DeadStrips.value().c_str(), m_iovStart, m_iovStop).isFailure()) {
+      ATH_MSG_ERROR("Problem opening " << m_deadStripsFile);
       return StatusCode::FAILURE;
-   }
-   //create XML files
-   if (m_doDeadStrip) {
-      if (openXML4DB(m_outDeadStrips, "DeadStrip", m_tagID4DeadStrips.value().c_str(), m_iovStart, m_iovStop).isFailure()) {
-         ATH_MSG_ERROR("Problem opening "<<m_deadStripsFile);
-         return StatusCode::FAILURE;
-      }
-   }
-   if (m_doDeadChip) {
-      if (openXML4DB(m_outDeadChips, "DeadChip", m_tagID4DeadChips.value().c_str(), m_iovStart, m_iovStop).isFailure()) {
-         ATH_MSG_ERROR("Problem opening "<<m_deadChipsFile);
-         return StatusCode::FAILURE;
-      }
-   }
-
-   // Get SCT_DetectorElementCollection
-   SG::ReadCondHandle<InDetDD::SiDetectorElementCollection> sctDetEle(m_SCTDetEleCollKey);
-   const InDetDD::SiDetectorElementCollection* elements(sctDetEle.retrieve());
-   if (elements==nullptr) {
-      ATH_MSG_FATAL(m_SCTDetEleCollKey.fullKey() << " could not be retrieved");
+    }
+  }
+  if (m_doDeadChip) {
+    if (openXML4DB(m_outDeadChips, "DeadChip", m_tagID4DeadChips.value().c_str(), m_iovStart, m_iovStop).isFailure()) {
+      ATH_MSG_ERROR("Problem opening " << m_deadChipsFile);
       return StatusCode::FAILURE;
-   }
-
-   //Dead identification
-   bool hasDeadStrip=false;
-   bool hasDeadChip=false;
-   bool isNoHitLink=false;
-   bool isDead=false;
-   bool beforeIsDead=false;
-   int n_deadStrip=0;
-   int n_deadChip=0;
-   int n_deadLink=0;
-   int n_deadModule=0;
-   int n_checkedChip=0;
-   int beginDead=0;
-   int endDead=0;
-   std::string defectStrip;
-   std::string defectChip;
-   std::ostringstream summaryList;
-   defectStrip.erase();
-   defectChip.erase();
-   const double deadStripDefinition = ROOT::Math::gaussian_cdf_c(m_deadStripSignificance);
-   const double deadChipDefinition = ROOT::Math::gaussian_cdf_c(m_deadChipSignificance);
-
-
-   //--- Loop over wafers
-   waferItr = m_pSCTHelper->wafer_begin();
-   for ( ; waferItr != waferItrE; ++waferItr ) {
-      Identifier     waferId   = *waferItr;
-      Identifier     moduleId  = m_pSCTHelper->module_id(waferId);
-      IdentifierHash waferHash = m_pSCTHelper->wafer_hash(waferId);
-
-      bool disabledChip[n_chipPerModule]= {false};
-      unsigned int disabledChipFlag=0;
-      double numHitsInStrip[n_stripPerChip*n_chipPerSide]= {0};
-      double numHitsInChip[n_chipPerSide]= {0};
-      double totalHitsInWafer=0;
-      int n_noisyStrip=0;
-      int n_noHitsStrip=0;
-      int n_disabledStrip=0;
-      int n_disabledInChip[n_chipPerSide]= {0};
-
-      //initialize
-      int side = m_pSCTHelper->side(waferId);
-      if (side==0) {
-         isDead=false;
-         beforeIsDead=false;
-         beginDead=0;
-         endDead=0;
-         defectStrip.erase();
-         defectChip.erase();
-      }
-
-      //check if module/link is disabled or not
-      bool disabled=false;
-      if (badMods->find(moduleId)!=badMods->end()) disabled=true;
-      linkItr=badLinks->find(waferHash);
-      if (linkItr!=linkEnd) {
-         std::pair<bool, bool> status = (*linkItr).second;
-         if ((side==0 && status.first==true) || (side==1 && status.second==true)) disabled=true;
-      }
-
-      //check BS Error
-      bool hasBSError=false;
-      if (m_calibBsErrTool->size(waferHash.value())>0) hasBSError=true;
-      if (disabled || hasBSError) { //goto WRITE_DB; //<-- who ever put this in should be shot; http://xkcd.com/292/
-         if (side==1) {
-            //write to DB & .xml.
-            if (defectChip==" 0-5  6-11 ") {
-               n_deadModule++;
-            } else if (defectChip==" 0-5 " || defectChip==" 6-11 ") {
-               n_deadLink++;
-            }
-
-            if (!(defectStrip.empty()) || !(defectChip.empty())) {
-               if (addToSummaryStr(summaryList, waferId, "DEAD", defectStrip.c_str(), defectChip.c_str()).isFailure()) {
-                  ATH_MSG_ERROR("Could not add dead strips to the summary");
-                  return StatusCode::FAILURE;
-               }
-            }
-
-            if (!(defectStrip.empty())) {
-               if (m_writeToCool) {
-                  if (m_pCalibWriteTool->createListStrip(moduleId,m_pSCTHelper,10000,"DEAD",m_deadStripSignificance,defectStrip).isFailure()) {
-                     ATH_MSG_ERROR("Could not create list");
-                     return StatusCode::FAILURE;
-                  }
-               }
-
-               if (addToXML4DB(m_outDeadStrips, waferId, "DEAD", m_deadStripSignificance, defectStrip.c_str()).isFailure()) {
-                  ATH_MSG_ERROR("Could not add dead strips to the summary");
-                  return StatusCode::FAILURE;
-               }
-
-               hasDeadStrip=true;
+    }
+  }
+
+  // Get SCT_DetectorElementCollection
+  SG::ReadCondHandle<InDetDD::SiDetectorElementCollection> sctDetEle{m_SCTDetEleCollKey};
+  const InDetDD::SiDetectorElementCollection* elements{sctDetEle.retrieve()};
+  if (elements==nullptr) {
+    ATH_MSG_FATAL(m_SCTDetEleCollKey.fullKey() << " could not be retrieved");
+    return StatusCode::FAILURE;
+  }
+
+  //Dead identification
+  bool hasDeadStrip{false};
+  bool hasDeadChip{false};
+  bool isNoHitLink{false};
+  bool isDead{false};
+  bool beforeIsDead{false};
+  int n_deadStrip{0};
+  int n_deadChip{0};
+  int n_deadLink{0};
+  int n_deadModule{0};
+  int n_checkedChip{0};
+  int beginDead{0};
+  int endDead{0};
+  std::string defectStrip;
+  std::string defectChip;
+  std::ostringstream summaryList;
+  defectStrip.erase();
+  defectChip.erase();
+  const double deadStripDefinition{ROOT::Math::gaussian_cdf_c(m_deadStripSignificance)};
+  const double deadChipDefinition{ROOT::Math::gaussian_cdf_c(m_deadChipSignificance)};
+
+
+  //--- Loop over wafers
+  waferItr = m_pSCTHelper->wafer_begin();
+  for (; waferItr != waferItrE; ++waferItr) {
+    Identifier waferId{*waferItr};
+    Identifier moduleId{m_pSCTHelper->module_id(waferId)};
+    IdentifierHash waferHash{m_pSCTHelper->wafer_hash(waferId)};
+
+    bool disabledChip[n_chipPerModule] = {false};
+    unsigned int disabledChipFlag=0;
+    double numHitsInStrip[n_stripPerChip*n_chipPerSide] = {0};
+    double numHitsInChip[n_chipPerSide] = {0};
+    double totalHitsInWafer{0};
+    int n_noisyStrip{0};
+    int n_noHitsStrip{0};
+    int n_disabledStrip{0};
+    int n_disabledInChip[n_chipPerSide] = {0};
+
+    //initialize
+    int side{m_pSCTHelper->side(waferId)};
+    if (side==0) {
+      isDead=false;
+      beforeIsDead=false;
+      beginDead=0;
+      endDead=0;
+      defectStrip.erase();
+      defectChip.erase();
+    }
+
+    //check if module/link is disabled or not
+    bool disabled{false};
+    if (badMods->find(moduleId)!=badMods->end()) disabled=true;
+    linkItr=badLinks->find(waferHash);
+    if (linkItr!=linkEnd) {
+      std::pair<bool, bool> status{(*linkItr).second};
+      if ((side==0 and status.first==true) or (side==1 and status.second==true)) disabled=true;
+    }
+
+    //check BS Error
+    bool hasBSError{false};
+    if (m_calibBsErrTool->size(waferHash.value())>0) hasBSError=true;
+    if (disabled or hasBSError) { //goto WRITE_DB; //<-- who ever put this in should be shot; http://xkcd.com/292/
+      if (side==1) {
+        //write to DB & .xml.
+        if (defectChip==" 0-5  6-11 ") {
+          n_deadModule++;
+        } else if (defectChip==" 0-5 " or defectChip==" 6-11 ") {
+          n_deadLink++;
+        }
+
+        if (!(defectStrip.empty()) or !(defectChip.empty())) {
+          if (addToSummaryStr(summaryList, waferId, "DEAD", defectStrip.c_str(), defectChip.c_str()).isFailure()) {
+            ATH_MSG_ERROR("Could not add dead strips to the summary");
+            return StatusCode::FAILURE;
+          }
+        }
+
+        if (!(defectStrip.empty())) {
+          if (m_writeToCool) {
+            if (m_pCalibWriteTool->createListStrip(moduleId, m_pSCTHelper, 10000, "DEAD", m_deadStripSignificance, defectStrip).isFailure()) {
+              ATH_MSG_ERROR("Could not create list");
+              return StatusCode::FAILURE;
             }
+          }
 
-            if (!(defectChip.empty())) {
-               if (m_writeToCool) {
-                  if ( m_pCalibWriteTool->createListChip(moduleId,m_pSCTHelper,10000,"DEAD",m_deadChipSignificance,defectChip).isFailure()) {
-                     ATH_MSG_ERROR("Could not create list");
-                     return StatusCode::FAILURE;
-                  }
-               }
-
-               if (addToXML4DB(m_outDeadChips, waferId, "DEAD", m_deadChipSignificance, defectChip.c_str()).isFailure()) {
-                  ATH_MSG_ERROR("Could not add dead chips to the summary");
-                  return StatusCode::FAILURE;
-                 }
+          if (addToXML4DB(m_outDeadStrips, waferId, "DEAD", m_deadStripSignificance, defectStrip.c_str()).isFailure()) {
+            ATH_MSG_ERROR("Could not add dead strips to the summary");
+            return StatusCode::FAILURE;
+          }
 
-               hasDeadChip=true;
+          hasDeadStrip=true;
+        }
 
+        if (!(defectChip.empty())) {
+          if (m_writeToCool) {
+            if (m_pCalibWriteTool->createListChip(moduleId, m_pSCTHelper, 10000, "DEAD", m_deadChipSignificance, defectChip).isFailure()) {
+              ATH_MSG_ERROR("Could not create list");
+              return StatusCode::FAILURE;
             }
-         }
-         continue;
-      }
-      //retrieving info of chip status
-      chipItr=badChips->find(moduleId);
-      if (chipItr!=chipEnd) disabledChipFlag = (*chipItr).second;
-      for (unsigned int i(0); i<n_chipPerModule; i++) {
-         disabledChip[i] = ((disabledChipFlag & (1<<i)) != 0);
-      }
+          }
 
-      //retrieving #hits in each strip
-      for (int j=0; j<n_stripPerChip*n_chipPerSide; j++) {
-         const InDetDD::SiDetectorElement* pElement = elements->getDetectorElement(waferHash);
-         bool swap=(pElement->swapPhiReadoutDirection()) ? true : false;
-         int chipNum=0;
-         if (side==0) chipNum = swap ? 5-j/n_stripPerChip : j/n_stripPerChip;
-         else chipNum = swap ? 11-j/n_stripPerChip : 6+j/n_stripPerChip;
-         int stripNum = swap ? 767-j : j;
-         Identifier stripId = m_pSCTHelper->strip_id(waferId,j);
-
-         numHitsInStrip[stripNum] = m_calibHitmapTool->getBinForHistogramIndex( j+1, waferHash.value());
-         bool misMatch=false;
-         double n_hitsInDisable=numHitsInStrip[stripNum];
-         if (((disabledChipFlag & (1<<chipNum))!=0) || badStripsExclusive.find(stripId)!=stripEnd) {
-            if (numHitsInStrip[stripNum]!=0) misMatch = true;
-            numHitsInStrip[stripNum] = -99;
-         }
-         if (misMatch) {
-            ATH_MSG_WARNING("hits in disabled Strip : "
-                            <<"n_hits="<<n_hitsInDisable<<", "
-                                <<"bec="<<m_pSCTHelper->barrel_ec(stripId)<<", "
-                            <<"layer="<<m_pSCTHelper->layer_disk(stripId)<<", "
-                            <<"phi="<<m_pSCTHelper->phi_module(stripId)<<", "
-                            <<"eta="<<m_pSCTHelper->eta_module(stripId)<<", "
-                            <<"side="<<m_pSCTHelper->side(stripId)<<", "
-                            <<"strip="<<m_pSCTHelper->strip(stripId));
-         }
-
-         if (numHitsInStrip[stripNum]==0) {
-            n_noHitsStrip++;
-            ATH_MSG_DEBUG("nohit strip : barrel_ec="<<m_pSCTHelper->barrel_ec(stripId)
-                          <<", layer="<<m_pSCTHelper->layer_disk(stripId)<<", phi="<<m_pSCTHelper->phi_module(stripId)
-                          <<", eta="<<m_pSCTHelper->eta_module(stripId)<<", side="<<m_pSCTHelper->side(stripId)
-                          <<", strip=offline"<<m_pSCTHelper->strip(stripId));
-         } else if (numHitsInStrip[stripNum]==-99) {
-            n_disabledStrip++;
-            n_disabledInChip[stripNum/n_stripPerChip]++;
-            ATH_MSG_DEBUG("disabled strip : barrel_ec="<<m_pSCTHelper->barrel_ec(stripId)
-                          <<", layer="<<m_pSCTHelper->layer_disk(stripId)<<", phi="<<m_pSCTHelper->phi_module(stripId)
-                          <<", eta="<<m_pSCTHelper->eta_module(stripId)<<", side="<<m_pSCTHelper->side(stripId)
-                          <<", strip=offline"<<m_pSCTHelper->strip(stripId));
-         } else if (numHitsInStrip[stripNum]/m_numberOfEvents>m_noisyThr4DeadFinding) {
-            n_noisyStrip++;
-         } else {
-            totalHitsInWafer+=numHitsInStrip[stripNum];
-         }
-
-      }//end strip loop
-
-      if (n_disabledStrip==768) {
-         if (side==1) {
-            //write to DB & .xml.
-            if (defectChip==" 0-5  6-11 ") {
-               n_deadModule++;
-            } else if (defectChip==" 0-5 " || defectChip==" 6-11 ") {
-               n_deadLink++;
-            }
-            if (!(defectStrip.empty()) || !(defectChip.empty())) {
-               if (addToSummaryStr(summaryList, waferId, "DEAD", defectStrip.c_str(), defectChip.c_str()).isFailure()) {
-                  ATH_MSG_ERROR("Could not add dead strips to the summary");
-                  return StatusCode::FAILURE;
-               }
+          if (addToXML4DB(m_outDeadChips, waferId, "DEAD", m_deadChipSignificance, defectChip.c_str()).isFailure()) {
+            ATH_MSG_ERROR("Could not add dead chips to the summary");
+            return StatusCode::FAILURE;
+          }
+
+          hasDeadChip=true;
+
+        }
+      }
+      continue;
+    }
+    //retrieving info of chip status
+    chipItr=badChips->find(moduleId);
+    if (chipItr!=chipEnd) disabledChipFlag = (*chipItr).second;
+    for (unsigned int i{0}; i<n_chipPerModule; i++) {
+      disabledChip[i] = ((disabledChipFlag & (1 << i)) != 0);
+    }
+
+    //retrieving #hits in each strip
+    for (int j=0; j<n_stripPerChip*n_chipPerSide; j++) {
+      const InDetDD::SiDetectorElement* pElement{elements->getDetectorElement(waferHash)};
+      bool swap{(pElement->swapPhiReadoutDirection()) ? true : false};
+      int chipNum{0};
+      if (side==0) chipNum = swap ? 5-j/n_stripPerChip : j/n_stripPerChip;
+      else chipNum = swap ? 11-j/n_stripPerChip : 6+j/n_stripPerChip;
+      int stripNum{swap ? 767-j : j};
+      Identifier stripId{m_pSCTHelper->strip_id(waferId, j)};
+
+      numHitsInStrip[stripNum] = m_calibHitmapTool->getBinForHistogramIndex(j+1, waferHash.value());
+      bool misMatch{false};
+      double n_hitsInDisable{numHitsInStrip[stripNum]};
+      if (((disabledChipFlag & (1 << chipNum))!=0) or badStripsExclusive.find(stripId)!=stripEnd) {
+        if (numHitsInStrip[stripNum]!=0) misMatch = true;
+        numHitsInStrip[stripNum] = -99;
+      }
+      if (misMatch) {
+        ATH_MSG_WARNING("hits in disabled Strip : "
+                        << "n_hits=" << n_hitsInDisable << ", "
+                        << "bec=" << m_pSCTHelper->barrel_ec(stripId) << ", "
+                        << "layer=" << m_pSCTHelper->layer_disk(stripId) << ", "
+                        << "phi=" << m_pSCTHelper->phi_module(stripId) << ", "
+                        << "eta=" << m_pSCTHelper->eta_module(stripId) << ", "
+                        << "side=" << m_pSCTHelper->side(stripId) << ", "
+                        << "strip=" << m_pSCTHelper->strip(stripId));
+      }
+
+      if (numHitsInStrip[stripNum]==0) {
+        n_noHitsStrip++;
+        ATH_MSG_DEBUG("nohit strip : barrel_ec=" << m_pSCTHelper->barrel_ec(stripId)
+                      << ", layer=" << m_pSCTHelper->layer_disk(stripId) << ", phi=" << m_pSCTHelper->phi_module(stripId)
+                      << ", eta=" << m_pSCTHelper->eta_module(stripId) << ", side=" << m_pSCTHelper->side(stripId)
+                      << ", strip=offline" << m_pSCTHelper->strip(stripId));
+      } else if (numHitsInStrip[stripNum]==-99) {
+        n_disabledStrip++;
+        n_disabledInChip[stripNum/n_stripPerChip]++;
+        ATH_MSG_DEBUG("disabled strip : barrel_ec=" << m_pSCTHelper->barrel_ec(stripId)
+                      << ", layer=" << m_pSCTHelper->layer_disk(stripId) << ", phi=" << m_pSCTHelper->phi_module(stripId)
+                      << ", eta=" << m_pSCTHelper->eta_module(stripId) << ", side=" << m_pSCTHelper->side(stripId)
+                      << ", strip=offline" << m_pSCTHelper->strip(stripId));
+      } else if (numHitsInStrip[stripNum]/m_numberOfEvents>m_noisyThr4DeadFinding) {
+        n_noisyStrip++;
+      } else {
+        totalHitsInWafer+=numHitsInStrip[stripNum];
+      }
+
+    }//end strip loop
+
+    if (n_disabledStrip==768) {
+      if (side==1) {
+        //write to DB & .xml.
+        if (defectChip==" 0-5  6-11 ") {
+          n_deadModule++;
+        } else if (defectChip==" 0-5 " or defectChip==" 6-11 ") {
+          n_deadLink++;
+        }
+        if (!(defectStrip.empty()) or !(defectChip.empty())) {
+          if (addToSummaryStr(summaryList, waferId, "DEAD", defectStrip.c_str(), defectChip.c_str()).isFailure()) {
+            ATH_MSG_ERROR("Could not add dead strips to the summary");
+            return StatusCode::FAILURE;
+          }
+        }
+
+        if (!(defectStrip.empty())) {
+          if (m_writeToCool) {
+            if (m_pCalibWriteTool->createListStrip(moduleId, m_pSCTHelper, 10000, "DEAD", m_deadStripSignificance, defectStrip).isFailure()) {
+              ATH_MSG_ERROR("Could not create strip list");
+              return StatusCode::FAILURE;
             }
+          }
 
-            if (!(defectStrip.empty())) {
-               if (m_writeToCool) {
-                  if (m_pCalibWriteTool->createListStrip(moduleId,m_pSCTHelper,10000,"DEAD",m_deadStripSignificance,defectStrip).isFailure()) {
-                     ATH_MSG_ERROR("Could not create strip list");
-                     return StatusCode::FAILURE;
-                  }
-               }
-
-               if (addToXML4DB(m_outDeadStrips, waferId, "DEAD", m_deadStripSignificance, defectStrip.c_str()).isFailure()) {
-                  ATH_MSG_ERROR("Could not add xml strip list");
-                  return StatusCode::FAILURE;
-               }
-               hasDeadStrip=true;
-
+          if (addToXML4DB(m_outDeadStrips, waferId, "DEAD", m_deadStripSignificance, defectStrip.c_str()).isFailure()) {
+            ATH_MSG_ERROR("Could not add xml strip list");
+            return StatusCode::FAILURE;
+          }
+          hasDeadStrip=true;
+
+        }
+        if (!(defectChip.empty())) {
+          if (m_writeToCool) {
+            if (m_pCalibWriteTool->createListChip(moduleId, m_pSCTHelper, 10000, "DEAD", m_deadChipSignificance, defectChip).isFailure()) {
+              ATH_MSG_ERROR("Could not create strip list");
+              return StatusCode::FAILURE;
             }
-            if (!(defectChip.empty())) {
-               if (m_writeToCool) {
-                  if (m_pCalibWriteTool->createListChip(moduleId,m_pSCTHelper,10000,"DEAD",m_deadChipSignificance,defectChip).isFailure()) {
-                     ATH_MSG_ERROR("Could not create strip list");
-                     return StatusCode::FAILURE;
-                  }
-               }
-
-               if (addToXML4DB(m_outDeadChips, waferId, "DEAD", m_deadChipSignificance, defectChip.c_str()).isFailure()) {
-                  ATH_MSG_ERROR("Could not add xml chip list");
-                  return StatusCode::FAILURE;
-               }
-
-               hasDeadChip=true;
+          }
 
+          if (addToXML4DB(m_outDeadChips, waferId, "DEAD", m_deadChipSignificance, defectChip.c_str()).isFailure()) {
+            ATH_MSG_ERROR("Could not add xml chip list");
+            return StatusCode::FAILURE;
+          }
+
+          hasDeadChip=true;
+
+        }
+      }
+      continue;
+
+    }
+
+    isNoHitLink=false;
+    if (n_noHitsStrip+n_disabledStrip==768) {
+      n_checkedChip+=n_chipPerSide;
+      isNoHitLink=true;
+
+      double meanOccu{0.};
+      if (m_pSCTHelper->barrel_ec(waferId)==BARREL) meanOccu=meanOccupancy_Barrel[m_pSCTHelper->layer_disk(waferId)];
+      else meanOccu=meanOccupancy_EC[m_pSCTHelper->layer_disk(waferId)][m_pSCTHelper->eta_module(waferId)];
+      double sum_binomial{ROOT::Math::binomial_cdf(0, meanOccu, m_numberOfEvents*n_stripPerChip*n_chipPerSide)};
+
+      if (sum_binomial<deadChipDefinition) {
+        ATH_MSG_INFO("DEADLINK : " << moduleId << ", side=" << side);
+        n_deadChip+=n_chipPerSide;
+
+        //For DeadStrip
+        if (m_doDeadStrip) {
+          if (side==0) beginDead=0, endDead=767;
+          else beginDead=768, endDead=1535;
+          defectStrip = m_pCalibWriteTool->addDefect(defectStrip, beginDead, endDead);
+        }
+
+        //For DeadChip
+        if (m_doDeadChip) {
+          if (side==0) beginDead=0, endDead=5;
+          else beginDead=6, endDead=11;
+          defectChip = m_pCalibWriteTool->addDefect(defectChip, beginDead, endDead);
+        }
+
+        if (side==1) {
+          //write to DB & .xml.
+          if (defectChip==" 0-5  6-11 ") {
+            n_deadModule++;
+          } else if (defectChip==" 0-5 " or defectChip==" 6-11 ") {
+            n_deadLink++;
+          }
+
+          if (!(defectStrip.empty()) or !(defectChip.empty())) {
+            if (addToSummaryStr(summaryList, waferId, "DEAD", defectStrip.c_str(), defectChip.c_str()).isFailure()) {
+              ATH_MSG_ERROR("Could not add dead strips to the summary");
+              return StatusCode::FAILURE;
             }
-         }
-         continue;
-
-      }
-
-      isNoHitLink=false;
-      if (n_noHitsStrip+n_disabledStrip==768) {
-         n_checkedChip+=n_chipPerSide;
-         isNoHitLink=true;
-
-         double meanOccu=0;
-         if (m_pSCTHelper->barrel_ec(waferId)==BARREL) meanOccu=meanOccupancy_Barrel[m_pSCTHelper->layer_disk(waferId)];
-         else meanOccu=meanOccupancy_EC[m_pSCTHelper->layer_disk(waferId)][m_pSCTHelper->eta_module(waferId)];
-         double sum_binomial = ROOT::Math::binomial_cdf(0, meanOccu, m_numberOfEvents*n_stripPerChip*n_chipPerSide);
-
-         if (sum_binomial<deadChipDefinition) {
-            ATH_MSG_INFO("DEADLINK : "<<moduleId<<", side="<<side);
-            n_deadChip+=n_chipPerSide;
-
-            //For DeadStrip
-            if (m_doDeadStrip) {
-               if (side==0) beginDead=0, endDead=767;
-               else beginDead=768, endDead=1535;
-               defectStrip = m_pCalibWriteTool->addDefect(defectStrip,beginDead,endDead);
+          }
+          if (!(defectStrip.empty())) {
+            if (m_writeToCool) {
+              if (m_pCalibWriteTool->createListStrip(moduleId, m_pSCTHelper, 10000, "DEAD", m_deadStripSignificance, defectStrip).isFailure()) {
+                ATH_MSG_ERROR("Could not create strip list");
+                return StatusCode::FAILURE;
+              }
             }
 
-            //For DeadChip
-            if (m_doDeadChip) {
-               if (side==0) beginDead=0, endDead=5;
-               else beginDead=6, endDead=11;
-               defectChip = m_pCalibWriteTool->addDefect(defectChip,beginDead,endDead);
+            if (addToXML4DB(m_outDeadStrips, waferId, "DEAD", m_deadStripSignificance, defectStrip.c_str()).isFailure()) {
+              ATH_MSG_ERROR("Could not add xml strip list");
+              return StatusCode::FAILURE;
             }
 
-            if (side==1) {
-               //write to DB & .xml.
-               if (defectChip==" 0-5  6-11 ") {
-                  n_deadModule++;
-               } else if (defectChip==" 0-5 " || defectChip==" 6-11 ") {
-                  n_deadLink++;
-               }
-
-               if (!(defectStrip.empty()) || !(defectChip.empty())) {
-                  if (addToSummaryStr(summaryList, waferId, "DEAD", defectStrip.c_str(), defectChip.c_str()).isFailure()) {
-                     ATH_MSG_ERROR("Could not add dead strips to the summary");
-                     return StatusCode::FAILURE;
-                  }
-               }
-               if (!(defectStrip.empty())) {
-                  if (m_writeToCool) {
-                     if (m_pCalibWriteTool->createListStrip(moduleId,m_pSCTHelper,10000,"DEAD",m_deadStripSignificance,defectStrip).isFailure()) {
-                        ATH_MSG_ERROR("Could not create strip list");
-                        return StatusCode::FAILURE;
-                    }
-                  }
-
-                  if (addToXML4DB(m_outDeadStrips, waferId, "DEAD", m_deadStripSignificance, defectStrip.c_str()).isFailure()) {
-                     ATH_MSG_ERROR("Could not add xml strip list");
-                     return StatusCode::FAILURE;
-                  }
-
-                  hasDeadStrip=true;
+            hasDeadStrip=true;
 
-               }
-
-               if (!(defectChip.empty())) {
-                  if (m_writeToCool) {
-                     if ( m_pCalibWriteTool->createListChip(moduleId,m_pSCTHelper,10000,"DEAD",m_deadChipSignificance,defectChip).isFailure()) {
-                        ATH_MSG_ERROR("Could not create chip list");
-                        return StatusCode::FAILURE;
-                     } 
-                  }
+          }
 
-                  if (addToXML4DB(m_outDeadChips, waferId, "DEAD", m_deadChipSignificance, defectChip.c_str()).isFailure()) {
-                     ATH_MSG_ERROR("Could not add xml chip list");
-                     return StatusCode::FAILURE;
-                  }
-
-                  hasDeadChip=true;
-
-               }
-            }
-            continue;
-         }
-      }//end DeadLink
-
-      if (n_noHitsStrip>0) {
-         int n_deadStripInWafer=0;
-         int n_deadChipInWafer=0;
-
-         double n_effectiveEvents=0;
-         if (busyStream) n_effectiveEvents = m_numberOfEvents*(n_stripPerChip*n_chipPerSide-n_disabledStrip-n_noisyStrip-n_noHitsStrip);
-         else n_effectiveEvents = m_numberOfEvents*(n_stripPerChip*n_chipPerSide-n_disabledStrip-n_noisyStrip);
-
-         //First, check DeadChip
-         double meanOccupancy = totalHitsInWafer/n_effectiveEvents;
-         for (int j=0; j<n_stripPerChip*n_chipPerSide; j++) {
-            if (numHitsInStrip[j]>0) numHitsInChip[j/n_stripPerChip] += numHitsInStrip[j];
-         }
-
-         for (int j=0; j<n_chipPerSide; j++) {
-            isDead=false;
-            int chipNum = side==0 ? j : j+6;
-            if (numHitsInChip[j]==0 && !disabledChip[chipNum]) {
-               if (!isNoHitLink) n_checkedChip++;
-               double sum_binomial = ROOT::Math::binomial_cdf(0, meanOccupancy, m_numberOfEvents*(n_stripPerChip-n_disabledInChip[j]));
-               if (sum_binomial<deadChipDefinition) {
-                  ATH_MSG_INFO("DEADCHIP : "<<moduleId<<", side="<<side
-                               <<", chip(online)="<<(side==0 ? j : j+n_chipPerSide));
-                  isDead=true;
-                  n_deadChip++;
-                  n_deadChipInWafer++;
-                  endDead = side==0 ? j : j+n_chipPerSide;
-                  if (!beforeIsDead) beginDead = side==0 ? j : j+n_chipPerSide;
-               }
+          if (!(defectChip.empty())) {
+            if (m_writeToCool) {
+              if (m_pCalibWriteTool->createListChip(moduleId, m_pSCTHelper, 10000, "DEAD", m_deadChipSignificance, defectChip).isFailure()) {
+                ATH_MSG_ERROR("Could not create chip list");
+                return StatusCode::FAILURE;
+              } 
             }
 
-            if (m_doDeadChip) {
-               if ((beforeIsDead && !isDead) || (j==5 && isDead)) defectChip = m_pCalibWriteTool->addDefect(defectChip,beginDead,endDead);
+            if (addToXML4DB(m_outDeadChips, waferId, "DEAD", m_deadChipSignificance, defectChip.c_str()).isFailure()) {
+              ATH_MSG_ERROR("Could not add xml chip list");
+              return StatusCode::FAILURE;
             }
-            beforeIsDead = isDead;
-         }//end chip loop
-
-         //Second, check DeadStrip
-         if (m_doDeadStrip) {
-            double meanOccExceptDeadChip=totalHitsInWafer/(n_effectiveEvents-n_stripPerChip*n_deadChipInWafer);
-            double numHitsInStripOnlineOrder[n_stripPerChip*n_chipPerSide]= {0};
-            for (int j=0; j<n_stripPerChip*n_chipPerSide; j++) {
-               numHitsInStripOnlineOrder[j] = side==0 ? numHitsInStrip[j] : numHitsInStrip[n_stripPerChip*n_chipPerSide-j];
-               isDead=false;
-               if (numHitsInStripOnlineOrder[j]==0) {
-                  double sum_binomial = ROOT::Math::binomial_cdf(0, meanOccExceptDeadChip, m_numberOfEvents);
-                  if (sum_binomial<deadStripDefinition) {
-                     ATH_MSG_INFO("DEADSTRIP : "<<moduleId<<", side="<<side<<", strip(offline)="<<j);
-                     isDead=true;
-                     n_deadStrip++;
-                     n_deadStripInWafer++;
-                     endDead = side==0 ? j : j+n_stripPerChip*n_chipPerSide;
-                     if (!beforeIsDead) beginDead = side==0 ? j : j+n_stripPerChip*n_chipPerSide;
-                  }
-               }
 
-               if (m_doDeadStrip) {
-                  if ((beforeIsDead && !isDead) || (j==5 && isDead)) defectStrip = m_pCalibWriteTool->addDefect(defectStrip,beginDead,endDead);
-               }
-               beforeIsDead = isDead;
+            hasDeadChip=true;
+
+          }
+        }
+        continue;
+      }
+    }//end DeadLink
+
+    if (n_noHitsStrip>0) {
+      int n_deadStripInWafer{0};
+      int n_deadChipInWafer{0};
+
+      double n_effectiveEvents{0.};
+      if (busyStream) n_effectiveEvents = m_numberOfEvents*(n_stripPerChip*n_chipPerSide-n_disabledStrip-n_noisyStrip-n_noHitsStrip);
+      else n_effectiveEvents = m_numberOfEvents*(n_stripPerChip*n_chipPerSide-n_disabledStrip-n_noisyStrip);
+
+      //First, check DeadChip
+      double meanOccupancy{totalHitsInWafer/n_effectiveEvents};
+      for (int j{0}; j<n_stripPerChip*n_chipPerSide; j++) {
+        if (numHitsInStrip[j]>0) numHitsInChip[j/n_stripPerChip] += numHitsInStrip[j];
+      }
+
+      for (int j{0}; j<n_chipPerSide; j++) {
+        isDead=false;
+        int chipNum{side==0 ? j : j+6};
+        if (numHitsInChip[j]==0 and !disabledChip[chipNum]) {
+          if (!isNoHitLink) n_checkedChip++;
+          double sum_binomial{ROOT::Math::binomial_cdf(0, meanOccupancy, m_numberOfEvents*(n_stripPerChip-n_disabledInChip[j]))};
+          if (sum_binomial<deadChipDefinition) {
+            ATH_MSG_INFO("DEADCHIP : " << moduleId << ", side=" << side
+                         << ", chip(online)=" << (side==0 ? j : j+n_chipPerSide));
+            isDead=true;
+            n_deadChip++;
+            n_deadChipInWafer++;
+            endDead = side==0 ? j : j+n_chipPerSide;
+            if (!beforeIsDead) beginDead = side==0 ? j : j+n_chipPerSide;
+          }
+        }
+
+        if (m_doDeadChip) {
+          if ((beforeIsDead and !isDead) or (j==5 and isDead)) defectChip = m_pCalibWriteTool->addDefect(defectChip, beginDead, endDead);
+        }
+        beforeIsDead = isDead;
+      }//end chip loop
+
+      //Second, check DeadStrip
+      if (m_doDeadStrip) {
+        double meanOccExceptDeadChip{totalHitsInWafer/(n_effectiveEvents-n_stripPerChip*n_deadChipInWafer)};
+        double numHitsInStripOnlineOrder[n_stripPerChip*n_chipPerSide] = {0};
+        for (int j{0}; j<n_stripPerChip*n_chipPerSide; j++) {
+          numHitsInStripOnlineOrder[j] = side==0 ? numHitsInStrip[j] : numHitsInStrip[n_stripPerChip*n_chipPerSide-j];
+          isDead=false;
+          if (numHitsInStripOnlineOrder[j]==0) {
+            double sum_binomial{ROOT::Math::binomial_cdf(0, meanOccExceptDeadChip, m_numberOfEvents)};
+            if (sum_binomial<deadStripDefinition) {
+              ATH_MSG_INFO("DEADSTRIP : " << moduleId << ", side=" << side << ", strip(offline)=" << j);
+              isDead=true;
+              n_deadStrip++;
+              n_deadStripInWafer++;
+              endDead = side==0 ? j : j+n_stripPerChip*n_chipPerSide;
+              if (!beforeIsDead) beginDead = side==0 ? j : j+n_stripPerChip*n_chipPerSide;
             }
-         }
+          }
+
+          if (m_doDeadStrip) {
+            if ((beforeIsDead and !isDead) or (j==5 and isDead)) defectStrip = m_pCalibWriteTool->addDefect(defectStrip, beginDead, endDead);
+          }
+          beforeIsDead = isDead;
+        }
       }
+    }
 
-      //go to next wafer itr
-   }//Wafer Loop end
+    //go to next wafer itr
+  }//Wafer Loop end
 
 
    //Close Files
-   if (m_doDeadStrip) {
-      ATH_MSG_INFO("total #DeadStrip : "<<n_deadStrip);
-      if (closeXML4DB(m_outDeadStrips).isFailure()) {
-         ATH_MSG_ERROR("Problem closing "<<m_deadStripsFile);
-         return StatusCode::FAILURE;
-      }
-   }
-   if (m_doDeadChip) {
-      ATH_MSG_INFO("total #DeadChip : "<<n_deadChip<<", #noHitChip : "<<n_checkedChip);
-      if (closeXML4DB(m_outDeadChips).isFailure()) {
-         ATH_MSG_ERROR("Problem closing "<<m_deadChipsFile);
-         return StatusCode::FAILURE;
-      }
-   }
-
-   //Making Summary File
-   if (openXML4DeadSummary(m_outDeadSummary, "DEAD", n_deadModule, n_deadLink, n_deadChip, n_deadStrip).isFailure()) {
-      ATH_MSG_ERROR("Problem opening "<<m_deadSummaryFile);
+  if (m_doDeadStrip) {
+    ATH_MSG_INFO("total #DeadStrip : " << n_deadStrip);
+    if (closeXML4DB(m_outDeadStrips).isFailure()) {
+      ATH_MSG_ERROR("Problem closing " << m_deadStripsFile);
       return StatusCode::FAILURE;
-   }
-   if (wrapUpXML4Summary(m_outDeadSummary, "DEAD", summaryList).isFailure()) {
-      ATH_MSG_ERROR("Problem closing "<<m_deadSummaryFile);
+    }
+  }
+  if (m_doDeadChip) {
+    ATH_MSG_INFO("total #DeadChip : " << n_deadChip << ", #noHitChip : " << n_checkedChip);
+    if (closeXML4DB(m_outDeadChips).isFailure()) {
+      ATH_MSG_ERROR("Problem closing " << m_deadChipsFile);
       return StatusCode::FAILURE;
-   }
-
-   if ( m_writeToCool ) {
-      if (m_doDeadStrip && hasDeadStrip) {
-         if ( m_pCalibWriteTool->wrapUpDeadStrips().isFailure() ) {
-            ATH_MSG_ERROR("Could not get DeadStrips Info");
-            return StatusCode::FAILURE;
-         }
-      }
-      if (m_doDeadChip && hasDeadChip) {
-         if ( m_pCalibWriteTool->wrapUpDeadChips().isFailure() ) {
-            ATH_MSG_ERROR("Could not get DeadChips Info");
-            return StatusCode::FAILURE;
-         }
-      }
-   }
-
-   ATH_MSG_INFO("END HERE");
-   return StatusCode::SUCCESS;
+    }
+  }
+
+  //Making Summary File
+  if (openXML4DeadSummary(m_outDeadSummary, "DEAD", n_deadModule, n_deadLink, n_deadChip, n_deadStrip).isFailure()) {
+    ATH_MSG_ERROR("Problem opening " << m_deadSummaryFile);
+    return StatusCode::FAILURE;
+  }
+  if (wrapUpXML4Summary(m_outDeadSummary, "DEAD", summaryList).isFailure()) {
+    ATH_MSG_ERROR("Problem closing " << m_deadSummaryFile);
+    return StatusCode::FAILURE;
+  }
+
+  if (m_writeToCool) {
+    if (m_doDeadStrip and hasDeadStrip) {
+      if (m_pCalibWriteTool->wrapUpDeadStrips().isFailure()) {
+        ATH_MSG_ERROR("Could not get DeadStrips Info");
+        return StatusCode::FAILURE;
+      }
+    }
+    if (m_doDeadChip and hasDeadChip) {
+      if (m_pCalibWriteTool->wrapUpDeadChips().isFailure()) {
+        ATH_MSG_ERROR("Could not get DeadChips Info");
+        return StatusCode::FAILURE;
+      }
+    }
+  }
+
+  ATH_MSG_INFO("END HERE");
+  return StatusCode::SUCCESS;
 }
 
 
@@ -1173,214 +1157,213 @@ StatusCode SCTCalib::getDeadStrip() {
 
 StatusCode SCTCalib::getNoiseOccupancy()
 {
-   ATH_MSG_INFO("----- in getNoiseOccupancy() -----");
-
-   //--- Initialization
-   int n_phiBinsBarrel[ n_barrels ] = { n_phiBinsB0, n_phiBinsB1, n_phiBinsB2, n_phiBinsB3 };
-   int n_phiBinsEndcap[ n_disks ][ n_etaBinsEC ] = { { n_phiBinsECOuter, n_phiBinsECMiddle,                0 },
-      { n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort },
-      { n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort },
-      { n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort },
-      { n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort },
-      { n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort },
-      { n_phiBinsECOuter, n_phiBinsECMiddle,                0 },
-      { n_phiBinsECOuter, n_phiBinsECMiddle,                0 },
-      { n_phiBinsECOuter,                 0,                0 }
-   };
-
-   double meanNO_Barrel[ n_barrels ] = { 0 };
-   double meanNO_ECA[ n_disks ][ n_etaBinsEC ] = { {0}, {0} };
-   double meanNO_ECC[ n_disks ][ n_etaBinsEC ] = { {0}, {0} };
-
-   //--- RunNumber
-   std::ostringstream runnum;
-   runnum << m_runNumber.value();
-
-   //--- Directory in HIST
-   std::string stem;
-
-   //--- EndcapC
-   stem = "/run_" + runnum.str() + "/SCT/SCTEC/Noise/";
-   m_pnoiseoccupancymapHistoVectorECm.clear();
-   for ( int iDisk = 0; iDisk < n_disks ; ++iDisk ) {
-      for ( int iSide = 0; iSide < 2; ++iSide ) {
-         ostringstream streamHist;
-         streamHist << "noiseoccupancymap";
-         if ( m_noiseOccupancyTriggerAware ) streamHist << "trigger";
-         streamHist << "ECm_" << iDisk << "_" << iSide;
-         std::string histName = stem + streamHist.str();
-         TProfile2D* hist_tmp = dynamic_cast<TProfile2D*>(m_inputHist->Get( histName.c_str() ));
-         m_pnoiseoccupancymapHistoVectorECm.push_back( hist_tmp );
-      }
-   }
-   //--- Barrel
-   stem = "/run_" + runnum.str() + "/SCT/SCTB/Noise/";
-   m_pnoiseoccupancymapHistoVector.clear();
-   for ( int iLayer = 0; iLayer < n_barrels ; ++iLayer ) {
-      for ( int iSide = 0; iSide < 2; ++iSide ) {
-         ostringstream streamHist;
-         streamHist << "noiseoccupancymap";
-         if ( m_noiseOccupancyTriggerAware ) streamHist << "trigger";
-         streamHist << "_" << iLayer << "_" << iSide;
-         std::string histName = stem + streamHist.str();
-         TProfile2D* hist_tmp = dynamic_cast<TProfile2D*>(m_inputHist->Get( histName.c_str() ));
-         m_pnoiseoccupancymapHistoVector.push_back( hist_tmp );
-      }
-   }
-   //--- EndcapA
-   stem = "/run_" + runnum.str() + "/SCT/SCTEA/Noise/";
-   m_pnoiseoccupancymapHistoVectorECp.clear();
-   for ( int iDisk = 0; iDisk < n_disks ; ++iDisk ) {
-      for ( int iSide = 0; iSide < 2; ++iSide ) {
-         ostringstream streamHist;
-         streamHist << "noiseoccupancymap";
-         if ( m_noiseOccupancyTriggerAware ) streamHist << "trigger";
-         streamHist << "ECp_" << iDisk << "_" << iSide;
-         std::string histName = stem + streamHist.str();
-         TProfile2D* hist_tmp = dynamic_cast<TProfile2D*>(m_inputHist->Get( histName.c_str() ));
-         m_pnoiseoccupancymapHistoVectorECp.push_back( hist_tmp );
-      }
-   }
-
-   //--- XML file
-   const char* outputNoiseOccupancyFileName = m_noiseOccupancyFile.value().c_str();
-   ofstream outFile( outputNoiseOccupancyFileName, std::ios::out );
-   if ( !outFile.good() ) {
-      ATH_MSG_ERROR("Unable to open NoiseOccupancyFile : " << outputNoiseOccupancyFileName);
-      return StatusCode::FAILURE;
-   }
-
-   //--- Header for XML outputs
-   ostringstream osHeader;
-   osHeader << "<channels server=\"ATLAS_COOLPROD\" schema=\"ATLAS_COOLOFL_SCT\" dbname=\"MONP200\" folder=\"SCT/Derived/NoiseOccupancy\" "
-            << "since=\""   << m_iovStart.re_time()   << "\" "
-            << "until=\""   << m_iovStop.re_time()    << "\" "
-            << "tag=\""     << m_tagID4NoiseOccupancy << "\" "
-            << "version=\"" << "multi\">"<< endl;
-   outFile << osHeader.str();
-
-   //--- EndcapC
-   for ( int iDisk = 0; iDisk < n_disks ; ++iDisk ) {
-      for ( int iSide = 0; iSide < 2; ++iSide ) {
-         for ( int iEta = 0; iEta < n_etaBinsEC; ++iEta ) {
-            for ( int iPhi = 0; iPhi < n_phiBinsEndcap[iDisk][iEta]; ++iPhi ) {
-               Identifier waferId = m_pSCTHelper->wafer_id( ENDCAP_C, iDisk, iPhi, iEta, iSide );
-               float occupancy = m_pnoiseoccupancymapHistoVectorECm[ 2*iDisk + iSide ]->GetBinContent( iEta+1, iPhi+1 );
-               occupancy /= float( ntimeBins );
-               occupancy /= 1E5;
-               //--- For calculating average Noise Occupancy
-               meanNO_ECC[iDisk][iEta]+=occupancy;
-               //outFile << outFile << xmlChannelNoiseOccDataString(waferId, occupancy)<<endl;
-               IdentifierHash   waferHash = m_pSCTHelper->wafer_hash( waferId );
-               SCT_SerialNumber sn        = m_CablingTool->getSerialNumberFromHash( waferHash );
-               outFile << xmlChannelNoiseOccDataString(waferId, occupancy, sn)<<endl;
-               //--- DB output
-               if ( m_writeToCool ) {
-                  if ( m_pCalibWriteTool->createListNO( waferId, m_pSCTHelper, 10000, occupancy ).isFailure() ) {
-                     ATH_MSG_ERROR("Unable to run createListNO");
-                     return StatusCode::FAILURE;
-                  }
-               }
+  ATH_MSG_INFO("----- in getNoiseOccupancy() -----");
+
+  //--- Initialization
+  int n_phiBinsBarrel[n_barrels] = {n_phiBinsB0, n_phiBinsB1, n_phiBinsB2, n_phiBinsB3};
+  int n_phiBinsEndcap[n_disks][n_etaBinsEC] = {{n_phiBinsECOuter, n_phiBinsECMiddle,                0}, 
+                                               {n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort}, 
+                                               {n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort}, 
+                                               {n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort}, 
+                                               {n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort}, 
+                                               {n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort}, 
+                                               {n_phiBinsECOuter, n_phiBinsECMiddle,                0}, 
+                                               {n_phiBinsECOuter, n_phiBinsECMiddle,                0}, 
+                                               {n_phiBinsECOuter,                 0,                0}
+  };
+  
+  double meanNO_Barrel[n_barrels] = {0};
+  double meanNO_ECA[n_disks][n_etaBinsEC] = {{0}, {0}};
+  double meanNO_ECC[n_disks][n_etaBinsEC] = {{0}, {0}};
+
+  //--- RunNumber
+  std::ostringstream runnum;
+  runnum << m_runNumber.value();
+
+  //--- Directory in HIST
+  std::string stem;
+
+  //--- EndcapC
+  stem = "/run_" + runnum.str() + "/SCT/SCTEC/Noise/";
+  m_pnoiseoccupancymapHistoVectorECm.clear();
+  for (int iDisk{0}; iDisk < n_disks ; ++iDisk) {
+    for (int iSide{0}; iSide < 2; ++iSide) {
+      ostringstream streamHist;
+      streamHist << "noiseoccupancymap";
+      if (m_noiseOccupancyTriggerAware) streamHist << "trigger";
+      streamHist << "ECm_" << iDisk << "_" << iSide;
+      std::string histName{stem + streamHist.str()};
+      TProfile2D* hist_tmp{dynamic_cast<TProfile2D*>(m_inputHist->Get(histName.c_str()))};
+      m_pnoiseoccupancymapHistoVectorECm.push_back(hist_tmp);
+    }
+  }
+  //--- Barrel
+  stem = "/run_" + runnum.str() + "/SCT/SCTB/Noise/";
+  m_pnoiseoccupancymapHistoVector.clear();
+  for (int iLayer{0}; iLayer < n_barrels ; ++iLayer) {
+    for (int iSide{0}; iSide < 2; ++iSide) {
+      ostringstream streamHist;
+      streamHist << "noiseoccupancymap";
+      if (m_noiseOccupancyTriggerAware) streamHist << "trigger";
+      streamHist << "_" << iLayer << "_" << iSide;
+      std::string histName{stem + streamHist.str()};
+      TProfile2D* hist_tmp{dynamic_cast<TProfile2D*>(m_inputHist->Get(histName.c_str()))};
+      m_pnoiseoccupancymapHistoVector.push_back(hist_tmp);
+    }
+  }
+  //--- EndcapA
+  stem = "/run_" + runnum.str() + "/SCT/SCTEA/Noise/";
+  m_pnoiseoccupancymapHistoVectorECp.clear();
+  for (int iDisk{0}; iDisk < n_disks ; ++iDisk) {
+    for (int iSide{0}; iSide < 2; ++iSide) {
+      ostringstream streamHist;
+      streamHist << "noiseoccupancymap";
+      if (m_noiseOccupancyTriggerAware) streamHist << "trigger";
+      streamHist << "ECp_" << iDisk << "_" << iSide;
+      std::string histName{stem + streamHist.str()};
+      TProfile2D* hist_tmp{dynamic_cast<TProfile2D*>(m_inputHist->Get(histName.c_str()))};
+      m_pnoiseoccupancymapHistoVectorECp.push_back(hist_tmp);
+    }
+  }
+
+  //--- XML file
+  const char* outputNoiseOccupancyFileName{m_noiseOccupancyFile.value().c_str()};
+  ofstream outFile{outputNoiseOccupancyFileName, std::ios::out};
+  if (!outFile.good()) {
+    ATH_MSG_ERROR("Unable to open NoiseOccupancyFile : " << outputNoiseOccupancyFileName);
+    return StatusCode::FAILURE;
+  }
+
+  //--- Header for XML outputs
+  ostringstream osHeader;
+  osHeader << "<channels server=\"ATLAS_COOLPROD\" schema=\"ATLAS_COOLOFL_SCT\" dbname=\"MONP200\" folder=\"SCT/Derived/NoiseOccupancy\" "
+           << "since=\""   << m_iovStart.re_time()   << "\" "
+           << "until=\""   << m_iovStop.re_time()    << "\" "
+           << "tag=\""     << m_tagID4NoiseOccupancy << "\" "
+           << "version=\"" << "multi\">" << endl;
+  outFile << osHeader.str();
+
+  //--- EndcapC
+  for (int iDisk{0}; iDisk < n_disks ; ++iDisk) {
+    for (int iSide{0}; iSide < 2; ++iSide) {
+      for (int iEta{0}; iEta < n_etaBinsEC; ++iEta) {
+        for (int iPhi{0}; iPhi < n_phiBinsEndcap[iDisk][iEta]; ++iPhi) {
+          Identifier waferId = m_pSCTHelper->wafer_id(ENDCAP_C, iDisk, iPhi, iEta, iSide);
+          float occupancy{static_cast<float>(m_pnoiseoccupancymapHistoVectorECm[2*iDisk + iSide]->GetBinContent(iEta+1, iPhi+1))};
+          occupancy /= static_cast<float>(ntimeBins);
+          occupancy /= 1E5;
+          //--- For calculating average Noise Occupancy
+          meanNO_ECC[iDisk][iEta]+=occupancy;
+          IdentifierHash waferHash{m_pSCTHelper->wafer_hash(waferId)};
+          SCT_SerialNumber sn{m_CablingTool->getSerialNumberFromHash(waferHash)};
+          outFile << xmlChannelNoiseOccDataString(waferId, occupancy, sn) << endl;
+          //--- DB output
+          if (m_writeToCool) {
+            if (m_pCalibWriteTool->createListNO(waferId, m_pSCTHelper, 10000, occupancy).isFailure()) {
+              ATH_MSG_ERROR("Unable to run createListNO");
+              return StatusCode::FAILURE;
             }
-         }
-      }
-   }
-   //--- Barrel
-   for ( int iLayer = 0; iLayer < n_barrels; ++iLayer ) {
-      for ( int iSide = 0; iSide < 2; ++iSide ) {
-         for ( int iEta = 0; iEta < n_etaBins; ++iEta ) {
-            if ( iEta-6 == 0 ) continue;
-            for ( int iPhi = 0; iPhi < n_phiBinsBarrel[iLayer]; ++iPhi ) {
-               Identifier waferId = m_pSCTHelper->wafer_id( BARREL, iLayer, iPhi, iEta-6, iSide );
-               float occupancy = m_pnoiseoccupancymapHistoVector[ 2*iLayer + iSide ]->GetBinContent( iEta+1, iPhi+1 );
-               occupancy /= float( ntimeBins );
-               occupancy /= 1E5;
-               //--- For calculating average Noise Occupancy
-               meanNO_Barrel[iLayer]+=occupancy;
-               IdentifierHash   waferHash = m_pSCTHelper->wafer_hash( waferId );
-               SCT_SerialNumber sn        = m_CablingTool->getSerialNumberFromHash( waferHash );
-               outFile << xmlChannelNoiseOccDataString(waferId, occupancy, sn)<<endl;
-               //--- DB output
-               if ( m_writeToCool ) {
-                  if ( m_pCalibWriteTool->createListNO( waferId, m_pSCTHelper, 10000, occupancy ).isFailure() ) {
-                     ATH_MSG_ERROR("Unable to run createListNO");
-                     return StatusCode::FAILURE;
-                  }
-               }
+          }
+        }
+      }
+    }
+  }
+  //--- Barrel
+  for (int iLayer{0}; iLayer < n_barrels; ++iLayer) {
+    for (int iSide{0}; iSide < 2; ++iSide) {
+      for (int iEta{0}; iEta < n_etaBins; ++iEta) {
+        if (iEta-6 == 0) continue;
+        for (int iPhi{0}; iPhi < n_phiBinsBarrel[iLayer]; ++iPhi) {
+          Identifier waferId{m_pSCTHelper->wafer_id(BARREL, iLayer, iPhi, iEta-6, iSide)};
+          float occupancy{static_cast<float>(m_pnoiseoccupancymapHistoVector[2*iLayer + iSide]->GetBinContent(iEta+1, iPhi+1))};
+          occupancy /= static_cast<float>(ntimeBins);
+          occupancy /= 1E5;
+          //--- For calculating average Noise Occupancy
+          meanNO_Barrel[iLayer]+=occupancy;
+          IdentifierHash waferHash{m_pSCTHelper->wafer_hash(waferId)};
+          SCT_SerialNumber sn{m_CablingTool->getSerialNumberFromHash(waferHash)};
+          outFile << xmlChannelNoiseOccDataString(waferId, occupancy, sn) << endl;
+          //--- DB output
+          if (m_writeToCool) {
+            if (m_pCalibWriteTool->createListNO(waferId, m_pSCTHelper, 10000, occupancy).isFailure()) {
+              ATH_MSG_ERROR("Unable to run createListNO");
+              return StatusCode::FAILURE;
             }
-         }
-      }
-   }
-   //--- EndcapA
-   for ( int iDisk = 0; iDisk < n_disks ; ++iDisk ) {
-      for ( int iSide = 0; iSide < 2; ++iSide ) {
-         for ( int iEta = 0; iEta < n_etaBinsEC; ++iEta ) {
-            for ( int iPhi = 0; iPhi < n_phiBinsEndcap[iDisk][iEta]; ++iPhi ) {
-               Identifier waferId = m_pSCTHelper->wafer_id( ENDCAP_A, iDisk, iPhi, iEta, iSide );
-               float occupancy = m_pnoiseoccupancymapHistoVectorECp[ 2*iDisk + iSide ]->GetBinContent( iEta+1, iPhi+1 );
-               occupancy /= float( ntimeBins );
-               occupancy /= 1E5;
-               //--- For calculating average Noise Occupancy
-               meanNO_ECA[iDisk][iEta]+=occupancy;
-               IdentifierHash   waferHash = m_pSCTHelper->wafer_hash( waferId );
-               SCT_SerialNumber sn        = m_CablingTool->getSerialNumberFromHash( waferHash );
-               outFile << xmlChannelNoiseOccDataString(waferId, occupancy, sn)<<endl;
-               //--- DB output
-               if ( m_writeToCool ) {
-                  if ( m_pCalibWriteTool->createListNO( waferId, m_pSCTHelper, 10000, occupancy ).isFailure() ) {
-                     ATH_MSG_ERROR("Unable to run createListNO");
-                     return StatusCode::FAILURE;
-                  }
-               }
+          }
+        }
+      }
+    }
+  }
+  //--- EndcapA
+  for (int iDisk{0}; iDisk < n_disks ; ++iDisk) {
+    for (int iSide{0}; iSide < 2; ++iSide) {
+      for (int iEta{0}; iEta < n_etaBinsEC; ++iEta) {
+        for (int iPhi{0}; iPhi < n_phiBinsEndcap[iDisk][iEta]; ++iPhi) {
+          Identifier waferId{m_pSCTHelper->wafer_id(ENDCAP_A, iDisk, iPhi, iEta, iSide)};
+          float occupancy{static_cast<float>(m_pnoiseoccupancymapHistoVectorECp[2*iDisk + iSide]->GetBinContent(iEta+1, iPhi+1))};
+          occupancy /= static_cast<float>(ntimeBins);
+          occupancy /= 1E5;
+          //--- For calculating average Noise Occupancy
+          meanNO_ECA[iDisk][iEta]+=occupancy;
+          IdentifierHash waferHash{m_pSCTHelper->wafer_hash(waferId)};
+          SCT_SerialNumber sn{m_CablingTool->getSerialNumberFromHash(waferHash)};
+          outFile << xmlChannelNoiseOccDataString(waferId, occupancy, sn) << endl;
+          //--- DB output
+          if (m_writeToCool) {
+            if (m_pCalibWriteTool->createListNO(waferId, m_pSCTHelper, 10000, occupancy).isFailure()) {
+              ATH_MSG_ERROR("Unable to run createListNO");
+              return StatusCode::FAILURE;
             }
-         }
-      }
-   }
-
-   //--- Tail of XML outputs
-   outFile << "</channels>" << endl;
-
-   //--- Summary XML output
-   ostringstream summaryList;
-   for ( int i = 0; i < n_disks; ++i ) {
-      for (int j = 0; j < n_etaBinsEC; ++j ) {
-         if ( n_phiBinsEndcap[i][j] != 0 ) {
-            meanNO_ECC[i][j] /= (n_phiBinsEndcap[i][j]*2);
-            summaryList<<xmlPartData(ENDCAP_C, i, j, "meanNO",meanNO_ECC[i][j]);
-         }
-      }
-   }
-   for ( int i = 0; i < n_barrels; ++i ) {
-      meanNO_Barrel[i] /= (n_phiBinsBarrel[i]*n_etaInBarrel*2);
-      summaryList<<xmlPartData(BARREL, i, 0, "meanNO",meanNO_Barrel[i] );
-   }
-   for ( int i = 0; i < n_disks; ++i ) {
-      for ( int j = 0; j < n_etaBinsEC; ++j ) {
-         if ( n_phiBinsEndcap[i][j] != 0 ) {
-            meanNO_ECA[i][j] /= (n_phiBinsEndcap[i][j]*2);
-            summaryList<<xmlPartData(ENDCAP_A, i, j, "meanNO",meanNO_ECA[i][j]);
-         }
-      }
-   }
-
-   if ( openXML4MonSummary( m_outNOSummary, "NoiseOccupancy" ).isFailure() ) {
-      ATH_MSG_ERROR("Problem in opening NoiseOccupancy file");
-      return StatusCode::FAILURE;
-   }
-   if ( wrapUpXML4Summary( m_outNOSummary, "NoiseOccupancy", summaryList ).isFailure() ) {
-      ATH_MSG_ERROR("Problem in closing NoiseOccupancy file");
+          }
+        }
+      }
+    }
+  }
+
+  //--- Tail of XML outputs
+  outFile << "</channels>" << endl;
+
+  //--- Summary XML output
+  ostringstream summaryList;
+  for (int i{0}; i < n_disks; ++i) {
+    for (int j{0}; j < n_etaBinsEC; ++j) {
+      if (n_phiBinsEndcap[i][j] != 0) {
+        meanNO_ECC[i][j] /= (n_phiBinsEndcap[i][j]*2);
+        summaryList << xmlPartData(ENDCAP_C, i, j, "meanNO", meanNO_ECC[i][j]);
+      }
+    }
+  }
+  for (int i{0}; i < n_barrels; ++i) {
+    meanNO_Barrel[i] /= (n_phiBinsBarrel[i]*n_etaInBarrel*2);
+    summaryList << xmlPartData(BARREL, i, 0, "meanNO", meanNO_Barrel[i]);
+  }
+  for (int i{0}; i < n_disks; ++i) {
+    for (int j{0}; j < n_etaBinsEC; ++j) {
+      if (n_phiBinsEndcap[i][j] != 0) {
+        meanNO_ECA[i][j] /= (n_phiBinsEndcap[i][j]*2);
+        summaryList << xmlPartData(ENDCAP_A, i, j, "meanNO", meanNO_ECA[i][j]);
+      }
+    }
+  }
+
+  if (openXML4MonSummary(m_outNOSummary, "NoiseOccupancy").isFailure()) {
+    ATH_MSG_ERROR("Problem in opening NoiseOccupancy file");
+    return StatusCode::FAILURE;
+  }
+  if (wrapUpXML4Summary(m_outNOSummary, "NoiseOccupancy", summaryList).isFailure()) {
+    ATH_MSG_ERROR("Problem in closing NoiseOccupancy file");
+    return StatusCode::FAILURE;
+  }
+
+  //--- DB output
+  if (m_writeToCool) {
+    if (m_pCalibWriteTool->wrapUpNoiseOccupancy().isFailure()) {
+      ATH_MSG_ERROR("Could not get NoiseOccupancy");
       return StatusCode::FAILURE;
-   }
+    }
+  }
 
-   //--- DB output
-   if ( m_writeToCool ) {
-      if ( m_pCalibWriteTool->wrapUpNoiseOccupancy().isFailure() ) {
-         ATH_MSG_ERROR("Could not get NoiseOccupancy");
-         return StatusCode::FAILURE;
-      }
-   }
-
-   return StatusCode::SUCCESS;
+  return StatusCode::SUCCESS;
 
 }
 
@@ -1391,148 +1374,148 @@ StatusCode SCTCalib::getNoiseOccupancy()
 
 StatusCode SCTCalib::getRawOccupancy()
 {
-   ATH_MSG_INFO("----- in getRawOccupancy() -----");
-
-   //--- Initialization
-   int n_phiBinsBarrel[ n_barrels ] = { n_phiBinsB0, n_phiBinsB1, n_phiBinsB2, n_phiBinsB3 };
-   int n_phiBinsEndcap[ n_disks ][ n_etaBinsEC ] = { { n_phiBinsECOuter, n_phiBinsECMiddle,                0 },
-      { n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort },
-      { n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort },
-      { n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort },
-      { n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort },
-      { n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort },
-      { n_phiBinsECOuter, n_phiBinsECMiddle,                0 },
-      { n_phiBinsECOuter, n_phiBinsECMiddle,                0 },
-      { n_phiBinsECOuter,                 0,                0 }
-   };
-
-   double meanRO_Barrel[ n_barrels ] = { 0 };
-   double meanRO_ECA[ n_disks ][ n_etaBinsEC ] = { {0}, {0} };
-   double meanRO_ECC[ n_disks ][ n_etaBinsEC ] = { {0}, {0} };
-
-   //--- RunNumber
-   std::ostringstream runnum;
-   runnum << m_runNumber.value();
-
-   //--- Directory in HIST
-   std::vector< std::pair<std::string, int> > EC_stems;
-   EC_stems.clear();
-   std::pair<std::string, int> stem_C("/run_" + runnum.str() + "/SCT/SCTEC/hits/", ENDCAP_C);
-   std::pair<std::string, int> stem_A("/run_" + runnum.str() + "/SCT/SCTEA/hits/", ENDCAP_A);
-   EC_stems.push_back(stem_C);
-   EC_stems.push_back(stem_A);
-   std::vector< std::pair<std::string, int> >::iterator stemItr=EC_stems.begin();
-
-   //--- Endcaps
-   for (stemItr=EC_stems.begin(); stemItr!=EC_stems.end(); stemItr++) {
-      for (int iDisk=0; iDisk<n_disks; ++iDisk) {
-         for (int iSide=0; iSide<2; ++iSide) {
-            for (int iEta=0; iEta<n_etaBinsEC; ++iEta) {
-               for (int iPhi=0; iPhi<n_phiBinsEndcap[iDisk][iEta]; ++iPhi) {
-                  Identifier waferId = m_pSCTHelper->wafer_id( (*stemItr).second, iDisk, iPhi, iEta, iSide );
-                  std::string detector_part;
-                  detector_part.erase();
-                  if (m_histBefore2010) {
-                     if ( (*stemItr).second==ENDCAP_C ) detector_part = "ECm_hitsmap";
-                     else detector_part = "ECp_hitsmap";
-                  } else {
-                     if ( (*stemItr).second==ENDCAP_C ) detector_part = "hitsmapECm";
-                     else detector_part = "hitsmapECp";
-                  }
-                  ostringstream streamHist;
-                  streamHist << detector_part << "_" << iDisk << "_" << iSide;
-                  std::string hitsmapname = stemItr->first + streamHist.str();
-                  TH2D* hist_tmp = dynamic_cast<TH2D*>(m_inputHist->Get( hitsmapname.c_str() ));
-                  unsigned long long n_hits = static_cast<unsigned long long>(hist_tmp->GetBinContent( iEta+1, iPhi+1 ));
-                  float raw_occu = 0;
-                  if (m_numberOfEvents!=0) {
-                     raw_occu = float(n_hits)/(m_numberOfEvents*n_chipPerSide*n_stripPerChip);
-                     //--- For calculating average Raw Occupancy
-                     if (stemItr->second==ENDCAP_C ) meanRO_ECC[iDisk][iEta]+=static_cast<double>(raw_occu);
-                     else if ( stemItr->second==ENDCAP_A ) meanRO_ECA[iDisk][iEta]+=static_cast<double>(raw_occu);
-                  }
-                  //--- DB writing
-                  if ( m_writeToCool ) {
-                     if ( m_pCalibWriteTool->createListRawOccu(waferId, m_pSCTHelper, m_numberOfEvents, raw_occu).isFailure() ) {
-                        ATH_MSG_ERROR("Unable to run createListRawOccu");
-                        return StatusCode::FAILURE;
-                     }
-                  }
-               }
+  ATH_MSG_INFO("----- in getRawOccupancy() -----");
+
+  //--- Initialization
+  int n_phiBinsBarrel[n_barrels] = {n_phiBinsB0, n_phiBinsB1, n_phiBinsB2, n_phiBinsB3};
+  int n_phiBinsEndcap[n_disks][n_etaBinsEC] = {{n_phiBinsECOuter, n_phiBinsECMiddle,                0},
+                                               {n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort}, 
+                                               {n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort}, 
+                                               {n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort}, 
+                                               {n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort}, 
+                                               {n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort}, 
+                                               {n_phiBinsECOuter, n_phiBinsECMiddle,                0}, 
+                                               {n_phiBinsECOuter, n_phiBinsECMiddle,                0}, 
+                                               {n_phiBinsECOuter,                 0,                0}
+  };
+
+  double meanRO_Barrel[n_barrels] = {0};
+  double meanRO_ECA[n_disks][n_etaBinsEC] = {{0}, {0}};
+  double meanRO_ECC[n_disks][n_etaBinsEC] = {{0}, {0}};
+
+  //--- RunNumber
+  std::ostringstream runnum;
+  runnum << m_runNumber.value();
+
+  //--- Directory in HIST
+  std::vector<std::pair<std::string, int>> EC_stems;
+  EC_stems.clear();
+  std::pair<std::string, int> stem_C("/run_" + runnum.str() + "/SCT/SCTEC/hits/", ENDCAP_C);
+  std::pair<std::string, int> stem_A("/run_" + runnum.str() + "/SCT/SCTEA/hits/", ENDCAP_A);
+  EC_stems.push_back(stem_C);
+  EC_stems.push_back(stem_A);
+  std::vector< std::pair<std::string, int> >::iterator stemItr{EC_stems.begin()};
+
+  //--- Endcaps
+  for (stemItr=EC_stems.begin(); stemItr!=EC_stems.end(); stemItr++) {
+    for (int iDisk{0}; iDisk<n_disks; ++iDisk) {
+      for (int iSide{0}; iSide<2; ++iSide) {
+        for (int iEta{0}; iEta<n_etaBinsEC; ++iEta) {
+          for (int iPhi{0}; iPhi<n_phiBinsEndcap[iDisk][iEta]; ++iPhi) {
+            Identifier waferId{m_pSCTHelper->wafer_id((*stemItr).second, iDisk, iPhi, iEta, iSide)};
+            std::string detector_part;
+            detector_part.erase();
+            if (m_histBefore2010) {
+              if ((*stemItr).second==ENDCAP_C) detector_part = "ECm_hitsmap";
+              else detector_part = "ECp_hitsmap";
+            } else {
+              if ((*stemItr).second==ENDCAP_C) detector_part = "hitsmapECm";
+              else detector_part = "hitsmapECp";
             }
-         }
-      }
-   }
-   //--- Barrel
-   for (int iLayer=0; iLayer<n_barrels; ++iLayer) {
-      for (int iSide=0; iSide<2; ++iSide) {
-         for (int iEta=0; iEta<n_etaBins; ++iEta) {
-            if (iEta-6==0) continue;
-            for (int iPhi=0; iPhi<n_phiBinsBarrel[iLayer]; ++iPhi) {
-               Identifier waferId = m_pSCTHelper->wafer_id( BARREL, iLayer, iPhi, iEta-6, iSide );
-               ostringstream streamHist;
-               streamHist << iLayer << "_" << iSide;
-               std::string hitsmapname = "/run_" + runnum.str() + "/SCT/SCTB/hits/hitsmap_" + streamHist.str();
-               TH2D* hist_tmp = dynamic_cast<TH2D*>(m_inputHist->Get( hitsmapname.c_str() ));
-               unsigned long long n_hits = static_cast<unsigned long long>(hist_tmp->GetBinContent( iEta+1, iPhi+1 ));
-               float raw_occu = 0;
-               if (m_numberOfEvents!=0) {
-                  raw_occu = float(n_hits)/(m_numberOfEvents*n_chipPerSide*n_stripPerChip);
-                  //--- For calculating average Raw Occupancy
-                  meanRO_Barrel[iLayer]+=static_cast<double>(raw_occu);
-               }
-               //--- DB writing
-               if ( m_writeToCool ) {
-                  if ( m_pCalibWriteTool->createListRawOccu(waferId, m_pSCTHelper, m_numberOfEvents, raw_occu).isFailure() ) {
-                     ATH_MSG_ERROR("Unable to run createListRawOccu");
-                     return StatusCode::FAILURE;
-                  }
-               }
+            ostringstream streamHist;
+            streamHist << detector_part << "_" << iDisk << "_" << iSide;
+            std::string hitsmapname{stemItr->first + streamHist.str()};
+            TH2D* hist_tmp{dynamic_cast<TH2D*>(m_inputHist->Get(hitsmapname.c_str()))};
+            unsigned long long n_hits{static_cast<unsigned long long>(hist_tmp->GetBinContent(iEta+1, iPhi+1))};
+            float raw_occu{0};
+            if (m_numberOfEvents!=0) {
+              raw_occu = static_cast<float>(n_hits)/(m_numberOfEvents*n_chipPerSide*n_stripPerChip);
+              //--- For calculating average Raw Occupancy
+              if (stemItr->second==ENDCAP_C) meanRO_ECC[iDisk][iEta] += static_cast<double>(raw_occu);
+              else if (stemItr->second==ENDCAP_A) meanRO_ECA[iDisk][iEta] += static_cast<double>(raw_occu);
             }
-         }
-      }
-   }
-   //--- Summary XML output
-   ostringstream summaryList;
-   for ( int i = 0; i < n_disks; ++i ) {
-      for ( int j = 0; j < n_etaBinsEC; ++j ) {
-         if ( n_phiBinsEndcap[i][j] != 0 ) {
-            meanRO_ECC[i][j] /= (n_phiBinsEndcap[i][j]*2);
-            summaryList<<xmlPartData(ENDCAP_C, i, j, "meanRO",meanRO_ECC[i][j]);
-         }
-      }
-   }
-   for ( int i = 0; i < n_barrels; ++i ) {
-      meanRO_Barrel[i] /= (n_phiBinsBarrel[i]*n_etaInBarrel*2);
-      summaryList<<xmlPartData(BARREL, i, 0, "meanRO",meanRO_Barrel[i]);
-   }
-   for ( int i = 0; i < n_disks; ++i ) {
-      for ( int j = 0; j < n_etaBinsEC; ++j ) {
-         if ( n_phiBinsEndcap[i][j] != 0 ) {
-            meanRO_ECA[i][j] /= (n_phiBinsEndcap[i][j]*2);
-            summaryList<<xmlPartData(ENDCAP_A, i, j, "meanRO",meanRO_ECA[i][j]);
-         }
-      }
-   }
-
-   if ( openXML4MonSummary( m_outROSummary, "RawOccupancy" ).isFailure() ) {
-      ATH_MSG_ERROR("Problem in opening RawOccupancy file");
-      return StatusCode::FAILURE;
-   }
-   if ( wrapUpXML4Summary( m_outROSummary, "RawOccupancy", summaryList ).isFailure() ) {
-      ATH_MSG_ERROR("Problem in closing RawOccupancy file ");
+            //--- DB writing
+            if (m_writeToCool) {
+              if (m_pCalibWriteTool->createListRawOccu(waferId, m_pSCTHelper, m_numberOfEvents, raw_occu).isFailure()) {
+                ATH_MSG_ERROR("Unable to run createListRawOccu");
+                return StatusCode::FAILURE;
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  //--- Barrel
+  for (int iLayer{0}; iLayer<n_barrels; ++iLayer) {
+    for (int iSide{0}; iSide<2; ++iSide) {
+      for (int iEta{0}; iEta<n_etaBins; ++iEta) {
+        if (iEta-6==0) continue;
+        for (int iPhi{0}; iPhi<n_phiBinsBarrel[iLayer]; ++iPhi) {
+          Identifier waferId{m_pSCTHelper->wafer_id(BARREL, iLayer, iPhi, iEta-6, iSide)};
+          ostringstream streamHist;
+          streamHist << iLayer << "_" << iSide;
+          std::string hitsmapname{"/run_" + runnum.str() + "/SCT/SCTB/hits/hitsmap_" + streamHist.str()};
+          TH2D* hist_tmp{dynamic_cast<TH2D*>(m_inputHist->Get(hitsmapname.c_str()))};
+          unsigned long long n_hits{static_cast<unsigned long long>(hist_tmp->GetBinContent(iEta+1, iPhi+1))};
+          float raw_occu{0};
+          if (m_numberOfEvents!=0) {
+            raw_occu = static_cast<float>(n_hits)/(m_numberOfEvents*n_chipPerSide*n_stripPerChip);
+            //--- For calculating average Raw Occupancy
+            meanRO_Barrel[iLayer] += static_cast<double>(raw_occu);
+          }
+          //--- DB writing
+          if (m_writeToCool) {
+            if (m_pCalibWriteTool->createListRawOccu(waferId, m_pSCTHelper, m_numberOfEvents, raw_occu).isFailure()) {
+              ATH_MSG_ERROR("Unable to run createListRawOccu");
+              return StatusCode::FAILURE;
+            }
+          }
+        }
+      }
+    }
+  }
+  //--- Summary XML output
+  ostringstream summaryList;
+  for (int i{0}; i < n_disks; ++i) {
+    for (int j{0}; j < n_etaBinsEC; ++j) {
+      if (n_phiBinsEndcap[i][j] != 0) {
+        meanRO_ECC[i][j] /= (n_phiBinsEndcap[i][j]*2);
+        summaryList << xmlPartData(ENDCAP_C, i, j, "meanRO", meanRO_ECC[i][j]);
+      }
+    }
+  }
+  for (int i{0}; i < n_barrels; ++i) {
+    meanRO_Barrel[i] /= (n_phiBinsBarrel[i]*n_etaInBarrel*2);
+    summaryList << xmlPartData(BARREL, i, 0, "meanRO", meanRO_Barrel[i]);
+  }
+  for (int i{0}; i < n_disks; ++i) {
+    for (int j{0}; j < n_etaBinsEC; ++j) {
+      if (n_phiBinsEndcap[i][j] != 0) {
+        meanRO_ECA[i][j] /= (n_phiBinsEndcap[i][j]*2);
+        summaryList << xmlPartData(ENDCAP_A, i, j, "meanRO", meanRO_ECA[i][j]);
+      }
+    }
+  }
+
+  if (openXML4MonSummary(m_outROSummary, "RawOccupancy").isFailure()) {
+    ATH_MSG_ERROR("Problem in opening RawOccupancy file");
+    return StatusCode::FAILURE;
+  }
+  if (wrapUpXML4Summary(m_outROSummary, "RawOccupancy", summaryList).isFailure()) {
+    ATH_MSG_ERROR("Problem in closing RawOccupancy file ");
+    return StatusCode::FAILURE;
+  }
+
+  //--- DB output
+  if (m_writeToCool) {
+    if (m_pCalibWriteTool->wrapUpRawOccupancy().isFailure()) {
+      ATH_MSG_ERROR("Could not get RawOccupancy");
       return StatusCode::FAILURE;
-   }
+    }
+  }
 
-   //--- DB output
-   if ( m_writeToCool ) {
-      if ( m_pCalibWriteTool->wrapUpRawOccupancy().isFailure() ) {
-         ATH_MSG_ERROR("Could not get RawOccupancy");
-         return StatusCode::FAILURE;
-      }
-   }
-
-   return StatusCode::SUCCESS;
+  return StatusCode::SUCCESS;
 
 }
 
@@ -1542,185 +1525,178 @@ StatusCode SCTCalib::getRawOccupancy()
 ///////////////////////////////////////////////////////////////////////////////////
 
 StatusCode SCTCalib::getEfficiency() {
-   ATH_MSG_INFO("----- in getEfficiency() -----");
-
-   //--- Initialization
-   int n_phiBinsBarrel[ n_barrels ] = { n_phiBinsB0, n_phiBinsB1, n_phiBinsB2, n_phiBinsB3 };
-   int n_phiBinsEndcap[ n_disks ][ n_etaBinsEC ] = { { n_phiBinsECOuter, n_phiBinsECMiddle,                0 },
-      { n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort },
-      { n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort },
-      { n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort },
-      { n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort },
-      { n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort },
-      { n_phiBinsECOuter, n_phiBinsECMiddle,                0 },
-      { n_phiBinsECOuter, n_phiBinsECMiddle,                0 },
-      { n_phiBinsECOuter,                 0,                0 }
-   };
-
-   double meanEff_Barrel[ n_barrels ] = { 0 };
-   double meanEff_ECA[ n_disks ][ n_etaBinsEC ] = { {0}, {0} };
-   double meanEff_ECC[ n_disks ][ n_etaBinsEC ] = { {0}, {0} };
-
-   //--- RunNumber
-   std::ostringstream runnum;
-   runnum << m_runNumber.value();
-
-   //--- Directory in HIST
-   std::vector< std::pair<std::string, int> > EC_stems;
-   EC_stems.clear();
-   std::pair<std::string, int> stem_C("/run_" + runnum.str() + "/SCT/SCTEC/eff/", ENDCAP_C);
-   std::pair<std::string, int> stem_A("/run_" + runnum.str() + "/SCT/SCTEA/eff/", ENDCAP_A);
-   EC_stems.push_back(stem_C);
-   EC_stems.push_back(stem_A);
-   std::vector< std::pair<std::string, int> >::iterator stemItr=EC_stems.begin();
-
-   //--- XML file
-   // if ( openXML4MonSummary( m_outEffSummary, "EfficiencyModule" ).isFailure() ) {
-   //   ATH_MSG_ERROR("Problem in opening " << m_outEffSummary);
-   //   return StatusCode::FAILURE;
-   // }
-
-   const char* outputEfficiencyFileName = m_efficiencyModuleFile.value().c_str();
-   ofstream outFile( outputEfficiencyFileName, std::ios::out );
-   if ( !outFile.good() ) {
-      ATH_MSG_ERROR("Unable to open EfficiencyFile : " << outputEfficiencyFileName);
-      return StatusCode::FAILURE;
-   }
-
-   std::string xslName="EfficiencyInfo.xsl";
-   outFile << xmlHeader<< linefeed<< associateStylesheet(xslName) << linefeed<< "<run>"<< endl;
-   outFile << xmlValue("RunNumber",  m_runNumber.value()               ) << linefeed
-           << xmlValue("StartTime",  m_utcBegin                        ) << linefeed
-           << xmlValue("EndTime",  m_utcEnd                            ) << linefeed
-           << xmlValue("Duration",  m_calibEvtInfoTool->duration()     ) << linefeed
-           << xmlValue("LB",  m_LBRange                                ) << linefeed
-           << xmlValue("Events",  m_numberOfEvents                     ) << linefeed
-           << "  <modules>"<< endl;
-
-
-   //--- Endcaps
-   for (stemItr=EC_stems.begin(); stemItr!=EC_stems.end(); stemItr++) {
-      for (int iDisk=0; iDisk<n_disks; ++iDisk) {
-         for (int iSide=0; iSide<2; ++iSide) {
-            for (int iEta=0; iEta<n_etaBinsEC; ++iEta) {
-               for (int iPhi=0; iPhi<n_phiBinsEndcap[iDisk][iEta]; ++iPhi) {
-                  Identifier waferId = m_pSCTHelper->wafer_id( (*stemItr).second, iDisk, iPhi, iEta, iSide );
-                  std::string detector_part;
-                  detector_part.erase();
-                  ostringstream streamProf;
-                  if ( (*stemItr).second==ENDCAP_C ) {
-                     detector_part = "m_eff";
-                     streamProf << detector_part << "_" << iDisk << "_" << iSide;
-                  } else {
-                     detector_part = "p_eff";
-                     streamProf << detector_part << "_" << iDisk << "_" << iSide;
-                  }
-                  std::string effmapname = stemItr->first + streamProf.str();
-                  TProfile2D* prof_tmp = dynamic_cast<TProfile2D*>(m_inputHist->Get( effmapname.c_str() ));
-                  int global_bin = prof_tmp->GetBin( iEta+1, iPhi+1 );
-                  float eff = static_cast<float>(prof_tmp->GetBinContent( global_bin ));
-                  unsigned long long eff_entry = static_cast<unsigned long long>(prof_tmp->GetBinEntries( global_bin ));
-                  //--- For calculating average Efficiency
-                  if ( stemItr->second==ENDCAP_C ) meanEff_ECC[iDisk][iEta]+=static_cast<double>(eff);
-                  else if ( stemItr->second==ENDCAP_A ) meanEff_ECA[iDisk][iEta]+=static_cast<double>(eff);
-                  //--- For Efficiency _not_ averaged over modules
-                  IdentifierHash   waferHash = m_pSCTHelper->wafer_hash( waferId );
-                  SCT_SerialNumber sn        = m_CablingTool->getSerialNumberFromHash( waferHash );
-                  outFile << xmlChannelEfficiencyDataString(waferId, eff, sn)<<endl;
-                  //--- DB writing
-                  if ( m_writeToCool ) {
-                     if ( m_pCalibWriteTool->createListEff(waferId, m_pSCTHelper, eff_entry, eff).isFailure() ) {
-                        ATH_MSG_ERROR("Unable to run createListEff");
-                        return StatusCode::FAILURE;
-                     }
-                  }
-               }
+  ATH_MSG_INFO("----- in getEfficiency() -----");
+
+  //--- Initialization
+  int n_phiBinsBarrel[n_barrels] = {n_phiBinsB0, n_phiBinsB1, n_phiBinsB2, n_phiBinsB3};
+  int n_phiBinsEndcap[n_disks][n_etaBinsEC] = {{n_phiBinsECOuter, n_phiBinsECMiddle,                0},
+                                               {n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort}, 
+                                               {n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort}, 
+                                               {n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort}, 
+                                               {n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort}, 
+                                               {n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort}, 
+                                               {n_phiBinsECOuter, n_phiBinsECMiddle,                0}, 
+                                               {n_phiBinsECOuter, n_phiBinsECMiddle,                0}, 
+                                               {n_phiBinsECOuter,                 0,                0}
+  };
+
+  double meanEff_Barrel[n_barrels] = {0};
+  double meanEff_ECA[n_disks][n_etaBinsEC] = {{0}, {0}};
+  double meanEff_ECC[n_disks][n_etaBinsEC] = {{0}, {0}};
+
+  //--- RunNumber
+  std::ostringstream runnum;
+  runnum << m_runNumber.value();
+
+  //--- Directory in HIST
+  std::vector<std::pair<std::string, int>> EC_stems;
+  EC_stems.clear();
+  std::pair<std::string, int> stem_C{"/run_" + runnum.str() + "/SCT/SCTEC/eff/", ENDCAP_C};
+  std::pair<std::string, int> stem_A{"/run_" + runnum.str() + "/SCT/SCTEA/eff/", ENDCAP_A};
+  EC_stems.push_back(stem_C);
+  EC_stems.push_back(stem_A);
+  std::vector<std::pair<std::string, int>>::iterator stemItr{EC_stems.begin()};
+
+  const char* outputEfficiencyFileName{m_efficiencyModuleFile.value().c_str()};
+  ofstream outFile{outputEfficiencyFileName, std::ios::out};
+  if (!outFile.good()) {
+    ATH_MSG_ERROR("Unable to open EfficiencyFile : " << outputEfficiencyFileName);
+    return StatusCode::FAILURE;
+  }
+
+  std::string xslName{"EfficiencyInfo.xsl"};
+  outFile << xmlHeader << linefeed << associateStylesheet(xslName) << linefeed << "<run>" << endl;
+  outFile << xmlValue("RunNumber", m_runNumber.value()) << linefeed
+          << xmlValue("StartTime", m_utcBegin) << linefeed
+          << xmlValue("EndTime", m_utcEnd) << linefeed
+          << xmlValue("Duration", m_calibEvtInfoTool->duration()) << linefeed
+          << xmlValue("LB", m_LBRange) << linefeed
+          << xmlValue("Events", m_numberOfEvents) << linefeed
+          << "  <modules>" << endl;
+
+
+  //--- Endcaps
+  for (stemItr=EC_stems.begin(); stemItr!=EC_stems.end(); stemItr++) {
+    for (int iDisk{0}; iDisk<n_disks; ++iDisk) {
+      for (int iSide{0}; iSide<2; ++iSide) {
+        for (int iEta{0}; iEta<n_etaBinsEC; ++iEta) {
+          for (int iPhi{0}; iPhi<n_phiBinsEndcap[iDisk][iEta]; ++iPhi) {
+            Identifier waferId = m_pSCTHelper->wafer_id((*stemItr).second, iDisk, iPhi, iEta, iSide);
+            std::string detector_part;
+            detector_part.erase();
+            ostringstream streamProf;
+            if ((*stemItr).second==ENDCAP_C) {
+              detector_part = "m_eff";
+              streamProf << detector_part << "_" << iDisk << "_" << iSide;
+            } else {
+              detector_part = "p_eff";
+              streamProf << detector_part << "_" << iDisk << "_" << iSide;
             }
-         }
-      }
-   }
-   //--- Barrel
-   for (int iLayer=0; iLayer<n_barrels; ++iLayer) {
-      for (int iSide=0; iSide<2; ++iSide) {
-         for (int iEta=0; iEta<n_etaBins; ++iEta) {
-            if (iEta-6==0) continue;
-            for (int iPhi=0; iPhi<n_phiBinsBarrel[iLayer]; ++iPhi) {
-               Identifier waferId = m_pSCTHelper->wafer_id( BARREL, iLayer, iPhi, iEta-6, iSide );
-               ostringstream streamProf;
-               streamProf << iLayer << "_" << iSide;
-               std::string effmapname = "/run_" + runnum.str() + "/SCT/SCTB/eff/eff_" + streamProf.str();
-               TProfile2D* prof_tmp = dynamic_cast<TProfile2D*>(m_inputHist->Get( effmapname.c_str() ));
-               int global_bin = prof_tmp->GetBin( iEta+1, iPhi+1 );
-               float eff = static_cast<float>(prof_tmp->GetBinContent( global_bin ));
-               unsigned long long eff_entry = static_cast<unsigned long long>(prof_tmp->GetBinEntries( global_bin ));
-               //--- For calculating average Efficiency
-               meanEff_Barrel[iLayer]+=static_cast<double>(eff);
-               //--- For Efficiency _not_ averaged over modules
-               IdentifierHash   waferHash = m_pSCTHelper->wafer_hash( waferId );
-               SCT_SerialNumber sn        = m_CablingTool->getSerialNumberFromHash( waferHash );
-               outFile << xmlChannelEfficiencyDataString(waferId, eff, sn)<<endl;
-               //--- DB writing
-               if ( m_writeToCool ) {
-                  if ( m_pCalibWriteTool->createListEff(waferId, m_pSCTHelper, eff_entry, eff).isFailure() ) {
-                     ATH_MSG_ERROR("Unable to run createListEff");
-                     return StatusCode::FAILURE;
-                  }
-               }
+            std::string effmapname{stemItr->first + streamProf.str()};
+            TProfile2D* prof_tmp{dynamic_cast<TProfile2D*>(m_inputHist->Get(effmapname.c_str()))};
+            int global_bin{prof_tmp->GetBin(iEta+1, iPhi+1)};
+            float eff{static_cast<float>(prof_tmp->GetBinContent(global_bin))};
+            unsigned long long eff_entry{static_cast<unsigned long long>(prof_tmp->GetBinEntries(global_bin))};
+            //--- For calculating average Efficiency
+            if (stemItr->second==ENDCAP_C) meanEff_ECC[iDisk][iEta] += static_cast<double>(eff);
+            else if (stemItr->second==ENDCAP_A) meanEff_ECA[iDisk][iEta] += static_cast<double>(eff);
+            //--- For Efficiency _not_ averaged over modules
+            IdentifierHash waferHash{m_pSCTHelper->wafer_hash(waferId)};
+            SCT_SerialNumber sn{m_CablingTool->getSerialNumberFromHash(waferHash)};
+            outFile << xmlChannelEfficiencyDataString(waferId, eff, sn) << endl;
+            //--- DB writing
+            if (m_writeToCool) {
+              if (m_pCalibWriteTool->createListEff(waferId, m_pSCTHelper, eff_entry, eff).isFailure()) {
+                ATH_MSG_ERROR("Unable to run createListEff");
+                return StatusCode::FAILURE;
+              }
             }
-         }
-      }
-   }
-
-   //--- Tail of XML outputs
-   //  outFile << "</channels>" << endl;
-
-   outFile << "  </modules>" << endl;
-   outFile << "</run>" << endl;
-
-
-   //--- Summary XML output
-   ostringstream summaryList;
-   for ( int i = 0; i < n_disks; ++i ) {
-      for ( int j = 0; j < n_etaBinsEC; ++j ) {
-         if ( n_phiBinsEndcap[i][j] != 0 ) {
-            meanEff_ECC[i][j] /= (n_phiBinsEndcap[i][j]*2);
-            summaryList<<xmlPartData(ENDCAP_C, i, j, "meanEff",meanEff_ECC[i][j]);
-         }
-      }
-   }
-   for ( int i = 0; i < n_barrels; ++i ) {
-      meanEff_Barrel[i] /= (n_phiBinsBarrel[i]*n_etaInBarrel*2);
-      summaryList<<xmlPartData(BARREL, i, 0, "meanEff",meanEff_Barrel[i]);
-   }
-   for ( int i = 0; i < n_disks; ++i ) {
-      for ( int j = 0; j < n_etaBinsEC; ++j ) {
-         if ( n_phiBinsEndcap[i][j] != 0 ) {
-            meanEff_ECA[i][j] /= (n_phiBinsEndcap[i][j]*2);
-            summaryList<<xmlPartData(ENDCAP_A, i, j, "meanEff",meanEff_ECA[i][j]);
-         }
-      }
-   }
-
-   if ( openXML4MonSummary( m_outEffSummary, "Efficiency" ).isFailure() ) {
-      ATH_MSG_ERROR("Problem in opening Efficiency file");
-      return StatusCode::FAILURE;
-   }
-
-   if ( wrapUpXML4Summary( m_outEffSummary, "Efficiency", summaryList ).isFailure() ) {
-      ATH_MSG_ERROR("Problem in closing Efficiency file ");
+          }
+        }
+      }
+    }
+  }
+  //--- Barrel
+  for (int iLayer{0}; iLayer<n_barrels; ++iLayer) {
+    for (int iSide{0}; iSide<2; ++iSide) {
+      for (int iEta{0}; iEta<n_etaBins; ++iEta) {
+        if (iEta-6==0) continue;
+        for (int iPhi{0}; iPhi<n_phiBinsBarrel[iLayer]; ++iPhi) {
+          Identifier waferId{m_pSCTHelper->wafer_id(BARREL, iLayer, iPhi, iEta-6, iSide)};
+          ostringstream streamProf;
+          streamProf << iLayer << "_" << iSide;
+          std::string effmapname{"/run_" + runnum.str() + "/SCT/SCTB/eff/eff_" + streamProf.str()};
+          TProfile2D* prof_tmp{dynamic_cast<TProfile2D*>(m_inputHist->Get(effmapname.c_str()))};
+          int global_bin{prof_tmp->GetBin(iEta+1, iPhi+1)};
+          float eff{static_cast<float>(prof_tmp->GetBinContent(global_bin))};
+          unsigned long long eff_entry{static_cast<unsigned long long>(prof_tmp->GetBinEntries(global_bin))};
+          //--- For calculating average Efficiency
+          meanEff_Barrel[iLayer] += static_cast<double>(eff);
+          //--- For Efficiency _not_ averaged over modules
+          IdentifierHash waferHash{m_pSCTHelper->wafer_hash(waferId)};
+          SCT_SerialNumber sn{m_CablingTool->getSerialNumberFromHash(waferHash)};
+          outFile << xmlChannelEfficiencyDataString(waferId, eff, sn) << endl;
+          //--- DB writing
+          if (m_writeToCool) {
+            if (m_pCalibWriteTool->createListEff(waferId, m_pSCTHelper, eff_entry, eff).isFailure()) {
+              ATH_MSG_ERROR("Unable to run createListEff");
+              return StatusCode::FAILURE;
+            }
+          }
+        }
+      }
+    }
+  }
+
+  //--- Tail of XML outputs
+  //  outFile << "</channels>" << endl;
+
+  outFile << "  </modules>" << endl;
+  outFile << "</run>" << endl;
+
+
+  //--- Summary XML output
+  ostringstream summaryList;
+  for (int i{0}; i < n_disks; ++i) {
+    for (int j{0}; j < n_etaBinsEC; ++j) {
+      if (n_phiBinsEndcap[i][j] != 0) {
+        meanEff_ECC[i][j] /= (n_phiBinsEndcap[i][j]*2);
+        summaryList << xmlPartData(ENDCAP_C, i, j, "meanEff", meanEff_ECC[i][j]);
+      }
+    }
+  }
+  for (int i{0}; i < n_barrels; ++i) {
+    meanEff_Barrel[i] /= (n_phiBinsBarrel[i]*n_etaInBarrel*2);
+    summaryList << xmlPartData(BARREL, i, 0, "meanEff", meanEff_Barrel[i]);
+  }
+  for (int i{0}; i < n_disks; ++i) {
+    for (int j{0}; j < n_etaBinsEC; ++j) {
+      if (n_phiBinsEndcap[i][j] != 0) {
+        meanEff_ECA[i][j] /= (n_phiBinsEndcap[i][j]*2);
+        summaryList << xmlPartData(ENDCAP_A, i, j, "meanEff", meanEff_ECA[i][j]);
+      }
+    }
+  }
+
+  if (openXML4MonSummary(m_outEffSummary, "Efficiency").isFailure()) {
+    ATH_MSG_ERROR("Problem in opening Efficiency file");
+    return StatusCode::FAILURE;
+  }
+
+  if (wrapUpXML4Summary(m_outEffSummary, "Efficiency", summaryList).isFailure()) {
+    ATH_MSG_ERROR("Problem in closing Efficiency file ");
+    return StatusCode::FAILURE;
+  }
+
+  //--- DB output
+  if (m_writeToCool) {
+    if (m_pCalibWriteTool->wrapUpEfficiency().isFailure()) {
+      ATH_MSG_ERROR("Could not get Efficiency");
       return StatusCode::FAILURE;
-   }
-
-   //--- DB output
-   if ( m_writeToCool ) {
-      if ( m_pCalibWriteTool->wrapUpEfficiency().isFailure() ) {
-         ATH_MSG_ERROR("Could not get Efficiency");
-         return StatusCode::FAILURE;
-      }
-   }
-
-   return StatusCode::SUCCESS;
+    }
+  }
 
+  return StatusCode::SUCCESS;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////
@@ -1729,354 +1705,345 @@ StatusCode SCTCalib::getEfficiency() {
 ///////////////////////////////////////////////////////////////////////////////////
 
 StatusCode SCTCalib::getBSErrors() {
-   ATH_MSG_INFO("----- in getBSErrors() -----");
-
-   //--- Initialization
-   int n_phiBinsBarrel[ n_barrels ] = { n_phiBinsB0, n_phiBinsB1, n_phiBinsB2, n_phiBinsB3 };
-   int n_phiBinsEndcap[ n_disks ][ n_etaBinsEC ] = { { n_phiBinsECOuter, n_phiBinsECMiddle,                0 },
-      { n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort },
-      { n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort },
-      { n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort },
-      { n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort },
-      { n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort },
-      { n_phiBinsECOuter, n_phiBinsECMiddle,                0 },
-      { n_phiBinsECOuter, n_phiBinsECMiddle,                0 },
-      { n_phiBinsECOuter,                 0,                0 }
-   };
-
-   unsigned long long nErrLink_Barrel[ n_barrels ] = { 0 };
-   unsigned long long nErrLink_ECA[ n_disks ][ n_etaBinsEC ] = { {0}, {0} };
-   unsigned long long nErrLink_ECC[ n_disks ][ n_etaBinsEC ] = { {0}, {0} };
-
-
-   unsigned long long nErrLink_Barrel_module[ n_barrels ][ 2 ][ n_etaBins ][ n_phiBinsB3 ] = {{{{0}}}};
-   unsigned long long nErrLink_ECA_module[ n_disks ][2][ n_etaBinsEC ][n_phiBinsECOuter] = {{{{0}}}};
-   unsigned long long nErrLink_ECC_module[ n_disks ][2][ n_etaBinsEC ][n_phiBinsECOuter] = {{{{0}}}};
-
-   std::string nErrLink_Barrel_module_serial[ n_barrels ][ 2 ][ n_etaBins ][ n_phiBinsB3 ];
-   std::string nErrLink_ECA_module_serial[ n_disks ][2][ n_etaBinsEC ][n_phiBinsECOuter];
-   std::string nErrLink_ECC_module_serial[ n_disks ][2][ n_etaBinsEC ][n_phiBinsECOuter];
-
-   unsigned long long nErrs_Barrel_module[ n_barrels ][ 2 ][ n_etaBins ][ n_phiBinsB3 ][ 15 ] = {{{{{0}}}}};
-   unsigned long long nErrs_ECA_module[ n_disks ][2][ n_etaBinsEC ][n_phiBinsECOuter][ 15 ]   = {{{{{0}}}}};
-   unsigned long long nErrs_ECC_module[ n_disks ][2][ n_etaBinsEC ][n_phiBinsECOuter][ 15 ]   = {{{{{0}}}}};
-
-
-
-   //--- RunNumber
-   std::ostringstream runnum;
-   runnum << m_runNumber.value();
-   //--- ErrorList
-   typedef std::map< int, std::string > IntStringMap;
-   IntStringMap ErrMap_C, ErrMap;
-   const int numberOfErrorTypes(12);
-   boost::array<std::string, numberOfErrorTypes> errorNames= {{
-         "BSParse","TimeOut", "BCID","LVL1ID", "Preamble", "Formatter",
-         "ABCD","Raw", "MaskedLink", "RODClock",
-         "TruncROD", (m_histBefore2010?"ROBFragment":"ROBFrag" )
-      }
-   };
-   //
-   boost::array<std::string, numberOfErrorTypes> errorNames_C= {{
-         "BSParse","TimeOut","BCID","LVL1ID", "Preamble", "Formatter",
-         "ABCD","Raw", (m_histBefore2010?"TmaskedLinks":"MaskedLink"), "RODClock",
-         "TruncROD", (m_histBefore2010?"ROBFragment":"ROBFrag" )
-      }
-   };
-   boost::array<int, numberOfErrorTypes> errorValues= {{0,1,2,3,4,5,9,10,11,12,13,14}};
-   //should do compile time check to ensure the sizes are equal.
-   ErrMap_C.clear();
-   for (int indx(0); indx!=numberOfErrorTypes; ++indx) {
-      ErrMap_C.insert(make_pair(errorValues[indx],errorNames_C[indx]));
-   }
-   ErrMap.clear();
-   for (int indx(0); indx!=numberOfErrorTypes; ++indx) {
-      ErrMap.insert(make_pair(errorValues[indx],errorNames[indx]));
-   }
-
-   //--- Directory in HIST
-   const int N_ENDCAPS(2);
-   boost::array<std::string, N_ENDCAPS> detectorStems= {{"/run_" + runnum.str() + "/SCT/SCTEC/errors/",  "/run_" + runnum.str() + "/SCT/SCTEA/errors/"}}; //barrel stem unused here
-   boost::array<IntStringMap::iterator, N_ENDCAPS> detectorIterators= {{ErrMap_C.begin(), ErrMap.begin()}};
-   boost::array<std::string, N_ENDCAPS> detectorParts= {{"ECm",  "ECp"}};
-   std::string defecttype("");
-   std::string n_defect("");
-   int n_errorLink = 0;
-   //--- Endcaps
-   for (int stemIndex=0; stemIndex!=N_ENDCAPS; ++stemIndex) {
-      // fix agrohsje const int thisBec=(2 * stemIndex) - 2; //map 0, 1 onto -2, 2
-      const int thisBec=(4 * stemIndex) - 2; //map 0, 1 onto -2, 2
-      const std::string detector_part=detectorParts[stemIndex];
-      for (int iDisk=0; iDisk<n_disks; ++iDisk) {
-         for (int iSide=0; iSide<2; ++iSide) {
-            for (int iEta=0; iEta<n_etaBinsEC; ++iEta) {
-               for (int iPhi=0; iPhi<n_phiBinsEndcap[iDisk][iEta]; ++iPhi) {
-                  defecttype.erase();
-                  n_defect.erase();
-                  ostringstream osErrorList;
-                  ostringstream osProbList;
-                  Identifier waferId = m_pSCTHelper->wafer_id( thisBec, iDisk, iPhi, iEta, iSide );
-                  IdentifierHash   waferHash = m_pSCTHelper->wafer_hash( waferId );
-                  SCT_SerialNumber sn        = m_CablingTool->getSerialNumberFromHash( waferHash );
-
-                  if ( thisBec==ENDCAP_C ) {
-                     nErrLink_ECC_module_serial[iDisk][iSide][iEta][iPhi]=sn.str();
-                  }
-                  else if ( thisBec==ENDCAP_A ) {
-                     nErrLink_ECA_module_serial[iDisk][iSide][iEta][iPhi]=sn.str();
-                  }
+  ATH_MSG_INFO("----- in getBSErrors() -----");
+
+  //--- Initialization
+  int n_phiBinsBarrel[n_barrels] = {n_phiBinsB0, n_phiBinsB1, n_phiBinsB2, n_phiBinsB3};
+  int n_phiBinsEndcap[n_disks][n_etaBinsEC] = {{n_phiBinsECOuter, n_phiBinsECMiddle,                0},
+                                               {n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort}, 
+                                               {n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort}, 
+                                               {n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort}, 
+                                               {n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort}, 
+                                               {n_phiBinsECOuter, n_phiBinsECMiddle, n_phiBinsECShort}, 
+                                               {n_phiBinsECOuter, n_phiBinsECMiddle,                0}, 
+                                               {n_phiBinsECOuter, n_phiBinsECMiddle,                0}, 
+                                               {n_phiBinsECOuter,                 0,                0}
+  };
+
+  unsigned long long nErrLink_Barrel[n_barrels] = {0};
+  unsigned long long nErrLink_ECA[n_disks][n_etaBinsEC] = {{0}, {0}};
+  unsigned long long nErrLink_ECC[n_disks][n_etaBinsEC] = {{0}, {0}};
+
+  unsigned long long nErrLink_Barrel_module[n_barrels][2][n_etaBins][n_phiBinsB3] = {{{{0}}}};
+  unsigned long long nErrLink_ECA_module[n_disks][2][n_etaBinsEC][n_phiBinsECOuter] = {{{{0}}}};
+  unsigned long long nErrLink_ECC_module[n_disks][2][n_etaBinsEC][n_phiBinsECOuter] = {{{{0}}}};
+
+  std::string nErrLink_Barrel_module_serial[n_barrels][2][n_etaBins][n_phiBinsB3];
+  std::string nErrLink_ECA_module_serial[n_disks][2][n_etaBinsEC][n_phiBinsECOuter];
+  std::string nErrLink_ECC_module_serial[n_disks][2][n_etaBinsEC][n_phiBinsECOuter];
+
+  unsigned long long nErrs_Barrel_module[n_barrels][2][n_etaBins][n_phiBinsB3][15] = {{{{{0}}}}};
+  unsigned long long nErrs_ECA_module[n_disks][2][n_etaBinsEC][n_phiBinsECOuter][15] = {{{{{0}}}}};
+  unsigned long long nErrs_ECC_module[n_disks][2][n_etaBinsEC][n_phiBinsECOuter][15] = {{{{{0}}}}};
+
+  //--- RunNumber
+  std::ostringstream runnum;
+  runnum << m_runNumber.value();
+  //--- ErrorList
+  typedef std::map<int, std::string> IntStringMap;
+  IntStringMap ErrMap_C, ErrMap;
+  const int numberOfErrorTypes{12};
+  boost::array<std::string, numberOfErrorTypes> errorNames = {{
+      "BSParse", "TimeOut", "BCID", "LVL1ID", "Preamble", "Formatter", 
+      "ABCD", "Raw", "MaskedLink", "RODClock", 
+      "TruncROD", (m_histBefore2010?"ROBFragment":"ROBFrag")
+    }
+  };
+  //
+  boost::array<std::string, numberOfErrorTypes> errorNames_C = {{
+      "BSParse", "TimeOut", "BCID", "LVL1ID", "Preamble", "Formatter", 
+      "ABCD", "Raw", (m_histBefore2010?"TmaskedLinks":"MaskedLink"), "RODClock", 
+      "TruncROD", (m_histBefore2010?"ROBFragment":"ROBFrag")
+    }
+  };
+  boost::array<int, numberOfErrorTypes> errorValues = {{0, 1, 2, 3, 4, 5, 9, 10, 11, 12, 13, 14}};
+  //should do compile time check to ensure the sizes are equal.
+  ErrMap_C.clear();
+  for (int indx{0}; indx!=numberOfErrorTypes; ++indx) {
+    ErrMap_C.insert(make_pair(errorValues[indx], errorNames_C[indx]));
+  }
+  ErrMap.clear();
+  for (int indx{0}; indx!=numberOfErrorTypes; ++indx) {
+    ErrMap.insert(make_pair(errorValues[indx], errorNames[indx]));
+  }
+
+  //--- Directory in HIST
+  const int N_ENDCAPS{2};
+  boost::array<std::string, N_ENDCAPS> detectorStems = {{"/run_" + runnum.str() + "/SCT/SCTEC/errors/", "/run_" + runnum.str() + "/SCT/SCTEA/errors/"}}; //barrel stem unused here
+  boost::array<IntStringMap::iterator, N_ENDCAPS> detectorIterators = {{ErrMap_C.begin(), ErrMap.begin()}};
+  boost::array<std::string, N_ENDCAPS> detectorParts = {{"ECm", "ECp"}};
+  std::string defecttype{""};
+  std::string n_defect{""};
+  int n_errorLink{0};
+  //--- Endcaps
+  for (int stemIndex{0}; stemIndex!=N_ENDCAPS; ++stemIndex) {
+    const int thisBec{(4 * stemIndex) - 2}; //map 0, 1 onto -2, 2
+    const std::string detector_part{detectorParts[stemIndex]};
+    for (int iDisk{0}; iDisk<n_disks; ++iDisk) {
+      for (int iSide{0}; iSide<2; ++iSide) {
+        for (int iEta{0}; iEta<n_etaBinsEC; ++iEta) {
+          for (int iPhi{0}; iPhi<n_phiBinsEndcap[iDisk][iEta]; ++iPhi) {
+            defecttype.erase();
+            n_defect.erase();
+            ostringstream osErrorList;
+            ostringstream osProbList;
+            Identifier waferId{m_pSCTHelper->wafer_id(thisBec, iDisk, iPhi, iEta, iSide)};
+            IdentifierHash waferHash{m_pSCTHelper->wafer_hash(waferId)};
+            SCT_SerialNumber sn{m_CablingTool->getSerialNumberFromHash(waferHash)};
+
+            if (thisBec==ENDCAP_C) {
+              nErrLink_ECC_module_serial[iDisk][iSide][iEta][iPhi]=sn.str();
+            } else if (thisBec==ENDCAP_A) {
+              nErrLink_ECA_module_serial[iDisk][iSide][iEta][iPhi]=sn.str();
+            }
 
-                  IntStringMap::iterator errItr=detectorIterators[stemIndex];
-                  for ( int iType = 0; iType < n_BSErrorType; ++iType ) {
-                     float errorProb = 0.;
-                     unsigned long long n_errors = 0;
-                     if ( iType == errItr->first ) {
-                        ostringstream streamHist;
-                        //temporal fix: folder and histogram names should be Preamble
-                        streamHist << errItr->second << "Errs" << "_" << iDisk << "_" << iSide;
-                        //        streamHist << "T" << errItr->second << "Errs" << detector_part << "_" << iDisk << "_" << iSide;
-                        std::string folder = errItr->second+std::string("/");
-                        //histogram might or might not be inside a folder with the same name
-                        std::string profname = detectorStems[stemIndex] + folder +streamHist.str();
-                        std::string profnameShort = detectorStems[stemIndex] + streamHist.str();
-
-                        TProfile2D* prof_tmp = dynamic_cast<TProfile2D*>(m_inputHist->Get( profname.c_str() ));
-                        if (prof_tmp ==nullptr) {
-                          prof_tmp = dynamic_cast<TProfile2D*>(m_inputHist->Get( profnameShort.c_str() ));
-                        }
-                        if (prof_tmp ==nullptr) {
-                           ATH_MSG_ERROR("Unable to get profile for BSErrorsDB : " << profname);
-                           return StatusCode::FAILURE;
-                        }
-
-                        n_errors = static_cast<unsigned long long>(prof_tmp->GetBinContent( iEta+1, iPhi+1 ));
-                        if (n_errors!=0) {
-                           defecttype = m_pCalibWriteTool->addNumber( defecttype, errItr->first );
-                           n_defect = m_pCalibWriteTool->addNumber( n_defect, n_errors );
-                           errorProb = static_cast<float>(n_errors) / static_cast<float>(m_numberOfEvents);
-                           nErrs_ECC_module[iDisk][iSide][iEta][iPhi][errItr->first] = n_errors;
-                           if ( thisBec==ENDCAP_C ) {
-                              nErrLink_ECC_module[iDisk][iSide][iEta][iPhi]+=n_errors;
-                           }
-                           else if ( thisBec==ENDCAP_A ) {
-                              nErrLink_ECA_module[iDisk][iSide][iEta][iPhi]+=n_errors;
-                           }
-
-                        }//end if (n_errors!=0)
-                        ++errItr;
-                     }//end if ( iType == (*errItr).first )
-                     osErrorList << n_errors;
-                     osProbList << errorProb;
-                     if ( iType != n_BSErrorType-1 ) {
-                        osErrorList << " ";
-                        osProbList << " ";
-                     }
-                  }//end ErrorType Loop
-                  //--- DB writing
-                  if (!(defecttype.empty())) {
-                     n_errorLink++;
-                     if ( thisBec==ENDCAP_C ) {
-                        nErrLink_ECC[iDisk][iEta]++;
-                     }
-                     else if ( thisBec==ENDCAP_A ) {
-                        nErrLink_ECA[iDisk][iEta]++;
-                     }
-                     if ( m_writeToCool ) {
-                        if ( m_pCalibWriteTool->createListBSErr(waferId, m_pSCTHelper, m_numberOfEvents, osErrorList.str(),osProbList.str()).isFailure() ) {
-                           ATH_MSG_ERROR("Unable to run createListBSError");
-                           return StatusCode::FAILURE;
-                        }
-                     }
-                  }
-               }// end of for iPhi
-            }//implicit end of iEta
-         }//implicit end of iside
-      }//implicit end of iDisk
-   }//end of stemIndex loop
-   //--- Barrel
-   for (int iLayer=0; iLayer<n_barrels; ++iLayer) {
-      for (int iSide=0; iSide<2; ++iSide) {
-         for (int iEta=0; iEta<n_etaBins; ++iEta) {
-            if (iEta-6==0) continue;
-            for (int iPhi=0; iPhi<n_phiBinsBarrel[iLayer]; ++iPhi) {
-               defecttype.erase();
-               n_defect.erase();
-               ostringstream osErrorList;//agrohsje
-               ostringstream osProbList;
-               Identifier waferId = m_pSCTHelper->wafer_id( BARREL, iLayer, iPhi, iEta-6, iSide );
-               IdentifierHash   waferHash = m_pSCTHelper->wafer_hash( waferId );
-               SCT_SerialNumber sn        = m_CablingTool->getSerialNumberFromHash( waferHash );
-               nErrLink_Barrel_module_serial[iLayer][iSide][iEta][iPhi] = sn.str();
-               IntStringMap::iterator errItr=ErrMap.begin();
-               for ( int iType = 0; iType < n_BSErrorType; ++iType ) {
-                  float errorProb = 0.;
-                  unsigned long long n_errors = 0;
-                  if ( iType == errItr->first ) {
-                     ostringstream streamHist;
-                     streamHist << "T" << errItr->second << "Errs" << "_" << iLayer << "_" << iSide;
-                     //histogram might or might not be inside a folder with the same name
-                     std::string folder = errItr->second+std::string("/");
-                     std::string profname = "/run_" + runnum.str() + "/SCT/SCTB/errors/" + folder + streamHist.str();
-                     std::string profnameShort = "/run_" + runnum.str() + "/SCT/SCTB/errors/" + streamHist.str();
-
-                     TProfile2D* prof_tmp = dynamic_cast<TProfile2D*>(m_inputHist->Get( profname.c_str() ));
-                     if (prof_tmp ==nullptr) {
-                        prof_tmp = dynamic_cast<TProfile2D*>(m_inputHist->Get( profnameShort.c_str() ));
-                     }
-                     if (prof_tmp ==nullptr) {
-                        ATH_MSG_ERROR("Unable to get profile for BSErrorsDB : " << profname);
-                        return StatusCode::FAILURE;
-                     }
-                     n_errors = static_cast<unsigned long long>(prof_tmp->GetBinContent( iEta+1, iPhi+1 ));
-                     if (n_errors!=0) {
-                        defecttype = m_pCalibWriteTool->addNumber( defecttype, errItr->first );
-                        n_defect = m_pCalibWriteTool->addNumber( n_defect, n_errors );
-                        errorProb = static_cast<float>(n_errors) / static_cast<float>(m_numberOfEvents);
-                        nErrs_Barrel_module[iLayer][iSide][iEta][iPhi][errItr->first] = n_errors;
-                        nErrLink_Barrel_module[iLayer][iSide][iEta][iPhi]+=n_errors;
-
-                     }//end if (n_errors!=0)
-                     ++errItr;
-                  }//end if ( iType == (*errItr).first )
-                  osErrorList << n_errors;
-                  osProbList << errorProb;
-                  if ( iType != n_BSErrorType-1 ) {
-                     osErrorList << " ";
-                     osProbList << " ";
+            IntStringMap::iterator errItr{detectorIterators[stemIndex]};
+            for (int iType{0}; iType < n_BSErrorType; ++iType) {
+              float errorProb{0.};
+              unsigned long long n_errors{0};
+              if (iType == errItr->first) {
+                ostringstream streamHist;
+                //temporal fix: folder and histogram names should be Preamble
+                streamHist << errItr->second << "Errs" << "_" << iDisk << "_" << iSide;
+                std::string folder{errItr->second+std::string("/")};
+                //histogram might or might not be inside a folder with the same name
+                std::string profname{detectorStems[stemIndex] + folder +streamHist.str()};
+                std::string profnameShort{detectorStems[stemIndex] + streamHist.str()};
+
+                TProfile2D* prof_tmp{dynamic_cast<TProfile2D*>(m_inputHist->Get(profname.c_str()))};
+                if (prof_tmp ==nullptr) {
+                  prof_tmp = dynamic_cast<TProfile2D*>(m_inputHist->Get(profnameShort.c_str()));
+                }
+                if (prof_tmp ==nullptr) {
+                  ATH_MSG_ERROR("Unable to get profile for BSErrorsDB : " << profname);
+                  return StatusCode::FAILURE;
+                }
+
+                n_errors = static_cast<unsigned long long>(prof_tmp->GetBinContent(iEta+1, iPhi+1));
+                if (n_errors!=0) {
+                  defecttype = m_pCalibWriteTool->addNumber(defecttype, errItr->first);
+                  n_defect = m_pCalibWriteTool->addNumber(n_defect, n_errors);
+                  errorProb = static_cast<float>(n_errors) / static_cast<float>(m_numberOfEvents);
+                  nErrs_ECC_module[iDisk][iSide][iEta][iPhi][errItr->first] = n_errors;
+                  if (thisBec==ENDCAP_C) {
+                    nErrLink_ECC_module[iDisk][iSide][iEta][iPhi]+=n_errors;
+                  } else if (thisBec==ENDCAP_A) {
+                    nErrLink_ECA_module[iDisk][iSide][iEta][iPhi]+=n_errors;
                   }
-               }   //end ErrorType Loop
-               //--- DB writing
-               if (!(defecttype.empty())) {
-                  n_errorLink++;
-                  nErrLink_Barrel[iLayer]++;
-                  if ( m_writeToCool ) {
-                     if ( m_pCalibWriteTool->createListBSErr(waferId, m_pSCTHelper, m_numberOfEvents, osErrorList.str(), osProbList.str()).isFailure() ) {
-                        ATH_MSG_ERROR("Unable to run createListBSError");
-                        return StatusCode::FAILURE;
-                     }//end of if m_pCalib
-                  }//end of if m_writeToCool
-               } //end of if defecttype empty
-            }//end of for iPhi
-         }//endof for iEta, implicit end of for iSide and iLayer
-      }
-   }
-
-   ATH_MSG_INFO("#Links which send BSError : " << n_errorLink);
-
-   //--- Summary XML output
-   ostringstream summaryList;
-   for ( int i = 0; i < n_disks; ++i ) {
-      for ( int j = 0; j < n_etaBinsEC; ++j ) {
-         if ( n_phiBinsEndcap[i][j] != 0 ) {
-            summaryList<<xmlPartData(ENDCAP_C, i, j, "nErrLink", nErrLink_ECC[i][j]);
-         }
-      }
-   }
-   for ( int i = 0; i < n_barrels; ++i ) {
-      summaryList<<xmlPartData(BARREL, i, 0, "nErrLink", nErrLink_Barrel[i]);
-   }
-
-   for ( int i = 0; i < n_disks; ++i ) {
-      for ( int j = 0; j < n_etaBinsEC; ++j ) {
-         if ( n_phiBinsEndcap[i][j] != 0 ) {
-            summaryList<<xmlPartData(ENDCAP_A, i, j, "nErrLink", nErrLink_ECA[i][j]);
-         }
-      }
-   }
 
-   if ( openXML4MonSummary( m_outBSErrSummary, "BSErrors" ).isFailure() ) {
-      ATH_MSG_ERROR("Problem in opening BSErrors file");
-      return StatusCode::FAILURE;
-   }
-   if ( wrapUpXML4Summary( m_outBSErrSummary, "BSErrors", summaryList ).isFailure() ) {
-      ATH_MSG_ERROR("Problem in closing BSErrors file");
-      return StatusCode::FAILURE;
-   }
-
-   //module XML output
-   //agascon 06.02.2015
-   ostringstream moduleList;
-   std::string serial;
-   for ( int i = 0; i < n_disks; ++i ) {
-      for ( int j = 0; j < n_etaBinsEC; ++j ) {
-         if ( n_phiBinsEndcap[i][j] != 0 ) {
-            for ( int k = 0; k < 2; k++) {
-               for ( int l = 0; l < n_phiBinsEndcap[i][j]; l++) {
-                  serial = nErrLink_ECC_module_serial[i][k][j][l];
-
-                  //fill ostringstream with number of error of each type for one particular module
-                  ostringstream errList;
-                  for ( int errCount = 0; errCount < numberOfErrorTypes; errCount++) {
-                     int type = errorValues[errCount]; //
-                     errList<<"    "<<xmlValue(ErrMap[type], nErrs_ECC_module[i][k][j][l][type])<<endl;
-                  }
+                }//end if (n_errors!=0)
+                ++errItr;
+              }//end if (iType == (*errItr).first)
+              osErrorList << n_errors;
+              osProbList << errorProb;
+              if (iType != n_BSErrorType-1) {
+                osErrorList << " ";
+                osProbList << " ";
+              }
+            }//end ErrorType Loop
+            //--- DB writing
+            if (!(defecttype.empty())) {
+              n_errorLink++;
+              if (thisBec==ENDCAP_C) {
+                nErrLink_ECC[iDisk][iEta]++;
+              } else if (thisBec==ENDCAP_A) {
+                nErrLink_ECA[iDisk][iEta]++;
+              }
+              if (m_writeToCool) {
+                if (m_pCalibWriteTool->createListBSErr(waferId, m_pSCTHelper, m_numberOfEvents, osErrorList.str(), osProbList.str()).isFailure()) {
+                  ATH_MSG_ERROR("Unable to run createListBSError");
+                  return StatusCode::FAILURE;
+                }
+              }
+            }
+          }// end of for iPhi
+        }//implicit end of iEta
+      }//implicit end of iside
+    }//implicit end of iDisk
+  }//end of stemIndex loop
+   //--- Barrel
+  for (int iLayer{0}; iLayer<n_barrels; ++iLayer) {
+    for (int iSide{0}; iSide<2; ++iSide) {
+      for (int iEta{0}; iEta<n_etaBins; ++iEta) {
+        if (iEta-6==0) continue;
+        for (int iPhi{0}; iPhi<n_phiBinsBarrel[iLayer]; ++iPhi) {
+          defecttype.erase();
+          n_defect.erase();
+          ostringstream osErrorList;//agrohsje
+          ostringstream osProbList;
+          Identifier waferId{m_pSCTHelper->wafer_id(BARREL, iLayer, iPhi, iEta-6, iSide)};
+          IdentifierHash waferHash{m_pSCTHelper->wafer_hash(waferId)};
+          SCT_SerialNumber sn{m_CablingTool->getSerialNumberFromHash(waferHash)};
+          nErrLink_Barrel_module_serial[iLayer][iSide][iEta][iPhi] = sn.str();
+          IntStringMap::iterator errItr{ErrMap.begin()};
+          for (int iType{0}; iType < n_BSErrorType; ++iType) {
+            float errorProb{0.};
+            unsigned long long n_errors{0};
+            if (iType == errItr->first) {
+              ostringstream streamHist;
+              streamHist << "T" << errItr->second << "Errs" << "_" << iLayer << "_" << iSide;
+              //histogram might or might not be inside a folder with the same name
+              std::string folder{errItr->second+std::string("/")};
+              std::string profname{"/run_" + runnum.str() + "/SCT/SCTB/errors/" + folder + streamHist.str()};
+              std::string profnameShort{"/run_" + runnum.str() + "/SCT/SCTB/errors/" + streamHist.str()};
+
+              TProfile2D* prof_tmp{dynamic_cast<TProfile2D*>(m_inputHist->Get(profname.c_str()))};
+              if (prof_tmp ==nullptr) {
+                prof_tmp = dynamic_cast<TProfile2D*>(m_inputHist->Get(profnameShort.c_str()));
+              }
+              if (prof_tmp ==nullptr) {
+                ATH_MSG_ERROR("Unable to get profile for BSErrorsDB : " << profname);
+                return StatusCode::FAILURE;
+              }
+              n_errors = static_cast<unsigned long long>(prof_tmp->GetBinContent(iEta+1, iPhi+1));
+              if (n_errors!=0) {
+                defecttype = m_pCalibWriteTool->addNumber(defecttype, errItr->first);
+                n_defect = m_pCalibWriteTool->addNumber(n_defect, n_errors);
+                errorProb = static_cast<float>(n_errors) / static_cast<float>(m_numberOfEvents);
+                nErrs_Barrel_module[iLayer][iSide][iEta][iPhi][errItr->first] = n_errors;
+                nErrLink_Barrel_module[iLayer][iSide][iEta][iPhi]+=n_errors;
+
+              }//end if (n_errors!=0)
+              ++errItr;
+            }//end if (iType == (*errItr).first)
+            osErrorList << n_errors;
+            osProbList << errorProb;
+            if (iType != n_BSErrorType-1) {
+              osErrorList << " ";
+              osProbList << " ";
+            }
+          }   //end ErrorType Loop
+          //--- DB writing
+          if (!(defecttype.empty())) {
+            n_errorLink++;
+            nErrLink_Barrel[iLayer]++;
+            if (m_writeToCool) {
+              if (m_pCalibWriteTool->createListBSErr(waferId, m_pSCTHelper, m_numberOfEvents, osErrorList.str(), osProbList.str()).isFailure()) {
+                ATH_MSG_ERROR("Unable to run createListBSError");
+                return StatusCode::FAILURE;
+              }//end of if m_pCalib
+            }//end of if m_writeToCool
+          } //end of if defecttype empty
+        }//end of for iPhi
+      }//endof for iEta, implicit end of for iSide and iLayer
+    }
+  }
+
+  ATH_MSG_INFO("#Links which send BSError : " << n_errorLink);
+
+  //--- Summary XML output
+  ostringstream summaryList;
+  for (int i{0}; i < n_disks; ++i) {
+    for (int j{0}; j < n_etaBinsEC; ++j) {
+      if (n_phiBinsEndcap[i][j] != 0) {
+        summaryList << xmlPartData(ENDCAP_C, i, j, "nErrLink", nErrLink_ECC[i][j]);
+      }
+    }
+  }
+  for (int i{0}; i < n_barrels; ++i) {
+    summaryList << xmlPartData(BARREL, i, 0, "nErrLink", nErrLink_Barrel[i]);
+  }
+
+  for (int i{0}; i < n_disks; ++i) {
+    for (int j{0}; j < n_etaBinsEC; ++j) {
+      if (n_phiBinsEndcap[i][j] != 0) {
+        summaryList << xmlPartData(ENDCAP_A, i, j, "nErrLink", nErrLink_ECA[i][j]);
+      }
+    }
+  }
+
+  if (openXML4MonSummary(m_outBSErrSummary, "BSErrors").isFailure()) {
+    ATH_MSG_ERROR("Problem in opening BSErrors file");
+    return StatusCode::FAILURE;
+  }
+  if (wrapUpXML4Summary(m_outBSErrSummary, "BSErrors", summaryList).isFailure()) {
+    ATH_MSG_ERROR("Problem in closing BSErrors file");
+    return StatusCode::FAILURE;
+  }
+
+  //module XML output
+  //agascon 06.02.2015
+  ostringstream moduleList;
+  std::string serial;
+  for (int i{0}; i < n_disks; ++i) {
+    for (int j{0}; j < n_etaBinsEC; ++j) {
+      if (n_phiBinsEndcap[i][j] != 0) {
+        for (int k{0}; k < 2; k++) {
+          for (int l{0}; l < n_phiBinsEndcap[i][j]; l++) {
+            serial = nErrLink_ECC_module_serial[i][k][j][l];
+
+            //fill ostringstream with number of error of each type for one particular module
+            ostringstream errList;
+            for (int errCount{0}; errCount < numberOfErrorTypes; errCount++) {
+              int type{errorValues[errCount]}; //
+              errList << "    " << xmlValue(ErrMap[type], nErrs_ECC_module[i][k][j][l][type]) << endl;
+            }
 
-                  moduleList<<xmlModuleData(ENDCAP_C, i, k, j, l, "nErrors", nErrLink_ECC_module[i][k][j][l], serial, errList.str());
-                  //          moduleList<<xmlModuleData(ENDCAP_C, i, k, j, l, "nErrLink", nErrLink_ECC_module[i][k][j][l], serial, errList);
+            moduleList << xmlModuleData(ENDCAP_C, i, k, j, l, "nErrors", nErrLink_ECC_module[i][k][j][l], serial, errList.str());
 
-               }
-            }
-         }
+          }
+        }
       }
-   }
+    }
+  }
 
 
-   for ( int i = 0; i < n_barrels; i++ ) {
-      for ( int j = 0; j < 2; j++) {
-         for ( int k = 0; k < n_etaBins; k++) {
-            for ( int l = 0; l < n_phiBinsBarrel[i] ; l++) {
-               serial = nErrLink_Barrel_module_serial[i][j][k][l];
+  for (int i{0}; i < n_barrels; i++) {
+    for (int j{0}; j < 2; j++) {
+      for (int k{0}; k < n_etaBins; k++) {
+        for (int l{0}; l < n_phiBinsBarrel[i] ; l++) {
+          serial = nErrLink_Barrel_module_serial[i][j][k][l];
 
-               ostringstream errList;
-               for ( int errCount = 0; errCount < numberOfErrorTypes; errCount++) {
-                  int type = errorValues[errCount]; //
-                  errList<<"    "<<xmlValue(ErrMap[type], nErrs_Barrel_module[i][j][k][l][type])<<endl;
-               }
+          ostringstream errList;
+          for (int errCount{0}; errCount < numberOfErrorTypes; errCount++) {
+            int type{errorValues[errCount]}; //
+            errList << "    " << xmlValue(ErrMap[type], nErrs_Barrel_module[i][j][k][l][type]) << endl;
+          }
 
-               moduleList<<xmlModuleData(BARREL, i, j, k, l, "nErrors", nErrLink_Barrel_module[i][j][k][l], serial, errList.str());
-            }
-         }
+          moduleList << xmlModuleData(BARREL, i, j, k, l, "nErrors", nErrLink_Barrel_module[i][j][k][l], serial, errList.str());
+        }
       }
-   }
-
-   for ( int i = 0; i < n_disks; ++i ) {
-      for ( int j = 0; j < n_etaBinsEC; ++j ) {
-         if ( n_phiBinsEndcap[i][j] != 0 ) {
-            for ( int k = 0; k < 2; k++) {
-               for ( int l = 0; l < n_phiBinsEndcap[i][j]; l++) {
-                  serial = nErrLink_ECA_module_serial[i][k][j][l];
-
-                  ostringstream errList;
-                  for ( int errCount = 0; errCount < numberOfErrorTypes; errCount++) {
-                     int type = errorValues[errCount]; //
-                     errList<<"    "<<xmlValue(ErrMap[type], nErrs_ECA_module[i][k][j][l][type])<<endl;
-                  }
+    }
+  }
+
+  for (int i{0}; i < n_disks; ++i) {
+    for (int j{0}; j < n_etaBinsEC; ++j) {
+      if (n_phiBinsEndcap[i][j] != 0) {
+        for (int k{0}; k < 2; k++) {
+          for (int l{0}; l < n_phiBinsEndcap[i][j]; l++) {
+            serial = nErrLink_ECA_module_serial[i][k][j][l];
 
-                  moduleList<<xmlModuleData(ENDCAP_A, i, k, j, l, "nErrors", nErrLink_ECA_module[i][k][j][l], serial, errList.str());
-               }
+            ostringstream errList;
+            for (int errCount{0}; errCount < numberOfErrorTypes; errCount++) {
+              int type{errorValues[errCount]}; //
+              errList << "    " << xmlValue(ErrMap[type], nErrs_ECA_module[i][k][j][l][type]) << endl;
             }
-         }
-      }
-   }
 
-   if ( openXML4MonSummary( m_outBSErrModule, "BSErrorsModule" ).isFailure() ) {
-      ATH_MSG_ERROR("Problem in opening BSErrorsModule file");
-      return StatusCode::FAILURE;
-   }
-   if ( wrapUpXML4Summary( m_outBSErrModule, "BSErrors", moduleList ).isFailure() ) {
-      ATH_MSG_ERROR("Problem in closing BSErrors file");
+            moduleList << xmlModuleData(ENDCAP_A, i, k, j, l, "nErrors", nErrLink_ECA_module[i][k][j][l], serial, errList.str());
+          }
+        }
+      }
+    }
+  }
+
+  if (openXML4MonSummary(m_outBSErrModule, "BSErrorsModule").isFailure()) {
+    ATH_MSG_ERROR("Problem in opening BSErrorsModule file");
+    return StatusCode::FAILURE;
+  }
+  if (wrapUpXML4Summary(m_outBSErrModule, "BSErrors", moduleList).isFailure()) {
+    ATH_MSG_ERROR("Problem in closing BSErrors file");
+    return StatusCode::FAILURE;
+  }
+
+  //--- DB output
+  if (m_writeToCool) {
+    if (m_pCalibWriteTool->wrapUpBSErrors().isFailure()) {
+      ATH_MSG_ERROR("Could not get ByteStream Errors");
       return StatusCode::FAILURE;
-   }
+    }
+  }
 
-   //--- DB output
-   if ( m_writeToCool ) {
-      if ( m_pCalibWriteTool->wrapUpBSErrors().isFailure() ) {
-         ATH_MSG_ERROR("Could not get ByteStream Errors");
-         return StatusCode::FAILURE;
-      }
-   }
-
-   return StatusCode::SUCCESS;
+  return StatusCode::SUCCESS;
 
 }
 
@@ -2086,377 +2053,355 @@ StatusCode SCTCalib::getBSErrors() {
 ///////////////////////////////////////////////////////////////////////////////////
 
 StatusCode SCTCalib::getLorentzAngle() {
-   ATH_MSG_INFO("----- in getLorentzAngle() -----");
-
-   //--- Initialization
-
-   float A_BarrelSide[ n_barrels ][ 2 ][ 2 ] = { {{0},{0}}, {{0},{0}} };
-   float LA_BarrelSide[ n_barrels ][ 2 ][ 2 ] = { {{0},{0}}, {{0},{0}} };
-   float B_BarrelSide[ n_barrels ][ 2 ][ 2 ] = { {{0},{0}}, {{0},{0}} };
-   float Sigma_BarrelSide[ n_barrels ][ 2 ][ 2 ] = { {{0},{0}}, {{0},{0}} };
-
-   float Err_A_BarrelSide[ n_barrels ][ 2 ][ 2 ] = { {{0},{0}}, {{0},{0}} };
-   float Err_LA_BarrelSide[ n_barrels ][ 2 ][ 2 ] = { {{0},{0}}, {{0},{0}} };
-   float Err_B_BarrelSide[ n_barrels ][ 2 ][ 2 ] = { {{0},{0}}, {{0},{0}} };
-   float Err_Sigma_BarrelSide[ n_barrels ][ 2 ][ 2 ] = { {{0},{0}}, {{0},{0}} };
-
-   float MCW_BarrelSide[ n_barrels ][ 2 ][ 2 ] = { {{0},{0}}, {{0},{0}} };
-   float Err_MCW_BarrelSide[ n_barrels ][ 2 ][ 2 ] = { {{0},{0}}, {{0},{0}} };
-   float Chisq_BarrelSide[ n_barrels ][ 2 ][ 2 ] = { {{0},{0}}, {{0},{0}} };
-
-   string DBUploadFlag = "G";  // fit status flag
-   string module[2]= {"100","111"};
-   int moduleint[2]= {100,111};
-
-   int FitFlag[ n_barrels ][ 2 ][ 2 ] = { {{0},{0}}, {{0},{0}} };  // fit status flag
-
-   TFile *fitFile;
-
-   //--- RunNumber
-   std::ostringstream runnum;
-   runnum << m_runNumber.value();
-
-   //--- Directory in HIST
-   std::string stem;
-
-   //--- Barrel
-   stem = "/run_" + runnum.str() + "/SCT/GENERAL/lorentz/";
-   m_h_phiVsNstripsSideHistoVector.clear();
-   for ( int iLayer = 0; iLayer < n_barrels ; ++iLayer ) {
-      for ( int iSide = 0; iSide < 2; ++iSide ) {
-         for ( int iModule = 0; iModule < 2; ++iModule ) {
-            ostringstream streamHist;
-            streamHist << "h_phiVsNstrips_" << module[iModule] << "_" << iLayer << "Side" << iSide;
-            std::string  histName = stem + streamHist.str();
-            TProfile* hist_tmp = dynamic_cast<TProfile*>(m_inputHist->Get( histName.c_str() ));
-            if (hist_tmp ==nullptr) {
-               ATH_MSG_ERROR("Unable to get histogram for LorentzAngle : " << histName);
-               return StatusCode::FAILURE;
-            }
-            m_h_phiVsNstripsSideHistoVector.push_back( hist_tmp );
-         }
-      }
-   }
-
-   //--- XML file
-   const char* outputLorentzAngleFileName = m_LorentzAngleFile.value().c_str();
-   ofstream outFile( outputLorentzAngleFileName, std::ios::out );
-   if ( !outFile.good() ) {
-      ATH_MSG_ERROR("Unable to open LorentzAngleFile : " << outputLorentzAngleFileName);
-      return StatusCode::FAILURE;
-   }
-
-   //--- Header for XML outputs
-   ostringstream osHeader;
-   osHeader << "<folder>"<< endl;
-   outFile << osHeader.str();
-
-   fitFile = new TFile("FittingDebugFile.root","RECREATE");
-
-   //--- Barrel
-   for ( int iLayer = 0; iLayer < n_barrels; ++iLayer ) {
-      for ( int iSide = 0; iSide < 2; ++iSide ) {
-         for ( int iModule = 0; iModule < 2; ++iModule ) {
-            if (iLayer==1 && iModule==0) continue; // Layer 1 doesn't contain 100 modules
-            ATH_MSG_INFO("LorentzAngle fit start : " << 4*iLayer + iSide +1 + iModule << " / 16");
-            Int_t fitResult;
-            Double_t par[4],err_par[4];
-            TF1 *LAfit = new TF1("LAfit", LA_func, -9., 2.,4 );
-            ostringstream streamFile;
-            streamFile << "h_phiVsNstrips_" << module[iModule] << "_" << iLayer << "Side" << iSide;
-
-            LAfit->SetParLimits(3, 0.1, 50.);
-            LAfit->SetParNames("a","LA","b","sigma");
-            LAfit->SetParameters(1.,-5.,1.13,2.);
-            fitResult = m_h_phiVsNstripsSideHistoVector[ 4*iLayer + 2*iSide +iModule ] -> Fit("LAfit", "E", "",-9.,2.);
-            LAfit->GetParameters(par);
-            err_par[0]=LAfit->GetParError(0);
-            err_par[1]=LAfit->GetParError(1);
-            err_par[2]=LAfit->GetParError(2);
-            err_par[3]=LAfit->GetParError(3);
-
-            //DEBUG MODE
-            if ( m_LorentzAngleDebugMode  ) {
-               ostringstream streamFileTmp;
-               streamFileTmp << "h_phiVsNstrips_" << module[iModule] << "_" << iLayer << "Side" << iSide << "_First_Fit";
-               std::string dn = streamFile.str();
-               std::string tmp_hn = streamFileTmp.str();
-               const char* dir_name = dn.c_str();
-               const char* histo_name = tmp_hn.c_str();
-               fitFile->cd();
-               fitFile->mkdir(dir_name);            //Creating Directories
-               fitFile->cd(dir_name);
-               m_h_phiVsNstripsSideHistoVector[ 4*iLayer + 2*iSide +iModule] -> SetName(histo_name);
-               m_h_phiVsNstripsSideHistoVector[ 4*iLayer + 2*iSide +iModule] -> Write();
-               ATH_MSG_INFO("-------:Directory Name: " << dir_name << "--------");
-            }
-
-
-
-            if ( fitResult != 0 ) {
-               ATH_MSG_INFO("Try to use parabola Fit to determine initial value!");
-               TF1 *parafit = new TF1("parafit", "[0]*(x-[1])*(x-[1])+[2]", -9., 2. );
-               ATH_MSG_INFO("LorentzAngle 2nd para fit start : " << 4*iLayer + iSide +1 + iModule << " / 16");
-               parafit->SetParameters(par[0],par[1],LAfit->Eval(par[1],0,0,0));
-               m_h_phiVsNstripsSideHistoVector[ 4*iLayer + 2*iSide +iModule ] -> Fit("parafit", "R", "",-9.,2.);
-               ATH_MSG_INFO("LorentzAngle 2nd pre fit start : " << 4*iLayer + iSide +1 + iModule << " / 16");
-               par[1]=parafit->GetParameter(1);
-               LAfit->SetParameters(par[0],par[1],par[2],par[3]);
-               LAfit->SetParLimits(1,par[1],par[1]);
-               m_h_phiVsNstripsSideHistoVector[ 4*iLayer + 2*iSide +iModule] -> Fit("LAfit", "R", "",-9.,2.);
-               LAfit->GetParameters(par);
-               LAfit->SetParLimits(1, -90., 90.);
-               LAfit->SetParameters(par[0],par[1],par[2],par[3]);
-               ATH_MSG_INFO("LorentzAngle 2nd main fit start : " << 4*iLayer + iSide +1 + iModule << " / 16");
-               fitResult = m_h_phiVsNstripsSideHistoVector[ 4*iLayer + 2*iSide +iModule] -> Fit("LAfit", "E", "",-9.,2.);
-               LAfit->GetParameters(par);
-               if ( m_LorentzAngleDebugMode  ) {
-
-                  ostringstream streamFileTmp;
-                  streamFileTmp << "h_phiVsNstrips_" << module[iModule] << "_" << iLayer << "Side" << iSide << "Second_Fit";
-                  std::string tmp_hn = streamFileTmp.str();
-                  const char* histo_name = tmp_hn.c_str();
-                  m_h_phiVsNstripsSideHistoVector[ 4*iLayer + 2*iSide +iModule] -> SetName(histo_name);
-                  m_h_phiVsNstripsSideHistoVector[ 4*iLayer + 2*iSide +iModule] -> Write();
-
-               }
-
-            }
-
-            if ( fitResult != 0 ) {
-               ATH_MSG_INFO("Try to fix one parameter sigma=2.0 to determine other initial value!");
-               ATH_MSG_INFO("LorentzAngle 3rd pre fit start : " << 4*iLayer + iSide +1+ iModule << " / 16");
-               LAfit->SetParameters(par[0],par[1],par[2],2.);
-               LAfit->SetParLimits(3,2.,2.);
-               m_h_phiVsNstripsSideHistoVector[ 4*iLayer + 2*iSide +iModule] -> Fit("LAfit", "R", "",-9.,2.);
-               LAfit->GetParameters(par);
-               LAfit->SetParLimits(3, 0., 50.);
-               LAfit->SetParameters(par[0],par[1],par[2],par[3]);
-               ATH_MSG_INFO("LorentzAngle 3rd main fit start : " << 4*iLayer + iSide +1 +iModule<< " / 16");
-               fitResult = m_h_phiVsNstripsSideHistoVector[ 4*iLayer + 2*iSide +iModule] -> Fit("LAfit", "E", "",-9.,2.);
-               LAfit->GetParameters(par);
-               if ( m_LorentzAngleDebugMode  ) {
-                  ostringstream streamFileTmp;
-                  streamFileTmp << "h_phiVsNstrips_" << module[iModule] << "_" << iLayer << "Side" << iSide << "Third_Fit";
-                  std::string tmp_hn = streamFileTmp.str();
-                  const char* histo_name = tmp_hn.c_str();
-                  m_h_phiVsNstripsSideHistoVector[ 4*iLayer + 2*iSide +iModule] -> SetName(histo_name);
-                  m_h_phiVsNstripsSideHistoVector[ 4*iLayer + 2*iSide +iModule] -> Write();
-               }
-
-            }
-
-
-            if ( fitResult == 0 ) {
-               FitFlag[iLayer][iSide][iModule]= 1;
-            } else {
-               DBUploadFlag="R";
-               FitFlag[iLayer][iSide][iModule]= 0;
-               ATH_MSG_WARNING("Fit Failed! Unable to get LorentzAngle");
-            }
-            double A      = par[0];
-            double LA     = par[1];                // Lorentz Angle
-            double B      = par[2];
-            double sigma  = par[3];
-            double err_A      = err_par[0];
-            double err_LA     = err_par[1];                // Lorentz Angle
-            double err_B      = err_par[2];
-            double err_sigma  = err_par[3];
-            float MCW     = LAfit->Eval(LA,0,0,0); //Min-cluster-width
-            float err_MCW     = LAfit->Eval(fabs(err_par[1]),0,0,0); //Min-cluster-width
-            //      float lorentz = fabs(LA);
-
-            A_BarrelSide[iLayer][iSide][iModule]= A;
-            LA_BarrelSide[iLayer][iSide][iModule]=LA;
-            B_BarrelSide[iLayer][iSide][iModule]=B;
-            Sigma_BarrelSide[iLayer][iSide][iModule]=sigma;
-            Err_A_BarrelSide[iLayer][iSide][iModule]= err_A;
-            Err_LA_BarrelSide[iLayer][iSide][iModule]=err_LA;
-            Err_B_BarrelSide[iLayer][iSide][iModule]=err_B;
-            Err_Sigma_BarrelSide[iLayer][iSide][iModule]=err_sigma;
-            MCW_BarrelSide[iLayer][iSide][iModule]=MCW;
-            Err_MCW_BarrelSide[iLayer][iSide][iModule]=err_MCW;
-            Chisq_BarrelSide[iLayer][iSide][iModule]=LAfit->GetChisquare();
-
-
-         }
-
-      }
-
-   }
-
-
-   if ( m_LorentzAngleDebugMode ) {
-      fitFile->Close();
-   }
-
-   for ( int iLayer = 0; iLayer < n_barrels; ++iLayer ) {
-      for ( int iSide = 0; iSide < 2; ++iSide ) {
-         for ( int iModule = 0; iModule < 2; ++iModule ) {
-            Identifier waferId = m_pSCTHelper->wafer_id( BARREL, iLayer, 0, 0, iSide );
-            int ch = 0;
-            outFile << "<folderDefinition folder=\"SCT/Derived/LorentzAngleRun2_v2\" version=\"multi\">"         << linefeed
-                    << "  <folderDescription>" << linefeed
-                    << "     <timeStamp>run-lumi</timeStamp>" << linefeed
-                    << "     <addrHeader>" << linefeed
-                    << "        <address_header service_type=\"71\" clid=\"1238547719\">" << linefeed
-                    << "     </addrHeader>" << linefeed
-                    << "     <typeName>CondAttrListCollection</typeName>" << linefeed
-                    << "  </folderDescription>" << linefeed
-
-                    << "  <payloadDescription>" << linefeed
-
-
-                    << "    <payloadType name=\"moduleType\">"          <<  moduleint[iModule]  << "</payloadType>" << linefeed
-                    << "    <payloadType name=\"lorentzAngle\">"        <<  LA_BarrelSide[iLayer][iSide][iModule] << "</payloadType>" << linefeed
-                    << "    <payloadType name=\"err_lorentzAngle\">"    << Err_LA_BarrelSide[iLayer][iSide][iModule]<< "</payloadType>" << linefeed
-                    << "    <payloadType name=\"chisq\">"               << Chisq_BarrelSide[iLayer][iSide][iModule]<< "</payloadType>" << linefeed
-                    << "    <payloadType name=\"fitParam_a\">"          << A_BarrelSide[iLayer][iSide][iModule] << "</payloadType>" << linefeed
-                    << "    <payloadType name=\"err_a\">"               << Err_A_BarrelSide[iLayer][iSide][iModule] << "</payloadType>" << linefeed
-                    << "    <payloadType name=\"fitParam_b\">"          << B_BarrelSide[iLayer][iSide][iModule] << "</payloadType>" << linefeed
-                    << "    <payloadType name=\"err_b\">"               << Err_B_BarrelSide[iLayer][iSide][iModule]      << "</payloadType>" << linefeed
-                    << "    <payloadType name=\"fitParam_sigma\">"      << Sigma_BarrelSide[iLayer][iSide][iModule]                      << "</payloadType>" << linefeed
-                    << "    <payloadType name=\"err_sigma\">"           << Err_Sigma_BarrelSide[iLayer][iSide][iModule]      << "</payloadType>" << linefeed
-                    << "    <payloadType name=\"minClusterWidth\">"     << MCW_BarrelSide[iLayer][iSide][iModule]  << "</payloadType>" << linefeed
-                    << "    <payloadType name=\"err_minClusterWidth\">" << Err_MCW_BarrelSide[iLayer][iSide][iModule]      << "</payloadType>" << linefeed
-
-                    << "  </payloadDescription>" <<linefeed
-                    << "  <channel id=\"" << ch << "\" name=\""<<iLayer<< "_"<<iSide<<" \" />" << linefeed
-                    << "</folderDefinition>" << endl;
-
-            ch++;
-
-            //--- DB output
-            if ( m_writeToCool ) {
-               //  if ( m_pCalibWriteTool->createListLA( waferId, m_pSCTHelper, 10000, moduleint[iModule], LA_BarrelSide[iLayer][iSide][iModule],MCW_BarrelSide[iLayer][iSide][iModule] ).isFailure() ) {
-               if ( m_pCalibWriteTool->createListLA( waferId, m_pSCTHelper, 10000, moduleint[iModule], LA_BarrelSide[iLayer][iSide][iModule], Err_LA_BarrelSide[iLayer][iSide][iModule],  Chisq_BarrelSide[iLayer][iSide][iModule], A_BarrelSide[iLayer][iSide][iModule], Err_A_BarrelSide[iLayer][iSide][iModule], B_BarrelSide[iLayer][iSide][iModule], Err_B_BarrelSide[iLayer][iSide][iModule], Sigma_BarrelSide[iLayer][iSide][iModule], Err_Sigma_BarrelSide[iLayer][iSide][iModule], MCW_BarrelSide[iLayer][iSide][iModule], Err_MCW_BarrelSide[iLayer][iSide][iModule] ).isFailure() ) {
-                  ATH_MSG_ERROR("Unable to run createListLA");
-                  return StatusCode::FAILURE;
-               }
-            }
-
-         }
-      }
-   }
-
-   //--- Tail of XML outputs
-   outFile << "</folder>" << endl;
-
-   //--- Summary XML output
-   ostringstream summaryList;
-   for ( int i = 0; i < n_barrels; ++i ) {
-      for ( int iSide = 0; iSide < 2; ++iSide ) {
-         for ( int iModule = 0; iModule < 2; ++iModule ) {
-            const std::string thisPart=shortNames[bec2Index(BARREL)];
-            summaryList<< "    <parts>" << linefeed
-                       << xmlValue("part",thisPart) << linefeed
-                       << xmlValue("layer", i) << linefeed
-                       << xmlValue("Side", iSide) << linefeed
-                       << xmlValue("Module", module[iModule]) << linefeed
-                       << xmlValue("lorentzAngle", LA_BarrelSide[i][iSide][iModule]) << linefeed
-                       << xmlValue("minClusterWidth",  MCW_BarrelSide[i][iSide][iModule]) << linefeed
-                       << xmlValue("Fit",  FitFlag[i][iSide][iModule]) << linefeed
-                       <<"    </parts>" << linefeed;
-         }
-      }
-   }
-
-   std::ofstream & file = m_outLASummary;
-   typedef std::pair<string, string> TwoStrings;
-   typedef std::map<std::string, TwoStrings > Names;
-   Names nameAssociation;
-   nameAssociation["LorentzAngle"]=TwoStrings(m_LorentzAngleSummaryFile, "LorentzAngleInfo.xsl");
-   Names::iterator found=nameAssociation.find("LorentzAngle");
-   if (found!=nameAssociation.end()) {
-      std::string filename=found->second.first;
-      std::string xslName=found->second.second;
-      file.open( filename.c_str(), std::ios::out );
-      if ( !file.good() ) return StatusCode::FAILURE;
-      file << xmlHeader<< linefeed<< associateStylesheet(xslName) << linefeed<< "<run>"<< endl;
-   }
-   else {
-      ATH_MSG_ERROR(" argument \"type\" needs to be  LorentzAngle.");
-      return StatusCode::FAILURE;
-   }
-
-   file << xmlValue("RunNumber",  m_runNumber.value()) << linefeed
-        << xmlValue("StartTime",  m_utcBegin) << linefeed
-        << xmlValue("EndTime",  m_utcEnd) << linefeed
-        << xmlValue("Duration",  m_calibEvtInfoTool->duration() ) << linefeed
-        << xmlValue("LB",  m_LBRange) << linefeed
-        << xmlValue("Events",  m_numberOfEvents) << linefeed
-        << xmlValue("Flag",  DBUploadFlag) << linefeed
-        << "  <data>"<< endl;
-
-
-   if ( wrapUpXML4Summary( m_outLASummary, "LorentzAngle", summaryList ).isFailure() ) {
-      ATH_MSG_ERROR("Problem in closing LorentzAngle file");
+  ATH_MSG_INFO("----- in getLorentzAngle() -----");
+
+  //--- Initialization
+
+  float A_BarrelSide[n_barrels][2][2] = {{{0}, {0}}, {{0}, {0}}};
+  float LA_BarrelSide[n_barrels][2][2] = {{{0}, {0}}, {{0}, {0}}};
+  float B_BarrelSide[n_barrels][2][2] = {{{0}, {0}}, {{0}, {0}}};
+  float Sigma_BarrelSide[n_barrels][2][2] = {{{0}, {0}}, {{0}, {0}}};
+
+  float Err_A_BarrelSide[n_barrels][2][2] = {{{0}, {0}}, {{0}, {0}}};
+  float Err_LA_BarrelSide[n_barrels][2][2] = {{{0}, {0}}, {{0}, {0}}};
+  float Err_B_BarrelSide[n_barrels][2][2] = {{{0}, {0}}, {{0}, {0}}};
+  float Err_Sigma_BarrelSide[n_barrels][2][2] = {{{0}, {0}}, {{0}, {0}}};
+
+  float MCW_BarrelSide[n_barrels][2][2] = {{{0}, {0}}, {{0}, {0}}};
+  float Err_MCW_BarrelSide[n_barrels][2][2] = {{{0}, {0}}, {{0}, {0}}};
+  float Chisq_BarrelSide[n_barrels][2][2] = {{{0}, {0}}, {{0}, {0}}};
+
+  string DBUploadFlag{"G"};  // fit status flag
+  string module[2] = {"100", "111"};
+  int moduleint[2] = {100, 111};
+
+  int FitFlag[n_barrels][2][2] = {{{0}, {0}}, {{0}, {0}}};  // fit status flag
+
+  TFile* fitFile;
+
+  //--- RunNumber
+  std::ostringstream runnum;
+  runnum << m_runNumber.value();
+
+  //--- Directory in HIST
+  std::string stem;
+
+  //--- Barrel
+  stem = "/run_" + runnum.str() + "/SCT/GENERAL/lorentz/";
+  m_h_phiVsNstripsSideHistoVector.clear();
+  for (int iLayer{0}; iLayer < n_barrels ; ++iLayer) {
+    for (int iSide{0}; iSide < 2; ++iSide) {
+      for (int iModule{0}; iModule < 2; ++iModule) {
+        ostringstream streamHist;
+        streamHist << "h_phiVsNstrips_" << module[iModule] << "_" << iLayer << "Side" << iSide;
+        std::string  histName{stem + streamHist.str()};
+        TProfile* hist_tmp{dynamic_cast<TProfile*>(m_inputHist->Get(histName.c_str()))};
+        if (hist_tmp ==nullptr) {
+          ATH_MSG_ERROR("Unable to get histogram for LorentzAngle : " << histName);
+          return StatusCode::FAILURE;
+        }
+        m_h_phiVsNstripsSideHistoVector.push_back(hist_tmp);
+      }
+    }
+  }
+
+  //--- XML file
+  const char* outputLorentzAngleFileName{m_LorentzAngleFile.value().c_str()};
+  ofstream outFile{outputLorentzAngleFileName, std::ios::out};
+  if (!outFile.good()) {
+    ATH_MSG_ERROR("Unable to open LorentzAngleFile : " << outputLorentzAngleFileName);
+    return StatusCode::FAILURE;
+  }
+
+  //--- Header for XML outputs
+  ostringstream osHeader;
+  osHeader << "<folder>" << endl;
+  outFile << osHeader.str();
+
+  fitFile = new TFile("FittingDebugFile.root", "RECREATE");
+
+  //--- Barrel
+  for (int iLayer{0}; iLayer < n_barrels; ++iLayer) {
+    for (int iSide{0}; iSide < 2; ++iSide) {
+      for (int iModule{0}; iModule < 2; ++iModule) {
+        if (iLayer==1 and iModule==0) continue; // Layer 1 doesn't contain 100 modules
+        ATH_MSG_INFO("LorentzAngle fit start : " << 4*iLayer + iSide +1 + iModule << " / 16");
+        Int_t fitResult;
+        Double_t par[4], err_par[4];
+        TF1* LAfit{new TF1{"LAfit", LA_func, -9., 2., 4}};
+        ostringstream streamFile;
+        streamFile << "h_phiVsNstrips_" << module[iModule] << "_" << iLayer << "Side" << iSide;
+
+        LAfit->SetParLimits(3, 0.1, 50.);
+        LAfit->SetParNames("a", "LA", "b", "sigma");
+        LAfit->SetParameters(1., -5., 1.13, 2.);
+        fitResult = m_h_phiVsNstripsSideHistoVector[4*iLayer + 2*iSide +iModule]->Fit("LAfit", "E", "", -9., 2.);
+        LAfit->GetParameters(par);
+        err_par[0] = LAfit->GetParError(0);
+        err_par[1] = LAfit->GetParError(1);
+        err_par[2] = LAfit->GetParError(2);
+        err_par[3] = LAfit->GetParError(3);
+
+        //DEBUG MODE
+        if (m_LorentzAngleDebugMode) {
+          ostringstream streamFileTmp;
+          streamFileTmp << "h_phiVsNstrips_" << module[iModule] << "_" << iLayer << "Side" << iSide << "_First_Fit";
+          std::string dn{streamFile.str()};
+          std::string tmp_hn{streamFileTmp.str()};
+          const char* dir_name{dn.c_str()};
+          const char* histo_name{tmp_hn.c_str()};
+          fitFile->cd();
+          fitFile->mkdir(dir_name);            //Creating Directories
+          fitFile->cd(dir_name);
+          m_h_phiVsNstripsSideHistoVector[4*iLayer + 2*iSide +iModule]->SetName(histo_name);
+          m_h_phiVsNstripsSideHistoVector[4*iLayer + 2*iSide +iModule]->Write();
+          ATH_MSG_INFO("-------:Directory Name: " << dir_name << "--------");
+        }
+
+        if (fitResult != 0) {
+          ATH_MSG_INFO("Try to use parabola Fit to determine initial value!");
+          TF1* parafit{new TF1{"parafit", "[0]*(x-[1])*(x-[1])+[2]", -9., 2.}};
+          ATH_MSG_INFO("LorentzAngle 2nd para fit start : " << 4*iLayer + iSide +1 + iModule << " / 16");
+          parafit->SetParameters(par[0], par[1], LAfit->Eval(par[1], 0, 0, 0));
+          m_h_phiVsNstripsSideHistoVector[4*iLayer + 2*iSide +iModule]->Fit("parafit", "R", "", -9., 2.);
+          ATH_MSG_INFO("LorentzAngle 2nd pre fit start : " << 4*iLayer + iSide +1 + iModule << " / 16");
+          par[1] = parafit->GetParameter(1);
+          LAfit->SetParameters(par[0], par[1], par[2], par[3]);
+          LAfit->SetParLimits(1, par[1], par[1]);
+          m_h_phiVsNstripsSideHistoVector[4*iLayer + 2*iSide +iModule]->Fit("LAfit", "R", "", -9., 2.);
+          LAfit->GetParameters(par);
+          LAfit->SetParLimits(1, -90., 90.);
+          LAfit->SetParameters(par[0], par[1], par[2], par[3]);
+          ATH_MSG_INFO("LorentzAngle 2nd main fit start : " << 4*iLayer + iSide +1 + iModule << " / 16");
+          fitResult = m_h_phiVsNstripsSideHistoVector[4*iLayer + 2*iSide +iModule]->Fit("LAfit", "E", "", -9., 2.);
+          LAfit->GetParameters(par);
+          if (m_LorentzAngleDebugMode) {
+            ostringstream streamFileTmp;
+            streamFileTmp << "h_phiVsNstrips_" << module[iModule] << "_" << iLayer << "Side" << iSide << "Second_Fit";
+            std::string tmp_hn{streamFileTmp.str()};
+            const char* histo_name{tmp_hn.c_str()};
+            m_h_phiVsNstripsSideHistoVector[4*iLayer + 2*iSide +iModule]->SetName(histo_name);
+            m_h_phiVsNstripsSideHistoVector[4*iLayer + 2*iSide +iModule]->Write();
+          }
+        }
+
+        if (fitResult != 0) {
+          ATH_MSG_INFO("Try to fix one parameter sigma=2.0 to determine other initial value!");
+          ATH_MSG_INFO("LorentzAngle 3rd pre fit start : " << 4*iLayer + iSide +1+ iModule << " / 16");
+          LAfit->SetParameters(par[0], par[1], par[2], 2.);
+          LAfit->SetParLimits(3, 2., 2.);
+          m_h_phiVsNstripsSideHistoVector[4*iLayer + 2*iSide +iModule]->Fit("LAfit", "R", "", -9., 2.);
+          LAfit->GetParameters(par);
+          LAfit->SetParLimits(3, 0., 50.);
+          LAfit->SetParameters(par[0], par[1], par[2], par[3]);
+          ATH_MSG_INFO("LorentzAngle 3rd main fit start : " << 4*iLayer + iSide +1 +iModule << " / 16");
+          fitResult = m_h_phiVsNstripsSideHistoVector[4*iLayer + 2*iSide +iModule]->Fit("LAfit", "E", "", -9., 2.);
+          LAfit->GetParameters(par);
+          if (m_LorentzAngleDebugMode) {
+            ostringstream streamFileTmp;
+            streamFileTmp << "h_phiVsNstrips_" << module[iModule] << "_" << iLayer << "Side" << iSide << "Third_Fit";
+            std::string tmp_hn{streamFileTmp.str()};
+            const char* histo_name{tmp_hn.c_str()};
+            m_h_phiVsNstripsSideHistoVector[4*iLayer + 2*iSide +iModule]->SetName(histo_name);
+            m_h_phiVsNstripsSideHistoVector[4*iLayer + 2*iSide +iModule]->Write();
+          }
+        }
+
+        if (fitResult == 0) {
+          FitFlag[iLayer][iSide][iModule] = 1;
+        } else {
+          DBUploadFlag = "R";
+          FitFlag[iLayer][iSide][iModule] = 0;
+          ATH_MSG_WARNING("Fit Failed! Unable to get LorentzAngle");
+        }
+        double A{par[0]};
+        double LA{par[1]}; // Lorentz Angle
+        double B{par[2]};
+        double sigma{par[3]};
+        double err_A{err_par[0]};
+        double err_LA{err_par[1]}; // Lorentz Angle
+        double err_B{err_par[2]};
+        double err_sigma{err_par[3]};
+        float MCW{static_cast<float>(LAfit->Eval(LA, 0, 0, 0))}; //Min-cluster-width
+        float err_MCW{static_cast<float>(LAfit->Eval(fabs(err_par[1]), 0, 0, 0))}; //Min-cluster-width
+
+        A_BarrelSide[iLayer][iSide][iModule] = A;
+        LA_BarrelSide[iLayer][iSide][iModule] = LA;
+        B_BarrelSide[iLayer][iSide][iModule] = B;
+        Sigma_BarrelSide[iLayer][iSide][iModule] = sigma;
+        Err_A_BarrelSide[iLayer][iSide][iModule] = err_A;
+        Err_LA_BarrelSide[iLayer][iSide][iModule] = err_LA;
+        Err_B_BarrelSide[iLayer][iSide][iModule] = err_B;
+        Err_Sigma_BarrelSide[iLayer][iSide][iModule] = err_sigma;
+        MCW_BarrelSide[iLayer][iSide][iModule] = MCW;
+        Err_MCW_BarrelSide[iLayer][iSide][iModule] = err_MCW;
+        Chisq_BarrelSide[iLayer][iSide][iModule] = LAfit->GetChisquare();
+      }
+    }
+  }
+
+  if (m_LorentzAngleDebugMode) {
+    fitFile->Close();
+  }
+
+  for (int iLayer{0}; iLayer < n_barrels; ++iLayer) {
+    for (int iSide{0}; iSide < 2; ++iSide) {
+      for (int iModule{0}; iModule < 2; ++iModule) {
+        Identifier waferId{m_pSCTHelper->wafer_id(BARREL, iLayer, 0, 0, iSide)};
+        int ch{0};
+        outFile << "<folderDefinition folder=\"SCT/Derived/LorentzAngleRun2_v2\" version=\"multi\">"         << linefeed
+                << "  <folderDescription>" << linefeed
+                << "     <timeStamp>run-lumi</timeStamp>" << linefeed
+                << "     <addrHeader>" << linefeed
+                << "        <address_header service_type=\"71\" clid=\"1238547719\">" << linefeed
+                << "     </addrHeader>" << linefeed
+                << "     <typeName>CondAttrListCollection</typeName>" << linefeed
+                << "  </folderDescription>" << linefeed
+                << "  <payloadDescription>" << linefeed
+                << "    <payloadType name=\"moduleType\">"          << moduleint[iModule]  << "</payloadType>" << linefeed
+                << "    <payloadType name=\"lorentzAngle\">"        << LA_BarrelSide[iLayer][iSide][iModule] << "</payloadType>" << linefeed
+                << "    <payloadType name=\"err_lorentzAngle\">"    << Err_LA_BarrelSide[iLayer][iSide][iModule] << "</payloadType>" << linefeed
+                << "    <payloadType name=\"chisq\">"               << Chisq_BarrelSide[iLayer][iSide][iModule] << "</payloadType>" << linefeed
+                << "    <payloadType name=\"fitParam_a\">"          << A_BarrelSide[iLayer][iSide][iModule] << "</payloadType>" << linefeed
+                << "    <payloadType name=\"err_a\">"               << Err_A_BarrelSide[iLayer][iSide][iModule] << "</payloadType>" << linefeed
+                << "    <payloadType name=\"fitParam_b\">"          << B_BarrelSide[iLayer][iSide][iModule] << "</payloadType>" << linefeed
+                << "    <payloadType name=\"err_b\">"               << Err_B_BarrelSide[iLayer][iSide][iModule]      << "</payloadType>" << linefeed
+                << "    <payloadType name=\"fitParam_sigma\">"      << Sigma_BarrelSide[iLayer][iSide][iModule]                      << "</payloadType>" << linefeed
+                << "    <payloadType name=\"err_sigma\">"           << Err_Sigma_BarrelSide[iLayer][iSide][iModule]      << "</payloadType>" << linefeed
+                << "    <payloadType name=\"minClusterWidth\">"     << MCW_BarrelSide[iLayer][iSide][iModule]  << "</payloadType>" << linefeed
+                << "    <payloadType name=\"err_minClusterWidth\">" << Err_MCW_BarrelSide[iLayer][iSide][iModule]      << "</payloadType>" << linefeed
+                << "  </payloadDescription>" << linefeed
+                << "  <channel id=\"" << ch << "\" name=\"" << iLayer << "_" << iSide << " \" />" << linefeed
+                << "</folderDefinition>" << endl;
+
+        ch++;
+
+        //--- DB output
+        if (m_writeToCool) {
+          if (m_pCalibWriteTool->createListLA(waferId, m_pSCTHelper, 10000, moduleint[iModule], LA_BarrelSide[iLayer][iSide][iModule], Err_LA_BarrelSide[iLayer][iSide][iModule], Chisq_BarrelSide[iLayer][iSide][iModule], A_BarrelSide[iLayer][iSide][iModule], Err_A_BarrelSide[iLayer][iSide][iModule], B_BarrelSide[iLayer][iSide][iModule], Err_B_BarrelSide[iLayer][iSide][iModule], Sigma_BarrelSide[iLayer][iSide][iModule], Err_Sigma_BarrelSide[iLayer][iSide][iModule], MCW_BarrelSide[iLayer][iSide][iModule], Err_MCW_BarrelSide[iLayer][iSide][iModule]).isFailure()) {
+            ATH_MSG_ERROR("Unable to run createListLA");
+            return StatusCode::FAILURE;
+          }
+        }
+
+      }
+    }
+  }
+
+  //--- Tail of XML outputs
+  outFile << "</folder>" << endl;
+
+  //--- Summary XML output
+  ostringstream summaryList;
+  for (int i{0}; i < n_barrels; ++i) {
+    for (int iSide{0}; iSide < 2; ++iSide) {
+      for (int iModule{0}; iModule < 2; ++iModule) {
+        const std::string thisPart{shortNames[bec2Index(BARREL)]};
+        summaryList << "    <parts>" << linefeed
+                    << xmlValue("part", thisPart) << linefeed
+                    << xmlValue("layer", i) << linefeed
+                    << xmlValue("Side", iSide) << linefeed
+                    << xmlValue("Module", module[iModule]) << linefeed
+                    << xmlValue("lorentzAngle", LA_BarrelSide[i][iSide][iModule]) << linefeed
+                    << xmlValue("minClusterWidth", MCW_BarrelSide[i][iSide][iModule]) << linefeed
+                    << xmlValue("Fit", FitFlag[i][iSide][iModule]) << linefeed
+                    << "    </parts>" << linefeed;
+      }
+    }
+  }
+
+  std::ofstream& file{m_outLASummary};
+  typedef std::pair<string, string> TwoStrings;
+  typedef std::map<std::string, TwoStrings > Names;
+  Names nameAssociation;
+  nameAssociation["LorentzAngle"]=TwoStrings(m_LorentzAngleSummaryFile, "LorentzAngleInfo.xsl");
+  Names::iterator found{nameAssociation.find("LorentzAngle")};
+  if (found!=nameAssociation.end()) {
+    std::string filename{found->second.first};
+    std::string xslName{found->second.second};
+    file.open(filename.c_str(), std::ios::out);
+    if (!file.good()) return StatusCode::FAILURE;
+    file << xmlHeader << linefeed << associateStylesheet(xslName) << linefeed << "<run>" << endl;
+  } else {
+    ATH_MSG_ERROR(" argument \"type\" needs to be  LorentzAngle.");
+    return StatusCode::FAILURE;
+  }
+
+  file << xmlValue("RunNumber", m_runNumber.value()) << linefeed
+       << xmlValue("StartTime", m_utcBegin) << linefeed
+       << xmlValue("EndTime", m_utcEnd) << linefeed
+       << xmlValue("Duration", m_calibEvtInfoTool->duration()) << linefeed
+       << xmlValue("LB", m_LBRange) << linefeed
+       << xmlValue("Events", m_numberOfEvents) << linefeed
+       << xmlValue("Flag", DBUploadFlag) << linefeed
+       << "  <data>" << endl;
+
+  if (wrapUpXML4Summary(m_outLASummary, "LorentzAngle", summaryList).isFailure()) {
+    ATH_MSG_ERROR("Problem in closing LorentzAngle file");
+    return StatusCode::FAILURE;
+  }
+
+  //--- DB output
+  if (m_writeToCool) {
+    if (m_pCalibWriteTool->wrapUpLorentzAngle().isFailure()) {
+      ATH_MSG_ERROR("Could not get LorentzAngle");
       return StatusCode::FAILURE;
-   }
-
-   //--- DB output
-   if ( m_writeToCool ) {
-      if ( m_pCalibWriteTool->wrapUpLorentzAngle().isFailure() ) {
-         ATH_MSG_ERROR("Could not get LorentzAngle");
-         return StatusCode::FAILURE;
-      }
-   }
-
-   return StatusCode::SUCCESS;
-
+    }
+  }
+  return StatusCode::SUCCESS;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////
 // Functions to handle XML File for COOL
 ///////////////////////////////////////////////////////////////////////////////////
 
-StatusCode SCTCalib::openXML4DB( std::ofstream& file, const char* type, const char* tag, IOVTime start, IOVTime end ) const {
-   if ( !strcmp( type, "DeadStrip" ) ) {
-      file.open( m_deadStripsFile.value().c_str(), std::ios::out );
-      if ( !file.good() ) return StatusCode::FAILURE;
-      file << "<channels server=\"ATLAS_COOLPROD\" schema=\"ATLAS_COOLOFL_SCT\" dbname=\"MONP200\" folder=\"SCT/Derived/DeadStrips\" ";
-   } else if ( !strcmp( type, "DeadChip" ) ) {
-      file.open( m_deadChipsFile.value().c_str(), std::ios::out );
-      if ( !file.good() ) return StatusCode::FAILURE;
-      file << "<channels server=\"ATLAS_COOLPROD\" schema=\"ATLAS_COOLOFL_SCT\" dbname=\"MONP200\" folder=\"SCT/Derived/DeadChips\" ";
-   } else {
-      ATH_MSG_ERROR("in openXML4DB : argument \"type\" needs to be (DeadStrip, DeadChip).");
-      return StatusCode::FAILURE;
-   }
-   file << "since=\""   << start.re_time() << "\" "
-        << "until=\""   << end.re_time()   << "\" "
-        << "tag=\""     << tag             << "\" "
-        << "version=\"" << "multi\">"      << linefeed;
-   return StatusCode::SUCCESS;
+StatusCode SCTCalib::openXML4DB(std::ofstream& file, const char* type, const char* tag, IOVTime start, IOVTime end) const {
+  if (!strcmp(type, "DeadStrip")) {
+    file.open(m_deadStripsFile.value().c_str(), std::ios::out);
+    if (!file.good()) return StatusCode::FAILURE;
+    file << "<channels server=\"ATLAS_COOLPROD\" schema=\"ATLAS_COOLOFL_SCT\" dbname=\"MONP200\" folder=\"SCT/Derived/DeadStrips\" ";
+  } else if (!strcmp(type, "DeadChip")) {
+    file.open(m_deadChipsFile.value().c_str(), std::ios::out);
+    if (!file.good()) return StatusCode::FAILURE;
+    file << "<channels server=\"ATLAS_COOLPROD\" schema=\"ATLAS_COOLOFL_SCT\" dbname=\"MONP200\" folder=\"SCT/Derived/DeadChips\" ";
+  } else {
+    ATH_MSG_ERROR("in openXML4DB : argument \"type\" needs to be (DeadStrip, DeadChip).");
+    return StatusCode::FAILURE;
+  }
+  file << "since=\""   << start.re_time() << "\" "
+       << "until=\""   << end.re_time()   << "\" "
+       << "tag=\""     << tag             << "\" "
+       << "version=\"" << "multi\">"      << linefeed;
+  return StatusCode::SUCCESS;
 }
 
-StatusCode SCTCalib::closeXML4DB( std::ofstream& file ) const {
-   file << "</channels>" << endl;
-   if ( file.is_open() ) {
-      file.close();
-      return StatusCode::SUCCESS;
-   } else {
-      return StatusCode::FAILURE;
-   }
+StatusCode SCTCalib::closeXML4DB(std::ofstream& file) const {
+  file << "</channels>" << endl;
+  if (file.is_open()) {
+    file.close();
+    return StatusCode::SUCCESS;
+  } else {
+    return StatusCode::FAILURE;
+  }
 }
 
-StatusCode SCTCalib::addToXML4DB( std::ofstream& file, const Identifier& waferId, const char* DefectType, float Threshold, const char* DefectList ) const {
-   std::string tmp = DefectList;
-   int length = tmp.length();
-   std::string Defect4DB = tmp.substr( 1, length-2 ); // Removing first&end spaces in DefectList
+StatusCode SCTCalib::addToXML4DB(std::ofstream& file, const Identifier& waferId, const char* DefectType, float Threshold, const char* DefectList) const {
+  std::string tmp{DefectList};
+  int length{static_cast<int>(tmp.length())};
+  std::string Defect4DB{tmp.substr(1, length-2)}; // Removing first&end spaces in DefectList
 
-   file << xmlOpenChannel( m_pSCTHelper->module_id( waferId ).get_identifier32().get_compact(), m_iovStart.re_time(), m_iovStop.re_time() ) << linefeed
-        << xmlValue("SampleSize","10000") << linefeed
-        << xmlValue("BarrelEndcap", m_pSCTHelper->barrel_ec( waferId ) )<< linefeed
-        << xmlValue("Layer", m_pSCTHelper->layer_disk( waferId ))<< linefeed
-        << xmlValue("Eta",  m_pSCTHelper->eta_module( waferId )) << linefeed
-        << xmlValue("Phi", m_pSCTHelper->phi_module( waferId )) << linefeed
-        << xmlValue("DefectType",  DefectType)<< linefeed
-        << xmlValue("Threshold", Threshold ) << linefeed
-        << xmlValue("DefectList",Defect4DB) << linefeed
-        << xmlCloseChannel() << endl;
+  file << xmlOpenChannel(m_pSCTHelper->module_id(waferId).get_identifier32().get_compact(), m_iovStart.re_time(), m_iovStop.re_time()) << linefeed
+       << xmlValue("SampleSize", "10000") << linefeed
+       << xmlValue("BarrelEndcap", m_pSCTHelper->barrel_ec(waferId)) << linefeed
+       << xmlValue("Layer", m_pSCTHelper->layer_disk(waferId)) << linefeed
+       << xmlValue("Eta", m_pSCTHelper->eta_module(waferId)) << linefeed
+       << xmlValue("Phi", m_pSCTHelper->phi_module(waferId)) << linefeed
+       << xmlValue("DefectType", DefectType) << linefeed
+       << xmlValue("Threshold", Threshold) << linefeed
+       << xmlValue("DefectList", Defect4DB) << linefeed
+       << xmlCloseChannel() << endl;
 
-   return StatusCode::SUCCESS;
+  return StatusCode::SUCCESS;
 
 }
 
@@ -2464,703 +2409,694 @@ StatusCode SCTCalib::addToXML4DB( std::ofstream& file, const Identifier& waferId
 // Functions to handle XML File for Summary
 ///////////////////////////////////////////////////////////////////////////////////
 
-StatusCode SCTCalib::openXML4DeadSummary( std::ofstream& file, const char* type, int n_Module, int n_Link, int n_Chip, int n_Strip ) const {
-   if ( !strcmp( type, "DEAD" ) ) {
-      file.open( m_deadSummaryFile.value().c_str(), std::ios::out );
-      if ( !file.good() ) return StatusCode::FAILURE;
-      file << xmlHeader<< linefeed<< associateStylesheet("DeadInfo.xsl") << linefeed
-           << "<run>"<< linefeed;
-   } else {
-      ATH_MSG_ERROR("in openXML4DeadSummary : argument \"type\" needs to be \"DEAD\".");
-      return StatusCode::FAILURE;
-   }
-
-   //--- Upload flag
-   string strUploadFlag = "U";
-   bool isNonZero( false );
-
-   if ( (m_doDeadChip && m_deadChipUploadTest) || (m_doDeadStrip && m_deadStripUploadTest) ) {
-      if ( n_Chip > 0 ) {
-         isNonZero = true;
-         strUploadFlag = "G";
-      } else {
-         strUploadFlag = "R";
-      }
-   }
-
-   //--- Upload test result
-   ostringstream osNonZero;
-   osNonZero << "#chips or #strips is non-zero";
-   ostringstream osFlagReason;
-   if ( !isNonZero ) osFlagReason << "FAILED in " << osNonZero.str();
-   string strFlagEnable = ( m_deadChipUploadTest || m_deadStripUploadTest ) ? "ENABLED" : "DISABLED";
-   ostringstream osCheckList;
-   osCheckList << osNonZero.str();
-
-   file <<xmlValue("RunNumber",      m_runNumber.value())               << linefeed
-        <<xmlValue("StartTime",      m_utcBegin)                        << linefeed
-        <<xmlValue("EndTime",        m_utcEnd)                          << linefeed
-        <<xmlValue("Duration",       m_calibEvtInfoTool->duration())     << linefeed
-        <<xmlValue("LB",             m_calibEvtInfoTool->numLumiBlocks())<< linefeed
-        <<xmlValue("Events",         m_numberOfEvents )                 << linefeed
-        <<xmlValue("Modules",        n_Module)                          << linefeed
-        <<xmlValue("Links",          n_Link)                            << linefeed
-        <<xmlValue("Chips",          n_Chip)                            << linefeed
-        <<xmlValue("Strips",         n_Strip)                           << linefeed
-        <<xmlValue("Flag",           strUploadFlag)                     << linefeed
-        <<xmlValue("FlagReason",     osFlagReason.str())                << linefeed
-        <<xmlValue("FlagEnable",     strFlagEnable)                     << linefeed
-        <<xmlValue("CheckList",      osCheckList.str())                 << linefeed
-        <<"  <modules>"                                                 << endl;
-
-   return StatusCode::SUCCESS;
+StatusCode SCTCalib::openXML4DeadSummary(std::ofstream& file, const char* type, int n_Module, int n_Link, int n_Chip, int n_Strip) const {
+  if (!strcmp(type, "DEAD")) {
+    file.open(m_deadSummaryFile.value().c_str(), std::ios::out);
+    if (!file.good()) return StatusCode::FAILURE;
+    file << xmlHeader << linefeed << associateStylesheet("DeadInfo.xsl") << linefeed
+         << "<run>" << linefeed;
+  } else {
+    ATH_MSG_ERROR("in openXML4DeadSummary : argument \"type\" needs to be \"DEAD\".");
+    return StatusCode::FAILURE;
+  }
+
+  //--- Upload flag
+  string strUploadFlag{"U"};
+  bool isNonZero{false};
+
+  if ((m_doDeadChip and m_deadChipUploadTest) or (m_doDeadStrip and m_deadStripUploadTest)) {
+    if (n_Chip > 0) {
+      isNonZero = true;
+      strUploadFlag = "G";
+    } else {
+      strUploadFlag = "R";
+    }
+  }
+
+  //--- Upload test result
+  ostringstream osNonZero;
+  osNonZero << "#chips or #strips is non-zero";
+  ostringstream osFlagReason;
+  if (!isNonZero) osFlagReason << "FAILED in " << osNonZero.str();
+  string strFlagEnable{(m_deadChipUploadTest or m_deadStripUploadTest) ? "ENABLED" : "DISABLED"};
+  ostringstream osCheckList;
+  osCheckList << osNonZero.str();
+
+  file << xmlValue("RunNumber",  m_runNumber.value())                 << linefeed
+       << xmlValue("StartTime",  m_utcBegin)                          << linefeed
+       << xmlValue("EndTime",    m_utcEnd)                            << linefeed
+       << xmlValue("Duration",   m_calibEvtInfoTool->duration())      << linefeed
+       << xmlValue("LB",         m_calibEvtInfoTool->numLumiBlocks()) << linefeed
+       << xmlValue("Events",     m_numberOfEvents)                    << linefeed
+       << xmlValue("Modules",    n_Module)                            << linefeed
+       << xmlValue("Links",      n_Link)                              << linefeed
+       << xmlValue("Chips",      n_Chip)                              << linefeed
+       << xmlValue("Strips",     n_Strip)                             << linefeed
+       << xmlValue("Flag",       strUploadFlag)                       << linefeed
+       << xmlValue("FlagReason", osFlagReason.str())                  << linefeed
+       << xmlValue("FlagEnable", strFlagEnable)                       << linefeed
+       << xmlValue("CheckList",  osCheckList.str())                   << linefeed
+       << "  <modules>"                                               << endl;
+
+  return StatusCode::SUCCESS;
 }
 
 
-StatusCode SCTCalib::openXML4MonSummary( std::ofstream& file, const char* type ) const {
-   typedef std::pair<string, string> TwoStrings;
-   typedef std::map<std::string, TwoStrings > Names;
-   Names nameAssociation;
-   nameAssociation["NoiseOccupancy"]=TwoStrings(m_noiseOccupancySummaryFile, "NoiseOccupancyInfo.xsl");
-   nameAssociation["RawOccupancy"]=TwoStrings(m_rawOccupancySummaryFile, "RawOccupancyInfo.xsl");
-   nameAssociation["Efficiency"]=TwoStrings(m_efficiencySummaryFile, "EfficiencyInfo.xsl");
-   nameAssociation["BSErrors"]=TwoStrings(m_BSErrorSummaryFile, "BSErrorInfo.xsl");
-   nameAssociation["BSErrorsModule"]=TwoStrings(m_BSErrorModuleFile, "BSErrorInfo.xsl");
-   //  nameAssociation["LorentzAngle"]=TwoStrings(m_LorentzAngleSummaryFile, "LorentzAngleInfo.xsl");
-   Names::iterator found=nameAssociation.find(type);
-   if (found!=nameAssociation.end()) {
-      std::string filename=found->second.first;
-      std::string xslName=found->second.second;
-      //
-      file.open( filename.c_str(), std::ios::out );
-      if ( !file.good() ) return StatusCode::FAILURE;
-      file << xmlHeader<< linefeed<< associateStylesheet(xslName) << linefeed<< "<run>"<< endl;
-   } else {
-      ATH_MSG_ERROR("in openXML4MonSummary : argument \"type\" needs to be ( NoiseOccupancy, RawOccupancy, Efficiency, BSErrors ).");
-      return StatusCode::FAILURE;
-   }
-   file << xmlValue("RunNumber", m_runNumber.value() ) << linefeed
-        << xmlValue("StartTime",  m_utcBegin                        ) << linefeed
-        << xmlValue("EndTime",  m_utcEnd                          ) << linefeed
-        << xmlValue("Duration",  m_calibEvtInfoTool->duration() ) << linefeed
-        << xmlValue("LB",  m_LBRange                         ) << linefeed
-        << xmlValue("Events",  m_numberOfEvents                  ) << linefeed
-        << "  <data>"<< endl;
-   return StatusCode::SUCCESS;
+StatusCode SCTCalib::openXML4MonSummary(std::ofstream& file, const char* type) const {
+  typedef std::pair<string, string> TwoStrings;
+  typedef std::map<std::string, TwoStrings> Names;
+  Names nameAssociation;
+  nameAssociation["NoiseOccupancy"] = TwoStrings(m_noiseOccupancySummaryFile, "NoiseOccupancyInfo.xsl");
+  nameAssociation["RawOccupancy"] = TwoStrings(m_rawOccupancySummaryFile, "RawOccupancyInfo.xsl");
+  nameAssociation["Efficiency"] = TwoStrings(m_efficiencySummaryFile, "EfficiencyInfo.xsl");
+  nameAssociation["BSErrors"] = TwoStrings(m_BSErrorSummaryFile, "BSErrorInfo.xsl");
+  nameAssociation["BSErrorsModule"] = TwoStrings(m_BSErrorModuleFile, "BSErrorInfo.xsl");
+  //  nameAssociation["LorentzAngle"]=TwoStrings(m_LorentzAngleSummaryFile, "LorentzAngleInfo.xsl");
+  Names::iterator found{nameAssociation.find(type)};
+  if (found!=nameAssociation.end()) {
+    std::string filename{found->second.first};
+    std::string xslName{found->second.second};
+    //
+    file.open(filename.c_str(), std::ios::out);
+    if (!file.good()) return StatusCode::FAILURE;
+    file << xmlHeader << linefeed << associateStylesheet(xslName) << linefeed << "<run>" << endl;
+  } else {
+    ATH_MSG_ERROR("in openXML4MonSummary : argument \"type\" needs to be (NoiseOccupancy, RawOccupancy, Efficiency, BSErrors).");
+    return StatusCode::FAILURE;
+  }
+  file << xmlValue("RunNumber", m_runNumber.value()) << linefeed
+       << xmlValue("StartTime", m_utcBegin) << linefeed
+       << xmlValue("EndTime", m_utcEnd) << linefeed
+       << xmlValue("Duration", m_calibEvtInfoTool->duration()) << linefeed
+       << xmlValue("LB", m_LBRange) << linefeed
+       << xmlValue("Events", m_numberOfEvents) << linefeed
+       << "  <data>" << endl;
+  return StatusCode::SUCCESS;
 }
 
 
-StatusCode SCTCalib::wrapUpXML4Summary( std::ofstream& file, const char* type, std::ostringstream& list ) const {
-   file << list.str();
-   if ( !strcmp( type, "DEAD" ) ) {
-      file << "  </modules>" << endl;
-   } else if ( !strcmp( type, "NoiseOccupancy" ) || !strcmp( type, "RawOccupancy" ) || !strcmp( type, "Efficiency" ) || !strcmp( type, "BSErrors" ) || !strcmp( type, "LorentzAngle" ) ) {
-      file << "  </data>" << endl;
-   }
-   file << "</run>" << endl;
-
-   if ( file.is_open() ) {
-      file.close();
-      return StatusCode::SUCCESS;
-   } else {
-      return StatusCode::FAILURE;
-   }
-
+StatusCode SCTCalib::wrapUpXML4Summary(std::ofstream& file, const char* type, std::ostringstream& list) const {
+  file << list.str();
+  if (!strcmp(type, "DEAD")) {
+    file << "  </modules>" << endl;
+  } else if (!strcmp(type, "NoiseOccupancy") or !strcmp(type, "RawOccupancy") or !strcmp(type, "Efficiency") or !strcmp(type, "BSErrors") or !strcmp(type, "LorentzAngle")) {
+    file << "  </data>" << endl;
+  }
+  file << "</run>" << endl;
+
+  if (file.is_open()) {
+    file.close();
+    return StatusCode::SUCCESS;
+  } else {
+    return StatusCode::FAILURE;
+  }
 }
 
 
-StatusCode SCTCalib::addToSummaryStr( std::ostringstream& list, const Identifier& waferId, const char* type, const char* stripId, const char* chipId ) const {
-   //--- Remove first&end spaces in DefectList
-   const std::string tmpstrip(stripId);
-   const std::string tmpchip(chipId);
-   int len_strip = tmpstrip.length();
-   int len_chip  = tmpchip.length();
-   std::string stripList("");
-   std::string chipList("");
-   if ( len_strip > 0 ) stripList = tmpstrip.substr( 1, len_strip-2 );
-   if ( len_chip  > 0 ) chipList  = tmpchip.substr( 1, len_chip-2 );
-   //--- Identifier/SN
-   IdentifierHash   waferHash = m_pSCTHelper->wafer_hash( waferId );
-   SCT_SerialNumber sn        = m_CablingTool->getSerialNumberFromHash( waferHash );
-   //--- Preparing linkList
-   //std::string linkList=chipList2LinkList(chipList);
-   std::string linkList=chipList2LinkList(stripList);
-   //--- Push to summary stream
-   XmlStreamer m("module", list);
-   {
-      XmlStreamer v("value", "name", "SN",list);
-      list<<sn.str();
-   }
-   {
-      XmlStreamer v("value", "name", "BecLayerPhiEta", list);
-      list<<formatPosition(waferId, m_pSCTHelper,".",false);
-   }
-   {
-      XmlStreamer v("value", "name", "LinkID", list);
-      list<<linkList;
-   }
-   //  {XmlStreamer v("value", "name", "ChipID", list); list<<chipList;}
-   {
-      XmlStreamer v("value", "name", "ChipID", list);
-      list<<stripList;
-   }
-   if ( !strcmp( type, "DEAD" ) ) {
-
-      XmlStreamer v("value", "name", "StripIDOnline", list);
-      list << stripList;
-
-   } else {
-
-      ATH_MSG_ERROR("in addToSummaryStr : argument \"type\" needs to be \"DEAD\".");
-      return StatusCode::FAILURE;
-
-   }
-
-   return StatusCode::SUCCESS;
-
+StatusCode SCTCalib::addToSummaryStr(std::ostringstream& list, const Identifier& waferId, const char* type, const char* stripId, const char* chipId) const {
+  //--- Remove first&end spaces in DefectList
+  const std::string tmpstrip{stripId};
+  const std::string tmpchip{chipId};
+  int len_strip{static_cast<int>(tmpstrip.length())};
+  int len_chip{static_cast<int>(tmpchip.length())};
+  std::string stripList{""};
+  std::string chipList{""};
+  if (len_strip > 0) stripList = tmpstrip.substr(1, len_strip-2);
+  if (len_chip  > 0) chipList  = tmpchip.substr(1, len_chip-2);
+  //--- Identifier/SN
+  IdentifierHash   waferHash{m_pSCTHelper->wafer_hash(waferId)};
+  SCT_SerialNumber sn{m_CablingTool->getSerialNumberFromHash(waferHash)};
+  //--- Preparing linkList
+  //std::string linkList=chipList2LinkList(chipList);
+  std::string linkList{chipList2LinkList(stripList)};
+  //--- Push to summary stream
+  XmlStreamer m{"module", list};
+  {
+    XmlStreamer v{"value", "name", "SN", list};
+    list << sn.str();
+  }
+  {
+    XmlStreamer v{"value", "name", "BecLayerPhiEta", list};
+    list << formatPosition(waferId, m_pSCTHelper, ".", false);
+  }
+  {
+    XmlStreamer v{"value", "name", "LinkID", list};
+    list << linkList;
+  }
+  {
+    XmlStreamer v{"value", "name", "ChipID", list};
+    list << stripList;
+  }
+  if (!strcmp(type, "DEAD")) {
+    XmlStreamer v{"value", "name", "StripIDOnline", list};
+    list << stripList;
+  } else {
+    ATH_MSG_ERROR("in addToSummaryStr : argument \"type\" needs to be \"DEAD\".");
+    return StatusCode::FAILURE;
+  }
+
+  return StatusCode::SUCCESS;
 }
 
 std::string
-SCTCalib::xmlChannelNoiseOccDataString(const Identifier & waferId,  const float occupancy, const SCT_SerialNumber & serial) const {
-   //agrohsje added space and ostringstream for proper xml output
-   ostringstream os;
-   os<<xmlOpenChannel(waferId.get_identifier32().get_compact(), m_iovStart.re_time(), m_iovStop.re_time())<<endl
-     <<"  "<<xmlValue("SN", serial.str())<<endl
-     <<"  "<<xmlValue("SampleSize",  "10000")<<endl
-     <<"  "<<xmlValue("barrel_endcap",  m_pSCTHelper->barrel_ec( waferId )  )<<endl
-     <<"  "<<xmlValue("Layer",  m_pSCTHelper->layer_disk( waferId ) )<< linefeed
-     <<"  "<<xmlValue("Eta",  m_pSCTHelper->eta_module( waferId ) )<<endl
-     <<"  "<<xmlValue("Phi",  m_pSCTHelper->phi_module( waferId ) )<<endl
-     <<"  "<<xmlValue("NoiseOccupancy", occupancy)<<endl
-     <<"  "<<xmlCloseChannel();
-   return os.str();
+SCTCalib::xmlChannelNoiseOccDataString(const Identifier& waferId, const float occupancy, const SCT_SerialNumber& serial) const {
+  //agrohsje added space and ostringstream for proper xml output
+  ostringstream os;
+  os << xmlOpenChannel(waferId.get_identifier32().get_compact(), m_iovStart.re_time(), m_iovStop.re_time()) << endl
+     << "  " << xmlValue("SN", serial.str()) << endl
+     << "  " << xmlValue("SampleSize", "10000") << endl
+     << "  " << xmlValue("barrel_endcap", m_pSCTHelper->barrel_ec(waferId)) << endl
+     << "  " << xmlValue("Layer", m_pSCTHelper->layer_disk(waferId)) << linefeed
+     << "  " << xmlValue("Eta", m_pSCTHelper->eta_module(waferId)) << endl
+     << "  " << xmlValue("Phi", m_pSCTHelper->phi_module(waferId)) << endl
+     << "  " << xmlValue("NoiseOccupancy", occupancy) << endl
+     << "  " << xmlCloseChannel();
+  return os.str();
 }
 
 //agasconb 02.02.2015: block for Efficiency output
 //requested by Naoki Ishijima
 std::string
-SCTCalib::xmlChannelEfficiencyDataString(const Identifier & waferId,  const float efficiency, const SCT_SerialNumber & serial) const {
-   ostringstream os;
-   os<<"   <module>"<<endl
-     //    os<<xmlOpenChannel(waferId.get_identifier32().get_compact(), m_iovStart.re_time(), m_iovStop.re_time())<<endl
-     <<"  "<<xmlValue("SN", serial.str())<<endl
-     <<"  "<<xmlValue("SampleSize",  "10000")<<endl
-     <<"  "<<xmlValue("barrel_endcap",  m_pSCTHelper->barrel_ec( waferId )  )<<endl
-     <<"  "<<xmlValue("Layer",  m_pSCTHelper->layer_disk( waferId ) )<< linefeed
-     <<"  "<<xmlValue("Eta",  m_pSCTHelper->eta_module( waferId ) )<<endl
-     <<"  "<<xmlValue("Phi",  m_pSCTHelper->phi_module( waferId ) )<<endl
-     <<"  "<<xmlValue("Efficiency", efficiency)<<endl
-     <<"   </module>";
-   //      <<"  "<<xmlCloseChannel();
-   return os.str();
+SCTCalib::xmlChannelEfficiencyDataString(const Identifier& waferId, const float efficiency, const SCT_SerialNumber& serial) const {
+  ostringstream os;
+  os << "   <module>" << endl
+     << "  " << xmlValue("SN", serial.str()) << endl
+     << "  " << xmlValue("SampleSize", "10000") << endl
+     << "  " << xmlValue("barrel_endcap", m_pSCTHelper->barrel_ec(waferId)) << endl
+     << "  " << xmlValue("Layer", m_pSCTHelper->layer_disk(waferId)) << linefeed
+     << "  " << xmlValue("Eta", m_pSCTHelper->eta_module(waferId)) << endl
+     << "  " << xmlValue("Phi", m_pSCTHelper->phi_module(waferId)) << endl
+     << "  " << xmlValue("Efficiency", efficiency) << endl
+     << "   </module>";
+  return os.str();
 }
 
-std::pair< int, bool >
-SCTCalib::getNumNoisyStrips( const Identifier& waferId ) const {
-   IdentifierHash waferHash = m_pSCTHelper->wafer_hash( waferId );
-   //--- Check if there are noisy strips in the wafer
-   int numNoisyStripsInTheWafer = 0;
-   bool isNoisyWafer(false);
-   float noisyStripThr = m_noisyStripThrDef?(m_noisyStripThrOffline):(m_noisyStripThrOnline);
-   for ( int iStrip = 0; iStrip != nbins; ++iStrip ) {
-      if ( m_calibHitmapTool->getBinForHistogramIndex( iStrip + 1, waferHash.value() ) / m_numberOfEvents > noisyStripThr ) ++numNoisyStripsInTheWafer;
-   }
-   //--- Define/counts noisy wafers using wafer occupancy and number of noisy strips
-   double averageOccupancy = m_calibHitmapTool->size(waferHash.value())/static_cast<double>(nbins)/static_cast<double>(m_numberOfEvents);
-   const int subdetector(m_pSCTHelper->barrel_ec( waferId ) );
-   isNoisyWafer = ( numNoisyStripsInTheWafer > m_noisyWaferFraction*nbins ) and
-                  ( ( subdetector == ENDCAP_C && averageOccupancy > m_noisyWaferThrECC) or
-                    ( subdetector == BARREL   && averageOccupancy > m_noisyWaferThrBarrel) or
-                    ( subdetector == ENDCAP_A && averageOccupancy > m_noisyWaferThrECA) );
-   if (isNoisyWafer) {
-      ATH_MSG_INFO("Module: " << waferHash.value());
-      ATH_MSG_INFO("Hits, Nevts, Occ: " << m_calibHitmapTool->size(waferHash.value()) << ", "
-                   << m_numberOfEvents << ", "
-                   << averageOccupancy);
-   }
-   return std::make_pair( numNoisyStripsInTheWafer, isNoisyWafer );
+std::pair<int, bool>
+SCTCalib::getNumNoisyStrips(const Identifier& waferId) const {
+  IdentifierHash waferHash{m_pSCTHelper->wafer_hash(waferId)};
+  //--- Check if there are noisy strips in the wafer
+  int numNoisyStripsInTheWafer{0};
+  bool isNoisyWafer{false};
+  float noisyStripThr{m_noisyStripThrDef ? (m_noisyStripThrOffline) : (m_noisyStripThrOnline)};
+  for (int iStrip{0}; iStrip != nbins; ++iStrip) {
+    if (m_calibHitmapTool->getBinForHistogramIndex(iStrip + 1, waferHash.value()) / m_numberOfEvents > noisyStripThr) ++numNoisyStripsInTheWafer;
+  }
+  //--- Define/counts noisy wafers using wafer occupancy and number of noisy strips
+  double averageOccupancy{m_calibHitmapTool->size(waferHash.value())/static_cast<double>(nbins)/static_cast<double>(m_numberOfEvents)};
+  const int subdetector{m_pSCTHelper->barrel_ec(waferId)};
+  isNoisyWafer = (numNoisyStripsInTheWafer > m_noisyWaferFraction*nbins) and
+    ((subdetector == ENDCAP_C and averageOccupancy > m_noisyWaferThrECC) or
+     (subdetector == BARREL   and averageOccupancy > m_noisyWaferThrBarrel) or
+     (subdetector == ENDCAP_A and averageOccupancy > m_noisyWaferThrECA));
+  if (isNoisyWafer) {
+    ATH_MSG_INFO("Module: " << waferHash.value());
+    ATH_MSG_INFO("Hits, Nevts, Occ: " << m_calibHitmapTool->size(waferHash.value()) << ", "
+                 << m_numberOfEvents << ", "
+                 << averageOccupancy);
+  }
+  return std::make_pair(numNoisyStripsInTheWafer, isNoisyWafer);
 }
 
 StatusCode
-SCTCalib::addStripsToList( Identifier& waferId, std::set<Identifier>& stripIdList, bool isNoisy, bool isNew ) {
-   IdentifierHash waferHash = m_pSCTHelper->wafer_hash( waferId );
-   float noisyStripThr = m_noisyStripThrDef?(m_noisyStripThrOffline):(m_noisyStripThrOnline);
-   for ( int iStrip = 0; iStrip != nbins; ++iStrip ) {
-      Identifier stripId = m_pSCTHelper->strip_id( waferId, iStrip );
-      if ( !isNoisy ) { //--- Add all strips
-         stripIdList.insert( stripId );
-      } else {
-         const float stripOccupancy =  m_calibHitmapTool->getBinForHistogramIndex( iStrip + 1, waferHash.value() )  / m_numberOfEvents;
-         if ( stripOccupancy > noisyStripThr ) {
-            if ( !isNew ) { //--- All noisy strips
-               stripIdList.insert( stripId );
-            } else { //--- New noisy strips : compared with configuration and calibration
-               const bool isGoodInConfiguration = m_useConfiguration ? m_ConfigurationConditionsTool->isGood( stripId, InDetConditions::SCT_STRIP ) : true;
-               const bool isGoodInCalibration   = m_useCalibration   ? m_ReadCalibDataTool->isGood( stripId, InDetConditions::SCT_STRIP )           : true;
-               if ( m_useConfiguration or m_useCalibration ) {
-                  if ( isGoodInConfiguration && isGoodInCalibration ) {
-                     stripIdList.insert( stripId );
-                  }
-               }
+SCTCalib::addStripsToList(Identifier& waferId, std::set<Identifier>& stripIdList, bool isNoisy, bool isNew) const {
+  IdentifierHash waferHash{m_pSCTHelper->wafer_hash(waferId)};
+  float noisyStripThr{m_noisyStripThrDef ? (m_noisyStripThrOffline):(m_noisyStripThrOnline)};
+  for (int iStrip{0}; iStrip != nbins; ++iStrip) {
+    Identifier stripId{m_pSCTHelper->strip_id(waferId, iStrip)};
+    if (!isNoisy) { //--- Add all strips
+      stripIdList.insert(stripId);
+    } else {
+      const float stripOccupancy{static_cast<float>(m_calibHitmapTool->getBinForHistogramIndex(iStrip + 1, waferHash.value()) / m_numberOfEvents)};
+      if (stripOccupancy > noisyStripThr) {
+        if (!isNew) { //--- All noisy strips
+          stripIdList.insert(stripId);
+        } else { //--- New noisy strips : compared with configuration and calibration
+          const bool isGoodInConfiguration{m_useConfiguration ? m_ConfigurationConditionsTool->isGood(stripId, InDetConditions::SCT_STRIP) : true};
+          const bool isGoodInCalibration{m_useCalibration ? m_ReadCalibDataTool->isGood(stripId, InDetConditions::SCT_STRIP) : true};
+          if (m_useConfiguration or m_useCalibration) {
+            if (isGoodInConfiguration and isGoodInCalibration) {
+              stripIdList.insert(stripId);
             }
-         }
+          }
+        }
       }
-   }
-   return StatusCode::SUCCESS;
+    }
+  }
+  return StatusCode::SUCCESS;
 }
 
 StatusCode
-SCTCalib::writeModuleListToCool( const std::map< Identifier, std::set<Identifier> >& moduleListAll,
-                                 const std::map< Identifier, std::set<Identifier> >& moduleListNew,
-                                 const std::map< Identifier, std::set<Identifier> >& moduleListRef ) {
-   //--- Write out strips
-   float noisyStripThr = m_noisyStripThrDef?(m_noisyStripThrOffline):(m_noisyStripThrOnline);
-   int nDefects = 0;
-   SCT_ID::const_id_iterator idItr  = m_pSCTHelper->wafer_begin();
-   SCT_ID::const_id_iterator idItrE = m_pSCTHelper->wafer_end();
-   for ( ; idItr != idItrE; ++idItr ) {
-      if ( m_pSCTHelper->side( *idItr ) == 0 ) {
-         Identifier moduleId = m_pSCTHelper->module_id( *idItr );
-         map< Identifier, std::set<Identifier> >::const_iterator moduleAllItr = moduleListAll.find( moduleId );
-         map< Identifier, std::set<Identifier> >::const_iterator moduleNewItr = moduleListNew.find( moduleId );
-         map< Identifier, std::set<Identifier> >::const_iterator moduleRefItr = moduleListRef.find( moduleId );
-         std::string defectStripsAll =  moduleAllItr != moduleListAll.end() ? getStripList( (*moduleAllItr).second ) : "";
-         std::string defectStripsNew =  moduleNewItr != moduleListNew.end() ? getStripList( (*moduleNewItr).second ) : "";
-         std::string defectStripsRef =  moduleRefItr != moduleListRef.end() ? getStripList( (*moduleRefItr).second ) : "";
-         if ( m_noisyUpdate ) { //--- UPD1/UPD4
-            if ( defectStripsAll != defectStripsRef ) {
-               if (m_pCalibWriteTool->createCondObjects( moduleId, m_pSCTHelper, 10000, "NOISY", noisyStripThr, defectStripsAll ).isFailure()) {
-                  ATH_MSG_ERROR("Could not create defect strip entry in the CalibWriteTool.");
-               }
-               nDefects++;
-            } else ATH_MSG_DEBUG("Module "<< moduleId  <<" is identical to the reference output");
-         } else {
-            if ( m_noisyStripAll ) { //--- ALL noisy strips
-               if ( !defectStripsAll.empty() ) m_pCalibWriteTool->createCondObjects( moduleId, m_pSCTHelper, 10000, "NOISY", noisyStripThr, defectStripsAll );
-            } else { //--- Only NEW noisy strips
-               if ( !defectStripsNew.empty() ) m_pCalibWriteTool->createCondObjects( moduleId, m_pSCTHelper, 10000, "NOISY", noisyStripThr, defectStripsNew );
-            }
-         }
-      }
-   }
-   //ATH_MSG_INFO("Number of modules for which conditions were created: " << nDefects <<"  !!!!"<< endmsg;
-   if ( moduleListAll.empty() || nDefects==0 ) {
-      ATH_MSG_INFO("Number of noisy strips was zero or the same list of noisy strips. No local DB was created.");
-   } else {
-      if ( m_pCalibWriteTool->wrapUpNoisyChannel().isFailure() ) {
-         ATH_MSG_ERROR("Could not get NoisyStrips info");
-         return StatusCode::FAILURE;
-      }
-   }
-   return StatusCode::SUCCESS;
+SCTCalib::writeModuleListToCool(const std::map<Identifier, std::set<Identifier>>& moduleListAll, 
+                                const std::map<Identifier, std::set<Identifier>>& moduleListNew, 
+                                const std::map<Identifier, std::set<Identifier>>& moduleListRef) const {
+  //--- Write out strips
+  float noisyStripThr{m_noisyStripThrDef?(m_noisyStripThrOffline):(m_noisyStripThrOnline)};
+  int nDefects{0};
+  SCT_ID::const_id_iterator idItr{m_pSCTHelper->wafer_begin()};
+  SCT_ID::const_id_iterator idItrE{m_pSCTHelper->wafer_end()};
+  for (; idItr != idItrE; ++idItr) {
+    if (m_pSCTHelper->side(*idItr) == 0) {
+      Identifier moduleId{m_pSCTHelper->module_id(*idItr)};
+      map<Identifier, std::set<Identifier>>::const_iterator moduleAllItr{moduleListAll.find(moduleId)};
+      map<Identifier, std::set<Identifier>>::const_iterator moduleNewItr{moduleListNew.find(moduleId)};
+      map<Identifier, std::set<Identifier>>::const_iterator moduleRefItr{moduleListRef.find(moduleId)};
+      std::string defectStripsAll{moduleAllItr != moduleListAll.end() ? getStripList((*moduleAllItr).second) : ""};
+      std::string defectStripsNew{moduleNewItr != moduleListNew.end() ? getStripList((*moduleNewItr).second) : ""};
+      std::string defectStripsRef{moduleRefItr != moduleListRef.end() ? getStripList((*moduleRefItr).second) : ""};
+      if (m_noisyUpdate) { //--- UPD1/UPD4
+        if (defectStripsAll != defectStripsRef) {
+          if (m_pCalibWriteTool->createCondObjects(moduleId, m_pSCTHelper, 10000, "NOISY", noisyStripThr, defectStripsAll).isFailure()) {
+            ATH_MSG_ERROR("Could not create defect strip entry in the CalibWriteTool.");
+          }
+          nDefects++;
+        } else ATH_MSG_DEBUG("Module " << moduleId  << " is identical to the reference output");
+      } else {
+        if (m_noisyStripAll) { //--- ALL noisy strips
+          if (!defectStripsAll.empty()) m_pCalibWriteTool->createCondObjects(moduleId, m_pSCTHelper, 10000, "NOISY", noisyStripThr, defectStripsAll);
+        } else { //--- Only NEW noisy strips
+          if (!defectStripsNew.empty()) m_pCalibWriteTool->createCondObjects(moduleId, m_pSCTHelper, 10000, "NOISY", noisyStripThr, defectStripsNew);
+        }
+      }
+    }
+  }
+  //ATH_MSG_INFO("Number of modules for which conditions were created: " << nDefects << "  !!!!" << endmsg;
+  if (moduleListAll.empty() or nDefects==0) {
+    ATH_MSG_INFO("Number of noisy strips was zero or the same list of noisy strips. No local DB was created.");
+  } else {
+    if (m_pCalibWriteTool->wrapUpNoisyChannel().isFailure()) {
+      ATH_MSG_ERROR("Could not get NoisyStrips info");
+      return StatusCode::FAILURE;
+    }
+  }
+  return StatusCode::SUCCESS;
 }
 
 std::string
-SCTCalib::getStripList( const std::set<Identifier>& stripIdList ) const {
-   std::string strList;
-   if ( !stripIdList.empty() ) {
-      int firstStrip = -1;
-      int groupSize  = -1;
-
-      std::set<Identifier>::const_iterator stripItrFirst = stripIdList.begin();
-      std::set<Identifier>::const_iterator stripItrLast  = --stripIdList.end();
-
-      std::set<Identifier>::const_iterator stripItr  = stripIdList.begin();
-      std::set<Identifier>::const_iterator stripItrE = stripIdList.end();
-      for ( ; stripItr != stripItrE; ++stripItr ) {
-         Identifier stripId = *stripItr;
-         int stripNum = m_pSCTHelper->side( stripId )*nbins + m_pSCTHelper->strip( stripId );
-         if ( stripItr == stripItrFirst ) {
-            firstStrip = stripNum;
-            groupSize  = 1;
-         } else {
-            if ( stripNum == firstStrip + groupSize ) {
-               ++groupSize;
-            } else {
-               int stripBegin = firstStrip;
-               int stripEnd   = firstStrip + groupSize -1;
-               strList = m_pCalibWriteTool->addDefect( strList, stripBegin, stripEnd );
-               firstStrip = stripNum;
-               groupSize  = 1;
-            }
-         }
-         if ( stripItr == stripItrLast ) {
-            int stripBegin = firstStrip;
-            int stripEnd   = stripNum;
-            strList = m_pCalibWriteTool->addDefect( strList, stripBegin, stripEnd );
-         }
-      }
-   }
-   return strList;
+SCTCalib::getStripList(const std::set<Identifier>& stripIdList) const {
+  std::string strList;
+  if (!stripIdList.empty()) {
+    int firstStrip{-1};
+    int groupSize{-1};
+
+    std::set<Identifier>::const_iterator stripItrFirst{stripIdList.begin()};
+    std::set<Identifier>::const_iterator stripItrLast{--stripIdList.end()};
+
+    std::set<Identifier>::const_iterator stripItr{stripIdList.begin()};
+    std::set<Identifier>::const_iterator stripItrE{stripIdList.end()};
+    for (; stripItr != stripItrE; ++stripItr) {
+      Identifier stripId{*stripItr};
+      int stripNum{m_pSCTHelper->side(stripId)*nbins + m_pSCTHelper->strip(stripId)};
+      if (stripItr == stripItrFirst) {
+        firstStrip = stripNum;
+        groupSize  = 1;
+      } else {
+        if (stripNum == firstStrip + groupSize) {
+          ++groupSize;
+        } else {
+          int stripBegin{firstStrip};
+          int stripEnd{firstStrip + groupSize -1};
+          strList = m_pCalibWriteTool->addDefect(strList, stripBegin, stripEnd);
+          firstStrip = stripNum;
+          groupSize  = 1;
+        }
+      }
+      if (stripItr == stripItrLast) {
+        int stripBegin{firstStrip};
+        int stripEnd{stripNum};
+        strList = m_pCalibWriteTool->addDefect(strList, stripBegin, stripEnd);
+      }
+    }
+  }
+  return strList;
 }
 
 StatusCode
-SCTCalib::noisyStripsToXml( const std::map< Identifier, std::set<Identifier> >& moduleList, const std::string& badStripsFile ) const {
-   //--- Open
-   const char* outputFileName = badStripsFile.c_str();
-   ofstream outFile( outputFileName, std::ios::out );
-   if ( !outFile.good() ) {
-      ATH_MSG_ERROR("Unable to open " << outputFileName);
-      return( StatusCode::FAILURE );
-   }
-   float noisyStripThr = m_noisyStripThrDef?(m_noisyStripThrOffline):(m_noisyStripThrOnline);
-   //--- Create module list
-   ostringstream osModuleList;
-   //--- Loop over wafers
-   SCT_ID::const_id_iterator waferItr  = m_pSCTHelper->wafer_begin();
-   SCT_ID::const_id_iterator waferItrE = m_pSCTHelper->wafer_end();
-   for ( ; waferItr != waferItrE; ++waferItr ) {
-      Identifier waferId  = *waferItr;
-      Identifier moduleId = m_pSCTHelper->module_id( waferId );
-      if ( m_pSCTHelper->side( waferId ) != 0 ) continue;
-      map< Identifier, std::set<Identifier> >::const_iterator moduleItr = moduleList.find( moduleId );
-      if ( moduleItr != moduleList.end() ) {
-         std::string defectStrips = getStripList( (*moduleItr).second );
-         osModuleList << "  <channel id=\""    << m_pSCTHelper->module_id( waferId ).get_compact() << "\" "
-                      <<            "since=\"" << m_iovStart.re_time()                             << "\" "
-                      <<            "until=\"" << m_iovStop.re_time()                              << "\">"       << linefeed
-                      << "    <value name=\"SampleSize\">"   << "10000"                            << "</value>" << linefeed
-                      << "    <value name=\"BarrelEndcap\">" << m_pSCTHelper->barrel_ec( waferId ) << "</value>" << linefeed
-                      << "    <value name=\"Layer\">"        << m_pSCTHelper->layer_disk( waferId )<< "</value>" << linefeed
-                      << "    <value name=\"Eta\">"          << m_pSCTHelper->eta_module( waferId )<< "</value>" << linefeed
-                      << "    <value name=\"Phi\">"          << m_pSCTHelper->phi_module( waferId )<< "</value>" << linefeed
-                      << "    <value name=\"DefectType\">"   << "NOISY"                            << "</value>" << linefeed
-                      << "    <value name=\"Threshold\">"    << noisyStripThr                      << "</value>" << linefeed
-                      << "    <value name=\"DefectList\">"   << normalizeList( defectStrips )        << "</value>" << linefeed
-                      << "  </channel>"                                                                          << endl;
-      }
-   }
-   //--- Write out the contents
-   outFile << "<channels server=\"ATLAS_COOLPROD\" schema=\"ATLAS_COOLOFL_SCT\" dbname=\"CONDBR2\" folder=\"SCT/Derived/Monitoring\" "
-           <<           "since=\""   << m_iovStart.re_time() << "\" "
-           <<           "until=\""   << m_iovStop.re_time()  << "\" "
-           <<           "tag=\""     << m_tagID4NoisyStrips  << "\" "
-           <<           "version=\"" << "multi\">"           << endl
-           <<    osModuleList.str()
-           << "</channels>" << endl;
-
-   return StatusCode::SUCCESS;
+SCTCalib::noisyStripsToXml(const std::map<Identifier, std::set<Identifier>>& moduleList, const std::string& badStripsFile) const {
+  //--- Open
+  const char* outputFileName{badStripsFile.c_str()};
+  ofstream outFile{outputFileName, std::ios::out};
+  if (!outFile.good()) {
+    ATH_MSG_ERROR("Unable to open " << outputFileName);
+    return(StatusCode::FAILURE);
+  }
+  float noisyStripThr{m_noisyStripThrDef ? (m_noisyStripThrOffline) : (m_noisyStripThrOnline)};
+  //--- Create module list
+  ostringstream osModuleList;
+  //--- Loop over wafers
+  SCT_ID::const_id_iterator waferItr{m_pSCTHelper->wafer_begin()};
+  SCT_ID::const_id_iterator waferItrE{m_pSCTHelper->wafer_end()};
+  for (; waferItr != waferItrE; ++waferItr) {
+    Identifier waferId{*waferItr};
+    Identifier moduleId{m_pSCTHelper->module_id(waferId)};
+    if (m_pSCTHelper->side(waferId) != 0) continue;
+    map< Identifier, std::set<Identifier> >::const_iterator moduleItr{moduleList.find(moduleId)};
+    if (moduleItr != moduleList.end()) {
+      std::string defectStrips{getStripList((*moduleItr).second)};
+      osModuleList << "  <channel id=\""    << m_pSCTHelper->module_id(waferId).get_compact()  << "\" "
+                   << "since=\"" << m_iovStart.re_time()                                       << "\" "
+                   << "until=\"" << m_iovStop.re_time()                                        << "\">"      << linefeed
+                   << "    <value name=\"SampleSize\">"   << "10000"                           << "</value>" << linefeed
+                   << "    <value name=\"BarrelEndcap\">" << m_pSCTHelper->barrel_ec(waferId)  << "</value>" << linefeed
+                   << "    <value name=\"Layer\">"        << m_pSCTHelper->layer_disk(waferId) << "</value>" << linefeed
+                   << "    <value name=\"Eta\">"          << m_pSCTHelper->eta_module(waferId) << "</value>" << linefeed
+                   << "    <value name=\"Phi\">"          << m_pSCTHelper->phi_module(waferId) << "</value>" << linefeed
+                   << "    <value name=\"DefectType\">"   << "NOISY"                           << "</value>" << linefeed
+                   << "    <value name=\"Threshold\">"    << noisyStripThr                     << "</value>" << linefeed
+                   << "    <value name=\"DefectList\">"   << normalizeList(defectStrips)       << "</value>" << linefeed
+                   << "  </channel>"                                                                         << endl;
+    }
+  }
+  //--- Write out the contents
+  outFile << "<channels server=\"ATLAS_COOLPROD\" schema=\"ATLAS_COOLOFL_SCT\" dbname=\"CONDBR2\" folder=\"SCT/Derived/Monitoring\" "
+          << "since=\""   << m_iovStart.re_time() << "\" "
+          << "until=\""   << m_iovStop.re_time()  << "\" "
+          << "tag=\""     << m_tagID4NoisyStrips  << "\" "
+          << "version=\"" << "multi\">"           << endl
+          << osModuleList.str()
+          << "</channels>" << endl;
+
+  return StatusCode::SUCCESS;
 }
 
-StatusCode SCTCalib::noisyStripsToSummaryXml( const std::map< Identifier, std::set<Identifier> >& moduleListAll,
-      const std::map< Identifier, std::set<Identifier> >& moduleListNew,
-      const std::map< Identifier, std::set<Identifier> >& moduleListRef,
-      const std::string& badStripsFile) const {
-   //--- Open
-   const char* outputFileName = badStripsFile.c_str();
-   ofstream outFile( outputFileName, std::ios::out );
-   if ( !outFile.good() ) {
-      ATH_MSG_ERROR("Unable to open " << outputFileName);
-      return( StatusCode::FAILURE );
-   }
-
-   //--- Initialization
-   int numLinksAll( 0 ), numChipsAll( 0 );
-   int numModulesAll( 0 ), numModulesNew( 0 ), numModulesRef( 0 );
-   int numStripsAll( 0 ), numStripsNew( 0 ), numStripsRef( 0 );
-   int numModulesDiff( 0 );
-
-   std::string defectLinks, defectChips;
-   std::string defectStripsAll, defectStripsNew, defectStripsRef;
-   ostringstream osModuleList, osChipList;
-
-   //--- Create module list
-   SCT_ID::const_id_iterator waferItr  = m_pSCTHelper->wafer_begin();
-   SCT_ID::const_id_iterator waferItrE = m_pSCTHelper->wafer_end();
-   for ( ; waferItr != waferItrE; ++waferItr ) {
-      //--- Identifier
-      Identifier       waferId   = *waferItr;
-      Identifier       moduleId  = m_pSCTHelper->module_id( waferId );
-      IdentifierHash   waferHash = m_pSCTHelper->wafer_hash( waferId );
-      SCT_SerialNumber sn        = m_CablingTool->getSerialNumberFromHash( waferHash );
-
-      //--- Initialization for a module
-      if ( m_pSCTHelper->side( waferId ) == 0 ) {
-         defectLinks.erase();
-         defectChips.erase();
-         defectStripsAll.erase();
-         defectStripsNew.erase();
-         defectStripsRef.erase();
-      }
-
-      //--- Noisy links
-      bool isNoisyWafer = getNumNoisyStrips( waferId ).second; // true if this wafer is noisy
-      if ( isNoisyWafer ) {
-         int link = m_pSCTHelper->side( waferId );
-         defectLinks = m_pCalibWriteTool->addDefect( defectLinks, link, link );
-         ++numLinksAll;
-      }
-
-      //--- Execute once in this module
-      if ( m_pSCTHelper->side( waferId ) == 1 ) {
-         //--- Noisy strips : All
-         map< Identifier, std::set<Identifier> >::const_iterator moduleAllItr = moduleListAll.find( moduleId );
-         if ( moduleAllItr != moduleListAll.end() ) {
-            defectStripsAll = getStripList( (*moduleAllItr).second );
-            ++numModulesAll;
-            numStripsAll += (*moduleAllItr).second.size();
-         }
-         //--- Noisy strips : New
-         map< Identifier, std::set<Identifier> >::const_iterator moduleNewItr = moduleListNew.find( moduleId );
-         if ( moduleNewItr != moduleListNew.end() ) {
-            defectStripsNew = getStripList( (*moduleNewItr).second );
-            ++numModulesNew;
-            numStripsNew += (*moduleNewItr).second.size();
-         }
-         //--- Noisy strips : Ref
-         map< Identifier, std::set<Identifier> >::const_iterator moduleRefItr = moduleListRef.find( moduleId );
-         if ( moduleRefItr != moduleListRef.end() ) {
-            defectStripsRef = getStripList( moduleRefItr->second );
-            ++numModulesRef;
-            numStripsRef += moduleRefItr->second.size();
-         }
-
-         //--- Noisy chips : stripIdList -> chipIdList
-         if ( moduleAllItr != moduleListAll.end() ) {
-            std::set<int> chipIdList = getNoisyChips( moduleAllItr->second );
-            if ( !chipIdList.empty() ) {
-               ++numChipsAll; // CS: I think we should count this!?
-               std::set<int>::iterator chipItr  = chipIdList.begin();
-               std::set<int>::iterator chipItrE = chipIdList.end();
-               for ( ; chipItr != chipItrE; ++chipItr ) {
-                  int chipId = *chipItr;
-                  //--- To be written into module list
-                  defectChips = m_pCalibWriteTool->addDefect( defectChips, chipId, chipId );
-                  //--- LBs where this chip was noisy
-                  std::pair< string, float > defectLB = getNoisyLB( moduleId, chipId );
-                  //--- Chip list written to XML
-                  osChipList << "    <chip>"                                                                                 << linefeed
-                             << "      <value name=\"SN\">"             << sn.str()                            << "</value>" << linefeed
-                             << "      <value name=\"BecLayerPhiEta\">" << m_pSCTHelper->barrel_ec( waferId )  << "."
-                             <<                                            m_pSCTHelper->layer_disk( waferId ) << "."
-                             <<                                            m_pSCTHelper->phi_module( waferId ) << "."
-                             <<                                            m_pSCTHelper->eta_module( waferId ) << "</value>" << linefeed
-                             << "      <value name=\"ChipID\">"         << chipId                              << "</value>" << linefeed
-                             << "      <value name=\"LB\">"             << normalizeList( defectLB.first )     << "</value>" << linefeed
-                             << "      <value name=\"LBFraction\">"     << defectLB.second                     << "</value>" << linefeed
-                             << "    </chip>"                                                                                << endl;
-               }
-            }
-         }
-         //--- Difference between All & Ref
-         if ( defectStripsAll != defectStripsRef ) ++numModulesDiff;
-         //--- Module list written to XML
-         if ( !defectStripsAll.empty() || ( m_noisyUpdate && defectStripsAll != defectStripsRef ) ) {
-            osModuleList << "    <module>"                                                                                << linefeed
-                         << "      <value name=\"SN\">"              << sn.str()                            << "</value>" << linefeed
-                         << "      <value name=\"BecLayerPhiEta\">"  << m_pSCTHelper->barrel_ec( waferId )  << "."
-                         <<                                             m_pSCTHelper->layer_disk( waferId ) << "."
-                         <<                                             m_pSCTHelper->phi_module( waferId ) << "."
-                         <<                                             m_pSCTHelper->eta_module( waferId ) << "</value>" << linefeed
-                         << "      <value name=\"LinkID\">"          << normalizeList( defectLinks )        << "</value>" << linefeed
-                         << "      <value name=\"ChipID\">"          << normalizeList( defectChips )        << "</value>" << linefeed
-                         << "      <value name=\"StripOfflineAll\">" << normalizeList( defectStripsAll )    << "</value>" << linefeed
-                         << "      <value name=\"StripOfflineNew\">" << normalizeList( defectStripsNew )    << "</value>" << linefeed
-                         << "      <value name=\"StripOfflineRef\">" << normalizeList( defectStripsRef )    << "</value>" << linefeed
-                         << "    </module>"                                                                               << endl;
-         }
-      }
-   }//--- end loop : waferItr
+StatusCode SCTCalib::noisyStripsToSummaryXml(const std::map<Identifier, std::set<Identifier>>& moduleListAll, 
+                                             const std::map<Identifier, std::set<Identifier>>& moduleListNew, 
+                                             const std::map<Identifier, std::set<Identifier>>& moduleListRef, 
+                                             const std::string& badStripsFile) const {
+  //--- Open
+  const char* outputFileName{badStripsFile.c_str()};
+  ofstream outFile{outputFileName, std::ios::out};
+  if (!outFile.good()) {
+    ATH_MSG_ERROR("Unable to open " << outputFileName);
+    return(StatusCode::FAILURE);
+  }
+
+  //--- Initialization
+  int numLinksAll{0}, numChipsAll{0};
+  int numModulesAll{0}, numModulesNew{0}, numModulesRef{0};
+  int numStripsAll{0}, numStripsNew{0}, numStripsRef{0};
+  int numModulesDiff{0};
+
+  std::string defectLinks, defectChips;
+  std::string defectStripsAll, defectStripsNew, defectStripsRef;
+  ostringstream osModuleList, osChipList;
+
+  //--- Create module list
+  SCT_ID::const_id_iterator waferItr{m_pSCTHelper->wafer_begin()};
+  SCT_ID::const_id_iterator waferItrE{m_pSCTHelper->wafer_end()};
+  for (; waferItr != waferItrE; ++waferItr) {
+    //--- Identifier
+    Identifier waferId{*waferItr};
+    Identifier moduleId{m_pSCTHelper->module_id(waferId)};
+    IdentifierHash waferHash{m_pSCTHelper->wafer_hash(waferId)};
+    SCT_SerialNumber sn{m_CablingTool->getSerialNumberFromHash(waferHash)};
+
+    //--- Initialization for a module
+    if (m_pSCTHelper->side(waferId) == 0) {
+      defectLinks.erase();
+      defectChips.erase();
+      defectStripsAll.erase();
+      defectStripsNew.erase();
+      defectStripsRef.erase();
+    }
+
+    //--- Noisy links
+    bool isNoisyWafer{getNumNoisyStrips(waferId).second}; // true if this wafer is noisy
+    if (isNoisyWafer) {
+      int link{m_pSCTHelper->side(waferId)};
+      defectLinks = m_pCalibWriteTool->addDefect(defectLinks, link, link);
+      ++numLinksAll;
+    }
+
+    //--- Execute once in this module
+    if (m_pSCTHelper->side(waferId) == 1) {
+      //--- Noisy strips : All
+      map< Identifier, std::set<Identifier> >::const_iterator moduleAllItr{moduleListAll.find(moduleId)};
+      if (moduleAllItr != moduleListAll.end()) {
+        defectStripsAll = getStripList((*moduleAllItr).second);
+        ++numModulesAll;
+        numStripsAll += (*moduleAllItr).second.size();
+      }
+      //--- Noisy strips : New
+      map< Identifier, std::set<Identifier> >::const_iterator moduleNewItr{moduleListNew.find(moduleId)};
+      if (moduleNewItr != moduleListNew.end()) {
+        defectStripsNew = getStripList((*moduleNewItr).second);
+        ++numModulesNew;
+        numStripsNew += (*moduleNewItr).second.size();
+      }
+      //--- Noisy strips : Ref
+      map< Identifier, std::set<Identifier> >::const_iterator moduleRefItr{moduleListRef.find(moduleId)};
+      if (moduleRefItr != moduleListRef.end()) {
+        defectStripsRef = getStripList(moduleRefItr->second);
+        ++numModulesRef;
+        numStripsRef += moduleRefItr->second.size();
+      }
+
+      //--- Noisy chips : stripIdList -> chipIdList
+      if (moduleAllItr != moduleListAll.end()) {
+        std::set<int> chipIdList{getNoisyChips(moduleAllItr->second)};
+        if (!chipIdList.empty()) {
+          ++numChipsAll; // CS: I think we should count this!?
+          std::set<int>::iterator chipItr{chipIdList.begin()};
+          std::set<int>::iterator chipItrE{chipIdList.end()};
+          for (; chipItr != chipItrE; ++chipItr) {
+            int chipId{*chipItr};
+            //--- To be written into module list
+            defectChips = m_pCalibWriteTool->addDefect(defectChips, chipId, chipId);
+            //--- LBs where this chip was noisy
+            std::pair< string, float > defectLB{getNoisyLB(moduleId, chipId)};
+            //--- Chip list written to XML
+            osChipList << "    <chip>"                                                                              << linefeed
+                       << "      <value name=\"SN\">"             << sn.str()                         << "</value>" << linefeed
+                       << "      <value name=\"BecLayerPhiEta\">" << m_pSCTHelper->barrel_ec(waferId) << "."
+                       <<                                          m_pSCTHelper->layer_disk(waferId)  << "."
+                       <<                                          m_pSCTHelper->phi_module(waferId)  << "."
+                       <<                                          m_pSCTHelper->eta_module(waferId)  << "</value>" << linefeed
+                       << "      <value name=\"ChipID\">"         << chipId                           << "</value>" << linefeed
+                       << "      <value name=\"LB\">"             << normalizeList(defectLB.first)    << "</value>" << linefeed
+                       << "      <value name=\"LBFraction\">"     << defectLB.second                  << "</value>" << linefeed
+                       << "    </chip>"                                                                             << endl;
+          }
+        }
+      }
+      //--- Difference between All & Ref
+      if (defectStripsAll != defectStripsRef) ++numModulesDiff;
+      //--- Module list written to XML
+      if (!defectStripsAll.empty() or (m_noisyUpdate and defectStripsAll != defectStripsRef)) {
+        osModuleList << "    <module>"                                                                              << linefeed
+                     << "      <value name=\"SN\">"              << sn.str()                          << "</value>" << linefeed
+                     << "      <value name=\"BecLayerPhiEta\">"  << m_pSCTHelper->barrel_ec(waferId)  << "."
+                     <<                                             m_pSCTHelper->layer_disk(waferId) << "."
+                     <<                                             m_pSCTHelper->phi_module(waferId) << "."
+                     <<                                             m_pSCTHelper->eta_module(waferId) << "</value>" << linefeed
+                     << "      <value name=\"LinkID\">"          << normalizeList(defectLinks)        << "</value>" << linefeed
+                     << "      <value name=\"ChipID\">"          << normalizeList(defectChips)        << "</value>" << linefeed
+                     << "      <value name=\"StripOfflineAll\">" << normalizeList(defectStripsAll)    << "</value>" << linefeed
+                     << "      <value name=\"StripOfflineNew\">" << normalizeList(defectStripsNew)    << "</value>" << linefeed
+                     << "      <value name=\"StripOfflineRef\">" << normalizeList(defectStripsRef)    << "</value>" << linefeed
+                     << "    </module>"                                                                             << endl;
+      }
+    }
+  }//--- end loop : waferItr
 
    //--- Upload flag
-   string strUploadFlag = "U";
-
-   bool isRunsInCool( false );
-   bool isNoisyMinStat( false ), isNoisyModuleList( false ), isNoisyModuleDiff( false ), isNoisyStripDiff( false );
-   if ( m_noisyUploadTest ) {
-      isRunsInCool = m_noisyModuleAverageInDB != -1. && m_noisyStripLastRunInDB != -999;
-      if ( isRunsInCool ) {
-         isNoisyMinStat    = m_numberOfEvents > m_noisyMinStat;
-         isNoisyModuleList = numModulesAll < m_noisyModuleList;
-         isNoisyModuleDiff = ( ( static_cast<float>(numModulesAll) - m_noisyModuleAverageInDB )/m_noisyModuleAverageInDB ) < m_noisyModuleDiff;
-         isNoisyStripDiff  = ( numStripsAll - m_noisyStripAverageInDB ) < m_noisyStripDiff;
-         if ( !isNoisyMinStat || !isNoisyModuleList ) {
-            strUploadFlag = "R";
-         } else {
-            if ( !isNoisyModuleDiff || !isNoisyStripDiff ) {
-               strUploadFlag = "Y";
-            } else {
-               strUploadFlag = "G";
-            }
-         }
-      }
-   }
-
-   //--- Upload test result to XML
-   ostringstream osNoisyMinStat, osNoisyModuleList, osNoisyModuleDiff, osNoisyStripDiff;
-   osNoisyMinStat    << "#events more than "                                                                      << m_noisyMinStat.value();
-   osNoisyModuleList << "#(modules w/ at least 1 noisy strip) less than "                                         << m_noisyModuleList.value();
-   osNoisyModuleDiff << "Increase of #(modules w/ at least 1 noisy strip) from average of recent runs less than " << m_noisyModuleDiff*100 << "%";
-   osNoisyStripDiff  << "Increase of #(noisy strips) from average of recent runs less than "                      << m_noisyStripDiff.value();
-
-   ostringstream osFlagReason;
-   if ( !isNoisyMinStat    ) osFlagReason << "FAILED in " << osNoisyMinStat.str()    << "; ";
-   if ( !isNoisyModuleList ) osFlagReason << "FAILED in " << osNoisyModuleList.str() << "; ";
-   if ( !isNoisyModuleDiff ) osFlagReason << "FAILED in " << osNoisyModuleDiff.str() << "; ";
-   if ( !isNoisyStripDiff  ) osFlagReason << "FAILED in " << osNoisyStripDiff.str();
-
-   string strFlagEnable = m_noisyUploadTest ? "ENABLED"   : "DISABLED";
-   string strRunsInCool = isRunsInCool      ? "AVAILABLE" : "UNAVAILABLE";
-
-   ostringstream osCheckList;
-   osCheckList << osNoisyMinStat.str()    << "; "
-               << osNoisyModuleList.str() << "; "
-               << osNoisyModuleDiff.str() << "; "
-               << osNoisyStripDiff.str();
-
-   //--- Write out the contents to XML file
-   outFile << xmlHeader                                       << linefeed
-           << associateStylesheet("BadStrips.xsl")                          << linefeed
-           << "<run>"                                                                                  << linefeed
-           << "  <value name=\"RunNumber\">"        << m_runNumber.value()               << "</value>" << linefeed
-           << "  <value name=\"StartTime\">"        << m_utcBegin                        << "</value>" << linefeed
-           << "  <value name=\"EndTime\">"          << m_utcEnd                          << "</value>" << linefeed
-           << "  <value name=\"Duration\">"         << m_calibEvtInfoTool->duration() << "</value>" << linefeed
-           << "  <value name=\"LB\">"               << m_numOfLBsProcessed               << "</value>" << linefeed
-           << "  <value name=\"Events\">"           << m_numberOfEvents            << "</value>" << linefeed
-           << "  <value name=\"Modules\">"          << numModulesAll                     << "</value>" << linefeed
-           << "  <value name=\"Links\">"            << numLinksAll                       << "</value>" << linefeed
-           << "  <value name=\"Chips\">"            << numChipsAll                       << "</value>" << linefeed
-           << "  <value name=\"StripsOfflineAll\">" << numStripsAll                      << "</value>" << linefeed
-           << "  <value name=\"StripsOfflineNew\">" << numStripsNew                      << "</value>" << linefeed
-           << "  <value name=\"ModulesRef\">"       << numModulesRef                     << "</value>" << linefeed
-           << "  <value name=\"StripsOfflineRef\">" << numStripsRef                      << "</value>" << linefeed
-           << "  <value name=\"ModulesDiff\">"      << numModulesDiff                << "</value>" << linefeed
-           << "  <value name=\"Flag\">"             << strUploadFlag                     << "</value>" << linefeed
-           << "  <value name=\"FlagReason\">"       << osFlagReason.str()                << "</value>" << linefeed
-           << "  <value name=\"FlagEnable\">"       << strFlagEnable                     << "</value>" << linefeed
-           << "  <value name=\"ReadCool\">"         << strRunsInCool                     << "</value>" << linefeed
-           << "  <value name=\"CheckList\">"        << osCheckList.str()                 << "</value>" << linefeed
-           << "  <chips>"                                                                              << linefeed
-           <<      osChipList.str()
-           << "  </chips>"                                                                             << linefeed
-           << "  <modules>"                                                                            << linefeed
-           <<  osModuleList.str()
-           << "  </modules>"                                                                           << linefeed
-           << "</run>"                                                                                 << endl;
-
-   return StatusCode::SUCCESS;
+  string strUploadFlag{"U"};
+
+  bool isRunsInCool{false};
+  bool isNoisyMinStat{false}, isNoisyModuleList{false}, isNoisyModuleDiff{false}, isNoisyStripDiff{false};
+  if (m_noisyUploadTest) {
+    isRunsInCool = m_noisyModuleAverageInDB != -1. and m_noisyStripLastRunInDB != -999;
+    if (isRunsInCool) {
+      isNoisyMinStat    = m_numberOfEvents > m_noisyMinStat;
+      isNoisyModuleList = numModulesAll < m_noisyModuleList;
+      isNoisyModuleDiff = ((static_cast<float>(numModulesAll) - m_noisyModuleAverageInDB)/m_noisyModuleAverageInDB) < m_noisyModuleDiff;
+      isNoisyStripDiff  = (numStripsAll - m_noisyStripAverageInDB) < m_noisyStripDiff;
+      if (!isNoisyMinStat or !isNoisyModuleList) {
+        strUploadFlag = "R";
+      } else {
+        if (!isNoisyModuleDiff or !isNoisyStripDiff) {
+          strUploadFlag = "Y";
+        } else {
+          strUploadFlag = "G";
+        }
+      }
+    }
+  }
+
+  //--- Upload test result to XML
+  ostringstream osNoisyMinStat, osNoisyModuleList, osNoisyModuleDiff, osNoisyStripDiff;
+  osNoisyMinStat    << "#events more than "                                                                      << m_noisyMinStat.value();
+  osNoisyModuleList << "#(modules w/ at least 1 noisy strip) less than "                                         << m_noisyModuleList.value();
+  osNoisyModuleDiff << "Increase of #(modules w/ at least 1 noisy strip) from average of recent runs less than " << m_noisyModuleDiff*100 << "%";
+  osNoisyStripDiff  << "Increase of #(noisy strips) from average of recent runs less than "                      << m_noisyStripDiff.value();
+
+  ostringstream osFlagReason;
+  if (!isNoisyMinStat)    osFlagReason << "FAILED in " << osNoisyMinStat.str()    << "; ";
+  if (!isNoisyModuleList) osFlagReason << "FAILED in " << osNoisyModuleList.str() << "; ";
+  if (!isNoisyModuleDiff) osFlagReason << "FAILED in " << osNoisyModuleDiff.str() << "; ";
+  if (!isNoisyStripDiff)  osFlagReason << "FAILED in " << osNoisyStripDiff.str();
+
+  string strFlagEnable = m_noisyUploadTest ? "ENABLED"   : "DISABLED";
+  string strRunsInCool = isRunsInCool      ? "AVAILABLE" : "UNAVAILABLE";
+
+  ostringstream osCheckList;
+  osCheckList << osNoisyMinStat.str()    << "; "
+              << osNoisyModuleList.str() << "; "
+              << osNoisyModuleDiff.str() << "; "
+              << osNoisyStripDiff.str();
+
+  //--- Write out the contents to XML file
+  outFile << xmlHeader                                                                                << linefeed
+          << associateStylesheet("BadStrips.xsl")                                                     << linefeed
+          << "<run>"                                                                                  << linefeed
+          << "  <value name=\"RunNumber\">"        << m_runNumber.value()               << "</value>" << linefeed
+          << "  <value name=\"StartTime\">"        << m_utcBegin                        << "</value>" << linefeed
+          << "  <value name=\"EndTime\">"          << m_utcEnd                          << "</value>" << linefeed
+          << "  <value name=\"Duration\">"         << m_calibEvtInfoTool->duration()    << "</value>" << linefeed
+          << "  <value name=\"LB\">"               << m_numOfLBsProcessed               << "</value>" << linefeed
+          << "  <value name=\"Events\">"           << m_numberOfEvents                  << "</value>" << linefeed
+          << "  <value name=\"Modules\">"          << numModulesAll                     << "</value>" << linefeed
+          << "  <value name=\"Links\">"            << numLinksAll                       << "</value>" << linefeed
+          << "  <value name=\"Chips\">"            << numChipsAll                       << "</value>" << linefeed
+          << "  <value name=\"StripsOfflineAll\">" << numStripsAll                      << "</value>" << linefeed
+          << "  <value name=\"StripsOfflineNew\">" << numStripsNew                      << "</value>" << linefeed
+          << "  <value name=\"ModulesRef\">"       << numModulesRef                     << "</value>" << linefeed
+          << "  <value name=\"StripsOfflineRef\">" << numStripsRef                      << "</value>" << linefeed
+          << "  <value name=\"ModulesDiff\">"      << numModulesDiff                    << "</value>" << linefeed
+          << "  <value name=\"Flag\">"             << strUploadFlag                     << "</value>" << linefeed
+          << "  <value name=\"FlagReason\">"       << osFlagReason.str()                << "</value>" << linefeed
+          << "  <value name=\"FlagEnable\">"       << strFlagEnable                     << "</value>" << linefeed
+          << "  <value name=\"ReadCool\">"         << strRunsInCool                     << "</value>" << linefeed
+          << "  <value name=\"CheckList\">"        << osCheckList.str()                 << "</value>" << linefeed
+          << "  <chips>"                                                                              << linefeed
+          << osChipList.str()
+          << "  </chips>"                                                                             << linefeed
+          << "  <modules>"                                                                            << linefeed
+          << osModuleList.str()
+          << "  </modules>"                                                                           << linefeed
+          << "</run>"                                                                                 << endl;
+
+  return StatusCode::SUCCESS;
 }
 
 std::set<int>
-SCTCalib::getNoisyChips( const std::set<Identifier>& stripIdList ) const {
-   std::set<int> chipIdList;
-   chipIdList.clear();
-
-   // Get SCT_DetectorElementCollection
-   SG::ReadCondHandle<InDetDD::SiDetectorElementCollection> sctDetEle(m_SCTDetEleCollKey);
-   const InDetDD::SiDetectorElementCollection* elements(sctDetEle.retrieve());
-   if (elements==nullptr) {
-      ATH_MSG_FATAL(m_SCTDetEleCollKey.fullKey() << " could not be retrieved");
-      return chipIdList;
-   }
-
-   //--- Minimum number of noisy strips for a noisy chip
-   unsigned int noisyChipThr = m_noisyChipFraction*n_stripPerChip;
-   if ( stripIdList.size() > noisyChipThr ) {
-      unsigned int numStripsPerChip[ n_chipPerModule ] = { 0 };
-      //--- Loop over stripIdList
-      std::set<Identifier>::const_iterator stripItr  = stripIdList.begin();
-      std::set<Identifier>::const_iterator stripItrE = stripIdList.end();
-      for ( ; stripItr != stripItrE; ++stripItr ) {
-         Identifier stripId = *stripItr;
-         int stripOffline = m_pSCTHelper->strip( stripId );
-         //--- Chip number : taken from SCT_ConfigurationConditionsSvc::getChip
-         IdentifierHash waferHash = m_pSCTHelper->wafer_hash( m_pSCTHelper->wafer_id( stripId ) );
-         const InDetDD::SiDetectorElement* pElement = elements->getDetectorElement( waferHash );
-         if ( !pElement ) {
-            ATH_MSG_FATAL("Element pointer is NULL");
-            continue;
-         }
-         int stripOnline = ( pElement->swapPhiReadoutDirection() ) ? lastStrip - stripOffline : stripOffline;
-         int chipId = m_pSCTHelper->side( stripId ) == 0 ? stripOnline/n_stripPerChip : stripOnline/n_stripPerChip + n_chipPerSide;
-         //--- Count number of noisy strips per chips
-         ++numStripsPerChip[ chipId ];
-      }
-
-      //--- Insert noisy chips
-      for ( int iChip = 0; iChip != n_chipPerModule; ++iChip ) {
-         if ( numStripsPerChip[iChip] > noisyChipThr ) chipIdList.insert( iChip );
-      }
-   }
-   return chipIdList;
+SCTCalib::getNoisyChips(const std::set<Identifier>& stripIdList) const {
+  std::set<int> chipIdList;
+  chipIdList.clear();
+
+  // Get SCT_DetectorElementCollection
+  SG::ReadCondHandle<InDetDD::SiDetectorElementCollection> sctDetEle{m_SCTDetEleCollKey};
+  const InDetDD::SiDetectorElementCollection* elements{sctDetEle.retrieve()};
+  if (elements==nullptr) {
+    ATH_MSG_FATAL(m_SCTDetEleCollKey.fullKey() << " could not be retrieved");
+    return chipIdList;
+  }
+
+  //--- Minimum number of noisy strips for a noisy chip
+  unsigned int noisyChipThr{static_cast<unsigned int>(m_noisyChipFraction*n_stripPerChip)};
+  if (stripIdList.size() > noisyChipThr) {
+    unsigned int numStripsPerChip[n_chipPerModule] = {0};
+    //--- Loop over stripIdList
+    std::set<Identifier>::const_iterator stripItr{stripIdList.begin()};
+    std::set<Identifier>::const_iterator stripItrE{stripIdList.end()};
+    for (; stripItr != stripItrE; ++stripItr) {
+      Identifier stripId{*stripItr};
+      int stripOffline{m_pSCTHelper->strip(stripId)};
+      //--- Chip number : taken from SCT_ConfigurationConditionsTool::getChip
+      IdentifierHash waferHash{m_pSCTHelper->wafer_hash(m_pSCTHelper->wafer_id(stripId))};
+      const InDetDD::SiDetectorElement* pElement{elements->getDetectorElement(waferHash)};
+      if (!pElement) {
+        ATH_MSG_FATAL("Element pointer is NULL");
+        continue;
+      }
+      int stripOnline{(pElement->swapPhiReadoutDirection()) ? lastStrip - stripOffline : stripOffline};
+      int chipId{m_pSCTHelper->side(stripId) == 0 ? stripOnline/n_stripPerChip : stripOnline/n_stripPerChip + n_chipPerSide};
+      //--- Count number of noisy strips per chips
+      ++numStripsPerChip[chipId];
+    }
+
+    //--- Insert noisy chips
+    for (int iChip{0}; iChip != n_chipPerModule; ++iChip) {
+      if (numStripsPerChip[iChip] > noisyChipThr) chipIdList.insert(iChip);
+    }
+  }
+  return chipIdList;
 }
 
 std::pair< string, float >
-SCTCalib::getNoisyLB( const Identifier& moduleId, int& chipId ) const {
-   std::string defectLB(""); //return value if invalid
-   float defectLBFrac(0.0); //return value if invalid
-   float noisyStripThr = m_noisyStripThrDef?(m_noisyStripThrOffline):(m_noisyStripThrOnline);
-
-   //--- Identifier
-   Identifier waferId = m_pSCTHelper->wafer_id( m_pSCTHelper->barrel_ec( moduleId ),
-                        m_pSCTHelper->layer_disk( moduleId ),
-                        m_pSCTHelper->phi_module( moduleId ),
-                        m_pSCTHelper->eta_module( moduleId ),
-                        chipId < n_chipPerSide ? 0 : 1 );
-   IdentifierHash waferHash = m_pSCTHelper->wafer_hash( waferId );
-   //--- Histogram for this chip
-   int chipPositionInSide = m_pSCTHelper->side( waferId ) == 0 ? chipId : chipId - n_chipPerSide;
-   int histIndex = (waferHash.value())*n_chipPerSide + chipPositionInSide;
-
-   //--- Find LBs where this chip was noisy
-   double chipOccupancyThr = noisyStripThr*n_stripPerChip*m_noisyChipFraction;
-   std::set<int> LBList;
-   LBList.clear();
-   if (!m_calibLbTool) {
-      ATH_MSG_ERROR("NULL pointer m_calibLbTool line "<<__LINE__);
-      return std::make_pair( defectLB, defectLBFrac );
-   }
-
-   for ( int iLB = 0; iLB != m_LBRange; ++iLB ) {
-      double numEventsInLB = m_calibLbTool->getNumberOfEventsInBin( iLB + 1 );
-      if ( numEventsInLB == 0 ) continue;
-      double chipOccupancy = m_calibLbTool->getBinForHistogramIndex( iLB + 1, histIndex )/numEventsInLB;
-      if ( chipOccupancy > chipOccupancyThr ) LBList.insert( iLB );
-   }
-   //--- Transform LBList to string and calculate a fraction of noisy LBs
-   if ( LBList.size() != 0 ) {
-      defectLB = getLBList( LBList );
-      defectLBFrac = static_cast<float>(LBList.size()) / m_numOfLBsProcessed;
-   }
-
-   return std::make_pair( defectLB, defectLBFrac );
+SCTCalib::getNoisyLB(const Identifier& moduleId, int& chipId) const {
+  std::string defectLB{""}; //return value if invalid
+  float defectLBFrac{0.0}; //return value if invalid
+  float noisyStripThr{m_noisyStripThrDef?(m_noisyStripThrOffline):(m_noisyStripThrOnline)};
+
+  //--- Identifier
+  Identifier waferId{m_pSCTHelper->wafer_id(m_pSCTHelper->barrel_ec(moduleId), 
+                                            m_pSCTHelper->layer_disk(moduleId), 
+                                            m_pSCTHelper->phi_module(moduleId), 
+                                            m_pSCTHelper->eta_module(moduleId), 
+                                            chipId < n_chipPerSide ? 0 : 1)};
+  IdentifierHash waferHash{m_pSCTHelper->wafer_hash(waferId)};
+  //--- Histogram for this chip
+  int chipPositionInSide{m_pSCTHelper->side(waferId) == 0 ? chipId : chipId - n_chipPerSide};
+  int histIndex{static_cast<int>((waferHash.value())*n_chipPerSide + chipPositionInSide)};
+
+  //--- Find LBs where this chip was noisy
+  double chipOccupancyThr{noisyStripThr*n_stripPerChip*m_noisyChipFraction};
+  std::set<int> LBList;
+  LBList.clear();
+  if (!m_calibLbTool) {
+    ATH_MSG_ERROR("NULL pointer m_calibLbTool line " <<__LINE__);
+    return std::make_pair(defectLB, defectLBFrac);
+  }
+
+  for (int iLB{0}; iLB != m_LBRange; ++iLB) {
+    double numEventsInLB{static_cast<double>(m_calibLbTool->getNumberOfEventsInBin(iLB + 1))};
+    if (numEventsInLB == 0) continue;
+    double chipOccupancy{m_calibLbTool->getBinForHistogramIndex(iLB + 1, histIndex)/numEventsInLB};
+    if (chipOccupancy > chipOccupancyThr) LBList.insert(iLB);
+  }
+  //--- Transform LBList to string and calculate a fraction of noisy LBs
+  if (LBList.size() != 0) {
+    defectLB = getLBList(LBList);
+    defectLBFrac = static_cast<float>(LBList.size()) / m_numOfLBsProcessed;
+  }
+
+  return std::make_pair(defectLB, defectLBFrac);
 }
 
-std::string SCTCalib::getLBList( const std::set<int>& LBList ) const {
-   std::string strList;
-   strList.erase();
-   if ( !LBList.empty() ) {
-      int firstLB = -1;
-      int LBSize  = -1;
-
-      std::set<int>::const_iterator LBItrFirst = LBList.begin();
-      std::set<int>::const_iterator LBItrLast  = --LBList.end();
-
-      std::set<int>::const_iterator LBItr  = LBList.begin();
-      std::set<int>::const_iterator LBItrE = LBList.end();
-      for ( ; LBItr != LBItrE; ++LBItr ) {
-         int iLB = *LBItr;
-         if ( LBItr == LBItrFirst ) {
-            firstLB = iLB;
-            LBSize  = 1;
-         } else {
-            if ( iLB == firstLB + LBSize ) {
-               ++LBSize;
-            } else {
-               int LBBegin = firstLB;
-               int LBEnd   = firstLB + LBSize -1;
-               strList = m_pCalibWriteTool->addDefect( strList, LBBegin, LBEnd );
-               firstLB = iLB;
-               LBSize  = 1;
-            }
-         }
-         if ( LBItr == LBItrLast ) {
-            int LBBegin = firstLB;
-            int LBEnd   = iLB;
-            strList = m_pCalibWriteTool->addDefect( strList, LBBegin, LBEnd );
-         }
-      }
-   }
-   return strList;
+std::string SCTCalib::getLBList(const std::set<int>& LBList) const {
+  std::string strList;
+  strList.erase();
+  if (!LBList.empty()) {
+    int firstLB{-1};
+    int LBSize{-1};
+
+    std::set<int>::const_iterator LBItrFirst{LBList.begin()};
+    std::set<int>::const_iterator LBItrLast{--LBList.end()};
+
+    std::set<int>::const_iterator LBItr{LBList.begin()};
+    std::set<int>::const_iterator LBItrE{LBList.end()};
+    for (; LBItr != LBItrE; ++LBItr) {
+      int iLB{*LBItr};
+      if (LBItr == LBItrFirst) {
+        firstLB = iLB;
+        LBSize  = 1;
+      } else {
+        if (iLB == firstLB + LBSize) {
+          ++LBSize;
+        } else {
+          int LBBegin{firstLB};
+          int LBEnd{firstLB + LBSize -1};
+          strList = m_pCalibWriteTool->addDefect(strList, LBBegin, LBEnd);
+          firstLB = iLB;
+          LBSize  = 1;
+        }
+      }
+      if (LBItr == LBItrLast) {
+        int LBBegin{firstLB};
+        int LBEnd{iLB};
+        strList = m_pCalibWriteTool->addDefect(strList, LBBegin, LBEnd);
+      }
+    }
+  }
+  return strList;
 }
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalibWriteTool.cxx b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalibWriteTool.cxx
index b98c334f7e5f434a1df69175444596f8fc8b1317..9bc1e38ff96c802267640d366b421f09b0a3f9ac 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalibWriteTool.cxx
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalibWriteTool.cxx
@@ -14,10 +14,6 @@
 // IOVDbTest includes
 #include "RegistrationServices/IIOVRegistrationSvc.h"
 
-// Gaudi includes
-#include "GaudiKernel/StatusCode.h"
-#include "GaudiKernel/IToolSvc.h"
-
 // Athena includes
 #include "AthenaKernel/IAthenaOutputStreamTool.h"
 #include "CoralBase/Attribute.h"
@@ -33,6 +29,10 @@
 //path resolver to find the file
 #include "PathResolver/PathResolver.h"
 
+// Gaudi includes
+#include "GaudiKernel/StatusCode.h"
+#include "GaudiKernel/IToolSvc.h"
+
 #include <fstream>
 #include <iterator>
 #include <sstream>
@@ -42,153 +42,134 @@
 
 using std::string;
 /////////////////////////////////////////////////////////////////////////////
-const string SCTCalibWriteTool::s_separator = string("-");
-const string SCTCalibWriteTool::s_defectFolderName = string("/SCT/Derived/Monitoring");
-const string SCTCalibWriteTool::s_deadStripFolderName = string("/SCT/Derived/DeadStrips");
-const string SCTCalibWriteTool::s_deadChipFolderName = string("/SCT/Derived/DeadChips");
-const string SCTCalibWriteTool::s_effFolderName = string("/SCT/Derived/Efficiency");
-const string SCTCalibWriteTool::s_noFolderName = string("/SCT/Derived/NoiseOccupancy");
-const string SCTCalibWriteTool::s_RawOccuFolderName = string("/SCT/Derived/RawOccupancy");
-const string SCTCalibWriteTool::s_BSErrFolderName = string("/SCT/Derived/BSErrorsRun2");
-const string SCTCalibWriteTool::s_LAFolderName = string("/SCT/Derived/LorentzAngleRun2_v2");
-
-const bool becCapsFormat(true);
-const bool becUnderscoreFormat(false);
+const string SCTCalibWriteTool::s_separator{"-"};
+const string SCTCalibWriteTool::s_defectFolderName{"/SCT/Derived/Monitoring"};
+const string SCTCalibWriteTool::s_deadStripFolderName{"/SCT/Derived/DeadStrips"};
+const string SCTCalibWriteTool::s_deadChipFolderName{"/SCT/Derived/DeadChips"};
+const string SCTCalibWriteTool::s_effFolderName{"/SCT/Derived/Efficiency"};
+const string SCTCalibWriteTool::s_noFolderName{"/SCT/Derived/NoiseOccupancy"};
+const string SCTCalibWriteTool::s_RawOccuFolderName{"/SCT/Derived/RawOccupancy"};
+const string SCTCalibWriteTool::s_BSErrFolderName{"/SCT/Derived/BSErrorsRun2"};
+const string SCTCalibWriteTool::s_LAFolderName{"/SCT/Derived/LorentzAngleRun2_v2"};
+
+const bool becCapsFormat{true};
+const bool becUnderscoreFormat{false};
 
 SCTCalibWriteTool::SCTCalibWriteTool(const std::string& type, const std::string& name, const IInterface* parent) :
-   AthAlgTool(type, name, parent),
-   m_detStore(0),
-   m_eventInfoKey(std::string("ByteStreamEventInfo")),
-   m_mutex(),
-   m_attrListColl(0),
-   m_attrListColl_deadStrip(0),
-   m_attrListColl_deadChip(0),
-   m_attrListColl_eff(0),
-   m_attrListColl_no(0),
-   m_attrListColl_RawOccu(0),
-   m_attrListColl_BSErr(0),
-   m_attrListColl_LA(0),
-   //boolean properties
-   m_writeCondObjs(true),
-   m_regIOV(true),
-   m_readWriteCool(true),
-   m_twoStepWriteReg(false),
-   m_manualiov(true),
-
-   /*m_regTime(0), never used */
-   m_version(0),
-   m_beginRun(IOVTime::MINRUN),
-   m_endRun(IOVTime::MAXRUN),
-   m_streamName("CondStreamTest"),
-
-   m_regSvc(0),
-   m_streamer(0),
-   //m_streamer("AthenaOutputStreamTool"),
-   m_badIds(),
-
-   m_defectRecorded(false),
-   m_deadStripRecorded(false),
-   m_deadChipRecorded(false),
-   m_effRecorded(false),
-   m_noRecorded(false),
-   m_RawOccuRecorded(false),
-   m_BSErrRecorded(false),
-   m_LARecorded(false),
-   m_pHelper(0)
-{
-   declareProperty("WriteCondObjs",        m_writeCondObjs);
-   declareProperty("RegisterIOV",          m_regIOV);
-   declareProperty("ReadWriteCool",        m_readWriteCool);
-   declareProperty("TwoStepWriteReg",      m_twoStepWriteReg);
-   declareProperty("ManualIOV",            m_manualiov);
-   //declareProperty("RegTime",              m_regTime);  never used Register time in sec
-
-   declareProperty("BeginRun",             m_beginRun);
-   declareProperty("EndRun",               m_endRun);
-   //string properties:
-   declareProperty("StreamName",           m_streamName);
-   declareProperty("TagID4NoisyStrips",    m_tagID4NoisyStrips);
-   declareProperty("TagID4DeadStrips",     m_tagID4DeadStrips);
-   declareProperty("TagID4DeadChips",      m_tagID4DeadChips);
-   declareProperty("TagID4Efficiency",     m_tagID4Efficiency);
-   declareProperty("TagID4NoiseOccupancy", m_tagID4NoiseOccupancy);
-   declareProperty("TagID4RawOccupancy",   m_tagID4RawOccupancy);
-   declareProperty("TagID4BSErrors",       m_tagID4BSErrors);
-   declareProperty("TagID4LorentzAngle",   m_tagID4LorentzAngle);
-
-}
+  AthAlgTool(type, name, parent),
+  m_eventInfoKey{"ByteStreamEventInfo"},
+  m_mutex{},
+  m_attrListColl{nullptr},
+  m_attrListColl_deadStrip{nullptr},
+  m_attrListColl_deadChip{nullptr},
+  m_attrListColl_eff{nullptr},
+  m_attrListColl_no{nullptr},
+  m_attrListColl_RawOccu{nullptr},
+  m_attrListColl_BSErr{nullptr},
+  m_attrListColl_LA{nullptr},
+  m_version{0},
+  m_regSvc{nullptr},
+  m_streamer{nullptr},
+  m_defectRecorded{false},
+  m_deadStripRecorded{false},
+  m_deadChipRecorded{false},
+  m_effRecorded{false},
+  m_noRecorded{false},
+  m_RawOccuRecorded{false},
+  m_BSErrRecorded{false},
+  m_LARecorded{false},
+  m_pHelper{nullptr}
+  {
+    declareProperty("WriteCondObjs",        m_writeCondObjs=true);
+    declareProperty("RegisterIOV",          m_regIOV=true);
+    declareProperty("ReadWriteCool",        m_readWriteCool=true);
+    declareProperty("TwoStepWriteReg",      m_twoStepWriteReg=false);
+    declareProperty("ManualIOV",            m_manualiov=true);
+
+    declareProperty("BeginRun",             m_beginRun=IOVTime::MINRUN);
+    declareProperty("EndRun",               m_endRun=IOVTime::MAXRUN);
+    //string properties:
+    declareProperty("StreamName",           m_streamName="CondStreamTest");
+    declareProperty("TagID4NoisyStrips",    m_tagID4NoisyStrips);
+    declareProperty("TagID4DeadStrips",     m_tagID4DeadStrips);
+    declareProperty("TagID4DeadChips",      m_tagID4DeadChips);
+    declareProperty("TagID4Efficiency",     m_tagID4Efficiency);
+    declareProperty("TagID4NoiseOccupancy", m_tagID4NoiseOccupancy);
+    declareProperty("TagID4RawOccupancy",   m_tagID4RawOccupancy);
+    declareProperty("TagID4BSErrors",       m_tagID4BSErrors);
+    declareProperty("TagID4LorentzAngle",   m_tagID4LorentzAngle);
+
+  }
 
 ///////////////////////////////////////////////////////////////////////////////////////////
 
 StatusCode
-SCTCalibWriteTool::initialize() {
-   StatusCode sc = service("DetectorStore", m_detStore);
-   if ( !sc.isSuccess() || 0 == m_detStore) return msg(MSG:: ERROR) << "Could not find DetStore" << endmsg, StatusCode::FAILURE;
-   if (m_detStore->retrieve(m_pHelper,"SCT_ID").isFailure()) return msg(MSG:: ERROR) << "SCT mgr failed to retrieve" << endmsg, StatusCode::FAILURE;
-
-   ATH_CHECK(m_eventInfoKey.initialize());
-
-   // ------------------------------------------------------------
-   // The following is required for writing out something to COOL
-
-   // CondAttrListCollection to store table temporarily
-   m_attrListColl = new CondAttrListCollection(true);
-   m_attrListColl_deadStrip = new CondAttrListCollection(true);
-   m_attrListColl_deadChip = new CondAttrListCollection(true);
-   m_attrListColl_eff = new CondAttrListCollection(true);
-   m_attrListColl_no = new CondAttrListCollection(true);
-   m_attrListColl_RawOccu = new CondAttrListCollection(true);
-   m_attrListColl_BSErr = new CondAttrListCollection(true);
-   m_attrListColl_LA = new CondAttrListCollection(true);
-
-   // Get the IOVRegistrationSvc when needed
-   if (m_regIOV) {
-      if (service("IOVRegistrationSvc", m_regSvc).isFailure()) return msg(MSG:: ERROR)<< "Unable to find IOVRegistrationSvc "<< endmsg, StatusCode::FAILURE;
-   }
-   return StatusCode::SUCCESS;
+SCTCalibWriteTool::queryInterface(const InterfaceID& riid, void** ppvIF)
+{
+  if (SCTCalibWriteTool::interfaceID().versionMatch(riid) ) {
+    *ppvIF = static_cast<SCTCalibWriteTool*>(this);
+  } else {
+    return AthAlgTool::queryInterface(riid, ppvIF);
+  }
+  return StatusCode::SUCCESS;
 }
 
-//////////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////////
 
 StatusCode
-SCTCalibWriteTool::finalize() {
-   if (!m_defectRecorded) delete m_attrListColl;
-   if (!m_deadStripRecorded) delete m_attrListColl_deadStrip;
-   if (!m_deadChipRecorded) delete m_attrListColl_deadChip;
-   if (!m_effRecorded) delete m_attrListColl_eff;
-   if (!m_noRecorded) delete m_attrListColl_no;
-   if (!m_RawOccuRecorded) delete m_attrListColl_RawOccu;
-   if (!m_BSErrRecorded) delete m_attrListColl_BSErr;
-   if (!m_LARecorded) delete m_attrListColl_LA;
-   return StatusCode::SUCCESS;
+SCTCalibWriteTool::initialize() {
+  if (detStore()->retrieve(m_pHelper,"SCT_ID").isFailure()) {
+    ATH_MSG_ERROR("SCT mgr failed to retrieve");
+    return StatusCode::FAILURE;
+  }
+
+  ATH_CHECK(m_eventInfoKey.initialize());
+
+  // ------------------------------------------------------------
+  // The following is required for writing out something to COOL
+
+  // CondAttrListCollection to store table temporarily
+  m_attrListColl = new CondAttrListCollection{true};
+  m_attrListColl_deadStrip = new CondAttrListCollection{true};
+  m_attrListColl_deadChip = new CondAttrListCollection{true};
+  m_attrListColl_eff = new CondAttrListCollection{true};
+  m_attrListColl_no = new CondAttrListCollection{true};
+  m_attrListColl_RawOccu = new CondAttrListCollection{true};
+  m_attrListColl_BSErr = new CondAttrListCollection{true};
+  m_attrListColl_LA = new CondAttrListCollection{true};
+
+  // Get the IOVRegistrationSvc when needed
+  if (m_regIOV) {
+    if (service("IOVRegistrationSvc", m_regSvc).isFailure()) {
+      ATH_MSG_ERROR("Unable to find IOVRegistrationSvc ");
+      return StatusCode::FAILURE;
+    }
+  }
+  return StatusCode::SUCCESS;
 }
 
 //////////////////////////////////////////////////////////////////////////////////////////
 
 StatusCode
-SCTCalibWriteTool::queryInterface(const InterfaceID& riid, void** ppvIF)
-{
-   if(SCTCalibWriteTool::interfaceID().versionMatch(riid) ) {
-      *ppvIF = (SCTCalibWriteTool*)this;
-   } else {
-      return AthAlgTool::queryInterface(riid, ppvIF);
-   }
-   return StatusCode::SUCCESS;
+SCTCalibWriteTool::finalize() {
+  delete m_attrListColl;
+  delete m_attrListColl_deadStrip;
+  delete m_attrListColl_deadChip;
+  delete m_attrListColl_eff;
+  delete m_attrListColl_no;
+  delete m_attrListColl_RawOccu;
+  delete m_attrListColl_BSErr;
+  delete m_attrListColl_LA;
+  return StatusCode::SUCCESS;
 }
 
 //////////////////////////////////////////////////////////////////////////////////////////
 
 unsigned int
 SCTCalibWriteTool::computeIstrip4moncond(const Identifier& elementId) const {
-   unsigned int iiside = m_pHelper->side(elementId);
-   unsigned int iistrip = m_pHelper->strip(elementId);
-   return 768*iiside + iistrip;
-}
-
-StatusCode
-SCTCalibWriteTool::fillData() {
-   // this is a dummy function
-   return StatusCode::SUCCESS;
+  unsigned int iiside{static_cast<unsigned int>(m_pHelper->side(elementId))};
+  unsigned int iistrip{static_cast<unsigned int>(m_pHelper->strip(elementId))};
+  return 768*iiside + iistrip;
 }
 
 //////////////////////////////////////////////////////////////////////////////////////////
@@ -198,76 +179,76 @@ SCTCalibWriteTool::fillData() {
 //////////////////////////////////////////////////////////////////////////////////////////
 
 string
-SCTCalibWriteTool::addDefect(const string& defectlist,const int defectBeginChannel,const int defectEndChannel) const {
-   // check size of defect list,
-   // if it is empty then use createDefectString to make first entry.
-   if (defectlist.empty()) return createDefectString(defectBeginChannel,defectEndChannel);
-
-   // adding another Defect in DefectList
-   std::ostringstream defect;
-   defect << defectlist << " " << defectBeginChannel;
-   if (defectBeginChannel==defectEndChannel) {
-      defect << " ";
-   } else {
-      defect << "-" << defectEndChannel << " ";
-   }
-   return defect.str();
+SCTCalibWriteTool::addDefect(const string& defectlist, const int defectBeginChannel, const int defectEndChannel) const {
+  // check size of defect list,
+  // if it is empty then use createDefectString to make first entry.
+  if (defectlist.empty()) return createDefectString(defectBeginChannel, defectEndChannel);
+
+  // adding another Defect in DefectList
+  std::ostringstream defect;
+  defect << defectlist << " " << defectBeginChannel;
+  if (defectBeginChannel==defectEndChannel) {
+    defect << " ";
+  } else {
+    defect << "-" << defectEndChannel << " ";
+  }
+  return defect.str();
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////
 
 std::string
-SCTCalibWriteTool::createDefectString(const int defectBeginChannel,const int defectEndChannel) const {
-   std::ostringstream defect;
-   defect << " " << defectBeginChannel;
-   if (defectBeginChannel!=defectEndChannel) {
-      defect << "-" << defectEndChannel;
-   }
-   defect << " ";
-   return defect.str();
+SCTCalibWriteTool::createDefectString(const int defectBeginChannel, const int defectEndChannel) const {
+  std::ostringstream defect;
+  defect << " " << defectBeginChannel;
+  if (defectBeginChannel!=defectEndChannel) {
+    defect << "-" << defectEndChannel;
+  }
+  defect << " ";
+  return defect.str();
 }
 
 
 ///////////////////////////////////////////////////////////////////////////////////////
 
 std::string
-SCTCalibWriteTool::addNumber(const string numStr,const unsigned long long number) const {
-   std::ostringstream num_string;
-   // if it is empty then use createDefectString to make first entry.
-   if (numStr.empty()) {
-      num_string << number;
-   } else { // adding another number to numStr
-      num_string << numStr << " " << number;
-   }
-   return num_string.str();
+SCTCalibWriteTool::addNumber(const string numStr, const unsigned long long number) const {
+  std::ostringstream num_string;
+  // if it is empty then use createDefectString to make first entry.
+  if (numStr.empty()) {
+    num_string << number;
+  } else { // adding another number to numStr
+    num_string << numStr << " " << number;
+  }
+  return num_string.str();
 }
 
 /////////////////////////////////////////////////////////////////////////////////////////////
 
 StatusCode
-SCTCalibWriteTool::createCondObjects(const Identifier& wafer_id,const SCT_ID* sctId,const int samplesize,const std::string & defectType,const float threshold,const std::string & defectList) const {
-   if (!m_writeCondObjs) {
-      return StatusCode::SUCCESS;
-   }
-   coral::AttributeListSpecification* attrSpec =createBasicDbSpec(becCapsFormat);
-   attrSpec->extend("DefectType","string");
-   attrSpec->extend("Threshold","float");
-   attrSpec->extend("DefectList","string");
-
-   if (!attrSpec->size()) {
-      msg(MSG:: ERROR) << " Attribute list specification is empty" <<endmsg;
-      return StatusCode::FAILURE;
-   }
-
-   coral::AttributeList attrList0(*attrSpec);
-   setBasicValues(attrList0, wafer_id, samplesize,sctId,becCapsFormat);
-   attrList0["DefectType"].setValue(static_cast<std::string>(defectType));
-   attrList0["Threshold"].setValue(static_cast<float>(threshold));
-   attrList0["DefectList"].setValue(static_cast<std::string>(defectList));
-   std::ostringstream attrStr2;
-   attrList0.toOutputStream( attrStr2 );
-   m_attrListColl->add(wafer_id.get_identifier32().get_compact(), attrList0);
-   return StatusCode::SUCCESS;
+SCTCalibWriteTool::createCondObjects(const Identifier& wafer_id, const SCT_ID* sctId, const int samplesize, const std::string& defectType, const float threshold, const std::string& defectList) const {
+  if (!m_writeCondObjs) {
+    return StatusCode::SUCCESS;
+  }
+  coral::AttributeListSpecification* attrSpec{createBasicDbSpec(becCapsFormat)};
+  attrSpec->extend("DefectType", "string");
+  attrSpec->extend("Threshold", "float");
+  attrSpec->extend("DefectList", "string");
+
+  if (!attrSpec->size()) {
+    ATH_MSG_ERROR(" Attribute list specification is empty");
+    return StatusCode::FAILURE;
+  }
+
+  coral::AttributeList attrList0{*attrSpec};
+  setBasicValues(attrList0, wafer_id, samplesize,sctId,becCapsFormat);
+  attrList0["DefectType"].setValue(static_cast<std::string>(defectType));
+  attrList0["Threshold"].setValue(static_cast<float>(threshold));
+  attrList0["DefectList"].setValue(static_cast<std::string>(defectList));
+  std::ostringstream attrStr2;
+  attrList0.toOutputStream(attrStr2);
+  m_attrListColl->add(wafer_id.get_identifier32().get_compact(), attrList0);
+  return StatusCode::SUCCESS;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -276,483 +257,482 @@ StatusCode
 SCTCalibWriteTool::createListStrip(const Identifier& wafer_id,
                                    const SCT_ID* sctId,
                                    const int samplesize,
-                                   const std::string & defectType,
+                                   const std::string& defectType,
                                    const float threshold,
-                                   const std::string & defectList) const
+                                   const std::string& defectList) const
 {
-   if (!m_writeCondObjs) {
-      return StatusCode::SUCCESS;
-   }
-   coral::AttributeListSpecification* attrSpec =createBasicDbSpec(becCapsFormat);
-   attrSpec->extend("DefectType","string");
-   attrSpec->extend("Threshold","float");
-   attrSpec->extend("DefectList","string");
-
-   if (!attrSpec->size()) {
-      msg(MSG:: ERROR) << " Attribute list specification is empty" <<endmsg;
-      return StatusCode::FAILURE;
-   }
-
-   coral::AttributeList attrList0(*attrSpec);
-   setBasicValues(attrList0, wafer_id, samplesize,sctId, becCapsFormat);
-   attrList0["DefectType"].setValue(static_cast<std::string>(defectType));
-   attrList0["Threshold"].setValue(static_cast<float>(threshold));
-   attrList0["DefectList"].setValue(static_cast<std::string>(defectList));
-
-   std::ostringstream attrStr2;
-   attrList0.toOutputStream( attrStr2 );
-   m_attrListColl_deadStrip->add(wafer_id.get_identifier32().get_compact(), attrList0);
-   msg(MSG::INFO)<<"createListStrip: return StatusCode::SUCCESS"<<endmsg;
-   return StatusCode::SUCCESS;
+  if (!m_writeCondObjs) {
+    return StatusCode::SUCCESS;
+  }
+  coral::AttributeListSpecification* attrSpec{createBasicDbSpec(becCapsFormat)};
+  attrSpec->extend("DefectType", "string");
+  attrSpec->extend("Threshold", "float");
+  attrSpec->extend("DefectList", "string");
+
+  if (!attrSpec->size()) {
+    ATH_MSG_ERROR(" Attribute list specification is empty");
+    return StatusCode::FAILURE;
+  }
+
+  coral::AttributeList attrList0{*attrSpec};
+  setBasicValues(attrList0, wafer_id, samplesize, sctId, becCapsFormat);
+  attrList0["DefectType"].setValue(static_cast<std::string>(defectType));
+  attrList0["Threshold"].setValue(static_cast<float>(threshold));
+  attrList0["DefectList"].setValue(static_cast<std::string>(defectList));
+
+  std::ostringstream attrStr2;
+  attrList0.toOutputStream(attrStr2);
+  m_attrListColl_deadStrip->add(wafer_id.get_identifier32().get_compact(), attrList0);
+  ATH_MSG_INFO("createListStrip: return StatusCode::SUCCESS");
+  return StatusCode::SUCCESS;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 
 StatusCode
-SCTCalibWriteTool::createListChip(const Identifier& wafer_id,const SCT_ID* sctId,const int samplesize,const std::string & defectType,const float threshold,const std::string & defectList) const {
-   if (!m_writeCondObjs) {
-      return StatusCode::SUCCESS;
-   }
-   coral::AttributeListSpecification* attrSpec =createBasicDbSpec(becCapsFormat);
-   attrSpec->extend("DefectType","string");
-   attrSpec->extend("Threshold","float");
-   attrSpec->extend("DefectList","string");
-   if (!attrSpec->size()) {
-      msg(MSG:: ERROR) << " Attribute list specification is empty" <<endmsg;
-      return StatusCode::FAILURE;
-   }
-
-   // Add three attr lists
-   coral::AttributeList attrList0(*attrSpec);
-   setBasicValues(attrList0, wafer_id, samplesize,sctId, becCapsFormat);
-   attrList0["DefectType"].setValue(static_cast<std::string>(defectType));
-   attrList0["Threshold"].setValue(static_cast<float>(threshold));
-   attrList0["DefectList"].setValue(static_cast<std::string>(defectList));
-
-   std::ostringstream attrStr2;
-   attrList0.toOutputStream( attrStr2 );
-   m_attrListColl_deadChip->add(wafer_id.get_identifier32().get_compact(), attrList0);
-
-   return StatusCode::SUCCESS;
+SCTCalibWriteTool::createListChip(const Identifier& wafer_id, const SCT_ID* sctId, const int samplesize, const std::string& defectType, const float threshold, const std::string& defectList) const {
+  if (!m_writeCondObjs) {
+    return StatusCode::SUCCESS;
+  }
+  coral::AttributeListSpecification* attrSpec{createBasicDbSpec(becCapsFormat)};
+  attrSpec->extend("DefectType", "string");
+  attrSpec->extend("Threshold", "float");
+  attrSpec->extend("DefectList", "string");
+  if (!attrSpec->size()) {
+    ATH_MSG_ERROR(" Attribute list specification is empty");
+    return StatusCode::FAILURE;
+  }
+
+  // Add three attr lists
+  coral::AttributeList attrList0{*attrSpec};
+  setBasicValues(attrList0, wafer_id, samplesize, sctId, becCapsFormat);
+  attrList0["DefectType"].setValue(static_cast<std::string>(defectType));
+  attrList0["Threshold"].setValue(static_cast<float>(threshold));
+  attrList0["DefectList"].setValue(static_cast<std::string>(defectList));
+
+  std::ostringstream attrStr2;
+  attrList0.toOutputStream(attrStr2);
+  m_attrListColl_deadChip->add(wafer_id.get_identifier32().get_compact(), attrList0);
+
+  return StatusCode::SUCCESS;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 
 StatusCode
-SCTCalibWriteTool::createListEff(const Identifier& wafer_id,const SCT_ID* sctId,const int samplesize,const float eff) const {
-   if(!m_writeCondObjs) {
-      return StatusCode::SUCCESS;
-   }
+SCTCalibWriteTool::createListEff(const Identifier& wafer_id,const SCT_ID* sctId, const int samplesize, const float eff) const {
+  if (!m_writeCondObjs) {
+    return StatusCode::SUCCESS;
+  }
 
-   coral::AttributeListSpecification* attrSpec =createBasicDbSpec(becUnderscoreFormat);
-   attrSpec->extend("Efficiency", "float");
-   if (!attrSpec->size()) {
-      msg(MSG:: ERROR) << " Attribute list specification is empty" <<endmsg;
-      return(StatusCode::FAILURE);
-   }
+  coral::AttributeListSpecification* attrSpec{createBasicDbSpec(becUnderscoreFormat)};
+  attrSpec->extend("Efficiency", "float");
+  if (!attrSpec->size()) {
+    ATH_MSG_ERROR(" Attribute list specification is empty");
+    return StatusCode::FAILURE;
+  }
 
-   coral::AttributeList attrList0(*attrSpec);
-   setBasicValues(attrList0, wafer_id, samplesize,sctId,becUnderscoreFormat);
-   attrList0["Efficiency"].setValue(static_cast<float>(eff));
+  coral::AttributeList attrList0{*attrSpec};
+  setBasicValues(attrList0, wafer_id, samplesize,sctId,becUnderscoreFormat);
+  attrList0["Efficiency"].setValue(static_cast<float>(eff));
 
-   std::ostringstream attrStr2;
-   attrList0.toOutputStream(attrStr2);
-   m_attrListColl_eff->add(wafer_id.get_identifier32().get_compact(), attrList0);
+  std::ostringstream attrStr2;
+  attrList0.toOutputStream(attrStr2);
+  m_attrListColl_eff->add(wafer_id.get_identifier32().get_compact(), attrList0);
 
-   return StatusCode::SUCCESS;
+  return StatusCode::SUCCESS;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////
 
 StatusCode
-SCTCalibWriteTool::createListNO(const Identifier& wafer_id,const SCT_ID* sctId,const int samplesize,const float noise_occ) const {
-   if (!m_writeCondObjs) {
-      return StatusCode::SUCCESS;
-   }
-   coral::AttributeListSpecification* attrSpec =createBasicDbSpec(becUnderscoreFormat);
-   attrSpec->extend("NoiseOccupancy", "float");
-   if (!attrSpec->size()) {
-      msg(MSG:: ERROR) << " Attribute list specification is empty" <<endmsg;
-      return StatusCode::FAILURE;
-   }
-   // Add three attr lists
-   coral::AttributeList attrList0(*attrSpec);
-   setBasicValues(attrList0, wafer_id, samplesize,sctId,becUnderscoreFormat);
-   attrList0["NoiseOccupancy"].setValue(static_cast<float>(noise_occ));
-   std::ostringstream attrStr2;
-   attrList0.toOutputStream(attrStr2);
-   m_attrListColl_no->add(wafer_id.get_identifier32().get_compact(), attrList0);
-   return StatusCode::SUCCESS;
+SCTCalibWriteTool::createListNO(const Identifier& wafer_id, const SCT_ID* sctId, const int samplesize, const float noise_occ) const {
+  if (!m_writeCondObjs) {
+    return StatusCode::SUCCESS;
+  }
+  coral::AttributeListSpecification* attrSpec{createBasicDbSpec(becUnderscoreFormat)};
+  attrSpec->extend("NoiseOccupancy", "float");
+  if (!attrSpec->size()) {
+    ATH_MSG_ERROR(" Attribute list specification is empty");
+    return StatusCode::FAILURE;
+  }
+  // Add three attr lists
+  coral::AttributeList attrList0{*attrSpec};
+  setBasicValues(attrList0, wafer_id, samplesize, sctId, becUnderscoreFormat);
+  attrList0["NoiseOccupancy"].setValue(static_cast<float>(noise_occ));
+  std::ostringstream attrStr2;
+  attrList0.toOutputStream(attrStr2);
+  m_attrListColl_no->add(wafer_id.get_identifier32().get_compact(), attrList0);
+  return StatusCode::SUCCESS;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////
 
 StatusCode
-SCTCalibWriteTool::createListRawOccu(const Identifier& wafer_id,const SCT_ID* sctId,const int samplesize,const float raw_occu) const {
-   if (!m_writeCondObjs) {
-      return StatusCode::SUCCESS;
-   }
-   coral::AttributeListSpecification* attrSpec =createBasicDbSpec(becUnderscoreFormat);
-   attrSpec->extend("RawOccupancy", "float");
-   if (!attrSpec->size()) {
-      msg(MSG:: ERROR) << " Attribute list specification is empty" <<endmsg;
-      return StatusCode::FAILURE;
-   }
-   // Add three attr lists
-   coral::AttributeList attrList0(*attrSpec);
-   setBasicValues(attrList0, wafer_id, samplesize, sctId,becUnderscoreFormat);
-   attrList0["RawOccupancy"].setValue(static_cast<float>(raw_occu));
-   std::ostringstream attrStr2;
-   attrList0.toOutputStream(attrStr2);
-   m_attrListColl_RawOccu->add(wafer_id.get_identifier32().get_compact(), attrList0);
-   return StatusCode::SUCCESS;
+SCTCalibWriteTool::createListRawOccu(const Identifier& wafer_id, const SCT_ID* sctId, const int samplesize, const float raw_occu) const {
+  if (!m_writeCondObjs) {
+    return StatusCode::SUCCESS;
+  }
+  coral::AttributeListSpecification* attrSpec{createBasicDbSpec(becUnderscoreFormat)};
+  attrSpec->extend("RawOccupancy", "float");
+  if (!attrSpec->size()) {
+    ATH_MSG_ERROR(" Attribute list specification is empty");
+    return StatusCode::FAILURE;
+  }
+  // Add three attr lists
+  coral::AttributeList attrList0{*attrSpec};
+  setBasicValues(attrList0, wafer_id, samplesize, sctId,becUnderscoreFormat);
+  attrList0["RawOccupancy"].setValue(static_cast<float>(raw_occu));
+  std::ostringstream attrStr2;
+  attrList0.toOutputStream(attrStr2);
+  m_attrListColl_RawOccu->add(wafer_id.get_identifier32().get_compact(), attrList0);
+  return StatusCode::SUCCESS;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////
 
 StatusCode
-SCTCalibWriteTool::createListBSErr(const Identifier& wafer_id,const SCT_ID* sctId,const int samplesize,const std::string & errorList,const std::string & probList) const {
-   if (!m_writeCondObjs) {
-      return StatusCode::SUCCESS;
-   }
-
-   int eta = sctId->eta_module(wafer_id);
-   int phi = sctId->phi_module(wafer_id);
-   int barrel_ec = sctId->barrel_ec(wafer_id);
-   int layer = sctId->layer_disk(wafer_id);
-
-   coral::AttributeListSpecification* attrSpec =
-      new coral::AttributeListSpecification();
-   attrSpec->extend("SampleSize", "int");
-   attrSpec->extend("barrel_endcap", "int");
-   attrSpec->extend("Layer", "int");
-   attrSpec->extend("Eta", "int");
-   attrSpec->extend("Phi", "int");
-   attrSpec->extend("BSErrors", "string");
-   attrSpec->extend("BadFraction", "string");
-
-   if (!attrSpec->size()) {
-      msg(MSG:: ERROR) << " Attribute list specification is empty" <<endmsg;
-      return StatusCode::FAILURE;
-   }
-
-   // Add three attr lists
-   coral::AttributeList attrList0(*attrSpec);
-   attrList0["SampleSize"].setValue(static_cast<int>(samplesize));
-   attrList0["barrel_endcap"].setValue(static_cast<int>(barrel_ec));
-   attrList0["Layer"].setValue(static_cast<int>(layer));
-   attrList0["Phi"].setValue(static_cast<int>(phi));
-   attrList0["Eta"].setValue(static_cast<int>(eta));
-   attrList0["BSErrors"].setValue(static_cast<std::string>(errorList));
-   attrList0["BadFraction"].setValue(static_cast<std::string>(probList));
-
-   std::ostringstream attrStr2;
-   attrList0.toOutputStream(attrStr2);
-   m_attrListColl_BSErr->add(wafer_id.get_identifier32().get_compact(), attrList0);
-   return StatusCode::SUCCESS;
+SCTCalibWriteTool::createListBSErr(const Identifier& wafer_id,const SCT_ID* sctId,const int samplesize, const std::string& errorList, const std::string& probList) const {
+  if (!m_writeCondObjs) {
+    return StatusCode::SUCCESS;
+  }
+
+  int eta{sctId->eta_module(wafer_id)};
+  int phi{sctId->phi_module(wafer_id)};
+  int barrel_ec{sctId->barrel_ec(wafer_id)};
+  int layer{sctId->layer_disk(wafer_id)};
+
+  coral::AttributeListSpecification* attrSpec{new coral::AttributeListSpecification{}};
+  attrSpec->extend("SampleSize", "int");
+  attrSpec->extend("barrel_endcap", "int");
+  attrSpec->extend("Layer", "int");
+  attrSpec->extend("Eta", "int");
+  attrSpec->extend("Phi", "int");
+  attrSpec->extend("BSErrors", "string");
+  attrSpec->extend("BadFraction", "string");
+
+  if (!attrSpec->size()) {
+    ATH_MSG_ERROR(" Attribute list specification is empty");
+    return StatusCode::FAILURE;
+  }
+
+  // Add three attr lists
+  coral::AttributeList attrList0{*attrSpec};
+  attrList0["SampleSize"].setValue(static_cast<int>(samplesize));
+  attrList0["barrel_endcap"].setValue(static_cast<int>(barrel_ec));
+  attrList0["Layer"].setValue(static_cast<int>(layer));
+  attrList0["Phi"].setValue(static_cast<int>(phi));
+  attrList0["Eta"].setValue(static_cast<int>(eta));
+  attrList0["BSErrors"].setValue(static_cast<std::string>(errorList));
+  attrList0["BadFraction"].setValue(static_cast<std::string>(probList));
+
+  std::ostringstream attrStr2;
+  attrList0.toOutputStream(attrStr2);
+  m_attrListColl_BSErr->add(wafer_id.get_identifier32().get_compact(), attrList0);
+  return StatusCode::SUCCESS;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////
 
 StatusCode
-SCTCalibWriteTool::createListLA(const Identifier& wafer_id,const SCT_ID* sctId,const int samplesize,int module, const float lorentz, const float err_lorentz, const float chisq, const float fitParam_a, const float err_a, const float fitParam_b, const float err_b, const float fitParam_sigma, const float err_sigma, const float MCW, const float err_MCW ) const {
-   if (!m_writeCondObjs) return StatusCode::SUCCESS;
-   int barrel_ec = sctId->barrel_ec(wafer_id);
-   int layer = sctId->layer_disk(wafer_id);
-   int side = sctId->side(wafer_id);
-
-   coral::AttributeListSpecification* attrSpec =new coral::AttributeListSpecification();
-   attrSpec->extend("SampleSize", "int");
-   attrSpec->extend("barrel_endcap", "int");
-   attrSpec->extend("Layer", "int");
-   attrSpec->extend("Side", "int");
-   attrSpec->extend("moduleType", "int");
-   attrSpec->extend("lorentzAngle", "float");
-   attrSpec->extend("err_lorentzAngle", "float");
-   attrSpec->extend("chisq", "float");
-   attrSpec->extend("fitParam_a", "float");
-   attrSpec->extend("err_a", "float");
-   attrSpec->extend("fitParam_b", "float");
-   attrSpec->extend("err_b", "float");
-   attrSpec->extend("fitParam_sigma", "float");
-   attrSpec->extend("err_sigma", "float");
-   attrSpec->extend("minClusterWidth", "float");
-   attrSpec->extend("err_minClusterWidth", "float");
-
-   if (!attrSpec->size()) {
-      msg(MSG:: ERROR) << " Attribute list specification is empty" <<endmsg;
-      return StatusCode::FAILURE;
-   }
-
-   // Add three attr lists
-   coral::AttributeList attrList0(*attrSpec);
-   attrList0["SampleSize"].setValue(static_cast<int>(samplesize));
-   attrList0["barrel_endcap"].setValue(static_cast<int>(barrel_ec));
-   attrList0["Layer"].setValue(static_cast<int>(layer));
-   attrList0["Side"].setValue(static_cast<int>(side));
-   attrList0["moduleType"].setValue(static_cast<int>(module));
-   attrList0["lorentzAngle"].setValue(static_cast<float>(lorentz));
-   attrList0["err_lorentzAngle"].setValue(static_cast<float>(err_lorentz));
-   attrList0["chisq"].setValue(static_cast<float>(chisq));
-   attrList0["fitParam_a"].setValue(static_cast<float>(fitParam_a));
-   attrList0["err_a"].setValue(static_cast<float>(err_a));
-   attrList0["fitParam_b"].setValue(static_cast<float>(fitParam_b));
-   attrList0["err_b"].setValue(static_cast<float>(err_b));
-   attrList0["fitParam_sigma"].setValue(static_cast<float>(fitParam_sigma));
-   attrList0["err_sigma"].setValue(static_cast<float>(err_sigma));
-   attrList0["minClusterWidth"].setValue(static_cast<float>(MCW));
-   attrList0["err_minClusterWidth"].setValue(static_cast<float>(err_MCW));
-
-   std::ostringstream attrStr2;
-   attrList0.toOutputStream(attrStr2);
-   m_attrListColl_LA->add(wafer_id.get_identifier32().get_compact(), attrList0);
-
-   return StatusCode::SUCCESS;
+SCTCalibWriteTool::createListLA(const Identifier& wafer_id,const SCT_ID* sctId,const int samplesize,int module, const float lorentz, const float err_lorentz, const float chisq, const float fitParam_a, const float err_a, const float fitParam_b, const float err_b, const float fitParam_sigma, const float err_sigma, const float MCW, const float err_MCW) const {
+  if (!m_writeCondObjs) return StatusCode::SUCCESS;
+  int barrel_ec{sctId->barrel_ec(wafer_id)};
+  int layer{sctId->layer_disk(wafer_id)};
+  int side{sctId->side(wafer_id)};
+
+  coral::AttributeListSpecification* attrSpec{new coral::AttributeListSpecification{}};
+  attrSpec->extend("SampleSize", "int");
+  attrSpec->extend("barrel_endcap", "int");
+  attrSpec->extend("Layer", "int");
+  attrSpec->extend("Side", "int");
+  attrSpec->extend("moduleType", "int");
+  attrSpec->extend("lorentzAngle", "float");
+  attrSpec->extend("err_lorentzAngle", "float");
+  attrSpec->extend("chisq", "float");
+  attrSpec->extend("fitParam_a", "float");
+  attrSpec->extend("err_a", "float");
+  attrSpec->extend("fitParam_b", "float");
+  attrSpec->extend("err_b", "float");
+  attrSpec->extend("fitParam_sigma", "float");
+  attrSpec->extend("err_sigma", "float");
+  attrSpec->extend("minClusterWidth", "float");
+  attrSpec->extend("err_minClusterWidth", "float");
+
+  if (!attrSpec->size()) {
+    ATH_MSG_ERROR(" Attribute list specification is empty");
+    return StatusCode::FAILURE;
+  }
+
+  // Add three attr lists
+  coral::AttributeList attrList0{*attrSpec};
+  attrList0["SampleSize"].setValue(static_cast<int>(samplesize));
+  attrList0["barrel_endcap"].setValue(static_cast<int>(barrel_ec));
+  attrList0["Layer"].setValue(static_cast<int>(layer));
+  attrList0["Side"].setValue(static_cast<int>(side));
+  attrList0["moduleType"].setValue(static_cast<int>(module));
+  attrList0["lorentzAngle"].setValue(static_cast<float>(lorentz));
+  attrList0["err_lorentzAngle"].setValue(static_cast<float>(err_lorentz));
+  attrList0["chisq"].setValue(static_cast<float>(chisq));
+  attrList0["fitParam_a"].setValue(static_cast<float>(fitParam_a));
+  attrList0["err_a"].setValue(static_cast<float>(err_a));
+  attrList0["fitParam_b"].setValue(static_cast<float>(fitParam_b));
+  attrList0["err_b"].setValue(static_cast<float>(err_b));
+  attrList0["fitParam_sigma"].setValue(static_cast<float>(fitParam_sigma));
+  attrList0["err_sigma"].setValue(static_cast<float>(err_sigma));
+  attrList0["minClusterWidth"].setValue(static_cast<float>(MCW));
+  attrList0["err_minClusterWidth"].setValue(static_cast<float>(err_MCW));
+
+  std::ostringstream attrStr2;
+  attrList0.toOutputStream(attrStr2);
+  m_attrListColl_LA->add(wafer_id.get_identifier32().get_compact(), attrList0);
+
+  return StatusCode::SUCCESS;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////
 
 const CondAttrListCollection*
 SCTCalibWriteTool::getAttrListCollectionByFolder(const string& foldername) const {
-   std::lock_guard<std::mutex> lock(m_mutex);
-   // trying to find the pointer in the hashmap
-   // if it exists, return it, otherwise put it in.
-   const CondAttrListCollection* nullPtr(0);
-   const CondAttrListCollection* attrListCollection = nullPtr;
-   if (m_attrListCollectionMap.count(foldername) == 0) {
-      if ( m_detStore->retrieve(attrListCollection, foldername).isFailure()) return  msg(MSG:: ERROR)<< "Could not retrieve " << foldername << endmsg, nullPtr;
-      m_attrListCollectionMap.insert(make_pair(foldername, attrListCollection));
-   } else {
-      attrListCollection = m_attrListCollectionMap[foldername];
-   }
-   return attrListCollection;
+  std::lock_guard<std::mutex> lock{m_mutex};
+  // trying to find the pointer in the hashmap
+  // if it exists, return it, otherwise put it in.
+  const CondAttrListCollection* attrListCollection{nullptr};
+  if (m_attrListCollectionMap.count(foldername) == 0) {
+    if (detStore()->retrieve(attrListCollection, foldername).isFailure()) {
+      ATH_MSG_ERROR("Could not retrieve " << foldername);
+      return nullptr;
+    }
+    m_attrListCollectionMap.insert(make_pair(foldername, attrListCollection));
+  } else {
+    attrListCollection = m_attrListCollectionMap[foldername];
+  }
+  return attrListCollection;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////
 
 int
 SCTCalibWriteTool::stringToInt(const std::string& s) const {
-   return atoi(s.c_str());
+  return atoi(s.c_str());
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////
 
 StatusCode
 SCTCalibWriteTool::wrapUpNoisyChannel() {
-   if (recordAndStream(m_attrListColl,s_defectFolderName,m_defectRecorded).isFailure()) return StatusCode::FAILURE;
-   if (registerCondObjectsWithErrMsg(s_defectFolderName, m_tagID4NoisyStrips).isFailure()) return StatusCode::FAILURE;
-   return StatusCode::SUCCESS;
+  if (recordAndStream(m_attrListColl, s_defectFolderName, m_defectRecorded).isFailure()) return StatusCode::FAILURE;
+  if (registerCondObjectsWithErrMsg(s_defectFolderName, m_tagID4NoisyStrips).isFailure()) return StatusCode::FAILURE;
+  return StatusCode::SUCCESS;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////
 
 StatusCode
 SCTCalibWriteTool::wrapUpDeadStrips() {
-   if ( recordAndStream(m_attrListColl_deadStrip,s_deadStripFolderName,m_deadStripRecorded).isFailure()) return  StatusCode::FAILURE;
-   if (registerCondObjectsWithErrMsg(s_deadStripFolderName, m_tagID4DeadStrips).isFailure()) return StatusCode::FAILURE;
-   return StatusCode::SUCCESS;
+  if (recordAndStream(m_attrListColl_deadStrip, s_deadStripFolderName, m_deadStripRecorded).isFailure()) return  StatusCode::FAILURE;
+  if (registerCondObjectsWithErrMsg(s_deadStripFolderName, m_tagID4DeadStrips).isFailure()) return StatusCode::FAILURE;
+  return StatusCode::SUCCESS;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////
 StatusCode
 
 SCTCalibWriteTool::wrapUpDeadChips() {
-   if (recordAndStream(m_attrListColl_deadChip,s_deadChipFolderName,m_deadChipRecorded).isFailure())  return StatusCode::FAILURE;
-   if (registerCondObjectsWithErrMsg(s_deadChipFolderName, m_tagID4DeadChips).isFailure()) return StatusCode::FAILURE;
-   return StatusCode::SUCCESS;
+  if (recordAndStream(m_attrListColl_deadChip, s_deadChipFolderName, m_deadChipRecorded).isFailure())  return StatusCode::FAILURE;
+  if (registerCondObjectsWithErrMsg(s_deadChipFolderName, m_tagID4DeadChips).isFailure()) return StatusCode::FAILURE;
+  return StatusCode::SUCCESS;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////
 
 StatusCode 
 SCTCalibWriteTool::wrapUpEfficiency() {
-   if (recordAndStream(m_attrListColl_eff, s_effFolderName,m_effRecorded).isFailure()) return StatusCode::FAILURE;
-   if (registerCondObjectsWithErrMsg(s_effFolderName, m_tagID4Efficiency).isFailure()) return StatusCode::FAILURE;
-   return StatusCode::SUCCESS;
+  if (recordAndStream(m_attrListColl_eff, s_effFolderName, m_effRecorded).isFailure()) return StatusCode::FAILURE;
+  if (registerCondObjectsWithErrMsg(s_effFolderName, m_tagID4Efficiency).isFailure()) return StatusCode::FAILURE;
+  return StatusCode::SUCCESS;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////
 
 StatusCode 
 SCTCalibWriteTool::wrapUpNoiseOccupancy() {
-   if (recordAndStream(m_attrListColl_no, s_noFolderName,m_noRecorded).isFailure()) return StatusCode::FAILURE;
-   if (registerCondObjectsWithErrMsg(s_noFolderName, m_tagID4NoiseOccupancy).isFailure()) return StatusCode::FAILURE;
-   return StatusCode::SUCCESS;
+  if (recordAndStream(m_attrListColl_no, s_noFolderName, m_noRecorded).isFailure()) return StatusCode::FAILURE;
+  if (registerCondObjectsWithErrMsg(s_noFolderName, m_tagID4NoiseOccupancy).isFailure()) return StatusCode::FAILURE;
+  return StatusCode::SUCCESS;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////
 
 StatusCode 
 SCTCalibWriteTool::wrapUpRawOccupancy() {
-   if (recordAndStream(m_attrListColl_RawOccu, s_RawOccuFolderName,m_RawOccuRecorded).isFailure()) return StatusCode::FAILURE;
-   if( registerCondObjectsWithErrMsg(s_RawOccuFolderName, m_tagID4RawOccupancy).isFailure()) return StatusCode::FAILURE;
-   return StatusCode::SUCCESS;
+  if (recordAndStream(m_attrListColl_RawOccu, s_RawOccuFolderName, m_RawOccuRecorded).isFailure()) return StatusCode::FAILURE;
+  if (registerCondObjectsWithErrMsg(s_RawOccuFolderName, m_tagID4RawOccupancy).isFailure()) return StatusCode::FAILURE;
+  return StatusCode::SUCCESS;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////
 
 StatusCode 
 SCTCalibWriteTool::wrapUpBSErrors() {
-   if (recordAndStream(m_attrListColl_BSErr, s_BSErrFolderName,m_BSErrRecorded).isFailure()) return StatusCode::FAILURE;
-   if (registerCondObjectsWithErrMsg(s_BSErrFolderName, m_tagID4BSErrors).isFailure()) return StatusCode::FAILURE;
-   return StatusCode::SUCCESS;
+  if (recordAndStream(m_attrListColl_BSErr, s_BSErrFolderName, m_BSErrRecorded).isFailure()) return StatusCode::FAILURE;
+  if (registerCondObjectsWithErrMsg(s_BSErrFolderName, m_tagID4BSErrors).isFailure()) return StatusCode::FAILURE;
+  return StatusCode::SUCCESS;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////
 
 StatusCode 
 SCTCalibWriteTool::wrapUpLorentzAngle() {
-   if (recordAndStream(m_attrListColl_LA, s_LAFolderName,m_LARecorded).isFailure()) return StatusCode::FAILURE;
-   if( registerCondObjectsWithErrMsg(s_LAFolderName, m_tagID4LorentzAngle).isFailure()) return StatusCode::FAILURE;
-   return StatusCode::SUCCESS;
+  if (recordAndStream(m_attrListColl_LA, s_LAFolderName, m_LARecorded).isFailure()) return StatusCode::FAILURE;
+  if (registerCondObjectsWithErrMsg(s_LAFolderName, m_tagID4LorentzAngle).isFailure()) return StatusCode::FAILURE;
+  return StatusCode::SUCCESS;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////
 
 StatusCode 
 SCTCalibWriteTool::streamOutCondObjects(const std::string& foldername) {
-   //if (m_streamer->connectOutput().isFailure()) {
-   if (m_streamer->connectOutput(m_streamName).isFailure()) {
-      msg(MSG:: ERROR) <<"Could not connect stream to output" <<endmsg;
-      return( StatusCode::FAILURE);
-   }
-   IAthenaOutputStreamTool::TypeKeyPairs typeKeys(1);
-   if (m_readWriteCool) {
-      IAthenaOutputStreamTool::TypeKeyPair
-      attrCollPair("CondAttrListCollection",foldername);
-      typeKeys[0] = attrCollPair;
-   }
-
-   if (m_streamer->streamObjects(typeKeys).isFailure()) {
-      msg(MSG:: ERROR) << "Could not stream out AttributeLists" << endmsg;
-      return StatusCode::FAILURE;
-   }
-
-   if (m_streamer->commitOutput().isFailure()) {
-      msg(MSG:: ERROR) << "Could not commit output stream" << endmsg;
-      return StatusCode::FAILURE;
-   }
-   return StatusCode::SUCCESS;
+  if (m_streamer->connectOutput(m_streamName).isFailure()) {
+    ATH_MSG_ERROR("Could not connect stream to output");
+    return( StatusCode::FAILURE);
+  }
+  IAthenaOutputStreamTool::TypeKeyPairs typeKeys{1};
+  if (m_readWriteCool) {
+    IAthenaOutputStreamTool::TypeKeyPair
+      attrCollPair{"CondAttrListCollection", foldername};
+    typeKeys[0] = attrCollPair;
+  }
+
+  if (m_streamer->streamObjects(typeKeys).isFailure()) {
+    ATH_MSG_ERROR("Could not stream out AttributeLists");
+    return StatusCode::FAILURE;
+  }
+
+  if (m_streamer->commitOutput().isFailure()) {
+    ATH_MSG_ERROR("Could not commit output stream");
+    return StatusCode::FAILURE;
+  }
+  return StatusCode::SUCCESS;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////
 
 StatusCode
 SCTCalibWriteTool::streamOutCondObjectsWithErrMsg(const std::string& foldername) {
-   if (streamOutCondObjects(foldername).isFailure()) {
-      return msg(MSG:: ERROR) <<"Could create conditions object  "<< foldername<< endmsg, StatusCode::FAILURE;
-   }
-   return StatusCode::SUCCESS;
+  if (streamOutCondObjects(foldername).isFailure()) {
+    ATH_MSG_ERROR("Could create conditions object  " << foldername);
+    return StatusCode::FAILURE;
+  }
+  return StatusCode::SUCCESS;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////
 
 StatusCode
-SCTCalibWriteTool::registerCondObjects(const std::string& foldername,const std::string& tagname) {
-   // Register the IOV DB with the conditions data written out
-   if (m_readWriteCool) {
-      // Can only write out AttrList's if this is NOT write and reg in two steps
-      if (!m_twoStepWriteReg) {
-         // Using COOL, write out attrlist and collection of attrlists
-         // attrlist collection
-         StatusCode sc;
-         unsigned int beginRun;
-         unsigned int endRun;
-         if ( !m_manualiov ) {
-
-            SG::ReadHandle<EventInfo> evt(m_eventInfoKey);
-            if (not evt.isValid()) {
-               msg(MSG:: ERROR) << "Unable to get the EventInfo" << endmsg;
-               return StatusCode::FAILURE;
-            }
-
-            beginRun = evt->event_ID()->run_number();
-            endRun = beginRun;
-
-         } else {
-            beginRun = m_beginRun;
-            if ( m_endRun != -1 )    endRun = m_endRun;
-            else                     endRun = IOVTime::MAXRUN;
-         }
-
-         unsigned int beginLB = IOVTime::MINEVENT;
-         unsigned int endLB = IOVTime::MAXEVENT;
-
-         //msg(MSG:: INFO) <<"beginRun = "<<beginRun<<"   endRun = "<<endRun<<"    tag = "<<tagname<<"   m_manualiov = "<<m_manualiov << endmsg;
-
-         if (not tagname.empty()) {
-            sc = m_regSvc->registerIOV("CondAttrListCollection",foldername,tagname,beginRun, endRun,beginLB, endLB);
-         } else {
-            sc = m_regSvc->registerIOV("CondAttrListCollection",foldername,"",beginRun, endRun,beginLB, endLB);
-         }
-         if (sc.isFailure()) {
-            msg(MSG:: ERROR) <<"Could not register in IOV DB for CondAttrListCollection" << endmsg;
-            return StatusCode::FAILURE;
-         }
+SCTCalibWriteTool::registerCondObjects(const std::string& foldername,const std::string& tagname) const {
+  // Register the IOV DB with the conditions data written out
+  if (m_readWriteCool) {
+    // Can only write out AttrList's if this is NOT write and reg in two steps
+    if (!m_twoStepWriteReg) {
+      // Using COOL, write out attrlist and collection of attrlists
+      // attrlist collection
+      StatusCode sc;
+      unsigned int beginRun;
+      unsigned int endRun;
+      if (!m_manualiov) {
+
+        SG::ReadHandle<EventInfo> evt{m_eventInfoKey};
+        if (not evt.isValid()) {
+          ATH_MSG_ERROR("Unable to get the EventInfo");
+          return StatusCode::FAILURE;
+        }
+
+        beginRun = evt->event_ID()->run_number();
+        endRun = beginRun;
+
+      } else {
+        beginRun = m_beginRun;
+        if ( m_endRun != -1 ) endRun = m_endRun;
+        else                  endRun = IOVTime::MAXRUN;
       }
-   }
-   return StatusCode::SUCCESS;
+
+      unsigned int beginLB{IOVTime::MINEVENT};
+      unsigned int endLB{IOVTime::MAXEVENT};
+
+      if (not tagname.empty()) {
+        sc = m_regSvc->registerIOV("CondAttrListCollection", foldername, tagname, beginRun, endRun, beginLB, endLB);
+      } else {
+        sc = m_regSvc->registerIOV("CondAttrListCollection", foldername, "", beginRun, endRun, beginLB, endLB);
+      }
+      if (sc.isFailure()) {
+        ATH_MSG_ERROR("Could not register in IOV DB for CondAttrListCollection");
+        return StatusCode::FAILURE;
+      }
+    }
+  }
+  return StatusCode::SUCCESS;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////
 
 StatusCode
-SCTCalibWriteTool::registerCondObjectsWithErrMsg(const std::string& foldername,const std::string& tagname) {
-   if (m_regIOV) {
-      if (registerCondObjects(foldername,tagname).isFailure()) {
-         msg(MSG:: ERROR) << "Could not register "<<foldername << endmsg;
-         return StatusCode::FAILURE;
-      }
-   }
-   return StatusCode::SUCCESS;
+SCTCalibWriteTool::registerCondObjectsWithErrMsg(const std::string& foldername,const std::string& tagname) const {
+  if (m_regIOV) {
+    if (registerCondObjects(foldername,tagname).isFailure()) {
+      ATH_MSG_ERROR("Could not register " << foldername);
+      return StatusCode::FAILURE;
+    }
+  }
+  return StatusCode::SUCCESS;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////
 
 StatusCode
-SCTCalibWriteTool::recordAndStream(const CondAttrListCollection* pCollection,const std::string & foldername, bool & flag) {
-   if (m_writeCondObjs) {
-      if (m_detStore->record(pCollection, foldername).isFailure()) {
-         msg(MSG:: ERROR) << "Could not record "<<foldername << endmsg;
-         return StatusCode::FAILURE;
-      }
-      flag=true;
-      if (streamOutCondObjectsWithErrMsg(s_defectFolderName).isFailure()) return StatusCode::FAILURE;
-   }
-   return StatusCode::SUCCESS;
+SCTCalibWriteTool::recordAndStream(const CondAttrListCollection* pCollection,const std::string& foldername, bool& flag) {
+  if (m_writeCondObjs) {
+    if (detStore()->record(pCollection, foldername).isFailure()) {
+      ATH_MSG_ERROR("Could not record "<<foldername);
+      return StatusCode::FAILURE;
+    }
+    flag=true;
+    if (streamOutCondObjectsWithErrMsg(s_defectFolderName).isFailure()) return StatusCode::FAILURE;
+  }
+  return StatusCode::SUCCESS;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////
 
 coral::AttributeListSpecification*
 SCTCalibWriteTool::createBasicDbSpec(const bool capsFormat) const {
-   coral::AttributeListSpecification* attrSpec =new coral::AttributeListSpecification();
-   const std::string becName=capsFormat?"BarrelEndcap":"barrel_endcap";
-   attrSpec->extend("SampleSize", "int");
-   attrSpec->extend(becName, "int");
-   attrSpec->extend("Layer", "int");
-   attrSpec->extend("Eta", "int");
-   attrSpec->extend("Phi", "int");
-   return attrSpec;
+  coral::AttributeListSpecification* attrSpec{new coral::AttributeListSpecification{}};
+  const std::string becName{capsFormat?"BarrelEndcap":"barrel_endcap"};
+  attrSpec->extend("SampleSize", "int");
+  attrSpec->extend(becName, "int");
+  attrSpec->extend("Layer", "int");
+  attrSpec->extend("Eta", "int");
+  attrSpec->extend("Phi", "int");
+  return attrSpec;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////
 
 void
-SCTCalibWriteTool::setBasicValues(coral::AttributeList & attrList, const Identifier& wafer_id, const int samplesize,const SCT_ID* sctId, const bool capsFormat) const {
-   int eta = sctId->eta_module(wafer_id);
-   int phi = sctId->phi_module(wafer_id);
-   int barrel_ec = sctId->barrel_ec(wafer_id);
-   int layer = sctId->layer_disk(wafer_id);
-   //
-   const std::string becName=capsFormat?"BarrelEndcap":"barrel_endcap";
-   attrList["SampleSize"].setValue(static_cast<int>(samplesize));
-   attrList[becName].setValue(static_cast<int>(barrel_ec));
-   attrList["Layer"].setValue(static_cast<int>(layer));
-   attrList["Eta"].setValue(static_cast<int>(eta));
-   attrList["Phi"].setValue(static_cast<int>(phi));
-
-   return;
+SCTCalibWriteTool::setBasicValues(coral::AttributeList& attrList, const Identifier& wafer_id, const int samplesize, const SCT_ID* sctId, const bool capsFormat) const {
+  int eta{sctId->eta_module(wafer_id)};
+  int phi{sctId->phi_module(wafer_id)};
+  int barrel_ec{sctId->barrel_ec(wafer_id)};
+  int layer{sctId->layer_disk(wafer_id)};
+  //
+  const std::string becName{capsFormat?"BarrelEndcap":"barrel_endcap"};
+  attrList["SampleSize"].setValue(static_cast<int>(samplesize));
+  attrList[becName].setValue(static_cast<int>(barrel_ec));
+  attrList["Layer"].setValue(static_cast<int>(layer));
+  attrList["Eta"].setValue(static_cast<int>(eta));
+  attrList["Phi"].setValue(static_cast<int>(phi));
+
+  return;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibBsErrorTool.cxx b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibBsErrorTool.cxx
index 3fe1ffba2842d6ded8e9bb75252e51e3ee76dc6d..f8bf22718557c4e0ba0123ea1d9782bb06662360 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibBsErrorTool.cxx
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibBsErrorTool.cxx
@@ -6,165 +6,154 @@
  * @file SCT_CalibBsErrorTool.cxx
  * Implementation file for the SCT_CalibBsErrorTool class
  * @author Shaun Roe
-**/
+ **/
 
 #include "SCT_CalibBsErrorTool.h"
 #include "SCT_CalibUtilities.h"
 #include "SCT_CalibNumbers.h"
-//Inner detector includes
-
-#include <set>
 
 #include "Identifier/Identifier.h"
 #include "Identifier/IdentifierHash.h"
-#include "GaudiKernel/ITHistSvc.h"
-
-#include "TH1I.h"
 
 // RAW data access
 #include "InDetRawData/InDetRawDataCLASS_DEF.h"
 #include "InDetRawData/SCT3_RawData.h"
 
+#include "GaudiKernel/ITHistSvc.h"
+
+#include "TH1I.h"
+
+#include <set>
+
 using namespace std;
 using namespace SCT_CalibAlgs;
 
-const static string pathRoot("/BSErrors/");
-const static string detectorPaths[]= {"SCTEC/", "SCTB/","SCTEA/"};
-const static string detectorNames[] = { "negativeEndcap", "barrel", "positiveEndcap" };
-const static int  n_BSErrorType = 15;
-const static int firstBSErrorType = 0;
-const static int lastBSErrorType = 14;
+static const string pathRoot{"/BSErrors/"};
+static const string detectorPaths[]{"SCTEC/", "SCTB/","SCTEA/"};
+static const string detectorNames[]{"negativeEndcap", "barrel", "positiveEndcap"};
+static const int n_BSErrorType{15};
+static const int firstBSErrorType{0};
+static const int lastBSErrorType{14};
 
 SCT_CalibBsErrorTool::SCT_CalibBsErrorTool(const std::string& type, const std::string& name, const IInterface* parent) :
-   base_class(type, name, parent),
-   m_detStore("DetectorStore", name),
-   m_evtStore("StoreGateSvc", name),
-   m_pSCTHelper(0),
-   m_scterr_bec(0),
-   m_scterr_layer(0),
-   m_scterr_eta(0),
-   m_scterr_phi(0),
-   m_scterr_side(0),
-   m_scterr_type(0),
-   m_maxHash(0)
+  base_class(type, name, parent),
+  m_pSCTHelper{nullptr},
+  m_scterr_bec{0},
+  m_scterr_layer{0},
+  m_scterr_eta{0},
+  m_scterr_phi{0},
+  m_scterr_side{0},
+  m_scterr_type{0},
+  m_maxHash{0}
 {
 }
 
 StatusCode
 SCT_CalibBsErrorTool::initialize() {
-   if ( service( "THistSvc", m_thistSvc ).isFailure() ) return msg( MSG::ERROR) << "Unable to retrieve pointer to THistSvc" << endmsg, StatusCode::FAILURE;
-   if ( m_detStore->retrieve( m_pSCTHelper, "SCT_ID").isFailure()) return msg( MSG::ERROR) << "Unable to retrieve SCTHelper" << endmsg, StatusCode::FAILURE;
-   if ( m_bytestreamErrorsTool.retrieve().isFailure()) return msg( MSG::ERROR) << "Unable to retrieve BS Error Tool" << endmsg, StatusCode::FAILURE;
-   //
-   m_maxHash=m_pSCTHelper->wafer_hash_max();
-   m_waferItrBegin  = m_pSCTHelper->wafer_begin();
-   m_waferItrEnd  = m_pSCTHelper->wafer_end();
-
-   return StatusCode::SUCCESS;
-}
+  ATH_CHECK(service("THistSvc", m_thistSvc));
+  ATH_CHECK(detStore()->retrieve(m_pSCTHelper, "SCT_ID"));
+  ATH_CHECK(m_bytestreamErrorsTool.retrieve());
 
-StatusCode
-SCT_CalibBsErrorTool::finalize() {
-   msg( MSG::INFO)<<"Finalize of SCT_CalibBsErrorTool"<<endmsg;
+  m_maxHash = m_pSCTHelper->wafer_hash_max();
+  m_waferItrBegin = m_pSCTHelper->wafer_begin();
+  m_waferItrEnd = m_pSCTHelper->wafer_end();
 
-   return StatusCode::SUCCESS;
+  return StatusCode::SUCCESS;
 }
 
 StatusCode
-SCT_CalibBsErrorTool::queryInterface(const InterfaceID & riid, void** ppvInterface ) {
-   if ( ISCT_CalibHistoTool::interfaceID().versionMatch(riid) ) {
-      *ppvInterface = dynamic_cast<ISCT_CalibHistoTool*>(this);
-   } else {
-      return AthAlgTool::queryInterface(riid, ppvInterface);
-   }
-   addRef();
-   return StatusCode::SUCCESS;
+SCT_CalibBsErrorTool::finalize() {
+  ATH_MSG_INFO("Finalize of SCT_CalibBsErrorTool");
+
+  return StatusCode::SUCCESS;
 }
 
 bool
 SCT_CalibBsErrorTool::book() {
-   bool result(true);
-   m_phistoVector.clear();
-   string histoName=pathRoot+"GENERAL/";
-   //histogram for numbers of events
-   m_numberOfEventsHisto=new TH1I("events","Events",1,0.5,1.5);
-   if( m_thistSvc->regHist( histoName.c_str(), m_numberOfEventsHisto ).isFailure() ) {
-      msg( MSG::ERROR ) << "Error in booking BSErrors histogram" << endmsg;
-   }
-   //--- BSErrors for each wafer
-   SCT_ID::const_id_iterator waferItr  = m_waferItrBegin;
-   SCT_ID::const_id_iterator waferItrE = m_waferItrEnd;
-   for( ; waferItr not_eq waferItrE; ++waferItr ) {
-      Identifier waferId = *waferItr;
-      const int bec( m_pSCTHelper->barrel_ec( waferId ) );
-      const string formattedPosition( formatPosition(waferId, m_pSCTHelper));
-      std::string histotitle = string( "SCT " ) + detectorNames[ bec2Index(bec) ] + string( " BSErrors : plane " ) + formattedPosition;
-      const std::string name=pathRoot+detectorPaths[bec2Index(m_pSCTHelper->barrel_ec( waferId ))] + formattedPosition;
-      TH1F* hitmapHisto_tmp = new TH1F( TString( formattedPosition ), TString( histotitle ), n_BSErrorType, firstBSErrorType-0.5, lastBSErrorType+0.5 );
-      if( m_thistSvc->regHist( name.c_str(), hitmapHisto_tmp ).isFailure() ) msg( MSG::ERROR ) << "Error in booking BSErrors histogram" << endmsg;
-      m_phistoVector.push_back( hitmapHisto_tmp );
-   }
-   return result;
+  bool result{true};
+  m_phistoVector.clear();
+  string histoName{pathRoot+"GENERAL/"};
+  //histogram for numbers of events
+  m_numberOfEventsHisto = new TH1I{"events", "Events", 1, 0.5, 1.5};
+  if (m_thistSvc->regHist(histoName.c_str(), m_numberOfEventsHisto ).isFailure()) {
+    ATH_MSG_ERROR("Error in booking BSErrors histogram");
+  }
+  //--- BSErrors for each wafer
+  SCT_ID::const_id_iterator waferItr{m_waferItrBegin};
+  SCT_ID::const_id_iterator waferItrE{m_waferItrEnd};
+  for (; waferItr not_eq waferItrE; ++waferItr) {
+    Identifier waferId{*waferItr};
+    const int bec{m_pSCTHelper->barrel_ec(waferId)};
+    const string formattedPosition{formatPosition(waferId, m_pSCTHelper)};
+    std::string histotitle{string{"SCT "} + detectorNames[bec2Index(bec)] + string{" BSErrors : plane "} + formattedPosition};
+    const std::string name{pathRoot+detectorPaths[bec2Index(m_pSCTHelper->barrel_ec(waferId))] + formattedPosition};
+    TH1F* hitmapHisto_tmp{new TH1F{TString{formattedPosition}, TString{histotitle}, n_BSErrorType, firstBSErrorType-0.5, lastBSErrorType+0.5}};
+    if (m_thistSvc->regHist(name.c_str(), hitmapHisto_tmp).isFailure()) {
+      ATH_MSG_ERROR("Error in booking BSErrors histogram");
+    }
+    m_phistoVector.push_back(hitmapHisto_tmp);
+  }
+  return result;
 }
 
 bool
-SCT_CalibBsErrorTool::read(const std::string & fileName) {
-   msg( MSG::ERROR ) << "Reding BsError histograms from " << fileName.c_str() << " is not supported!" << endmsg;
-   return false;
+SCT_CalibBsErrorTool::read(const std::string& fileName) {
+  ATH_MSG_ERROR("Reding BsError histograms from " << fileName.c_str() << " is not supported!");
+  return false;
 }
 
 bool
 SCT_CalibBsErrorTool::fill(const bool fromData) {
-   if (fromData) {
-      return fillFromData();
-   }
-   bool result(true);
-   //--- Number of event
-   m_numberOfEventsHisto->Fill( 1 );
-   //--- Fill BSErrors
-   const int maxEntry = m_scterr_type->size();
-   for( int i = 0; i != maxEntry; ++i ) {
-      int bec   = (*m_scterr_bec)[i];
-      int layer = (*m_scterr_layer)[i];
-      int phi   = (*m_scterr_phi)[i];
-      int eta   = (*m_scterr_eta)[i];
-      int side  = (*m_scterr_side)[i];
-      int type  = (*m_scterr_type)[i];
-      Identifier waferId = m_pSCTHelper->wafer_id( bec, layer, phi, eta, side );
-      fillBsErrorsForWafer(waferId, type);
-   }
-   return result;
+  if (fromData) {
+    return fillFromData();
+  }
+  bool result{true};
+  //--- Number of event
+  m_numberOfEventsHisto->Fill( 1 );
+  //--- Fill BSErrors
+  const int maxEntry{static_cast<int>(m_scterr_type->size())};
+  for (int i{0}; i != maxEntry; ++i ) {
+    int bec{(*m_scterr_bec)[i]};
+    int layer{(*m_scterr_layer)[i]};
+    int phi{(*m_scterr_phi)[i]};
+    int eta{(*m_scterr_eta)[i]};
+    int side{(*m_scterr_side)[i]};
+    int type{(*m_scterr_type)[i]};
+    Identifier waferId{m_pSCTHelper->wafer_id( bec, layer, phi, eta, side )};
+    fillBsErrorsForWafer(waferId, type);
+  }
+  return result;
 }
 
 bool
 SCT_CalibBsErrorTool::fillFromData() {
-   bool result(true);
-   //--- Number of event
-   m_numberOfEventsHisto->Fill( 1 );
-   //--- Loop over BSErrors
-   for ( int type = 0; type < SCT_ByteStreamErrors::NUM_ERROR_TYPES; ++type ) {
-      const std::set<IdentifierHash>* errorSet = m_bytestreamErrorsTool->getErrorSet( type );
-      if ( errorSet != 0 ) {
-         std::set<IdentifierHash>::const_iterator it  = errorSet->begin();
-         std::set<IdentifierHash>::const_iterator itE = errorSet->end();
-         for ( ; it != itE; ++it ) {
-            Identifier waferId = m_pSCTHelper->wafer_id( *it );
-            fillBsErrorsForWafer(waferId, type);
-         }
+  bool result{true};
+  //--- Number of event
+  m_numberOfEventsHisto->Fill( 1 );
+  //--- Loop over BSErrors
+  for (int type{0}; type < SCT_ByteStreamErrors::NUM_ERROR_TYPES; ++type) {
+    const std::set<IdentifierHash>* errorSet{m_bytestreamErrorsTool->getErrorSet(type)};
+    if ( errorSet != 0 ) {
+      std::set<IdentifierHash>::const_iterator it{errorSet->begin()};
+      std::set<IdentifierHash>::const_iterator itE{errorSet->end()};
+      for ( ; it != itE; ++it ) {
+        Identifier waferId{m_pSCTHelper->wafer_id(*it)};
+        fillBsErrorsForWafer(waferId, type);
       }
-   }
-   return result;
+    }
+  }
+  return result;
 }
 
 void
-SCT_CalibBsErrorTool::fillBsErrorsForWafer(const Identifier & waferId, const int type) {
-   int iWaferHash = (int) m_pSCTHelper->wafer_hash( waferId );
-   const string osWafer=formatPosition(waferId, m_pSCTHelper,".");
-   //--- Protection for wrong waferID
-   if ( iWaferHash < 0 || iWaferHash >= m_maxHash ) {
-      msg( MSG::WARNING ) << "WaferHash " << iWaferHash << " is out of range : [ bec.layer.eta.phi.side, BSErrorType ] = [ " << osWafer << ", " << type << " ]" << endmsg;
-   } else {
-      if (msgLvl(MSG::DEBUG)) msg( MSG::DEBUG ) << "BSError : [ bec.layer.eta.phi.side, Type ] = [ " << osWafer<< ", " << type << " ]"<< endmsg;
-      m_phistoVector[ iWaferHash ]->Fill( type );
-   }
+SCT_CalibBsErrorTool::fillBsErrorsForWafer(const Identifier& waferId, const int type) {
+  int iWaferHash{static_cast<int>(m_pSCTHelper->wafer_hash(waferId))};
+  const string osWafer{formatPosition(waferId, m_pSCTHelper,".")};
+  //--- Protection for wrong waferID
+  if ( iWaferHash < 0 || iWaferHash >= m_maxHash ) {
+    ATH_MSG_WARNING("WaferHash " << iWaferHash << " is out of range : [ bec.layer.eta.phi.side, BSErrorType ] = [ " << osWafer << ", " << type << " ]");
+  } else {
+    ATH_MSG_DEBUG("BSError : [ bec.layer.eta.phi.side, Type ] = [ " << osWafer<< ", " << type << " ]");
+    m_phistoVector[ iWaferHash ]->Fill( type );
+  }
 }
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibBsErrorTool.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibBsErrorTool.h
index b21ef94a7978d4ddbc3bd8298963dc2fbb97f34f..183b25c52f0dd7c635ef91df5396ce57896a4479 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibBsErrorTool.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibBsErrorTool.h
@@ -3,21 +3,16 @@
 */
 
 /**
-* @file SCT_CalibBsErrorTool.h
-* Header file for the SCT_CalibBsErrorTool class
-* @author Shaun Roe
-**/
+ * @file SCT_CalibBsErrorTool.h
+ * Header file for the SCT_CalibBsErrorTool class
+ * @author Shaun Roe
+ **/
 
 #ifndef SCT_CalibBsErrorTool_h
 #define SCT_CalibBsErrorTool_h
 
-
-//STL includes
-#include <string>
-
 //Athena includes
 #include "AthenaBaseComps/AthAlgTool.h"
-#include "StoreGate/StoreGateSvc.h"
 #include "GaudiKernel/ToolHandle.h"
 #include "InDetIdentifier/SCT_ID.h"
 
@@ -26,52 +21,49 @@
 //local includes
 #include "SCT_CalibAlgs/ISCT_CalibHistoTool.h"
 
-//fwd declarations
+//STL includes
+#include <string>
 
+//fwd declarations
 class StatusCode;
 class ISvcLocator;
 
 class SCT_CalibBsErrorTool : public extends<AthAlgTool, ISCT_CalibHistoTool>
 {
 
-   public:
-      //@name Tool methods, reimplemented
-      //@{
-      SCT_CalibBsErrorTool(const std::string&, const std::string&, const IInterface*);
-      virtual ~SCT_CalibBsErrorTool() = default;
-      virtual StatusCode initialize();
-      virtual StatusCode finalize();
-      //interfaceID() implementation is in the baseclass
-      virtual StatusCode queryInterface(const InterfaceID & riid, void** ppvInterface );
-      //@}
-      //@name ISCT_CalibHistoSvc methods, reimplemented
-      //@{
-      virtual bool book();
-      virtual bool read(const std::string & fileName);
-      virtual bool fill(const bool fromData=false);
-      virtual bool fillFromData();
-      //@}
+ public:
+  //@name Tool methods, reimplemented
+  //@{
+  SCT_CalibBsErrorTool(const std::string&, const std::string&, const IInterface*);
+  virtual ~SCT_CalibBsErrorTool() = default;
+  virtual StatusCode initialize();
+  virtual StatusCode finalize();
+  //@}
+  //@name ISCT_CalibHistoSvc methods, reimplemented
+  //@{
+  virtual bool book();
+  virtual bool read(const std::string& fileName);
+  virtual bool fill(const bool fromData=false);
+  virtual bool fillFromData();
+  //@}
 
-   private:
-      ServiceHandle<StoreGateSvc> m_detStore;
-      ServiceHandle<StoreGateSvc> m_evtStore;
-      ToolHandle<ISCT_ByteStreamErrorsTool> m_bytestreamErrorsTool{this, "SCT_ByteStreamErrorsTool", "SCT_ByteStreamErrorsTool", "Tool to retrieve SCT ByteStream Errors"};
-      const SCT_ID* m_pSCTHelper;
+ private:
+  ToolHandle<ISCT_ByteStreamErrorsTool> m_bytestreamErrorsTool{this, "SCT_ByteStreamErrorsTool", "SCT_ByteStreamErrorsTool", "Tool to retrieve SCT ByteStream Errors"};
+  const SCT_ID* m_pSCTHelper;
 
-      // SCT specific numbers
-      SCT_ID::const_id_iterator m_waferItrBegin;
-      SCT_ID::const_id_iterator m_waferItrEnd;
-      typedef std::vector<int> VecInt;
-      VecInt *m_scterr_bec;
-      VecInt *m_scterr_layer;
-      VecInt *m_scterr_eta;
-      VecInt *m_scterr_phi;
-      VecInt *m_scterr_side;
-      VecInt *m_scterr_type;
-      int m_maxHash;
+  // SCT specific numbers
+  SCT_ID::const_id_iterator m_waferItrBegin;
+  SCT_ID::const_id_iterator m_waferItrEnd;
+  typedef std::vector<int> VecInt;
+  VecInt* m_scterr_bec;
+  VecInt* m_scterr_layer;
+  VecInt* m_scterr_eta;
+  VecInt* m_scterr_phi;
+  VecInt* m_scterr_side;
+  VecInt* m_scterr_type;
+  int m_maxHash;
 
-      void
-      fillBsErrorsForWafer(const Identifier & waferId, const int type);
+  void fillBsErrorsForWafer(const Identifier & waferId, const int type);
 
 };
 #endif
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibEventInfo.cxx b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibEventInfo.cxx
index f21d3bcf6968c759c066d0e4decb1dab9962694b..6a7bf37050e353fb15374e3ac77d5c6537db5949 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibEventInfo.cxx
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibEventInfo.cxx
@@ -1,14 +1,12 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /**
  * @file SCT_CalibEventInfo.h
  * Implementation file for the SCT_CalibEventInfo class
  * @author Shaun Roe
-**/
-
-#include <limits>
+ **/
 
 #include "SCT_CalibEventInfo.h"
 #include "SCT_CalibUtilities.h"
@@ -18,160 +16,151 @@
 
 #include "CoralBase/TimeStamp.h"
 
+#include <limits>
+
 namespace {
-const int INTMIN(std::numeric_limits<int>::min());
-const int INTMAX(std::numeric_limits<int>::max());
-const long long oneBillion(1000000000LL);
-}
-
-SCT_CalibEventInfo::SCT_CalibEventInfo(const std::string& type, const std::string& name, const IInterface* parent) :
-   base_class(type, name, parent),
-   m_timeStampBegin(INTMAX),
-   m_tsBeginString(""),
-   m_tsEndString(""),
-   m_timeStampEnd(INTMIN),
-   m_duration(0),
-   m_LBBegin(INTMAX),
-   m_LBEnd(INTMIN),
-   m_numLB(0),
-   m_source("UNKNOWN"),
-   m_runNumber(0),
-   m_lumiBlock(0),
-   m_timeStamp(0),
-   m_bunchCrossing(0),
-   m_counter(0)
+  const int INTMIN{std::numeric_limits<int>::min()};
+  const int INTMAX{std::numeric_limits<int>::max()};
+  const long long oneBillion{1000000000LL};
+}
+
+SCT_CalibEventInfo::SCT_CalibEventInfo(const std::string& type, const std::string& name, const IInterface* parent):
+  base_class(type, name, parent),
+  m_timeStampBegin{INTMAX},
+  m_tsBeginString{""},
+  m_tsEndString{""},
+  m_timeStampEnd{INTMIN},
+  m_duration{0},
+  m_LBBegin{INTMAX},
+  m_LBEnd{INTMIN},
+  m_numLB{0},
+  m_source{"UNKNOWN"},
+  m_runNumber{0},
+  m_lumiBlock{0},
+  m_timeStamp{0},
+  m_bunchCrossing{0},
+  m_counter{0}
 {
 }
 
 StatusCode
 SCT_CalibEventInfo::initialize() {
-   msg( MSG::INFO)<<"Initialize of evtInfo in "<<PACKAGE_VERSION<<endmsg;
-   return StatusCode::SUCCESS;
+  ATH_MSG_INFO("Initialize of evtInfo in " << PACKAGE_VERSION);
+  return StatusCode::SUCCESS;
 }
 
 StatusCode
 SCT_CalibEventInfo::finalize() {
-   return StatusCode::SUCCESS;
-}
-
-StatusCode
-SCT_CalibEventInfo::queryInterface(const InterfaceID & riid, void** ppvInterface ) {
-   if ( ISCT_CalibEvtInfo::interfaceID().versionMatch(riid) ) {
-      *ppvInterface = dynamic_cast<ISCT_CalibEvtInfo*>(this);
-   } else {
-      return AthAlgTool::queryInterface(riid, ppvInterface);
-   }
-   addRef();
-   return StatusCode::SUCCESS;
-}
-
-int SCT_CalibEventInfo::lumiBlock() const {
-   return m_lumiBlock;
+  return StatusCode::SUCCESS;
 }
 
 void
 SCT_CalibEventInfo::setTimeStamp(const int begin, const int end) {
-   m_timeStampBegin=begin;
-   m_timeStampEnd=end;
-   m_duration=m_timeStampEnd-m_timeStampBegin;
-   m_tsBeginString=toUtc(begin);
-   m_tsEndString=toUtc(end);
-}
-
-int SCT_CalibEventInfo::duration() const {
-   return m_duration;
+  m_timeStampBegin = begin;
+  m_timeStampEnd = end;
+  m_duration = m_timeStampEnd-m_timeStampBegin;
+  m_tsBeginString = toUtc(begin);
+  m_tsEndString = toUtc(end);
 }
 
 void
-SCT_CalibEventInfo::setTimeStamp(const std::string & begin, const std::string & end) {
-   int ibegin=std::stoi(begin);
-   int iend=std::stoi(end);
-   setTimeStamp(ibegin,iend);
+SCT_CalibEventInfo::setTimeStamp(const std::string& begin, const std::string& end) {
+  int ibegin{std::stoi(begin)};
+  int iend{std::stoi(end)};
+  setTimeStamp(ibegin, iend);
 }
 
 void
 SCT_CalibEventInfo::setTimeStamp(const int ts) {
-   m_timeStamp=ts;
+  m_timeStamp = ts;
 }
 
 void
-SCT_CalibEventInfo::getLumiBlock(int & begin, int & end) const {
-   begin=m_LBBegin;
-   end=m_LBEnd;
+SCT_CalibEventInfo::getTimeStamps(int& begin, int& end) const {
+  begin = m_timeStampBegin;
+  end = m_timeStampEnd;
 }
 
 void
-SCT_CalibEventInfo::setLumiBlock(const int begin, const int end) {
-   m_LBBegin=begin;
-   m_LBEnd=end;
-   m_numLB=end-begin+1;
+SCT_CalibEventInfo::getTimeStamps(std::string& begin, std::string& end) const {
+  begin = m_tsBeginString;
+  end = m_tsEndString;
 }
 
-void
-SCT_CalibEventInfo::setLumiBlock(const int lb) {
-   m_lumiBlock=lb;
+int
+SCT_CalibEventInfo::timeStamp() const {
+  return m_timeStamp;
+}
+
+int SCT_CalibEventInfo::duration() const {
+  return m_duration;
 }
 
 void
 SCT_CalibEventInfo::setSource(const std::string source) {
-   m_source=source;
+  m_source = source;
 }
 
 void
-SCT_CalibEventInfo::setRunNumber(const int rn) {
-   m_runNumber=rn;
+SCT_CalibEventInfo::setLumiBlock(const int begin, const int end) {
+  m_LBBegin = begin;
+  m_LBEnd = end;
+  m_numLB = end-begin+1;
 }
 
 void
-SCT_CalibEventInfo::setBunchCrossing(const int bc) {
-   m_bunchCrossing=bc;
+SCT_CalibEventInfo::setLumiBlock(const int lb) {
+  m_lumiBlock = lb;
 }
 
 void
-SCT_CalibEventInfo::getTimeStamps(std::string & begin, std::string & end) const {
-   begin=m_tsBeginString;
-   end=m_tsEndString;
+SCT_CalibEventInfo::getLumiBlock(int& begin, int& end) const {
+  begin = m_LBBegin;
+  end = m_LBEnd;
 }
 
-void
-SCT_CalibEventInfo::getTimeStamps(int & begin, int & end) const {
-   begin=m_timeStampBegin;
-   end=m_timeStampEnd;
+int SCT_CalibEventInfo::lumiBlock() const {
+  return m_lumiBlock;
 }
 
 int
-SCT_CalibEventInfo::timeStamp() const {
-   return m_timeStamp;
+SCT_CalibEventInfo::numLumiBlocks() const {
+  return m_numLB;
 }
 
-int
-SCT_CalibEventInfo::runNumber() const {
-   return m_runNumber;
+void
+SCT_CalibEventInfo::setRunNumber(const int rn) {
+  m_runNumber = rn;
 }
 
 int
-SCT_CalibEventInfo::counter() const {
-   return m_counter;
+SCT_CalibEventInfo::runNumber() const {
+  return m_runNumber;
 }
 
 void
-SCT_CalibEventInfo::incrementCounter() {
-   ++m_counter;
+SCT_CalibEventInfo::setCounter(const int counterVal) {
+  m_counter = counterVal;
 }
 
 void
-SCT_CalibEventInfo::setCounter(const int counterVal) {
-   m_counter=counterVal;
+SCT_CalibEventInfo::incrementCounter() {
+  ++m_counter;
 }
 
 int
-SCT_CalibEventInfo::numLumiBlocks() const {
-   return m_numLB;
+SCT_CalibEventInfo::counter() const {
+  return m_counter;
+}
+
+void
+SCT_CalibEventInfo::setBunchCrossing(const int bc) {
+  m_bunchCrossing = bc;
 }
 
 std::string
 SCT_CalibEventInfo::toUtc(const int timestamp) const {
-   coral::TimeStamp::ValueType nsTime = timestamp*oneBillion;
-   coral::TimeStamp utc( nsTime );
-   return utc.toString();
+  coral::TimeStamp::ValueType nsTime{timestamp*oneBillion};
+  coral::TimeStamp utc{nsTime};
+  return utc.toString();
 }
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibEventInfo.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibEventInfo.h
index 54d44636ff0c13775b257f0e72feba34629a52f6..15c6e755dd960303d366073767b69fe1fe2cf77a 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibEventInfo.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibEventInfo.h
@@ -6,16 +6,17 @@
  * @file SCT_CalibEventInfo.h
  * Header file for the SCT_CalibEventInfo class
  * @author Shaun Roe
-**/
+ **/
 
 #ifndef SCT_CalibEventInfo_h
 #define SCT_CalibEventInfo_h
 
 #include "AthenaBaseComps/AthAlgTool.h"
-#include "GaudiKernel/ToolHandle.h"     //member
 
 #include "SCT_CalibAlgs/ISCT_CalibEvtInfo.h"
-#include <atomic>
+
+#include "GaudiKernel/ToolHandle.h"
+
 #include <string>
 
 class StatusCode;
@@ -24,62 +25,61 @@ class InterfaceID;
 
 class SCT_CalibEventInfo: public extends<AthAlgTool, ISCT_CalibEvtInfo>
 {
-   public:
-      //@name Service methods, reimplemented
-      //@{
-      SCT_CalibEventInfo(const std::string&, const std::string&, const IInterface*);
-      virtual ~SCT_CalibEventInfo() = default;
-      virtual StatusCode initialize();
-      virtual StatusCode finalize();
-      //static const InterfaceID & interfaceID() {return ISCT_CalibEvtInfo::interfaceID();}
-      virtual StatusCode queryInterface(const InterfaceID & riid, void** ppvInterface );
-      //@}
-      //@name ISCT_CalibEvtinfo interface methods, implemented
-      //@{
-      virtual void setTimeStamp(const int begin, const int end);
-      virtual void setTimeStamp(const std::string & begin, const std::string & end);
-      virtual void setTimeStamp(const int ts);
-
-      virtual void getLumiBlock(int & begin, int & end) const;
-      virtual void setLumiBlock(const int begin, const int end);
-      virtual void setLumiBlock(const int lb);
-
-      virtual void setSource(const std::string source);
-
-      virtual void setRunNumber(const int rn);
-      virtual void setBunchCrossing(const int bc);
-      virtual void setCounter(const int counterVal);
-      virtual void incrementCounter();
-
-      virtual void getTimeStamps(int & begin, int & end) const;
-      virtual void getTimeStamps(std::string & begin, std::string & end) const;
-      virtual int timeStamp() const;
-      virtual int duration() const;
-      virtual int lumiBlock() const;
-      virtual int runNumber() const;
-      virtual int counter() const;
-      virtual int numLumiBlocks() const;
-      //@}
-
-   private:
-
-      int  m_timeStampBegin;
-      std::string m_tsBeginString;
-      std::string m_tsEndString;
-      int  m_timeStampEnd;
-      int  m_duration;
-      int  m_LBBegin;
-      int  m_LBEnd;
-      int  m_numLB;
-      std::string m_source;
-
-      //
-      mutable std::atomic_int m_runNumber;
-      mutable std::atomic_int m_lumiBlock;
-      mutable std::atomic_int m_timeStamp;
-      mutable std::atomic_int m_bunchCrossing;
-      int  m_counter;
-      std::string toUtc(const int timestamp) const;
+ public:
+  //@name Service methods, reimplemented
+  //@{
+  SCT_CalibEventInfo(const std::string&, const std::string&, const IInterface*);
+  virtual ~SCT_CalibEventInfo() = default;
+  virtual StatusCode initialize();
+  virtual StatusCode finalize();
+  //@}
+  //@name ISCT_CalibEvtinfo interface methods, implemented
+  //@{
+  virtual void setTimeStamp(const int begin, const int end);
+  virtual void setTimeStamp(const std::string& begin, const std::string& end);
+  virtual void setTimeStamp(const int ts);
+  virtual void getTimeStamps(int& begin, int& end) const;
+  virtual void getTimeStamps(std::string& begin, std::string& end) const;
+  virtual int timeStamp() const;
+  virtual int duration() const;
+
+  virtual void setSource(const std::string source);
+
+  virtual void setLumiBlock(const int begin, const int end);
+  virtual void setLumiBlock(const int lb);
+  virtual void getLumiBlock(int& begin, int& end) const;
+  virtual int lumiBlock() const;
+  virtual int numLumiBlocks() const;
+
+  virtual void setRunNumber(const int rn);
+  virtual int runNumber() const;
+
+  virtual void setCounter(const int counterVal);
+  virtual void incrementCounter();
+  virtual int counter() const;
+
+  virtual void setBunchCrossing(const int bc);
+  //@}
+
+ private:
+
+  int  m_timeStampBegin;
+  std::string m_tsBeginString;
+  std::string m_tsEndString;
+  int  m_timeStampEnd;
+  int  m_duration;
+  int  m_LBBegin;
+  int  m_LBEnd;
+  int  m_numLB;
+  std::string m_source;
+
+  //
+  int  m_runNumber;
+  int  m_lumiBlock;
+  int  m_timeStamp;
+  int  m_bunchCrossing;
+  int  m_counter;
+  std::string toUtc(const int timestamp) const;
 };
 
 #endif
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHitmapTool.cxx b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHitmapTool.cxx
index 5b9d0c950f00d4ee7e2566f2498d6549b73ba1bd..d3ee38ea9e5a566f2c2b2193071a1823904bc5ba 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHitmapTool.cxx
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHitmapTool.cxx
@@ -1,12 +1,12 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /**
  * @file SCT_CalibHitmapSvc.cxx
  * Implementation file for the SCT_CalibHitmapTool class
  * @author Shaun Roe
-**/
+ **/
 
 #include "SCT_CalibHitmapTool.h"
 #include "SCT_CalibUtilities.h"
@@ -19,6 +19,7 @@
 
 #include "Identifier/Identifier.h"
 #include "Identifier/IdentifierHash.h"
+
 #include "GaudiKernel/ITHistSvc.h"
 
 #include "TH1I.h"
@@ -29,176 +30,160 @@
 
 using namespace std;
 using namespace SCT_CalibAlgs;
-const static string pathRoot("/HitMaps/");
-const static string detectorNames[] = { "negativeEndcap", "barrel", "positiveEndcap" };
-const static string detectorPaths[]= {"SCTEC/", "SCTB/","SCTEA/"};
-
-SCT_CalibHitmapTool::SCT_CalibHitmapTool(const std::string& type, const std::string& name, const IInterface* parent) :
-   base_class(type, name, parent),
-   m_detStore("DetectorStore", name),
-   m_evtStore("StoreGateSvc", name),
-   m_pSCTHelper(0),
-   m_sct_waferHash(0),
-   m_sct_firstStrip(0),
-   m_sct_rdoGroupSize(0),
-   m_rdoContainerKey(std::string("SCT_RDOs"))
+const static string pathRoot{"/HitMaps/"};
+const static string detectorNames[]{"negativeEndcap", "barrel", "positiveEndcap"};
+const static string detectorPaths[]{"SCTEC/", "SCTB/","SCTEA/"};
+
+SCT_CalibHitmapTool::SCT_CalibHitmapTool(const std::string& type, const std::string& name, const IInterface* parent):
+  base_class(type, name, parent),
+  m_pSCTHelper{nullptr},
+  m_sct_waferHash{0},
+  m_sct_firstStrip{0},
+  m_sct_rdoGroupSize{0},
+  m_rdoContainerKey{"SCT_RDOs"}
 {
 }
 
 StatusCode
 SCT_CalibHitmapTool::initialize() {
-   if ( m_detStore->retrieve( m_pSCTHelper, "SCT_ID").isFailure()) return msg( MSG::ERROR) << "Unable to retrieve SCTHelper" << endmsg, StatusCode::FAILURE;
-   //
-   m_waferItrBegin  = m_pSCTHelper->wafer_begin();
-   m_waferItrEnd  = m_pSCTHelper->wafer_end();
-   //
+  ATH_CHECK(detStore()->retrieve(m_pSCTHelper, "SCT_ID"));
+  //
+  m_waferItrBegin = m_pSCTHelper->wafer_begin();
+  m_waferItrEnd = m_pSCTHelper->wafer_end();
+  //
 
-   // Read Handle Key
-   ATH_CHECK(m_rdoContainerKey.initialize());
+  // Read Handle Key
+  ATH_CHECK(m_rdoContainerKey.initialize());
 
-   return StatusCode::SUCCESS;
+  return StatusCode::SUCCESS;
 }
 
 StatusCode
 SCT_CalibHitmapTool::finalize() {
-   msg(MSG::VERBOSE) << "SCT_CalibHitmapSvc::finalize()"<<endmsg;
-   if (m_sct_waferHash) delete m_sct_waferHash;
-   if (m_sct_rdoGroupSize) delete m_sct_rdoGroupSize;
-   if (m_sct_firstStrip) delete m_sct_firstStrip;
-   return StatusCode::SUCCESS;
-}
+  ATH_MSG_VERBOSE("SCT_CalibHitmapSvc::finalize()");
 
-StatusCode
-SCT_CalibHitmapTool::queryInterface(const InterfaceID & riid, void** ppvInterface ) {
-   if ( ISCT_CalibHistoTool::interfaceID().versionMatch(riid) ) {
-      *ppvInterface = dynamic_cast<ISCT_CalibHistoTool*>(this);
-   } else {
-      return AthAlgTool::queryInterface(riid, ppvInterface);
-   }
-   addRef();
-   return StatusCode::SUCCESS;
+  delete m_sct_waferHash;
+  delete m_sct_rdoGroupSize;
+  delete m_sct_firstStrip;
+
+  return StatusCode::SUCCESS;
 }
 
 bool
 SCT_CalibHitmapTool::book() {
-   bool result(true);
-   //pointers to the histos are deleted by m_thistSvc methods
-   m_phistoVector.clear();
-   string histoName=pathRoot+"GENERAL/";
-   //histogram for numbers of events
-   m_numberOfEventsHisto=new TH1I("events","Events",1,0.5,1.5);
-   if( m_thistSvc->regHist( histoName.c_str(), m_numberOfEventsHisto ).isFailure() ) {
-      msg( MSG::ERROR ) << "Error in booking EventNumber histogram" << endmsg;
-   }
-   //histograms for each wafer
-   SCT_ID::const_id_iterator waferItr  = m_waferItrBegin;
-   std::string hitmapPaths[3];
-   for (int i(0); i<3; ++i) {
-      hitmapPaths[i]=pathRoot+detectorPaths[i];
-   }
-   for( ; waferItr not_eq m_waferItrEnd; ++waferItr ) {
-      const Identifier & waferId = *waferItr;
-      const int bec( m_pSCTHelper->barrel_ec( waferId ) );
-      const string formattedPosition=formatPosition(waferId, m_pSCTHelper);
-      std::string histotitle = string( "SCT " ) + detectorNames[ bec2Index(bec) ] + string( " Hitmap: plane " ) + formattedPosition;
-      std::string name=hitmapPaths[bec2Index(m_pSCTHelper->barrel_ec( waferId ))] + formattedPosition;
-      TH1F* hitmapHisto_tmp = new TH1F( TString( formattedPosition ), TString( histotitle ), nbins, firstStrip-0.5, lastStrip+0.5 );
-
-      //cout<<name.c_str()<<endl;
-      if( m_thistSvc->regHist( name.c_str(), hitmapHisto_tmp ).isFailure()) {
-         msg( MSG::ERROR ) << "Error in booking Hitmap histogram" << endmsg;
-      } else {
-         m_phistoVector.push_back( hitmapHisto_tmp );
-      }
-
-   }
-   return result;
+  bool result{true};
+  //pointers to the histos are deleted by m_thistSvc methods
+  m_phistoVector.clear();
+  string histoName{pathRoot + "GENERAL/"};
+  //histogram for numbers of events
+  m_numberOfEventsHisto = new TH1I{"events", "Events", 1, 0.5, 1.5};
+  if (m_thistSvc->regHist(histoName.c_str(), m_numberOfEventsHisto).isFailure()) {
+    ATH_MSG_ERROR("Error in booking EventNumber histogram");
+  }
+  //histograms for each wafer
+  SCT_ID::const_id_iterator waferItr{m_waferItrBegin};
+  std::string hitmapPaths[3];
+  for (int i{0}; i<3; ++i) {
+    hitmapPaths[i]=pathRoot+detectorPaths[i];
+  }
+  for (; waferItr not_eq m_waferItrEnd; ++waferItr) {
+    const Identifier& waferId{*waferItr};
+    const int bec{m_pSCTHelper->barrel_ec(waferId)};
+    const string formattedPosition{formatPosition(waferId, m_pSCTHelper)};
+    std::string histotitle{string{"SCT "} + detectorNames[bec2Index(bec)] + string{" Hitmap: plane "} + formattedPosition};
+    std::string name{hitmapPaths[bec2Index(m_pSCTHelper->barrel_ec(waferId))] + formattedPosition};
+    TH1F* hitmapHisto_tmp{new TH1F{TString{formattedPosition}, TString{histotitle}, nbins, firstStrip-0.5, lastStrip+0.5}};
+
+    if (m_thistSvc->regHist( name.c_str(), hitmapHisto_tmp ).isFailure()) {
+      ATH_MSG_ERROR("Error in booking Hitmap histogram");
+    } else {
+      m_phistoVector.push_back(hitmapHisto_tmp);
+    }
+
+  }
+  return result;
 }
 
 bool
-SCT_CalibHitmapTool::read(const std::string & fileName) {
-   bool result(true);
-   //pointers to the histos are deleted by m_thistSvc methods
-   m_phistoVector.clear();
-   TFile *fileHitmap = TFile::Open( fileName.c_str() );
-   msg( MSG::INFO ) << "opening Hitmap file : " << fileName.c_str() << endmsg;
-
-   if(fileHitmap==NULL) {
-      msg( MSG::ERROR ) << "can not open Hitmap file : " << fileName.c_str() << endmsg;
-      return result;
-   }
-   //histogram for numbers of events
-   m_numberOfEventsHisto = (TH1I*) fileHitmap->Get("GENERAL/events");
-   if( m_numberOfEventsHisto==NULL ) {
-      msg( MSG::ERROR ) << "Error in reading EventNumber histogram" << endmsg;
-   }
-   //histograms for each wafer
-   SCT_ID::const_id_iterator waferItr  = m_waferItrBegin;
-   for( ; waferItr not_eq m_waferItrEnd; ++waferItr ) {
-      const Identifier & waferId = *waferItr;
-      const string formattedPosition=formatPosition(waferId, m_pSCTHelper);
-      std::string name=detectorPaths[bec2Index(m_pSCTHelper->barrel_ec( waferId ))] + formattedPosition;
-      TH1F* hitmapHisto_tmp = (TH1F*) fileHitmap->Get(name.c_str());
-      if( hitmapHisto_tmp==NULL ) {
-         msg( MSG::ERROR ) << "Error in reading Hitmap histogram" << endmsg;
-      } else {
-         m_phistoVector.push_back( hitmapHisto_tmp );
-      }
-   }
-   return result;
+SCT_CalibHitmapTool::read(const std::string& fileName) {
+  bool result{true};
+  //pointers to the histos are deleted by m_thistSvc methods
+  m_phistoVector.clear();
+  TFile* fileHitmap{TFile::Open(fileName.c_str())};
+  ATH_MSG_INFO("opening Hitmap file : " << fileName.c_str());
+
+  if (fileHitmap==nullptr) {
+    ATH_MSG_ERROR("can not open Hitmap file : " << fileName.c_str());
+    return result;
+  }
+  //histogram for numbers of events
+  m_numberOfEventsHisto = static_cast<TH1I*>(fileHitmap->Get("GENERAL/events"));
+  if (m_numberOfEventsHisto==nullptr) {
+    ATH_MSG_ERROR("Error in reading EventNumber histogram");
+  }
+  //histograms for each wafer
+  SCT_ID::const_id_iterator waferItr{m_waferItrBegin};
+  for (; waferItr not_eq m_waferItrEnd; ++waferItr) {
+    const Identifier& waferId{*waferItr};
+    const string formattedPosition{formatPosition(waferId, m_pSCTHelper)};
+    std::string name{detectorPaths[bec2Index(m_pSCTHelper->barrel_ec(waferId))] + formattedPosition};
+    TH1F* hitmapHisto_tmp{static_cast<TH1F*>(fileHitmap->Get(name.c_str()))};
+    if (hitmapHisto_tmp==nullptr) {
+      ATH_MSG_ERROR("Error in reading Hitmap histogram");
+    } else {
+      m_phistoVector.push_back(hitmapHisto_tmp);
+    }
+  }
+  return result;
 }
 
 bool
 SCT_CalibHitmapTool::fill(const bool fromData) {
-   //cout<<"fromData "<<fromData<<endl;
-   if (fromData) {
-      return fillFromData();
-   }
-   bool result(true);
-   //--- Number of events
-   m_numberOfEventsHisto->Fill( 1 );
-   // both ways hshould give the same results
-   // int eventNumber = m_numberOfEventsHisto->GetBinContent(1);
-   //  int eventNumber = m_numberOfEventsHisto->GetEntries();
-
-   //--- Fill hitmap
-   const int MaxEntry = m_sct_waferHash->size();
-   for( int i = 0; i != MaxEntry; ++i ) {
-      const int theFirstStrip = (*m_sct_firstStrip)[i];
-      const int endStrip  = (*m_sct_rdoGroupSize)[i] + theFirstStrip;
-      const int index         = (*m_sct_waferHash)[i];
-      TH1F * pThisHisto=m_phistoVector[ index ];
-      for( int strip(theFirstStrip); strip !=endStrip; ++strip) {
-         pThisHisto->Fill( strip);
-      }
-   }
-   return result;
+  //cout<<"fromData "<<fromData<<endl;
+  if (fromData) {
+    return fillFromData();
+  }
+  bool result{true};
+  //--- Number of events
+  m_numberOfEventsHisto->Fill(1);
+
+  //--- Fill hitmap
+  const int MaxEntry{static_cast<int>(m_sct_waferHash->size())};
+  for (int i{0}; i != MaxEntry; ++i) {
+    const int theFirstStrip{(*m_sct_firstStrip)[i]};
+    const int endStrip{(*m_sct_rdoGroupSize)[i] + theFirstStrip};
+    const int index{(*m_sct_waferHash)[i]};
+    TH1F* pThisHisto{m_phistoVector[index]};
+    for (int strip{theFirstStrip}; strip!=endStrip; ++strip) {
+      pThisHisto->Fill(strip);
+    }
+  }
+  return result;
 }
 
 bool
 SCT_CalibHitmapTool::fillFromData() {
-   bool result(true);
-   m_numberOfEventsHisto->Fill( 1 );
-   // unused int eventNumber = m_numberOfEventsHisto->GetEntries();
-   SG::ReadHandle<SCT_RDO_Container> prdoContainer(m_rdoContainerKey);
-   if (not prdoContainer.isValid() ) msg(MSG::ERROR) <<"Failed to retrieve the SCT RDO container"<<endmsg;
-   SCT_RDO_Container::const_iterator itr=prdoContainer->begin();
-   const SCT_RDO_Container::const_iterator end=prdoContainer->end();
-   for (; itr !=end; ++itr) {
-      const InDetRawDataCollection<SCT_RDORawData>* SCT_Collection(*itr);
-      if (not SCT_Collection) continue;
-      const Identifier waferId = SCT_Collection->identify();
-      const IdentifierHash waferHash = m_pSCTHelper->wafer_hash(waferId);
-      TH1F * pThisHisto =m_phistoVector[(int)waferHash];
-      DataVector<SCT_RDORawData>::const_iterator rdoItr = SCT_Collection->begin();
-      const DataVector<SCT_RDORawData>::const_iterator rdoEnd = SCT_Collection->end();
-      for(; rdoItr != rdoEnd; ++rdoItr) {
-         int strip=m_pSCTHelper->strip((*rdoItr)->identify());
-         const int endStrip=(*rdoItr)->getGroupSize() + strip;
-         for (; strip != endStrip; ++strip) {
-            pThisHisto->Fill(strip);
-         }
+  bool result{true};
+  m_numberOfEventsHisto->Fill(1);
+  SG::ReadHandle<SCT_RDO_Container> prdoContainer{m_rdoContainerKey};
+  if (not prdoContainer.isValid()) ATH_MSG_ERROR("Failed to retrieve the SCT RDO container");
+  SCT_RDO_Container::const_iterator itr{prdoContainer->begin()};
+  const SCT_RDO_Container::const_iterator end{prdoContainer->end()};
+  for (; itr !=end; ++itr) {
+    const InDetRawDataCollection<SCT_RDORawData>* SCT_Collection{*itr};
+    if (not SCT_Collection) continue;
+    const Identifier waferId{SCT_Collection->identify()};
+    const IdentifierHash waferHash{m_pSCTHelper->wafer_hash(waferId)};
+    TH1F* pThisHisto{m_phistoVector[static_cast<int>(waferHash)]};
+    DataVector<SCT_RDORawData>::const_iterator rdoItr{SCT_Collection->begin()};
+    const DataVector<SCT_RDORawData>::const_iterator rdoEnd{SCT_Collection->end()};
+    for (; rdoItr != rdoEnd; ++rdoItr) {
+      int strip{m_pSCTHelper->strip((*rdoItr)->identify())};
+      const int endStrip{(*rdoItr)->getGroupSize() + strip};
+      for (; strip != endStrip; ++strip) {
+        pThisHisto->Fill(strip);
       }
-   }
-   return result;
+    }
+  }
+  return result;
 }
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHitmapTool.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHitmapTool.h
index 996ee330190b6ddd8083b14237469d7f80cdbfb1..46117f6d4c851c2b81c97be862cda7b282dd14c0 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHitmapTool.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHitmapTool.h
@@ -6,18 +6,14 @@
  * @file SCT_CalibHitmapTool.h
  * Header file for the SCT_CalibHitmapTool class
  * @author Shaun Roe
-**/
+ **/
 
 #ifndef SCT_CalibHitmapTool_h
 #define SCT_CalibHitmapTool_h
 
-//STL includes
-#include <string>
-
 //Athena includes
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "StoreGate/StoreGateSvc.h"
-#include "GaudiKernel/ToolHandle.h"
 #include "StoreGate/ReadHandleKey.h"
 
 //Inner detector includes
@@ -27,46 +23,45 @@
 //local includes
 #include "SCT_CalibAlgs/ISCT_CalibHistoTool.h"
 
+//Gaudi includes
+#include "GaudiKernel/ToolHandle.h"
+
+//STL includes
+#include <string>
+
 //fwd declarations
 
 class StatusCode;
 
-//class SCT_CalibHitmapTool : virtual public ISCT_CalibHistoTool, public AthAlgTool
 class SCT_CalibHitmapTool : public extends<AthAlgTool, ISCT_CalibHistoTool>
- {
-
-   public:
-      //@name Tool methods, reimplemented
-      //@{
-      SCT_CalibHitmapTool(const std::string&, const std::string&, const IInterface*);
-      virtual ~SCT_CalibHitmapTool() = default;
-      virtual StatusCode initialize();
-      virtual StatusCode finalize();
-      //interfaceID() implementation is in the baseclass
-      virtual StatusCode queryInterface(const InterfaceID & riid, void** ppvInterface );
-      //@}
-      //@name ISCT_CalibHistoTool methods, reimplemented
-      //@{
-      virtual bool book();
-      virtual bool read(const std::string & fileName);
-      virtual bool fill(const bool fromData=false);
-      virtual bool fillFromData();
-      //virtual bool binHistograms(const int eventsPerWindow);
-      //@}
+{
 
-   private:
-      ServiceHandle<StoreGateSvc> m_detStore;
-      ServiceHandle<StoreGateSvc> m_evtStore;
+ public:
+  //@name Tool methods, reimplemented
+  //@{
+  SCT_CalibHitmapTool(const std::string&, const std::string&, const IInterface*);
+  virtual ~SCT_CalibHitmapTool() = default;
+  virtual StatusCode initialize();
+  virtual StatusCode finalize();
+  //@}
+  //@name ISCT_CalibHistoTool methods, reimplemented
+  //@{
+  virtual bool book();
+  virtual bool read(const std::string& fileName);
+  virtual bool fill(const bool fromData=false);
+  virtual bool fillFromData();
+  //@}
 
-      const SCT_ID* m_pSCTHelper;
-      SCT_ID::const_id_iterator m_waferItrBegin;
-      SCT_ID::const_id_iterator m_waferItrEnd;
-      typedef std::vector<int> VecInt;
-      VecInt *m_sct_waferHash;
-      VecInt *m_sct_firstStrip;
-      VecInt *m_sct_rdoGroupSize;
+ private:
+  const SCT_ID* m_pSCTHelper;
+  SCT_ID::const_id_iterator m_waferItrBegin;
+  SCT_ID::const_id_iterator m_waferItrEnd;
+  typedef std::vector<int> VecInt;
+  VecInt* m_sct_waferHash;
+  VecInt* m_sct_firstStrip;
+  VecInt* m_sct_rdoGroupSize;
 
-      SG::ReadHandleKey<SCT_RDO_Container> m_rdoContainerKey;
+  SG::ReadHandleKey<SCT_RDO_Container> m_rdoContainerKey;
 
 };
 #endif
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHvTool.cxx b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHvTool.cxx
index aac90abdc7d74351a2e3ca73043d0e90cfbb4c90..1239b093f586a28eaa4b8f5e71d8b73ce7b078df 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHvTool.cxx
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHvTool.cxx
@@ -1,12 +1,12 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /**
-* @file SCT_CalibHvTool.cxx
-* Implementation file for the SCT_CalibHvTool class
-* @author Shaun Roe
-**/
+ * @file SCT_CalibHvTool.cxx
+ * Implementation file for the SCT_CalibHvTool class
+ * @author Shaun Roe
+ **/
 
 #include "SCT_CalibHvTool.h"
 #include "SCT_CalibUtilities.h"
@@ -18,214 +18,195 @@
 using namespace std;
 using namespace SCT_CalibAlgs;
 
-const static string detectorNames[] = { "negativeEndcap", "barrel", "positiveEndcap" };
+const static string detectorNames[]{"negativeEndcap", "barrel", "positiveEndcap"};
 
-const static string detectorPaths[]= {"SCTEC/", "SCTB/","SCTEA/"};
+const static string detectorPaths[]{"SCTEC/", "SCTB/","SCTEA/"};
 namespace {
-void
-initQueue(std::queue<int> & q, const int numvals, const int setval) {
-   for (int i(0); i<numvals; ++i) q.push(setval);
-}
+  void
+  initQueue(std::queue<int>& q, const int numvals, const int setval) {
+    for (int i{0}; i<numvals; ++i) q.push(setval);
+  }
 }
 
 SCT_CalibHvTool::SCT_CalibHvTool(const std::string& type, const std::string& name, const IInterface* parent) :
-   base_class(type, name, parent),
-   m_detStore("DetectorStore", name),
-   m_evtStore("StoreGateSvc", name),
-   m_pSCTHelper(0),
-   m_sct_waferHash(0),
-   m_sct_numHitsInWafer(0),
-   m_maxq(100),
-   m_phvtripPrevTime(0),
-   m_phvtripFirstTime(0),
-   m_absolutetriplimit(0),
-   m_relativetriplimit(0),
-   m_tq{0},
-   m_evt(0),
-   m_outputLowHits(false),m_lowHitCut(100)
-{
-}
+  base_class(type, name, parent),
+  m_pSCTHelper{nullptr},
+  m_sct_waferHash{0},
+  m_sct_numHitsInWafer{0},
+  m_maxq{100},
+  m_phvtripPrevTime{0},
+  m_phvtripFirstTime{0},
+  m_absolutetriplimit{0},
+  m_relativetriplimit{0},
+  m_tq{0},
+  m_evt{0},
+  m_outputLowHits{false},
+  m_lowHitCut{100}
+  {
+  }
 
 StatusCode
 SCT_CalibHvTool::initialize() {
-   ATH_CHECK(m_DCSConditionsTool.retrieve());
-   return StatusCode::SUCCESS;
-
+  ATH_CHECK(m_DCSConditionsTool.retrieve());
+  return StatusCode::SUCCESS;
 }
 
 StatusCode
 SCT_CalibHvTool::finalize() {
-   return StatusCode::SUCCESS;
-}
-
-StatusCode
-SCT_CalibHvTool::queryInterface(const InterfaceID & riid, void** ppvInterface ) {
-   if ( ISCT_CalibHistoTool::interfaceID().versionMatch(riid) ) {
-      *ppvInterface = dynamic_cast<ISCT_CalibHistoTool*>(this);
-   } else {
-      return AthAlgTool::queryInterface(riid, ppvInterface);
-   }
-   addRef();
-   return StatusCode::SUCCESS;
+  return StatusCode::SUCCESS;
 }
 
 bool
 SCT_CalibHvTool::book() {
-   bool result(true);
-   if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Book HVTrips" <<endmsg;
-   //now initialize the queues (fill 100 spots with 0):
-   queue<int> qtemp;
-   initQueue(qtemp, m_maxq,0);
-   // need to keep previous bins lbn 4 deep.
-   initQueue(m_prevLBN, 4, 0);
-   vector< pair <int,int> > dummy;
-   //first set num events processed to 0
-   m_phvtripProcessedEventsInt.insert(m_phvtripProcessedEventsInt.end(), n_elements, 1);
-   m_phvtripRunningTotalInt.insert(m_phvtripRunningTotalInt.end(), n_elements, 0);
-   m_phvtripHasItTripped.insert(m_phvtripHasItTripped.end(),n_elements, 0);
-   m_phvtripQueue.insert(m_phvtripQueue.end(), n_elements, qtemp);
-   m_summarytrips.insert(m_summarytrips.end(),n_elements, dummy);
-   m_summarytripslb.insert(m_summarytripslb.end(), n_elements, dummy);
-   m_phvtripHasItTripped_prev = m_phvtripHasItTripped;
-   return result;
+  bool result{true};
+  ATH_MSG_DEBUG("Book HVTrips");
+  //now initialize the queues (fill 100 spots with 0):
+  queue<int> qtemp;
+  initQueue(qtemp, m_maxq,0);
+  // need to keep previous bins lbn 4 deep.
+  initQueue(m_prevLBN, 4, 0);
+  vector<pair <int,int>> dummy;
+  //first set num events processed to 0
+  m_phvtripProcessedEventsInt.insert(m_phvtripProcessedEventsInt.end(), n_elements, 1);
+  m_phvtripRunningTotalInt.insert(m_phvtripRunningTotalInt.end(), n_elements, 0);
+  m_phvtripHasItTripped.insert(m_phvtripHasItTripped.end(),n_elements, 0);
+  m_phvtripQueue.insert(m_phvtripQueue.end(), n_elements, qtemp);
+  m_summarytrips.insert(m_summarytrips.end(),n_elements, dummy);
+  m_summarytripslb.insert(m_summarytripslb.end(), n_elements, dummy);
+  m_phvtripHasItTripped_prev = m_phvtripHasItTripped;
+  return result;
 }
 
 bool
 SCT_CalibHvTool::fill(const bool fromData) {
-   if (fromData) {
-      return fillFromData();
-   }
-   bool result(true);
-   int lumi_block(0); //fix me!
-   //int event_number;
-   const int wafersize = m_sct_waferHash->size();
-   int time_stamp= m_evt->event_ID()->time_stamp();
-   int curr_time =  time_stamp;
-   int dtime = curr_time - m_phvtripPrevTime;
-   int totalHits = 0;
-   if (curr_time<m_phvtripPrevTime) {
-      msg(MSG::ERROR) << "Events not sorted properly (time is going backwards!) " << endmsg;
-      return false;
-   }
-   // for first event
-   if (m_phvtripFirstTime > curr_time) {
-      m_phvtripFirstTime = curr_time;
-   }
-   bool newbin = false;
-   // check if we have a new time bin, if we do pop off the back (oldest) part
-   // of the queue and enqueue 0 for every wafer
-   int maxtbins(5);
-   if (dtime > maxtbins) {
-      newbin = true;
-      if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " new t bin " << dtime <<" since start "<< (curr_time-(m_phvtripFirstTime-1.01)) << endmsg;
-      m_phvtripHasItTripped_prev = m_phvtripHasItTripped;
-      for (int iwaf = 0; iwaf!=n_elements; ++iwaf) {
-         m_phvtripQueue[iwaf].pop();
-         m_phvtripQueue[iwaf].push(0);
-         m_phvtripHasItTripped[iwaf]=0;
-      }
-   }
-   //if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "time stamp "<<time_stamp <<" event number "<< Event_number<<endmsg;
-   // Loop over all hits in the event
-   bool isgoodnow;
-   for( int itrk=0; itrk!=wafersize; ++itrk) {
-      int waferhash = (*m_sct_waferHash)[itrk];
-      Identifier waferId = m_pSCTHelper->wafer_id(waferhash);
-      Identifier moduleId = m_pSCTHelper->module_id(waferId);
-      //step one is to make sure this one isn't already know to be messed up:
-      isgoodnow = m_DCSConditionsTool->isGood(moduleId,InDetConditions::SCT_MODULE);
-      if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "checked is good "<< isgoodnow <<endmsg;
-      if (isgoodnow) {
-         int numhits = (*m_sct_numHitsInWafer)[itrk];
-         totalHits += numhits;
-         /**
+  if (fromData) {
+    return fillFromData();
+  }
+  bool result{true};
+  int lumi_block{0}; //fix me!
+  const int wafersize{static_cast<int>(m_sct_waferHash->size())};
+  int time_stamp{static_cast<int>(m_evt->event_ID()->time_stamp())};
+  int curr_time{time_stamp};
+  int dtime{curr_time - m_phvtripPrevTime};
+  int totalHits{0};
+  if (curr_time<m_phvtripPrevTime) {
+    ATH_MSG_ERROR("Events not sorted properly (time is going backwards!) ");
+    return false;
+  }
+  // for first event
+  if (m_phvtripFirstTime > curr_time) {
+    m_phvtripFirstTime = curr_time;
+  }
+  bool newbin{false};
+  // check if we have a new time bin, if we do pop off the back (oldest) part
+  // of the queue and enqueue 0 for every wafer
+  int maxtbins{5};
+  if (dtime > maxtbins) {
+    newbin = true;
+    ATH_MSG_DEBUG(" new t bin " << dtime <<" since start "<< (curr_time-(m_phvtripFirstTime-1.01)));
+    m_phvtripHasItTripped_prev = m_phvtripHasItTripped;
+    for (int iwaf{0}; iwaf!=n_elements; ++iwaf) {
+      m_phvtripQueue[iwaf].pop();
+      m_phvtripQueue[iwaf].push(0);
+      m_phvtripHasItTripped[iwaf]=0;
+    }
+  }
+  // Loop over all hits in the event
+  bool isgoodnow;
+  for( int itrk{0}; itrk!=wafersize; ++itrk) {
+    int waferhash{(*m_sct_waferHash)[itrk]};
+    Identifier waferId{m_pSCTHelper->wafer_id(waferhash)};
+    Identifier moduleId{m_pSCTHelper->module_id(waferId)};
+    //step one is to make sure this one isn't already know to be messed up:
+    isgoodnow = m_DCSConditionsTool->isGood(moduleId,InDetConditions::SCT_MODULE);
+    ATH_MSG_DEBUG("checked is good "<< isgoodnow);
+    if (isgoodnow) {
+      int numhits{(*m_sct_numHitsInWafer)[itrk]};
+      totalHits += numhits;
+      /**
          calculate the limit for an individual module, limit is m_relativetriplimit (default = 4) times the running average in that module.
          limits are given in hits/second. need to convert numhits in bin to average (within bin) hits/sec.
-         **/
-         double limit =  m_relativetriplimit * (double)m_phvtripRunningTotalInt[waferhash] / ((double)curr_time-((double)m_phvtripFirstTime-0.01));
-
-         if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "waferhash "<<waferhash<<" itrk "<<itrk <<" run tot "<< m_phvtripRunningTotalInt[waferhash]
-                                                    <<" num hits "<<numhits<<" evnts processed "<<  m_phvtripProcessedEventsInt[waferhash] <<" limit "<<limit
-                                                    <<" abs limit, rel limit "<<m_absolutetriplimit<<","<< m_relativetriplimit<<" max bins "<<maxtbins
-                                                    <<endmsg;
-
-         if ( ((numhits + m_phvtripQueue[waferhash].back() )/ (double)maxtbins ) > m_absolutetriplimit
-               and ((numhits + m_phvtripQueue[waferhash].back() )/ (double)maxtbins ) > limit) {
-            //read back queue and see if the high hit rate is persistant for 3 previous bins (a bin is 5 seconds by default)
-            for (int iq = 0; iq<m_maxq; ++iq) {
-               m_tq[iq]=m_phvtripQueue[waferhash].front();
-               m_phvtripQueue[waferhash].pop();
-            }
-            if (m_tq[m_maxq-2]/(double)maxtbins > limit && m_tq[m_maxq-3]/(double)maxtbins > limit && m_tq[m_maxq-4]/(double)maxtbins > limit) {
-               // found a persistent trip/thing
-               if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Found a potential trip in SCT wafer "<< waferhash<<endmsg;
-               //if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "TRIP: "<< waferhash<<" "<<time_stamp <<" "<< Event_number <<" "<< (numhits + m_tq[m_maxq-1] ) <<endmsg;
-               if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "TRIP more info: limit = "<< limit <<" abslimit = "<<  m_absolutetriplimit
-                                                          <<" hits/secs now = "<< ((numhits + m_tq[m_maxq-1])/ maxtbins )
-                                                          <<" running total = "<< m_phvtripRunningTotalInt[waferhash]
-                                                          <<" running average =  "<<  m_phvtripRunningTotalInt[waferhash] / (curr_time-(m_phvtripFirstTime-1.01)) << endmsg;
-               m_phvtripHasItTripped[waferhash] =  (numhits + m_tq[m_maxq-1] );
-            } // end trip found
-
-            //put queue back the way we found it:
-            for (int iq = 0; iq < m_maxq; ++iq) {
-               m_phvtripQueue[waferhash].push(m_tq[iq]);
-            }
-         } // end potential trip id
-         //incriment event counter
-         m_phvtripProcessedEventsInt[waferhash] += 1;
-         //recalcuate running total:
-         m_phvtripRunningTotalInt[waferhash] += numhits;
-         m_phvtripQueue[waferhash].back() += numhits;
-      } //end is good check
-      else {
-         if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Was a bad module already: "<< waferhash <<endmsg;
-      }
-   } //end loop over tracks
-
-   // text output, summarizing the event
-   //if new bin summarzie the previous event.
-   if (newbin) {
-      SCT_ID::const_id_iterator waferItr  = m_waferItrBegin;
-      SCT_ID::const_id_iterator waferItrE = m_waferItrEnd;
-      for( ; waferItr not_eq waferItrE; ++waferItr ) {
-         Identifier       waferId   = *waferItr;
-         IdentifierHash   waferHash = m_pSCTHelper->wafer_hash( waferId );
-         if (m_phvtripHasItTripped_prev[waferHash]>0) {
-            pair<int,int> wp;
-            wp.first = (m_phvtripPrevTime - 3*maxtbins);
-            wp.second = (m_phvtripPrevTime + maxtbins);
-            m_summarytrips[waferHash].push_back(wp);
-            pair<int,int> lbn;
-            lbn.first = m_prevLBN.front();
-            lbn.second = m_prevLBN.back();
-            m_summarytripslb[waferHash].push_back(lbn);
-         }
-      }
-      m_phvtripPrevTime = curr_time; //reset prev and current time
-      m_prevLBN.pop();
-      m_prevLBN.push(lumi_block);
-   }
-
-   for (int iwaf(0); iwaf!=n_elements; ++iwaf) {
-      if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "mod "<< iwaf <<" events with that waf " <<m_phvtripProcessedEventsInt[iwaf] << " numhits "<<m_phvtripRunningTotalInt[iwaf] <<endmsg;
-      if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "did it trip "<<m_phvtripHasItTripped[iwaf] << endmsg;
-      if (m_phvtripHasItTripped[iwaf]) {
-         //if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "TRIP: "<< iwaf <<" "<<time_stamp <<" "<< Event_number <<" "<<  m_phvtripQueue[iwaf].back() <<endmsg;
-         if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "TRIP more info: abslimit = "<<  m_absolutetriplimit
-                                                    <<" hits/secs now = "<< ( m_phvtripQueue[iwaf].back() / maxtbins )
-                                                    <<" running total = "<< m_phvtripRunningTotalInt[iwaf]
-                                                    <<" running average =  "<<  m_phvtripRunningTotalInt[iwaf] / (curr_time-(m_phvtripFirstTime-1.01)) << endmsg;
+      **/
+      double limit{m_relativetriplimit * static_cast<double>(m_phvtripRunningTotalInt[waferhash]) / (static_cast<double>(curr_time)-(static_cast<double>(m_phvtripFirstTime-0.01)))};
+
+      ATH_MSG_DEBUG("waferhash "<<waferhash<<" itrk "<<itrk <<" run tot "<< m_phvtripRunningTotalInt[waferhash]
+                    <<" num hits "<<numhits<<" evnts processed "<<  m_phvtripProcessedEventsInt[waferhash] <<" limit "<<limit
+                    <<" abs limit, rel limit "<<m_absolutetriplimit<<","<< m_relativetriplimit<<" max bins "<<maxtbins);
+
+      if ( ((numhits + m_phvtripQueue[waferhash].back() )/ static_cast<double>(maxtbins) ) > m_absolutetriplimit
+           and ((numhits + m_phvtripQueue[waferhash].back() )/ static_cast<double>(maxtbins) ) > limit) {
+        //read back queue and see if the high hit rate is persistant for 3 previous bins (a bin is 5 seconds by default)
+        for (int iq{0}; iq<m_maxq; ++iq) {
+          m_tq[iq]=m_phvtripQueue[waferhash].front();
+          m_phvtripQueue[waferhash].pop();
+        }
+        if (m_tq[m_maxq-2]/static_cast<double>(maxtbins) > limit && m_tq[m_maxq-3]/static_cast<double>(maxtbins) > limit && m_tq[m_maxq-4]/static_cast<double>(maxtbins) > limit) {
+          // found a persistent trip/thing
+          ATH_MSG_DEBUG("Found a potential trip in SCT wafer " << waferhash);
+          ATH_MSG_DEBUG("TRIP more info: limit = " << limit << " abslimit = " << m_absolutetriplimit
+                        << " hits/secs now = " << ((numhits + m_tq[m_maxq-1])/ maxtbins )
+                        << " running total = " << m_phvtripRunningTotalInt[waferhash]
+                        << " running average =  " <<  m_phvtripRunningTotalInt[waferhash] / (curr_time-(m_phvtripFirstTime-1.01)));
+          m_phvtripHasItTripped[waferhash] = (numhits + m_tq[m_maxq-1] );
+        } // end trip found
+
+        //put queue back the way we found it:
+        for (int iq{0}; iq < m_maxq; ++iq) {
+          m_phvtripQueue[waferhash].push(m_tq[iq]);
+        }
+      } // end potential trip id
+      //incriment event counter
+      m_phvtripProcessedEventsInt[waferhash] += 1;
+      //recalcuate running total:
+      m_phvtripRunningTotalInt[waferhash] += numhits;
+      m_phvtripQueue[waferhash].back() += numhits;
+    } //end is good check
+    else {
+      ATH_MSG_DEBUG("Was a bad module already: " << waferhash);
+    }
+  } //end loop over tracks
+
+  // text output, summarizing the event
+  //if new bin summarzie the previous event.
+  if (newbin) {
+    SCT_ID::const_id_iterator waferItr{m_waferItrBegin};
+    SCT_ID::const_id_iterator waferItrE{m_waferItrEnd};
+    for (; waferItr not_eq waferItrE; ++waferItr) {
+      Identifier waferId{*waferItr};
+      IdentifierHash waferHash{m_pSCTHelper->wafer_hash(waferId)};
+      if (m_phvtripHasItTripped_prev[waferHash]>0) {
+        pair<int, int> wp;
+        wp.first = (m_phvtripPrevTime - 3*maxtbins);
+        wp.second = (m_phvtripPrevTime + maxtbins);
+        m_summarytrips[waferHash].push_back(wp);
+        pair<int ,int> lbn;
+        lbn.first = m_prevLBN.front();
+        lbn.second = m_prevLBN.back();
+        m_summarytripslb[waferHash].push_back(lbn);
       }
-   }
-   if (m_outputLowHits && (totalHits < m_lowHitCut) ) {
-      //msg(MSG::WARNING) <<"Event: " << Event_number << " Total hits: " << totalHits << endmsg;
-   }
-   return result;
+    }
+    m_phvtripPrevTime = curr_time; //reset prev and current time
+    m_prevLBN.pop();
+    m_prevLBN.push(lumi_block);
+  }
+
+  for (int iwaf{0}; iwaf!=n_elements; ++iwaf) {
+    ATH_MSG_DEBUG("mod "<< iwaf <<" events with that waf " <<m_phvtripProcessedEventsInt[iwaf] << " numhits "<<m_phvtripRunningTotalInt[iwaf]);
+    ATH_MSG_DEBUG("did it trip "<<m_phvtripHasItTripped[iwaf]);
+    if (m_phvtripHasItTripped[iwaf]) {
+      ATH_MSG_DEBUG("TRIP more info: abslimit = "<<  m_absolutetriplimit
+                    <<" hits/secs now = "<< ( m_phvtripQueue[iwaf].back() / maxtbins )
+                    <<" running total = "<< m_phvtripRunningTotalInt[iwaf]
+                    <<" running average =  "<<  m_phvtripRunningTotalInt[iwaf] / (curr_time-(m_phvtripFirstTime-1.01)));
+    }
+  }
+  if (m_outputLowHits && (totalHits < m_lowHitCut) ) {
+  }
+  return result;
 }
 
 bool
 SCT_CalibHvTool::fillFromData() {
-   bool result(true);
-   return result;
+  bool result{true};
+  return result;
 }
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHvTool.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHvTool.h
index 082980f99e683eef033b17aafa6342b0c379e017..60cd5ff9b15c41e5a50a83b87a1b7e3f2fe71527 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHvTool.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHvTool.h
@@ -6,22 +6,13 @@
  * @file SCT_CalibHvTool.h
  * Header file for the SCT_CalibHvTool class
  * @author Shaun Roe
-**/
+ **/
 
 #ifndef SCT_CalibHvTool_h
 #define SCT_CalibHvTool_h
 
-//STL includes
-#include <string>
-#include <vector>
-#include <queue>
-#include <utility> //for 'pair'
-
 //Athena includes
 #include "AthenaBaseComps/AthAlgTool.h"
-#include "StoreGate/StoreGateSvc.h"
-#include "GaudiKernel/ToolHandle.h"
-#include "GaudiKernel/ServiceHandle.h"
 
 //Inner detector includes
 #include "InDetIdentifier/SCT_ID.h"
@@ -30,6 +21,15 @@
 #include "SCT_CalibAlgs/ISCT_CalibHistoTool.h"
 #include "SCT_ConditionsTools/ISCT_DCSConditionsTool.h" //template parameter
 
+// Gaudi includes
+#include "GaudiKernel/ToolHandle.h"
+
+//STL includes
+#include <string>
+#include <vector>
+#include <queue>
+#include <utility> //for 'pair'
+
 //fwd declarations
 class StatusCode;
 class ISvcLocator;
@@ -39,68 +39,67 @@ class EventInfo;
 class SCT_CalibHvTool : public extends<AthAlgTool, ISCT_CalibHistoTool>
 {
 
-   public:
-      //@name Tool methods, reimplemented
-      //@{
-      SCT_CalibHvTool(const std::string&, const std::string&, const IInterface*);
-      virtual ~SCT_CalibHvTool() = default;
-      virtual StatusCode initialize();
-      virtual StatusCode finalize();
-      //interfaceID() implementation is in the baseclass
-      virtual StatusCode queryInterface(const InterfaceID & riid, void** ppvInterface );
-      //@}
-      //@name ISCT_CalibHistoTool methods, reimplemented
-      //@{
-      virtual bool book();
-      virtual bool fill(const bool fromData=false);
-      virtual bool fillFromData();
-      //@}
-
-   private:
-      enum { n_chipPerSide = 6, n_chipPerModule = 12, n_stripPerChip = 128, n_etaInBarrel = 12,
-             n_phiBinsB0 = 32, n_phiBinsB1 = 40, n_phiBinsB2 = 48, n_phiBinsB3 = 56,
-             n_phiBinsECShort = 40, n_phiBinsECMiddle = 40, n_phiBinsECOuter = 52, n_elements=8176,
-             n_BSErrorType = 15, firstBSErrorType = 0, lastBSErrorType = 14
-           };
-
-      ServiceHandle<StoreGateSvc> m_detStore;
-      ServiceHandle<StoreGateSvc> m_evtStore;
-      ToolHandle<ISCT_DCSConditionsTool> m_DCSConditionsTool{this, "SCT_DCSConditionsTool", "SCT_DCSConditionsTool", "Tool to retrieve SCT DCS information"};
-
-      const SCT_ID* m_pSCTHelper;
-      SCT_ID::const_id_iterator m_waferItrBegin;
-      SCT_ID::const_id_iterator m_waferItrEnd;
-      typedef std::vector<int> VecInt;
-      VecInt *m_sct_waferHash;
-      VecInt *m_sct_numHitsInWafer;
-
-      //private use in this class
-      int m_maxq;
-      // For HV trips
-      std::vector< std::queue<int> > m_phvtripQueue;
-      std::queue<int> m_prevLBN;
-      VecInt m_phvtripRunningTotalInt;
-      VecInt m_phvtripProcessedEventsInt;
-      VecInt m_phvtripHasItTripped;
-      VecInt m_phvtripHasItTripped_prev;
-      //
-      int m_phvtripPrevTime;
-      int m_phvtripFirstTime;
-      double          m_absolutetriplimit;
-      double          m_relativetriplimit;
-      int m_tq[100];
-
-      std::vector< std::vector< std::pair<int, int> > > m_summarytrips;
-      std::vector< std::vector< std::pair<int, int> > > m_summarytripslb;
-      const EventInfo* m_evt;
-      bool m_outputLowHits;
-      int m_lowHitCut;
-      ///retrieve a tool and report if it failed
-      template<class T>
-      bool retrievedTool(T & tool, const std::string & toolName) {
-         if (tool.retrieve().isFailure() ) return msg(MSG::ERROR)<<"Unable to retrieve "<<toolName<<endmsg, false;
-         return true;
-      }
+ public:
+  //@name Tool methods, reimplemented
+  //@{
+  SCT_CalibHvTool(const std::string&, const std::string&, const IInterface*);
+  virtual ~SCT_CalibHvTool() = default;
+  virtual StatusCode initialize();
+  virtual StatusCode finalize();
+  //@}
+  //@name ISCT_CalibHistoTool methods, reimplemented
+  //@{
+  virtual bool book();
+  virtual bool fill(const bool fromData=false);
+  virtual bool fillFromData();
+  //@}
+
+ private:
+  enum {n_chipPerSide = 6, n_chipPerModule = 12, n_stripPerChip = 128, n_etaInBarrel = 12,
+        n_phiBinsB0 = 32, n_phiBinsB1 = 40, n_phiBinsB2 = 48, n_phiBinsB3 = 56,
+        n_phiBinsECShort = 40, n_phiBinsECMiddle = 40, n_phiBinsECOuter = 52, n_elements=8176,
+        n_BSErrorType = 15, firstBSErrorType = 0, lastBSErrorType = 14
+  };
+
+  ToolHandle<ISCT_DCSConditionsTool> m_DCSConditionsTool{this, "SCT_DCSConditionsTool", "SCT_DCSConditionsTool", "Tool to retrieve SCT DCS information"};
+
+  const SCT_ID* m_pSCTHelper;
+  SCT_ID::const_id_iterator m_waferItrBegin;
+  SCT_ID::const_id_iterator m_waferItrEnd;
+  typedef std::vector<int> VecInt;
+  VecInt* m_sct_waferHash;
+  VecInt* m_sct_numHitsInWafer;
+
+  //private use in this class
+  int m_maxq;
+  // For HV trips
+  std::vector<std::queue<int>> m_phvtripQueue;
+  std::queue<int> m_prevLBN;
+  VecInt m_phvtripRunningTotalInt;
+  VecInt m_phvtripProcessedEventsInt;
+  VecInt m_phvtripHasItTripped;
+  VecInt m_phvtripHasItTripped_prev;
+  //
+  int m_phvtripPrevTime;
+  int m_phvtripFirstTime;
+  double m_absolutetriplimit;
+  double m_relativetriplimit;
+  int m_tq[100];
+
+  std::vector<std::vector<std::pair<int, int>>> m_summarytrips;
+  std::vector<std::vector<std::pair<int, int>>> m_summarytripslb;
+  const EventInfo* m_evt;
+  bool m_outputLowHits;
+  int m_lowHitCut;
+  ///retrieve a tool and report if it failed
+  template<class T>
+    bool retrievedTool(T& tool, const std::string& toolName) const {
+    if (tool.retrieve().isFailure()) {
+      ATH_MSG_ERROR("Unable to retrieve " << toolName);
+      return false;
+    }
+    return true;
+  }
 
 };
 #endif
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibLbTool.cxx b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibLbTool.cxx
index 0ad0ddc382a9ddd9512b4adb0cc52368a76149b4..17a1b8670184b5a24d52a1a78be0a67cb62661b3 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibLbTool.cxx
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibLbTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 
@@ -7,7 +7,7 @@
  * @file SCT_CalibLbTool.cxx
  * Implementation file for the SCT_CalibLbTool class
  * @author Shaun Roe
-**/
+ **/
 
 #include "SCT_CalibLbTool.h"
 #include "SCT_CalibUtilities.h"
@@ -17,17 +17,15 @@
 //InnerDetector
 #include "InDetReadoutGeometry/SiDetectorElement.h"
 #include "InDetReadoutGeometry/SCT_DetectorManager.h"
-
 #include "InDetRawData/SCT3_RawData.h"
 #include "InDetRawData/InDetRawDataCLASS_DEF.h"
 
-#include "StoreGate/ReadHandle.h"
-
 #include "Identifier/Identifier.h"
 #include "Identifier/IdentifierHash.h"
-#include "GaudiKernel/ITHistSvc.h"
 
-#include <boost/lexical_cast.hpp>
+#include "StoreGate/ReadHandle.h"
+
+#include "GaudiKernel/ITHistSvc.h"
 
 #include "TH1I.h"
 #include "TH1F.h"
@@ -35,266 +33,251 @@
 #include "TFile.h"
 #include "TMath.h"
 
+#include <boost/lexical_cast.hpp>
+
 using namespace std;
 using namespace SCT_CalibAlgs;
 
-const static string pathRoot("/LB/");
-const static int n_chipsPerSide(6);
-const static int n_stripsPerChip(128);
-const static string detectorNames[] = { "negativeEndcap", "barrel", "positiveEndcap" };
-const static string detectorPaths[]= {"SCTEC/", "SCTB/","SCTEA/"};
-
-
-SCT_CalibLbTool::SCT_CalibLbTool(const std::string& type, const std::string& name, const IInterface* parent) :
-   base_class(type, name, parent),
-   m_detStore("DetectorStore", name),
-   m_evtStore("StoreGateSvc", name),
-   m_evtInfo("SCT_CalibEventInfo",name),
-   m_pSCTHelper(0),
-   m_pManager(0),
-   m_sct_waferHash(0),
-   m_sct_firstStrip(0),
-   m_sct_rdoGroupSize(0),
-   m_lumiBlock(0),
-   m_LbRange(0),
-   m_LbsToMerge(0),
-   m_rdoContainerKey(std::string("SCT_RDOs"))
+static const string pathRoot{"/LB/"};
+static const int n_chipsPerSide{6};
+static const int n_stripsPerChip{128};
+static const string detectorNames[]{"negativeEndcap", "barrel", "positiveEndcap"};
+static const string detectorPaths[]{"SCTEC/", "SCTB/","SCTEA/"};
+
+SCT_CalibLbTool::SCT_CalibLbTool(const std::string& type, const std::string& name, const IInterface* parent):
+  base_class(type, name, parent),
+  m_pSCTHelper{nullptr},
+  m_pManager{nullptr},
+  m_sct_waferHash{0},
+  m_sct_firstStrip{0},
+  m_sct_rdoGroupSize{0},
+  m_lumiBlock{0},
+  m_LbRange{0},
+  m_LbsToMerge{0},
+  m_rdoContainerKey{"SCT_RDOs"}
 {
-   //nop
+  //nop
 }
 
 StatusCode
 SCT_CalibLbTool::initialize() {
-   msg( MSG::INFO)<<"Initialize of "<<PACKAGE_VERSION<<endmsg;
-   if ( service( "THistSvc", m_thistSvc ).isFailure() ) return msg( MSG::ERROR) << "Unable to retrieve pointer to THistSvc" << endmsg, StatusCode::FAILURE;
-   if ( m_detStore->retrieve( m_pSCTHelper, "SCT_ID").isFailure()) return msg( MSG::ERROR) << "Unable to retrieve SCTHelper" << endmsg, StatusCode::FAILURE;
-   if ( m_detStore->retrieve( m_pManager, "SCT").isFailure() ) return msg( MSG::ERROR) << "Unable to retrieve SCTManager" << endmsg,StatusCode::FAILURE;
-   std::pair<std::string, bool> msgCode=retrievedTool(m_evtInfo);
-   if (not msgCode.second) return msg( MSG::ERROR) <<msgCode.first<< endmsg,StatusCode::FAILURE;
-   //
-   m_waferItrBegin  = m_pSCTHelper->wafer_begin();
-   m_waferItrEnd  = m_pSCTHelper->wafer_end();
-
-   m_LbRange=numberOfLb();
-
-   // Read Handle Key
-   ATH_CHECK( m_rdoContainerKey.initialize() );
-
-   return StatusCode::SUCCESS;
+  ATH_MSG_INFO("Initialize of " << PACKAGE_VERSION);
+  ATH_CHECK(service("THistSvc", m_thistSvc));
+  ATH_CHECK(detStore()->retrieve(m_pSCTHelper, "SCT_ID"));
+  ATH_CHECK(detStore()->retrieve(m_pManager, "SCT"));
+  std::pair<std::string, bool> msgCode{retrievedTool(m_evtInfo)};
+  if (not msgCode.second) {
+    ATH_MSG_ERROR(msgCode.first);
+    return StatusCode::FAILURE;
+  }
+  //
+  m_waferItrBegin = m_pSCTHelper->wafer_begin();
+  m_waferItrEnd = m_pSCTHelper->wafer_end();
+
+  m_LbRange = numberOfLb();
+
+  // Read Handle Key
+  ATH_CHECK(m_rdoContainerKey.initialize());
+
+  return StatusCode::SUCCESS;
 }
 
 StatusCode
 SCT_CalibLbTool::finalize() {
-   msg( MSG::INFO)<<"Finalize of "<<PACKAGE_VERSION<<endmsg;
-   return StatusCode::SUCCESS;
-}
-
-StatusCode
-SCT_CalibLbTool::queryInterface(const InterfaceID & riid, void** ppvInterface ) {
-   if ( ISCT_CalibHistoTool::interfaceID().versionMatch(riid) ) {
-      *ppvInterface = dynamic_cast<ISCT_CalibHistoTool*>(this);
-   } else {
-      return AthAlgTool::queryInterface(riid, ppvInterface);
-   }
-   addRef();
-   return StatusCode::SUCCESS;
+  ATH_MSG_INFO("Finalize of " << PACKAGE_VERSION);
+  return StatusCode::SUCCESS;
 }
 
 bool
 SCT_CalibLbTool::book() {
-   msg( MSG::INFO)<<"book() method of "<<PACKAGE_VERSION<<endmsg;
-   bool result(true);
-   //pointers to the histos are deleted by m_thistSvc methods
-   m_phistoVector.clear();
-   m_phistoVector2D.clear();
-   string histoName=pathRoot+"GENERAL/";
-   m_LbRange=numberOfLb();
-   m_numberOfEventsHisto=new TH1I("events","Events",m_LbRange,0.5,m_LbRange+0.5);
-
-   m_LbsToMerge = LbToMerge();
-   int yAxisBins = TMath::Ceil(1.0*m_LbRange/m_LbsToMerge);
-
-
-   if( m_thistSvc->regHist( histoName.c_str(), m_numberOfEventsHisto ).isFailure() ) {
-      msg( MSG::ERROR ) << "Error in booking EventNumber histogram" << endmsg;
-   }
-   //histograms for each wafer
-   SCT_ID::const_id_iterator waferItr  = m_waferItrBegin;
-   ////
-   std::string hitmapPaths[3];
-   for (int i(0); i<3; ++i) {
-      hitmapPaths[i]=pathRoot+detectorPaths[i];
-   }
-   ////
-   for(; waferItr !=m_waferItrEnd; ++waferItr) {
-      const  Identifier &waferId=*waferItr;
-      const int bec(m_pSCTHelper->barrel_ec(waferId));
-      const string formattedPosition=formatPosition(waferId, m_pSCTHelper)+"_";
-      ////
-      std::string histotitle = string( "SCT " ) + detectorNames[ bec2Index(bec) ] + string( " Hitmap: plane " ) + formattedPosition;
-      std::string formattedPosition2D = formattedPosition+"_2D";
-      std::string name2D=hitmapPaths[bec2Index(m_pSCTHelper->barrel_ec( waferId ))] + formattedPosition + "_2D";
-      //    TH2F* hitmapHistoLB_tmp2D = new TH2F( TString( formattedPosition2D ), TString( histotitle ), nbins, firstStrip-0.5, lastStrip+0.5 ,1,0,0);
-      TH2F* hitmapHistoLB_tmp2D = new TH2F( TString( formattedPosition2D ), TString( histotitle ), nbins, firstStrip-0.5, lastStrip+0.5,yAxisBins,0.5,m_LbsToMerge*yAxisBins+0.5);
-      //    hitmapHistoLB_tmp2D->GetYaxis()->SetCanExtend(kTRUE);
-      //    TH2F* hitmapHistoLB_tmp2D = new TH2F( TString( formattedPosition2D ), TString( histotitle ), nbins, firstStrip-0.5, lastStrip+0.5 ,m_LbRange,0.5,m_LbRange+0.5);
-      if(m_thistSvc->regHist( name2D.c_str(), hitmapHistoLB_tmp2D ).isFailure() ) {
-         msg( MSG::ERROR ) << "Error in booking 2D Hitmap histogram" << endmsg;
-      } else {
-         //      m_phistoVector.push_back( hitmapHisto_tmp );
-         m_phistoVector2D.push_back( hitmapHistoLB_tmp2D );
-      }
-      ////
-      for (int iChip(0); iChip!=n_chipsPerSide; ++iChip) {
-         int chipId= m_pSCTHelper->side(waferId)==0 ? iChip:iChip+n_chipsPerSide;
-         const string formattedChipPosition = formattedPosition + boost::lexical_cast<string>(chipId);
-         const string hname= pathRoot+detectorPaths[bec2Index(bec)]+"/"+formattedChipPosition;
-         const string histTitle = string("SCT")+detectorNames[bec2Index(bec)]+string(" LB: chip ")+formattedChipPosition;
-         TH1F* hist_tmp = new TH1F(TString(formattedChipPosition), TString(histTitle), m_LbRange, 0.5, m_LbRange+0.5);
-         if(m_thistSvc->regHist(hname.c_str(), hist_tmp).isFailure() ) msg(MSG::ERROR)<<"Error in booking LB histogram"<<endl;
-         m_phistoVector.push_back(hist_tmp);
-      }
-   }
-   return result;
+  ATH_MSG_INFO("book() method of " << PACKAGE_VERSION);
+  bool result{true};
+  //pointers to the histos are deleted by m_thistSvc methods
+  m_phistoVector.clear();
+  m_phistoVector2D.clear();
+  string histoName{pathRoot+"GENERAL/"};
+  m_LbRange = numberOfLb();
+  m_numberOfEventsHisto = new TH1I{"events", "Events", m_LbRange, 0.5, m_LbRange+0.5};
+
+  m_LbsToMerge = LbToMerge();
+  int yAxisBins{static_cast<int>(TMath::Ceil(1.0*m_LbRange/m_LbsToMerge))};
+
+  if (m_thistSvc->regHist( histoName.c_str(), m_numberOfEventsHisto ).isFailure()) {
+    ATH_MSG_ERROR("Error in booking EventNumber histogram");
+  }
+  //histograms for each wafer
+  SCT_ID::const_id_iterator waferItr{m_waferItrBegin};
+  ////
+  std::string hitmapPaths[3];
+  for (int i{0}; i<3; ++i) {
+    hitmapPaths[i] = pathRoot+detectorPaths[i];
+  }
+  ////
+  for (; waferItr !=m_waferItrEnd; ++waferItr) {
+    const Identifier& waferId{*waferItr};
+    const int bec{m_pSCTHelper->barrel_ec(waferId)};
+    const string formattedPosition{formatPosition(waferId, m_pSCTHelper)+"_"};
+    ////
+    std::string histotitle{string{"SCT "} + detectorNames[bec2Index(bec)] + string{" Hitmap: plane "} + formattedPosition};
+    std::string formattedPosition2D{formattedPosition + "_2D"};
+    std::string name2D{hitmapPaths[bec2Index(m_pSCTHelper->barrel_ec(waferId))] + formattedPosition + "_2D"};
+    TH2F* hitmapHistoLB_tmp2D{new TH2F{TString{formattedPosition2D}, TString{histotitle}, nbins, firstStrip-0.5, lastStrip+0.5, yAxisBins, 0.5, m_LbsToMerge*yAxisBins+0.5}};
+    if (m_thistSvc->regHist(name2D.c_str(), hitmapHistoLB_tmp2D).isFailure()) {
+      ATH_MSG_ERROR("Error in booking 2D Hitmap histogram");
+    } else {
+      m_phistoVector2D.push_back(hitmapHistoLB_tmp2D);
+    }
+    ////
+    for (int iChip(0); iChip!=n_chipsPerSide; ++iChip) {
+      int chipId{m_pSCTHelper->side(waferId)==0 ? iChip:iChip+n_chipsPerSide};
+      const string formattedChipPosition{formattedPosition + boost::lexical_cast<string>(chipId)};
+      const string hname{pathRoot + detectorPaths[bec2Index(bec)] + "/" + formattedChipPosition};
+      const string histTitle{string{"SCT"} + detectorNames[bec2Index(bec)] + string{" LB: chip "} + formattedChipPosition};
+      TH1F* hist_tmp{new TH1F{TString{formattedChipPosition}, TString{histTitle}, m_LbRange, 0.5, m_LbRange+0.5}};
+      if (m_thistSvc->regHist(hname.c_str(), hist_tmp).isFailure()) ATH_MSG_ERROR("Error in booking LB histogram");
+      m_phistoVector.push_back(hist_tmp);
+    }
+  }
+  return result;
 }
 
 bool
-SCT_CalibLbTool::read(const std::string & fileName) {
-   msg( MSG::INFO)<<"read() method of "<<PACKAGE_VERSION<<endmsg;
-   bool result(true);
-   m_LbRange=numberOfLb();
-   //pointers to the histos are deleted by m_thistSvc methods
-   m_phistoVector.clear();
-   m_phistoVector2D.clear();
-   TFile *fileLB = TFile::Open( fileName.c_str() );
-   msg( MSG::INFO ) << "opening LB file : " << fileName.c_str() << endmsg;
-
-   if(fileLB) {
-      m_numberOfEventsHisto= (TH1I*) fileLB->Get("GENERAL/events");
-   } else {
-      msg( MSG::ERROR ) << "can not open LB file : " << fileName.c_str() << endmsg;
-      return result;
-   }
-
-   if( m_numberOfEventsHisto==NULL ) {
-      msg( MSG::ERROR ) << "Error in reading EventNumber histogram" << endmsg;
-   }
-   //std::cout<<"new of m_numberOfEventsHisto, value = "<<m_numberOfEventsHisto<<std::endl;
-   //histograms for each wafer
-   SCT_ID::const_id_iterator waferItr  = m_waferItrBegin;
-   for(; waferItr !=m_waferItrEnd; ++waferItr) {
-      const  Identifier &waferId=*waferItr;
-      const int bec(m_pSCTHelper->barrel_ec(waferId));
-      const string formattedPosition=formatPosition(waferId, m_pSCTHelper)+"_";
-      ////
-      std::string name2D=detectorPaths[bec2Index(m_pSCTHelper->barrel_ec( waferId ))] + formattedPosition + "_2D";
-      TH2F* hitmapHistoLB_tmp2D = (TH2F*) fileLB->Get(name2D.c_str());
-      //    hitmapHistoLB_tmp2D->GetYaxis()->SetCanExtend(kTRUE);
-
-      if( hitmapHistoLB_tmp2D==NULL ) {
-         msg( MSG::ERROR ) << "Error in reading Hitmap histogram" << endmsg;
+SCT_CalibLbTool::read(const std::string& fileName) {
+  ATH_MSG_INFO("read() method of " << PACKAGE_VERSION);
+  bool result{true};
+  m_LbRange = numberOfLb();
+  //pointers to the histos are deleted by m_thistSvc methods
+  m_phistoVector.clear();
+  m_phistoVector2D.clear();
+  TFile* fileLB{TFile::Open(fileName.c_str())};
+  ATH_MSG_INFO("opening LB file : " << fileName.c_str());
+
+  if (fileLB) {
+    m_numberOfEventsHisto = static_cast<TH1I*>(fileLB->Get("GENERAL/events"));
+  } else {
+    ATH_MSG_ERROR("can not open LB file : " << fileName.c_str());
+    return result;
+  }
+
+  if (m_numberOfEventsHisto==nullptr) {
+    ATH_MSG_ERROR("Error in reading EventNumber histogram");
+  }
+  //histograms for each wafer
+  SCT_ID::const_id_iterator waferItr{m_waferItrBegin};
+  for (; waferItr !=m_waferItrEnd; ++waferItr) {
+    const Identifier& waferId{*waferItr};
+    const int bec{m_pSCTHelper->barrel_ec(waferId)};
+    const string formattedPosition{formatPosition(waferId, m_pSCTHelper)+"_"};
+    ////
+    std::string name2D=detectorPaths[bec2Index(m_pSCTHelper->barrel_ec( waferId ))] + formattedPosition + "_2D";
+    TH2F* hitmapHistoLB_tmp2D = (TH2F*) fileLB->Get(name2D.c_str());
+
+    if (hitmapHistoLB_tmp2D==nullptr) {
+      ATH_MSG_ERROR("Error in reading Hitmap histogram");
+    } else {
+      m_phistoVector2D.push_back(hitmapHistoLB_tmp2D);
+    }
+    ////
+    for (int iChip{0}; iChip!=n_chipsPerSide; ++iChip) {
+      int chipId{m_pSCTHelper->side(waferId)==0 ? iChip : iChip+n_chipsPerSide};
+      const string hname{detectorPaths[bec2Index(bec)] + "/" + formattedPosition + boost::lexical_cast<string>(chipId)};
+      TH1F* hist_tmp{static_cast<TH1F*>(fileLB->Get(hname.c_str()))};
+      if (hist_tmp==nullptr) {
+        ATH_MSG_ERROR("Error in reading LB histogram");
       } else {
-         m_phistoVector2D.push_back( hitmapHistoLB_tmp2D );
-      }
-      ////
-      for (int iChip(0); iChip!=n_chipsPerSide; ++iChip) {
-         int chipId= m_pSCTHelper->side(waferId)==0 ? iChip : iChip+n_chipsPerSide;
-         const string hname= detectorPaths[bec2Index(bec)]+"/"+formattedPosition + boost::lexical_cast<string>(chipId);
-         TH1F* hist_tmp = (TH1F*) fileLB->Get(hname.c_str());
-         if( hist_tmp==NULL ) {
-            msg( MSG::ERROR ) << "Error in reading LB histogram" << endmsg;
-         } else {
-            m_phistoVector.push_back(hist_tmp);
-         }
+        m_phistoVector.push_back(hist_tmp);
       }
-   }
-   return result;
+    }
+  }
+  return result;
 }
 
 bool
 SCT_CalibLbTool::fill(const bool fromData) {
-   if (fromData) {
-      return fillFromData();
-   }
-   m_numberOfEventsHisto->Fill(m_lumiBlock);
-   bool result(true);
-   int maxEntry = m_sct_waferHash->size();
-   for( int i = 0; i != maxEntry; ++i ) {
-      int theFirstStrip = (*m_sct_firstStrip)[i];
-      //
-      int endStrip      = (*m_sct_rdoGroupSize)[i] + theFirstStrip;
-      int index         = (*m_sct_waferHash)[i];
-      TH2F * pThisHisto2D=m_phistoVector2D[ index ];
-      //     pThisHisto2D->GetYaxis()->SetCanExtend(kTRUE);
-
-      for( int strip(theFirstStrip); strip !=endStrip; ++strip) {
-         pThisHisto2D->Fill( strip, m_lumiBlock);
-      }
-      //
-      int rdoGroupSize  = (*m_sct_rdoGroupSize)[i];
-      IdentifierHash waferHash = (*m_sct_waferHash)[i];
-      fillLbForWafer(waferHash, theFirstStrip, rdoGroupSize);
-   }
-
-   return result;
+  if (fromData) {
+    return fillFromData();
+  }
+  m_numberOfEventsHisto->Fill(m_lumiBlock);
+  bool result{true};
+  int maxEntry{static_cast<int>(m_sct_waferHash->size())};
+  for (int i{0}; i != maxEntry; ++i) {
+    int theFirstStrip{(*m_sct_firstStrip)[i]};
+    //
+    int endStrip{(*m_sct_rdoGroupSize)[i] + theFirstStrip};
+    int index{(*m_sct_waferHash)[i]};
+    TH2F* pThisHisto2D{m_phistoVector2D[index]};
+
+    for (int strip{theFirstStrip}; strip !=endStrip; ++strip) {
+      pThisHisto2D->Fill(strip, m_lumiBlock);
+    }
+    //
+    int rdoGroupSize{(*m_sct_rdoGroupSize)[i]};
+    IdentifierHash waferHash{static_cast<unsigned int>((*m_sct_waferHash)[i])};
+    fillLbForWafer(waferHash, theFirstStrip, rdoGroupSize);
+  }
+
+  return result;
 }
 
 bool
 SCT_CalibLbTool::fillFromData() {
-   if (not m_evtInfo) return msg( MSG::ERROR ) << "The evtInfo pointer is NULL" << endmsg, false;
-   m_lumiBlock=m_evtInfo->lumiBlock();
-   m_numberOfEventsHisto->Fill(m_lumiBlock);
-   bool result(true);
-   //--- Retrieve the RDO container
-   typedef SCT_RDORawData SCTRawDataType;
-   SG::ReadHandle<SCT_RDO_Container> p_rdoContainer(m_rdoContainerKey);
-   if ( not p_rdoContainer.isValid() ) {
-      msg( MSG::ERROR ) << "Failed to retrieve SCT RDO container" << endmsg;
-   }
-
-   SCT_RDO_Container::const_iterator itr  = p_rdoContainer->begin();
-   SCT_RDO_Container::const_iterator itrE = p_rdoContainer->end();
-   for( ; itr != itrE; ++itr ) {
-      const InDetRawDataCollection<SCTRawDataType>* SCT_Collection( *itr );
-      if ( !SCT_Collection ) continue;// select only SCT RDOs
-      Identifier     waferId   = SCT_Collection->identify();
-      IdentifierHash waferHash = m_pSCTHelper->wafer_hash( waferId );
+  if (!m_evtInfo) {
+    ATH_MSG_ERROR("The evtInfo pointer is NULL");
+    return false;
+  }
+  m_lumiBlock=m_evtInfo->lumiBlock();
+  m_numberOfEventsHisto->Fill(m_lumiBlock);
+  bool result{true};
+  //--- Retrieve the RDO container
+  typedef SCT_RDORawData SCTRawDataType;
+  SG::ReadHandle<SCT_RDO_Container> p_rdoContainer{m_rdoContainerKey};
+  if (not p_rdoContainer.isValid()) {
+    ATH_MSG_ERROR("Failed to retrieve SCT RDO container");
+  }
+
+  SCT_RDO_Container::const_iterator itr{p_rdoContainer->begin()};
+  SCT_RDO_Container::const_iterator itrE{p_rdoContainer->end()};
+  for (; itr != itrE; ++itr) {
+    const InDetRawDataCollection<SCTRawDataType>* SCT_Collection{*itr};
+    if (SCT_Collection==nullptr) continue;// select only SCT RDOs
+    Identifier waferId{SCT_Collection->identify()};
+    IdentifierHash waferHash{m_pSCTHelper->wafer_hash(waferId)};
+    ////
+    TH2F* pThisHisto2D{m_phistoVector2D[static_cast<int>(waferHash)]};
+    ////
+    DataVector<SCTRawDataType>::const_iterator rdoItr{SCT_Collection->begin()};
+    DataVector<SCTRawDataType>::const_iterator rdoItrE{SCT_Collection->end()};
+    for (; rdoItr != rdoItrE; ++rdoItr ) {
+      int theFirstStrip{m_pSCTHelper->strip((*rdoItr)->identify())};
       ////
-      TH2F * pThisHisto2D =m_phistoVector2D[(int)waferHash];
-      ////
-      DataVector<SCTRawDataType>::const_iterator rdoItr  = SCT_Collection->begin();
-      DataVector<SCTRawDataType>::const_iterator rdoItrE = SCT_Collection->end();
-      for( ; rdoItr != rdoItrE; ++rdoItr ) {
-         int theFirstStrip = m_pSCTHelper->strip((*rdoItr)->identify());
-         ////
-         int strip=m_pSCTHelper->strip((*rdoItr)->identify());
-         const int endStrip=(*rdoItr)->getGroupSize() + strip;
-         for (; strip != endStrip; ++strip) {
-            pThisHisto2D->Fill( strip, m_lumiBlock);
-         }
-         ////
-         int rdoGroupSize  = (*rdoItr)->getGroupSize();
-         fillLbForWafer(waferHash, theFirstStrip, rdoGroupSize);
+      int strip{m_pSCTHelper->strip((*rdoItr)->identify())};
+      const int endStrip{(*rdoItr)->getGroupSize() + strip};
+      for (; strip != endStrip; ++strip) {
+        pThisHisto2D->Fill( strip, m_lumiBlock);
       }
-   }
+      ////
+      int rdoGroupSize{(*rdoItr)->getGroupSize()};
+      fillLbForWafer(waferHash, theFirstStrip, rdoGroupSize);
+    }
+  }
 
-   return result;
+  return result;
 }
 
 void
-SCT_CalibLbTool::fillLbForWafer(const IdentifierHash &waferHash, const int theFirstStrip, const int groupSize ) {
-   const InDetDD::SiDetectorElement* pElement = m_pManager->getDetectorElement( waferHash );
-
-   if ( pElement) {
-      int stripNumber = ( pElement->swapPhiReadoutDirection() ) ? lastStrip - theFirstStrip : theFirstStrip;
-      int index = ((int)waferHash)*n_chipsPerSide + stripNumber/n_stripsPerChip;
-      //--- Fill LB histograms
-      for( int j = 0; j != groupSize; ++j ) {
-         m_phistoVector[ index ]->Fill( m_lumiBlock );
-      }
-
-   } else {
-      msg( MSG::FATAL ) << "Element pointer is NULL" << endmsg;
-   }
+SCT_CalibLbTool::fillLbForWafer(const IdentifierHash& waferHash, const int theFirstStrip, const int groupSize) {
+  const InDetDD::SiDetectorElement* pElement{m_pManager->getDetectorElement(waferHash)};
+
+  if (pElement) {
+    int stripNumber{pElement->swapPhiReadoutDirection() ? lastStrip - theFirstStrip : theFirstStrip};
+    int index{static_cast<int>(waferHash)*n_chipsPerSide + stripNumber/n_stripsPerChip};
+    //--- Fill LB histograms
+    for (int j{0}; j != groupSize; ++j) {
+      m_phistoVector[index]->Fill(m_lumiBlock);
+    }
+
+  } else {
+    ATH_MSG_FATAL("Element pointer is NULL");
+  }
 
 }
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibLbTool.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibLbTool.h
index e3eee1990eb78cb2a9dab8926da017d1c07365c2..12f5ccf4a03709ab119c55ffbcb28516286b67b1 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibLbTool.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibLbTool.h
@@ -6,16 +6,14 @@
  * @file SCT_CalibLbTool.h
  * Header file for the SCT_CalibLbTool class
  * @author Shaun Roe
-**/
+ **/
 
 #ifndef SCT_CalibLbTool_h
 #define SCT_CalibLbTool_h
 
 //Athena includes
 #include "AthenaBaseComps/AthAlgTool.h"
-#include "StoreGate/StoreGateSvc.h"
 #include "StoreGate/ReadHandleKey.h"
-#include "GaudiKernel/ToolHandle.h"
 #include "SCT_CalibAlgs/ISCT_CalibEvtInfo.h"
 #include "InDetRawData/SCT_RDO_Container.h"
 
@@ -25,14 +23,16 @@
 //local includes
 #include "SCT_CalibAlgs/ISCT_CalibHistoTool.h"
 
+//Gaudi includes
+#include "GaudiKernel/ToolHandle.h"
+
 //STL includes
-#include <atomic>
 #include <string>
 
 //fwd declarations
 
 namespace InDetDD {
-class  SCT_DetectorManager;
+  class  SCT_DetectorManager;
 }
 class StatusCode;
 class ISvcLocator;
@@ -41,48 +41,43 @@ class IdentifierHash;
 class SCT_CalibLbTool : public extends<AthAlgTool, ISCT_CalibHistoTool>
 {
    
-   public:
-      //@name Tool methods, reimplemented
-      //@{
-      SCT_CalibLbTool(const std::string&, const std::string&, const IInterface*);
-      virtual ~SCT_CalibLbTool() = default;
-      virtual StatusCode initialize();
-      virtual StatusCode finalize();
-      //interfaceID() implementation is in the baseclass
-      virtual StatusCode queryInterface(const InterfaceID & riid, void** ppvInterface );
-      //@}
-      //@name ISCT_CalibHistoTool methods, reimplemented
-      //@{
-      virtual bool book();
-      virtual bool fill(const bool fromData=false);
-      virtual bool read(const std::string & fileName);
-      virtual bool fillFromData();
-      //@}
-
-   private:
-      ServiceHandle<StoreGateSvc> m_detStore;
-      ServiceHandle<StoreGateSvc> m_evtStore;
-      ServiceHandle<ISCT_CalibEvtInfo> m_evtInfo;
-
-      const SCT_ID* m_pSCTHelper;
-      const InDetDD::SCT_DetectorManager* m_pManager;
-      SCT_ID::const_id_iterator m_waferItrBegin;
-      SCT_ID::const_id_iterator m_waferItrEnd;
-      typedef std::vector<int> VecInt;
-      VecInt *m_sct_waferHash;
-      VecInt *m_sct_firstStrip;
-      VecInt *m_sct_rdoGroupSize;
-
-      mutable std::atomic_int m_lumiBlock;
-
-      //private use in this class
-      int                m_LbRange;
-      int                m_LbsToMerge;
-
-      SG::ReadHandleKey<SCT_RDO_Container> m_rdoContainerKey;
-
-      void
-      fillLbForWafer(const IdentifierHash &waferHash, const int theFirstStrip, const int groupSize );
+ public:
+  //@name Tool methods, reimplemented
+  //@{
+  SCT_CalibLbTool(const std::string&, const std::string&, const IInterface*);
+  virtual ~SCT_CalibLbTool() = default;
+  virtual StatusCode initialize();
+  virtual StatusCode finalize();
+  //@}
+  //@name ISCT_CalibHistoTool methods, reimplemented
+  //@{
+  virtual bool book();
+  virtual bool fill(const bool fromData=false);
+  virtual bool read(const std::string& fileName);
+  virtual bool fillFromData();
+  //@}
+
+ private:
+  ToolHandle<ISCT_CalibEvtInfo> m_evtInfo{this, "SCT_CalibEvtInfo", "SCT_CalibEvtInfo"};
+
+  const SCT_ID* m_pSCTHelper;
+  const InDetDD::SCT_DetectorManager* m_pManager;
+  SCT_ID::const_id_iterator m_waferItrBegin;
+  SCT_ID::const_id_iterator m_waferItrEnd;
+  typedef std::vector<int> VecInt;
+  VecInt* m_sct_waferHash;
+  VecInt* m_sct_firstStrip;
+  VecInt* m_sct_rdoGroupSize;
+
+  int m_lumiBlock;
+
+  //private use in this class
+  int m_LbRange;
+  int m_LbsToMerge;
+
+  SG::ReadHandleKey<SCT_RDO_Container> m_rdoContainerKey;
+
+  void fillLbForWafer(const IdentifierHash& waferHash, const int theFirstStrip, const int groupSize);
 
 };
 #endif
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibModuleListTool.cxx b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibModuleListTool.cxx
index 43a0b00fc0d8217eaf5c9b63ea5cbfbcbcfcda53..bb5c39831d17afd72e77c397beebef4222410c5f 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibModuleListTool.cxx
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibModuleListTool.cxx
@@ -1,72 +1,46 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "SCT_CalibModuleListTool.h"
 
-SCT_CalibModuleListTool::SCT_CalibModuleListTool(const std::string& type, const std::string& name, const IInterface* parent) :
-   base_class(type, name, parent),
-   m_pSCTHelper(0),
-   m_detStore("DetectorStore", name),
-   m_IOVDbSvc( "IOVDbSvc", name )
+SCT_CalibModuleListTool::SCT_CalibModuleListTool(const std::string& type, const std::string& name, const IInterface* parent):
+  base_class(type, name, parent),
+  m_pSCTHelper{nullptr},
+  m_IOVDbSvc{"IOVDbSvc", name}
 {
 }
 
 StatusCode SCT_CalibModuleListTool::initialize() {
-   if (msgLvl(MSG::DEBUG)) msg(MSG:: DEBUG) << "Initializing SCT_CalibModuleListTool "  << endmsg;
+  ATH_MSG_DEBUG("Initializing SCT_CalibModuleListTool");
 
-   StatusCode sc = m_detStore->retrieve( m_pSCTHelper, "SCT_ID" );
-   if ( sc.isFailure() ) {
-      msg( MSG::ERROR ) << "Unable to retrieve SCTHelper" << endmsg;
-      return sc;
-   }
+  ATH_CHECK(detStore()->retrieve(m_pSCTHelper, "SCT_ID"));
+  ATH_CHECK(m_MonitorConditionsTool.retrieve());
+  ATH_CHECK(m_IOVDbSvc.retrieve());
 
-   sc = m_MonitorConditionsTool.retrieve();
-   if ( sc.isFailure() ) {
-      msg( MSG::ERROR ) << "Unable to retrieve MonitorConditionsSvc" << endmsg;
-      return sc;
-   }
-
-   sc = m_IOVDbSvc.retrieve();
-   if ( sc.isFailure() ) {
-      msg( MSG::ERROR ) << "Unable to retrieve IOVDbSvc" << endmsg;
-      return sc;
-   }
-
-   return StatusCode::SUCCESS;
+  return StatusCode::SUCCESS;
 }
 
 StatusCode SCT_CalibModuleListTool::finalize() {
-   return StatusCode::SUCCESS;
-}
-
-StatusCode
-SCT_CalibModuleListTool::queryInterface(const InterfaceID & riid, void** ppvInterface ) {
-   if ( ISCT_CalibModuleListTool::interfaceID().versionMatch(riid) ) {
-      *ppvInterface = dynamic_cast<ISCT_CalibModuleListTool*>(this);
-   } else {
-      return AthAlgTool::queryInterface(riid, ppvInterface);
-   }
-   addRef();
-   return StatusCode::SUCCESS;
+  return StatusCode::SUCCESS;
 }
 
-StatusCode SCT_CalibModuleListTool::readModuleList( std::map< Identifier, std::set<Identifier> >& moduleList ) {
-   //--- Read strips using SCT_MonitorConditionsSvc
-   SCT_ID::const_id_iterator waferIdItr  = m_pSCTHelper->wafer_begin();
-   SCT_ID::const_id_iterator waferIdItrE = m_pSCTHelper->wafer_end();
-   for( ; waferIdItr != waferIdItrE; ++waferIdItr ) {
-      if ( m_pSCTHelper->side( *waferIdItr ) != 0 ) continue;
-      Identifier waferId  = *waferIdItr;
-      Identifier moduleId = m_pSCTHelper->module_id( waferId );
+StatusCode SCT_CalibModuleListTool::readModuleList(std::map<Identifier, std::set<Identifier>>& moduleList) const {
+  //--- Read strips using SCT_MonitorConditionsSvc
+  SCT_ID::const_id_iterator waferIdItr{m_pSCTHelper->wafer_begin()};
+  SCT_ID::const_id_iterator waferIdItrE{m_pSCTHelper->wafer_end()};
+  for (; waferIdItr != waferIdItrE; ++waferIdItr) {
+    if (m_pSCTHelper->side( *waferIdItr ) != 0) continue;
+    Identifier waferId{*waferIdItr};
+    Identifier moduleId{m_pSCTHelper->module_id(waferId)};
 
-      std::set<Identifier> stripIdList;
-      m_MonitorConditionsTool->badStrips( moduleId, stripIdList );
-      if ( !stripIdList.empty() ) moduleList.insert( std::map< Identifier, std::set<Identifier> >::value_type( moduleId, stripIdList ) );
-   }
+    std::set<Identifier> stripIdList;
+    m_MonitorConditionsTool->badStrips(moduleId, stripIdList);
+    if (!stripIdList.empty()) moduleList.insert(std::map<Identifier, std::set<Identifier>>::value_type(moduleId, stripIdList));
+  }
 
-   //--- Drop the folder to avoid conflict with SCTCalibWriteSvc
-   if ( !( m_IOVDbSvc->dropObject( "/SCT/Derived/Monitoring", true ) ) ) msg( MSG::ERROR ) << "Unable to drop /SCT/Derived/Monitoring" << endmsg;
+  //--- Drop the folder to avoid conflict with SCTCalibWriteSvc
+  if (!(m_IOVDbSvc->dropObject("/SCT/Derived/Monitoring", true))) ATH_MSG_ERROR("Unable to drop /SCT/Derived/Monitoring");
 
-   return StatusCode::SUCCESS;
+  return StatusCode::SUCCESS;
 }
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibModuleListTool.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibModuleListTool.h
index c66830f836247e24f7088a1149f5520ee61d63f4..e0ade40160f2e64a6951dff2eee1941474434ed3 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibModuleListTool.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibModuleListTool.h
@@ -3,33 +3,31 @@
 */
 
 /**
-* @file SCT_CalibModuleListTool.h
-* Header file for the SCT_CalibModuleListTool class
-* @author Shaun Roe
-**/
+ * @file SCT_CalibModuleListTool.h
+ * Header file for the SCT_CalibModuleListTool class
+ * @author Shaun Roe
+ **/
 
 #ifndef SCT_CalibModuleListTool_h
 #define SCT_CalibModuleListTool_h
 
-// STL and boost headers
-#include <string>
-#include <vector>
-#include <set>
-#include <map>
-
-#include "GaudiKernel/IInterface.h"
 #include "AthenaBaseComps/AthAlgTool.h"
-#include "StoreGate/StoreGateSvc.h"
+#include "SCT_CalibAlgs/ISCT_CalibModuleListTool.h"
+
 #include "AthenaKernel/IIOVDbSvc.h"
+#include "Identifier/Identifier.h"
+#include "InDetIdentifier/SCT_ID.h"
+#include "SCT_ConditionsTools/ISCT_MonitorConditionsTool.h"
+#include "StoreGate/StoreGateSvc.h"
 
 #include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/ServiceHandle.h"
 
-#include "SCT_CalibAlgs/ISCT_CalibModuleListTool.h"
-#include "SCT_ConditionsTools/ISCT_MonitorConditionsTool.h"
-
-#include "Identifier/Identifier.h"
-#include "InDetIdentifier/SCT_ID.h"
+// STL and boost headers
+#include <string>
+#include <vector>
+#include <set>
+#include <map>
 
 //fwd declarations
 class StatusCode;
@@ -37,22 +35,20 @@ class StatusCode;
 class SCT_CalibModuleListTool : public extends<AthAlgTool, ISCT_CalibModuleListTool>
 {
 
-   public:
-      //@name Tool methods, reimplemented
-      //@{
-      SCT_CalibModuleListTool(const std::string&, const std::string&, const IInterface*);
-      virtual ~SCT_CalibModuleListTool() = default;
-      virtual StatusCode initialize();
-      virtual StatusCode finalize();
-      virtual StatusCode queryInterface(const InterfaceID & riid, void** ppvInterface );
-      //@}
-      virtual StatusCode readModuleList( std::map< Identifier, std::set<Identifier> >& moduleList );
-
-   private:
-      const SCT_ID* m_pSCTHelper;
-      ServiceHandle<StoreGateSvc> m_detStore;
-      ToolHandle<ISCT_MonitorConditionsTool> m_MonitorConditionsTool{this, "SCT_MonitorConditionsTool", "SCT_MonitorConditionsTool/InDetSCT_MonitorConditionsTool", "Tool to retrieve noisy strip information"};
-      ServiceHandle<IIOVDbSvc> m_IOVDbSvc;
+ public:
+  //@name Tool methods, reimplemented
+  //@{
+  SCT_CalibModuleListTool(const std::string&, const std::string&, const IInterface*);
+  virtual ~SCT_CalibModuleListTool() = default;
+  virtual StatusCode initialize();
+  virtual StatusCode finalize();
+  //@}
+  virtual StatusCode readModuleList(std::map<Identifier, std::set<Identifier>>& moduleList) const;
+
+ private:
+  const SCT_ID* m_pSCTHelper;
+  ToolHandle<ISCT_MonitorConditionsTool> m_MonitorConditionsTool{this, "SCT_MonitorConditionsTool", "SCT_MonitorConditionsTool/InDetSCT_MonitorConditionsTool", "Tool to retrieve noisy strip information"};
+  ServiceHandle<IIOVDbSvc> m_IOVDbSvc;
 
 };
 #endif
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibNumbers.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibNumbers.h
index 5a5dd67d19f76c35323a0f7171095916a96561b0..56459138feaf9fae90c1af7aa4f8307a5ed7bd24 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibNumbers.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibNumbers.h
@@ -1,22 +1,22 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef SCT_CalibNumbers_h
 #define SCT_CalibNumbers_h
 namespace SCT_CalibAlgs {
 
-// SCT specific numbers
-enum { nbins       = 6*128, firstStrip     =  0, lastStrip     = nbins-1,
-       ntimeBins   =     3, firstTimeBin   =  0, lastTimeBin   =  2,
-       n_hitBins   =    50, first_hitBin   =  0, last_hitBin   = 50,
-       n_etaBins   =    13, first_etaBin   = -6, last_etaBin   =  6,
-       n_phiBins   =    56, first_phiBin   =  0, last_phiBin   = 55,
-       n_barrels   =     4, first_barrel   =  0, last_barrel   =  3,
-       n_disks     =     9, first_disk     =  0, last_disk     =  8,
-       n_etaBinsEC =     3, first_etaBinEC =  0, last_etaBinEC =  2,
-       n_phiBinsEC =    52, first_phiBinEC =  0, last_phiBinEC = 51
-     };
+  // SCT specific numbers
+  enum { nbins       = 6*128, firstStrip     =  0, lastStrip     = nbins-1,
+         ntimeBins   =     3, firstTimeBin   =  0, lastTimeBin   =  2,
+         n_hitBins   =    50, first_hitBin   =  0, last_hitBin   = 50,
+         n_etaBins   =    13, first_etaBin   = -6, last_etaBin   =  6,
+         n_phiBins   =    56, first_phiBin   =  0, last_phiBin   = 55,
+         n_barrels   =     4, first_barrel   =  0, last_barrel   =  3,
+         n_disks     =     9, first_disk     =  0, last_disk     =  8,
+         n_etaBinsEC =     3, first_etaBinEC =  0, last_etaBinEC =  2,
+         n_phiBinsEC =    52, first_phiBinEC =  0, last_phiBinEC = 51
+  };
 }
 
 #endif
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibUtilities.cxx b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibUtilities.cxx
index 291051f1bab04caddc8d20a737815ca4cb1e27c6..1f30a0d1a6d2f7502487191bc3ff594eb0798acb 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibUtilities.cxx
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibUtilities.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /**
@@ -11,62 +11,62 @@
 
 #include "SCT_CalibUtilities.h"
 
-//STL, boost
-#include <boost/lexical_cast.hpp>
-
 //gaudi
 #include "EventInfo/EventInfo.h"
 #include "EventInfo/EventID.h"
 #include "InDetIdentifier/SCT_ID.h"
 #include "Identifier/Identifier.h"
 
+//STL, boost
+#include <boost/lexical_cast.hpp>
+
 namespace SCT_CalibAlgs {
-std::string
-eventInfoAsString(const EventInfo * theEvent) {
-   using boost::lexical_cast;
-   using std::string;
-   const EventID* e=theEvent->event_ID();
-   string result = string("[ Run, Event, Time, Lumi, Bunch ] = [ " )+
-                   lexical_cast<string>(e->run_number()) + ", " +
-                   lexical_cast<string>(e->event_number()) + ", "+
-                   lexical_cast<string>(e->time_stamp()) + ", "+
-                   lexical_cast<string>(e->lumi_block()) + ", "+
-                   lexical_cast<string>(e->lumi_block()) + " ] ";
-   return result;
-}//function end
+  std::string
+  eventInfoAsString(const EventInfo* theEvent) {
+    using boost::lexical_cast;
+    using std::string;
+    const EventID* e{theEvent->event_ID()};
+    string result{string("[ Run, Event, Time, Lumi, Bunch ] = [ " )+
+        lexical_cast<string>(e->run_number()) + ", " +
+        lexical_cast<string>(e->event_number()) + ", "+
+        lexical_cast<string>(e->time_stamp()) + ", "+
+        lexical_cast<string>(e->lumi_block()) + ", "+
+        lexical_cast<string>(e->lumi_block()) + " ] "};
+    return result;
+  }//function end
 
-std::string
-formatPosition(const Identifier & waferId, const SCT_ID* helper, const std::string & delimiter, const bool includeSide) {
-   using boost::lexical_cast;
-   using std::string;
-   string result=lexical_cast<string>(helper->barrel_ec(waferId))+delimiter;
-   result+=lexical_cast<string>(helper->layer_disk(waferId))+delimiter;
-   result+=lexical_cast<string>(helper->phi_module(waferId))+delimiter;
-   result+=lexical_cast<string>(helper->eta_module(waferId));
-   if (includeSide) result+=(  delimiter+lexical_cast<string>(helper->side(waferId))  );
-   return result;
-}//function end
+  std::string
+  formatPosition(const Identifier& waferId, const SCT_ID* helper, const std::string& delimiter, const bool includeSide) {
+    using boost::lexical_cast;
+    using std::string;
+    string result{lexical_cast<string>(helper->barrel_ec(waferId))+delimiter};
+    result += lexical_cast<string>(helper->layer_disk(waferId))+delimiter;
+    result += lexical_cast<string>(helper->phi_module(waferId))+delimiter;
+    result += lexical_cast<string>(helper->eta_module(waferId));
+    if (includeSide) result += (delimiter+lexical_cast<string>(helper->side(waferId)));
+    return result;
+  }//function end
 
-std::string
-chipList2LinkList(const std::string & chipList) {
-   if ( chipList == "0-5  6-11" ) {
+  std::string
+  chipList2LinkList(const std::string& chipList) {
+    if (chipList == "0-5  6-11") {
       return "0 1";
-   } else if ( chipList == "0-5" ) {
+    } else if (chipList == "0-5") {
       return "0";
-   } else if ( chipList == "6-11" ) {
+    } else if (chipList == "6-11") {
       return "1";
-   } else {
+    } else {
       return "";
-   }
-}
+    }
+  }
 
-unsigned int
-bec2Index( const int bec ) {
-   return (bec/2) + 1;
-}
+  unsigned int
+  bec2Index(const int bec) {
+    return static_cast<unsigned int>((bec/2) + 1);
+  }
 
-std::string
-xmlCloseChannel() {
-   return "</channel>";
-}
+  std::string
+  xmlCloseChannel() {
+    return "</channel>";
+  }
 } //end of namespace
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibUtilities.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibUtilities.h
index 6078988736a53787fcf569d827ffb4c562999abf..c3dccda0e852511f2be30561c16988d001362933 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibUtilities.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibUtilities.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /**
@@ -21,27 +21,27 @@ class EventInfo;
 
 namespace SCT_CalibAlgs {
 
-std::string eventInfoAsString(const EventInfo * theEvent);
-std::string formatPosition(const Identifier & waferId, const SCT_ID* helper, const std::string & delimiter="_", const bool includeSide=true);
-std::string chipList2LinkList(const std::string & chipList);
-unsigned int bec2Index( const int bec );
-
-template <class T>
-std::string xmlValue(const std::string & name, const T value) {
-   std::ostringstream os;
-   os<<"  <value name=\""<<name<<"\">"<<value<<"</value>";
-   return os.str();
-}
-
-template <class T>
-std::string xmlOpenChannel(const long id, const T since, const T until) {
-   std::string opener=std::string("  <channel id=\"")+boost::lexical_cast<std::string>(id)+"\"";
-   std::string sinceAttr=std::string(" since=\"")+boost::lexical_cast<std::string>(since)+"\"";
-   std::string untilAttr=std::string(" until=\"")+boost::lexical_cast<std::string>(until)+"\"";
-   return opener+sinceAttr+untilAttr+">";
-}
-
-std::string xmlCloseChannel();
+  std::string eventInfoAsString(const EventInfo* theEvent);
+  std::string formatPosition(const Identifier& waferId, const SCT_ID* helper, const std::string& delimiter="_", const bool includeSide=true);
+  std::string chipList2LinkList(const std::string& chipList);
+  unsigned int bec2Index(const int bec);
+
+  template <class T>
+    std::string xmlValue(const std::string& name, const T value) {
+    std::ostringstream os;
+    os << "  <value name=\"" << name << "\">" << value << "</value>";
+    return os.str();
+  }
+
+  template <class T>
+    std::string xmlOpenChannel(const long id, const T since, const T until) {
+    std::string opener=std::string{"  <channel id=\""}+boost::lexical_cast<std::string>(id)+"\"";
+    std::string sinceAttr=std::string{" since=\""}+boost::lexical_cast<std::string>(since)+"\"";
+    std::string untilAttr=std::string{" until=\""}+boost::lexical_cast<std::string>(until)+"\"";
+    return opener+sinceAttr+untilAttr+">";
+  }
+
+  std::string xmlCloseChannel();
 
 } //end of namespace
 
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/XmlHeader.cxx b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/XmlHeader.cxx
index 893a8184927f252a25f927bdcf9b8d5c8f48c927..c3ee81616db4417e1a55feda5bb3f498eb07b9d0 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/XmlHeader.cxx
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/XmlHeader.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /**
@@ -13,13 +13,13 @@
 #include <ostream>
 
 namespace SCT_CalibAlgs {
-XmlHeader::XmlHeader(std::ostream & output): m_os(output) {
-   m_os << "<?xml version=\"1.0\" encoding=\"UTF-8\"?> \n";
-}
+  XmlHeader::XmlHeader(std::ostream& output): m_os(output) {
+    m_os << "<?xml version=\"1.0\" encoding=\"UTF-8\"?> \n";
+  }
 
-void
-XmlHeader::addStylesheet(const std::string  & stylesheetPath) {
-   m_os << std::string("<?xml-stylesheet type=\"text/xsl\" href=\"") + stylesheetPath + std::string("\"?>\n");
-}
+  void
+  XmlHeader::addStylesheet(const std::string& stylesheetPath) {
+    m_os << std::string{"<?xml-stylesheet type=\"text/xsl\" href=\""} + stylesheetPath + std::string{"\"?>\n"};
+  }
 
 }
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/XmlHeader.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/XmlHeader.h
index 8c11634bccc6b2adee691ba6b449e3cf039efacc..543bfc6d7a487f9bd07e6a8e3d3f58bdd1e5649f 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/XmlHeader.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/XmlHeader.h
@@ -1,13 +1,13 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /**
-* @file XmlHeader.h
-* header file for the XmlHeader class
-*
-* @author Shaun Roe shaun.roe@cern.ch
-**/
+ * @file XmlHeader.h
+ * header file for the XmlHeader class
+ *
+ * @author Shaun Roe shaun.roe@cern.ch
+ **/
 
 #ifndef SCT_CalibAlgs_XmlHeader_h
 #define SCT_CalibAlgs_XmlHeader_h
@@ -15,14 +15,14 @@
 #include <string>
 
 namespace SCT_CalibAlgs {
-class XmlHeader {
-   public:
-      XmlHeader(std::ostream & output);
-      void addStylesheet(const std::string & stylesheetPath);
+  class XmlHeader {
+  public:
+    XmlHeader(std::ostream& output);
+    void addStylesheet(const std::string& stylesheetPath);
 
-   private:
-      std::ostream & m_os;
-};
+  private:
+    std::ostream& m_os;
+  };
 }
 
 #endif
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/XmlStreamer.cxx b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/XmlStreamer.cxx
index 8cb1e0dfeab31e7f10e61d82e25f5e415c2602d8..f731bd8ff8938fec0155b3a092bf94944e3cb569 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/XmlStreamer.cxx
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/XmlStreamer.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 /*
  *  XmlStreamer.cpp
@@ -17,48 +17,49 @@ static Attributes_t empty;
 
 namespace SCT_CalibAlgs {
 
-XmlStreamer::XmlStreamer(const std::string & name, const Attributes_t & attributes, std::ostream & os):IElementStreamer(name,attributes, os) {
-   //if (m_nodeId==0) m_os<<"<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
-   m_os<<"\n<"<<m_name;
-   if (not attributes.empty()) {
-      Attributes_t::const_iterator i(attributes.begin());
-      const Attributes_t::const_iterator end(attributes.end());
-      for(; i!=end; ++i) {
-         m_os<<" "<<i->first<<"=\""<<i->second<<"\"";
+  XmlStreamer::XmlStreamer(const std::string& name, const Attributes_t& attributes, std::ostream& os):
+    IElementStreamer(name, attributes, os) {
+    m_os << "\n<" << m_name;
+    if (not attributes.empty()) {
+      Attributes_t::const_iterator i{attributes.begin()};
+      const Attributes_t::const_iterator end{attributes.end()};
+      for (; i!=end; ++i) {
+        m_os << " " << i->first << "=\"" << i->second << "\"";
       }
-   }
-   m_os<<">";
-   m_os.flush();
-}
+    }
+    m_os << ">";
+    m_os.flush();
+  }
 
-XmlStreamer::XmlStreamer(const std::string & name, const NameValue_t & attributeNames, const NameValue_t & attributeValues, std::ostream & os):IElementStreamer(name,attributeNames,attributeValues, os) {
-   //if (m_nodeId==0) m_os<<"<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
-   m_os<<"\n<"<<m_name;
-   for(unsigned int i(0); i!=attributeNames.size(); ++i) {
-      m_os<<" "<<attributeNames[i]<<"=\""<<attributeValues[i]<<"\"";
-   }
-   m_os<<">";
-   m_os.flush();
-}
+  XmlStreamer::XmlStreamer(const std::string& name, const NameValue_t& attributeNames, const NameValue_t& attributeValues, std::ostream& os):
+    IElementStreamer(name, attributeNames, attributeValues, os) {
+    m_os << "\n<" << m_name;
+    for (unsigned int i{0}; i!=attributeNames.size(); ++i) {
+      m_os << " " << attributeNames[i] << "=\"" << attributeValues[i] << "\"";
+    }
+    m_os << ">";
+    m_os.flush();
+  }
 
-XmlStreamer::XmlStreamer(const std::string & name, std::ostream & os)
-   :IElementStreamer(name,empty, os) {
-   m_os<<"\n<"<<m_name<<">";
-   m_os.flush();
-}
+  XmlStreamer::XmlStreamer(const std::string& name, std::ostream& os)
+    :IElementStreamer(name, empty, os) {
+    m_os << "\n<" << m_name << ">";
+    m_os.flush();
+  }
 
-XmlStreamer::XmlStreamer(const std::string & name, const std::string & attributeName, const std::string & attributeValue, std::ostream & os):IElementStreamer(name,attributeName,attributeValue, os) {
-   m_os<<"\n<"<<m_name;
-   for(unsigned int i(0); i!=m_attributeNames.size(); ++i) {
-      m_os<<" "<<m_attributeNames[i]<<"=\""<<m_attributeValues[i]<<"\"";
-   }
-   m_os<<">";
-   m_os.flush();
-}
+  XmlStreamer::XmlStreamer(const std::string& name, const std::string& attributeName, const std::string& attributeValue, std::ostream& os):
+    IElementStreamer(name, attributeName, attributeValue, os) {
+    m_os << "\n<" << m_name;
+    for (unsigned int i{0}; i!=m_attributeNames.size(); ++i) {
+      m_os << " " << m_attributeNames[i] << "=\"" << m_attributeValues[i] << "\"";
+    }
+    m_os << ">";
+    m_os.flush();
+  }
 
-XmlStreamer::~XmlStreamer() {
-   m_os<<"</"<<m_name<<">";
-   if (m_depth==1) m_os<<"\n";
-}
+  XmlStreamer::~XmlStreamer() {
+    m_os << "</" << m_name << ">";
+    if (m_depth==1) m_os << "\n";
+  }
 
 }
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/XmlStreamer.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/XmlStreamer.h
index 62bcf2df6dd4fae287dc50dab121ab77c263079c..a5bbd5ef9087244e21d2025aae4428bf668b87de 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/XmlStreamer.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/XmlStreamer.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 /*
  *  XmlStreamer.h
@@ -15,16 +15,16 @@
 
 namespace SCT_CalibAlgs {
 
-class XmlStreamer:public IElementStreamer {
+  class XmlStreamer:public IElementStreamer {
 
-   public:
-      XmlStreamer(const std::string & name, const std::map<std::string, std::string> & attributes, std::ostream & os=std::cout);
-      XmlStreamer(const std::string & name, const std::string & attributeName, const std::string & attributeValue, std::ostream & os=std::cout);
+  public:
+    XmlStreamer(const std::string& name, const std::map<std::string, std::string>& attributes, std::ostream& os=std::cout);
+    XmlStreamer(const std::string& name, const std::string& attributeName, const std::string& attributeValue, std::ostream& os=std::cout);
 
-      XmlStreamer(const std::string & name, const std::vector<std::string> & attributeNames, const std::vector<std::string> & attributeValues, std::ostream & os=std::cout);
-      XmlStreamer(const std::string & name, std::ostream & os=std::cout);
-      virtual ~XmlStreamer();
-};
+    XmlStreamer(const std::string& name, const std::vector<std::string>& attributeNames, const std::vector<std::string>& attributeValues, std::ostream& os=std::cout);
+    XmlStreamer(const std::string& name, std::ostream& os=std::cout);
+    virtual ~XmlStreamer();
+  };
 
 }
 #endif
diff --git a/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/src/SCT_ByteStreamFractionContainerCnv.cxx b/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/src/SCT_ByteStreamFractionContainerCnv.cxx
index 309644374436d0b2fc339b63b01fd54207c7a967..a896010a4d8dc358cf1f91b143a1e52cb1fe682b 100644
--- a/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/src/SCT_ByteStreamFractionContainerCnv.cxx
+++ b/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/src/SCT_ByteStreamFractionContainerCnv.cxx
@@ -20,7 +20,7 @@ SCT_ByteStreamFractionContainerCnv::createPersistent(SCT_ByteStreamFractionConta
 SCT_ByteStreamFractionContainer*
 SCT_ByteStreamFractionContainerCnv::createTransient() {
   MsgStream log(msgSvc(), "SCT_ByteStreamFractionContainerCnv" );
-  static pool::Guid p1_guid("EB75984C-F651-4F40-BA1C-9C2A0A558A55");
+  const pool::Guid p1_guid("EB75984C-F651-4F40-BA1C-9C2A0A558A55");
   if( compareClassGuid(p1_guid) ) {
     /** using auto_ptr ensures deletion of the persistent object */
     std::auto_ptr< SCT_ByteStreamFractionContainer_p1 > col_vect( poolReadObject< SCT_ByteStreamFractionContainer_p1 >() );
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_ModuleVetoCondAlg.cxx b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_ModuleVetoCondAlg.cxx
index 41879063b3fad1ba28a550e2fa4fb191228ca113..cd8b13726c5da7da95f7396f8ceee4eeb56f8143 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_ModuleVetoCondAlg.cxx
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_ModuleVetoCondAlg.cxx
@@ -8,15 +8,17 @@
 
 #include <memory>
 
-template <class T> 
-static std::vector<T> 
-string2Vector(const std::string& s) {
-  std::vector<T> v;
-  std::istringstream inputStream{s};
-  std::istream_iterator<T> vecRead{inputStream};
-  std::istream_iterator<T> endOfString; //relies on default constructor to produce eof
-  std::copy(vecRead,endOfString, std::back_inserter(v)); // DOESN'T ALLOW NON-WHITESPACE DELIMITER !
-  return v;
+namespace {
+  template <class T>
+  std::vector<T>
+  string2Vector(const std::string& s) {
+    std::vector<T> v;
+    std::istringstream inputStream{s};
+    std::istream_iterator<T> vecRead{inputStream};
+    std::istream_iterator<T> endOfString; //relies on default constructor to produce eof
+    std::copy(vecRead,endOfString, std::back_inserter(v)); // DOESN'T ALLOW NON-WHITESPACE DELIMITER !
+    return v;
+  }
 }
 
 SCT_ModuleVetoCondAlg::SCT_ModuleVetoCondAlg(const std::string& name, ISvcLocator* pSvcLocator)
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_TdaqEnabledCondAlg.cxx b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_TdaqEnabledCondAlg.cxx
index 8ceee2302dbb3da89c754d51338399b71668e835..f1e516fd71ae96a6230b379502b90179264cb6eb 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_TdaqEnabledCondAlg.cxx
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_TdaqEnabledCondAlg.cxx
@@ -5,7 +5,6 @@
 #include "SCT_TdaqEnabledCondAlg.h"
 
 #include "Identifier/IdentifierHash.h"
-#include "SCT_Cabling/SCT_OnlineId.h"
 
 #include "GaudiKernel/EventIDRange.h"
 
@@ -14,6 +13,7 @@
 SCT_TdaqEnabledCondAlg::SCT_TdaqEnabledCondAlg(const std::string& name, ISvcLocator* pSvcLocator)
   : ::AthReentrantAlgorithm(name, pSvcLocator)
   , m_condSvc{"CondSvc", name}
+  , m_onlineId{}
 {
 }
 
@@ -94,7 +94,7 @@ StatusCode SCT_TdaqEnabledCondAlg::execute(const EventContext& ctx) const
       unsigned int rodNumber{parseChannelName(chanName)};
       // range check on the rod channel number has been removed, since it refers both to existing channel names
       // which can be rods in slots 1-128 but also historical names which have since been removed
-      if (SCT_OnlineId::rodIdInRange(rodNumber)) {
+      if (m_onlineId.rodIdInRange(rodNumber)) {
         if ((not enabled.empty()) and (not writeCdo->setGoodRod(rodNumber))) {
           ATH_MSG_WARNING("Set insertion failed for rod "<<rodNumber);
         }
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_TdaqEnabledCondAlg.h b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_TdaqEnabledCondAlg.h
index 6822548b0f23ee8d1e63c07e801334da40405050..d2836a3009967deb06e5261dbcae542f86e6a2e4 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_TdaqEnabledCondAlg.h
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_TdaqEnabledCondAlg.h
@@ -9,6 +9,7 @@
 
 #include "AthenaPoolUtilities/CondAttrListCollection.h"
 #include "SCT_Cabling/ISCT_CablingTool.h"
+#include "SCT_Cabling/SCT_OnlineId.h"
 #include "SCT_ConditionsData/SCT_TdaqEnabledCondData.h"
 #include "StoreGate/ReadCondHandleKey.h"
 #include "StoreGate/WriteCondHandleKey.h"
@@ -35,6 +36,8 @@ class SCT_TdaqEnabledCondAlg : public AthReentrantAlgorithm
   ServiceHandle<ICondSvc> m_condSvc; 
   ToolHandle<ISCT_CablingTool> m_cablingTool{this, "SCT_CablingTool", "SCT_CablingTool", "Tool to retrieve SCT Cabling"};
 
+  SCT_OnlineId m_onlineId;
+
   static const unsigned int s_NRODS;
   static const unsigned int s_modulesPerRod;
   static const unsigned int s_earliestRunForFolder;
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsTools/CMakeLists.txt b/InnerDetector/InDetConditions/SCT_ConditionsTools/CMakeLists.txt
index 73dc39b601c963585d397b743cc6cfa875622c9c..6f3c6525d757d1c3c5a57d2406b0b6de8bdf84cc 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsTools/CMakeLists.txt
+++ b/InnerDetector/InDetConditions/SCT_ConditionsTools/CMakeLists.txt
@@ -15,7 +15,6 @@ atlas_depends_on_subdirs( PUBLIC
                           PRIVATE
                           Control/AthenaBaseComps
                           Control/StoreGate
-                          Event/EventInfo
                           Event/xAOD/xAODEventInfo
                           Database/RDBAccessSvc
                           DetectorDescription/GeoModel/GeoModelInterfaces
@@ -37,14 +36,14 @@ find_package( GMock )
 atlas_add_component ( SCT_ConditionsTools
                       src/components/*.cxx
                       INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaKernel Identifier GeoModelUtilities GaudiKernel AthenaBaseComps StoreGateLib SGtests EventInfo xAODEventInfo SCT_ConditionsData InDetByteStreamErrors InDetIdentifier InDetReadoutGeometry SCT_CablingLib SiPropertiesToolLib SCT_ConditionsToolsLib )
+                      LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaKernel Identifier GeoModelUtilities GaudiKernel AthenaBaseComps StoreGateLib SGtests xAODEventInfo SCT_ConditionsData InDetByteStreamErrors InDetIdentifier InDetReadoutGeometry SCT_CablingLib SiPropertiesToolLib SCT_ConditionsToolsLib )
 
 
 atlas_add_library( SCT_ConditionsToolsLib
                    src/*.cxx
                    PUBLIC_HEADERS SCT_ConditionsTools
                    INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaKernel Identifier GeoModelUtilities GaudiKernel AthenaBaseComps StoreGateLib SGtests EventInfo xAODEventInfo SCT_ConditionsData SiPropertiesToolLib InDetByteStreamErrors InDetIdentifier InDetReadoutGeometry SCT_CablingLib )
+                   LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaKernel Identifier GeoModelUtilities GaudiKernel AthenaBaseComps StoreGateLib SGtests xAODEventInfo SCT_ConditionsData SiPropertiesToolLib InDetByteStreamErrors InDetIdentifier InDetReadoutGeometry SCT_CablingLib )
 
 # Add unit tests
 atlas_add_test( SCT_RODVetoTool_test
diff --git a/InnerDetector/InDetConditions/SiLorentzAngleSvc/SiLorentzAngleSvc/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetConditions/SiLorentzAngleSvc/SiLorentzAngleSvc/ATLAS_CHECK_THREAD_SAFETY
deleted file mode 100644
index 8fd15b490e94ceed5df882f101861f1334cffad6..0000000000000000000000000000000000000000
--- a/InnerDetector/InDetConditions/SiLorentzAngleSvc/SiLorentzAngleSvc/ATLAS_CHECK_THREAD_SAFETY
+++ /dev/null
@@ -1 +0,0 @@
-InnerDetector/InDetConditions/SiLorentzAngleSvc
diff --git a/InnerDetector/InDetConditions/SiLorentzAngleSvc/python/SiLorentzAngleSvcConfigDb.py b/InnerDetector/InDetConditions/SiLorentzAngleSvc/python/SiLorentzAngleSvcConfigDb.py
deleted file mode 100644
index 77499920a0588387ccc65c6ada9f38092ab4552c..0000000000000000000000000000000000000000
--- a/InnerDetector/InDetConditions/SiLorentzAngleSvc/python/SiLorentzAngleSvcConfigDb.py
+++ /dev/null
@@ -1,8 +0,0 @@
-# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-
-# https://twiki.cern.ch/twiki/bin/viewauth/AtlasComputing/ConfiguredFactory
-
-from AthenaCommon.CfgGetter import addTool
-
-addTool("SiLorentzAngleSvc.SiLorentzAngleSvcConfig.getSCTLorentzAngleTool", "SCTLorentzAngleTool")
-addTool("SiLorentzAngleSvc.SiLorentzAngleSvcConfig.getPixelLorentzAngleTool", "PixelLorentzAngleTool")
diff --git a/InnerDetector/InDetConditions/SiLorentzAngleSvc/CMakeLists.txt b/InnerDetector/InDetConditions/SiLorentzAngleTool/CMakeLists.txt
similarity index 89%
rename from InnerDetector/InDetConditions/SiLorentzAngleSvc/CMakeLists.txt
rename to InnerDetector/InDetConditions/SiLorentzAngleTool/CMakeLists.txt
index 50f42535de49e12669a34f7724bd213a729b72ca..86125e6f55e0f9b5d90085a3cc64e8f2bd0baf0c 100644
--- a/InnerDetector/InDetConditions/SiLorentzAngleSvc/CMakeLists.txt
+++ b/InnerDetector/InDetConditions/SiLorentzAngleTool/CMakeLists.txt
@@ -1,9 +1,9 @@
 ################################################################################
-# Package: SiLorentzAngleSvc
+# Package: SiLorentzAngleTool
 ################################################################################
 
 # Declare the package name:
-atlas_subdir( SiLorentzAngleSvc )
+atlas_subdir( SiLorentzAngleTool )
 
 # Declare the package's dependencies:
 atlas_depends_on_subdirs( PUBLIC
@@ -29,7 +29,7 @@ atlas_depends_on_subdirs( PUBLIC
 find_package( Eigen )
 
 # Component(s) in the package:
-atlas_add_component( SiLorentzAngleSvc
+atlas_add_component( SiLorentzAngleTool
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS}
@@ -37,11 +37,11 @@ atlas_add_component( SiLorentzAngleSvc
 
 # Run tests:
 atlas_add_test( TestSCTLorentzAngle
-                SCRIPT athena.py --threads=5 SiLorentzAngleSvc/testSCTLorentzAngle.py 
+                SCRIPT athena.py --threads=5 SiLorentzAngleTool/testSCTLorentzAngle.py 
                 PROPERTIES TIMEOUT 300
                 ENVIRONMENT THREADS=5 )
 
 # Install files from the package:
-atlas_install_headers( SiLorentzAngleSvc )
+atlas_install_headers( SiLorentzAngleTool )
 atlas_install_python_modules( python/*.py )
 atlas_install_joboptions( share/*.py )
diff --git a/InnerDetector/InDetConditions/SiLorentzAngleTool/SiLorentzAngleTool/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetConditions/SiLorentzAngleTool/SiLorentzAngleTool/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..372bf00d2df19e4c2caebf243ebcc38310857d48
--- /dev/null
+++ b/InnerDetector/InDetConditions/SiLorentzAngleTool/SiLorentzAngleTool/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetConditions/SiLorentzAngleTool
diff --git a/InnerDetector/InDetConditions/SiLorentzAngleSvc/SiLorentzAngleSvc/SiLorentzAngleCondData.h b/InnerDetector/InDetConditions/SiLorentzAngleTool/SiLorentzAngleTool/SiLorentzAngleCondData.h
similarity index 100%
rename from InnerDetector/InDetConditions/SiLorentzAngleSvc/SiLorentzAngleSvc/SiLorentzAngleCondData.h
rename to InnerDetector/InDetConditions/SiLorentzAngleTool/SiLorentzAngleTool/SiLorentzAngleCondData.h
diff --git a/InnerDetector/InDetConditions/SiLorentzAngleSvc/doc/packagedoc.h b/InnerDetector/InDetConditions/SiLorentzAngleTool/doc/packagedoc.h
similarity index 79%
rename from InnerDetector/InDetConditions/SiLorentzAngleSvc/doc/packagedoc.h
rename to InnerDetector/InDetConditions/SiLorentzAngleTool/doc/packagedoc.h
index c83b513489040770ab492c779f9538bd06b398dc..6b1909528d45d1c580153a4916ebb8f4d02d1ae3 100644
--- a/InnerDetector/InDetConditions/SiLorentzAngleSvc/doc/packagedoc.h
+++ b/InnerDetector/InDetConditions/SiLorentzAngleTool/doc/packagedoc.h
@@ -4,29 +4,29 @@
 
 /**
 
-@page SiLorentzAngleSvc_page SiLorentzAngleSvc Package
+@page SiLorentzAngleTool_page SiLorentzAngleTool Package
 
 @authors Grant Gorfine
 
-@section SiLorentzAngleSvc_SiLorentzAngleSvcIntro Introduction
+@section SiLorentzAngleTool_SiLorentzAngleToolIntro Introduction
 
 Service for providing Lorentz angle (and the corresponding shift of the measurement)
 for each detector element. 
 
-@section SiLorentzAngleSvc_SiLorentzAngleSvcUsage Usage Notes
+@section SiLorentzAngleTool_SiLorentzAngleToolUsage Usage Notes
 
 A python module has been provided for easy setup.
 To load simply include the following in your job options.
 
 @verbatim
-  from SiLorentzAngleSvc.LorentzAngleSvcSetup import lorentzAngleSvc
+  from SiLorentzAngleTool.LorentzAngleSvcSetup import lorentzAngleSvc
 @endverbatim
 
 This will setup both pixel and SCT. If you only want to setup them up separately you can do
 
 @verbatim
-  from SiLorentzAngleSvc.PixelLorentzAngleSvcSetup import pixelLorentzAngleSvcSetup
-  from SiLorentzAngleSvc.SCTLorentzAngleSvcSetup import sctLorentzAngleSvcSetup
+  from SiLorentzAngleTool.PixelLorentzAngleSvcSetup import pixelLorentzAngleSvcSetup
+  from SiLorentzAngleTool.SCTLorentzAngleSvcSetup import sctLorentzAngleSvcSetup
 @endverbatim
 
 
@@ -91,7 +91,7 @@ or
 Alternatively, you can also access the services by:
 
 @verbatim
-  from SiLorentzAngleSvc.LorentzAngleSvcSetup import PixelLorentzAngleSvc,SCTLorentzAngleSvc
+  from SiLorentzAngleTool.LorentzAngleSvcSetup import PixelLorentzAngleSvc,SCTLorentzAngleSvc
   PixelLorentzAngleSvc.OutputLevel = VERBOSE
   SCTLorentzAngleSvc.OutputLevel = VERBOSE
 @endverbatim
@@ -99,10 +99,10 @@ Alternatively, you can also access the services by:
 or 
 
 @verbatim
-  from SiLorentzAngleSvc.PixelLorentzAngleSvcSetup import PixelLorentzAngleSvc
+  from SiLorentzAngleTool.PixelLorentzAngleSvcSetup import PixelLorentzAngleSvc
   PixelLorentzAngleSvc.OutputLevel = VERBOSE
 
-  from SiLorentzAngleSvc.SCTLorentzAngleSvcSetup import SCTLorentzAngleSvc
+  from SiLorentzAngleTool.SCTLorentzAngleSvcSetup import SCTLorentzAngleSvc
   SCTLorentzAngleSvc.OutputLevel = VERBOSE
 @endverbatim
 
diff --git a/InnerDetector/InDetConditions/SiLorentzAngleSvc/python/PixelLorentzAngleToolSetup.py b/InnerDetector/InDetConditions/SiLorentzAngleTool/python/PixelLorentzAngleToolSetup.py
similarity index 94%
rename from InnerDetector/InDetConditions/SiLorentzAngleSvc/python/PixelLorentzAngleToolSetup.py
rename to InnerDetector/InDetConditions/SiLorentzAngleTool/python/PixelLorentzAngleToolSetup.py
index f6bad11a9b68e3ebefd8b32ea7f478b72b7c197a..f9f0e2b6d0e364cae01f3a3d23ce2c4d3e074d01 100644
--- a/InnerDetector/InDetConditions/SiLorentzAngleSvc/python/PixelLorentzAngleToolSetup.py
+++ b/InnerDetector/InDetConditions/SiLorentzAngleTool/python/PixelLorentzAngleToolSetup.py
@@ -43,7 +43,7 @@ class PixelLorentzAngleToolSetup:
                                   ReadKey = "PixelSiliconPropertiesVector")
 
     if not hasattr(condSeq, "PixelSiLorentzAngleCondAlg"):
-      from SiLorentzAngleSvc.SiLorentzAngleSvcConf import PixelSiLorentzAngleCondAlg
+      from SiLorentzAngleTool.SiLorentzAngleToolConf import PixelSiLorentzAngleCondAlg
       condSeq += PixelSiLorentzAngleCondAlg(name = "PixelSiLorentzAngleCondAlg",
                                             SiPropertiesTool = ToolSvc.PixelSiPropertiesTool,
                                             UseMagFieldSvc = True,
@@ -51,7 +51,7 @@ class PixelLorentzAngleToolSetup:
       pixelSiLorentzAngleCondAlg = condSeq.PixelSiLorentzAngleCondAlg
 
     if not hasattr(ToolSvc, "PixelLorentzAngleTool"):
-      from SiLorentzAngleSvc.SiLorentzAngleSvcConf import SiLorentzAngleTool
+      from SiLorentzAngleTool.SiLorentzAngleToolConf import SiLorentzAngleTool
       ToolSvc += SiLorentzAngleTool(name="PixelLorentzAngleTool", DetectorName="Pixel", SiLorentzAngleCondData="PixelSiLorentzAngleCondData")
       pixelLorentzAngleTool = ToolSvc.PixelLorentzAngleTool
       # Pass the silicon conditions tool to the Lorentz angle tool
diff --git a/InnerDetector/InDetConditions/SiLorentzAngleSvc/python/SCTLorentzAngleToolSetup.py b/InnerDetector/InDetConditions/SiLorentzAngleTool/python/SCTLorentzAngleToolSetup.py
similarity index 97%
rename from InnerDetector/InDetConditions/SiLorentzAngleSvc/python/SCTLorentzAngleToolSetup.py
rename to InnerDetector/InDetConditions/SiLorentzAngleTool/python/SCTLorentzAngleToolSetup.py
index e259c39cc974b37ead81d8b1902edc15364f7a8b..270b01b6f0a442a5760f828f8348efc830fb5b16 100644
--- a/InnerDetector/InDetConditions/SiLorentzAngleSvc/python/SCTLorentzAngleToolSetup.py
+++ b/InnerDetector/InDetConditions/SiLorentzAngleTool/python/SCTLorentzAngleToolSetup.py
@@ -45,7 +45,7 @@ class SCTLorentzAngleToolSetup:
         from AthenaCommon.AlgSequence import AthSequencer
         condSeq = AthSequencer("AthCondSeq")
         if not hasattr(condSeq, "SCTSiLorentzAngleCondAlg"):
-            from SiLorentzAngleSvc.SiLorentzAngleSvcConf import SCTSiLorentzAngleCondAlg
+            from SiLorentzAngleTool.SiLorentzAngleToolConf import SCTSiLorentzAngleCondAlg
             from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
             condSeq += SCTSiLorentzAngleCondAlg(name = "SCTSiLorentzAngleCondAlg",
                                                 SiConditionsTool = sctSiliconConditionsTool,
diff --git a/InnerDetector/InDetConditions/SiLorentzAngleSvc/python/SiLorentzAngleSvcConfig.py b/InnerDetector/InDetConditions/SiLorentzAngleTool/python/SiLorentzAngleToolConfig.py
similarity index 81%
rename from InnerDetector/InDetConditions/SiLorentzAngleSvc/python/SiLorentzAngleSvcConfig.py
rename to InnerDetector/InDetConditions/SiLorentzAngleTool/python/SiLorentzAngleToolConfig.py
index 305fe9fe0e1ecc69d09d98912dd7e3beae5ebdb4..00c6e6103ce87efce9ee6bdf4ead921094a9c72b 100644
--- a/InnerDetector/InDetConditions/SiLorentzAngleSvc/python/SiLorentzAngleSvcConfig.py
+++ b/InnerDetector/InDetConditions/SiLorentzAngleTool/python/SiLorentzAngleToolConfig.py
@@ -7,11 +7,11 @@ from AthenaCommon import CfgMgr
 def getSCTLorentzAngleTool(name="SCTLorentzAngleTool", **kwargs):
     kwargs.setdefault("DetectorName", "SCT")
     kwargs.setdefault("SiLorentzAngleCondData", "SCTSiLorentzAngleCondData")
-    from SiLorentzAngleSvc.SiLorentzAngleSvcConf import SiLorentzAngleTool
+    from SiLorentzAngleTool.SiLorentzAngleToolConf import SiLorentzAngleTool
     return CfgMgr.SiLorentzAngleTool(name, **kwargs)
 
 def getPixelLorentzAngleTool(name="PixelLorentzAngleTool", **kwargs):
     kwargs.setdefault("DetectorName", "Pixel")
     kwargs.setdefault("SiLorentzAngleCondData","PixelSiLorentzAngleCondData")
-    from SiLorentzAngleSvc.SiLorentzAngleSvcConf import SiLorentzAngleTool
+    from SiLorentzAngleTool.SiLorentzAngleToolConf import SiLorentzAngleTool
     return CfgMgr.SiLorentzAngleTool(name, **kwargs)
diff --git a/InnerDetector/InDetConditions/SiLorentzAngleTool/python/SiLorentzAngleToolConfigDb.py b/InnerDetector/InDetConditions/SiLorentzAngleTool/python/SiLorentzAngleToolConfigDb.py
new file mode 100644
index 0000000000000000000000000000000000000000..2176f55ea05d6bcd6d7e6a94877d7f175ca63ad7
--- /dev/null
+++ b/InnerDetector/InDetConditions/SiLorentzAngleTool/python/SiLorentzAngleToolConfigDb.py
@@ -0,0 +1,8 @@
+# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+
+# https://twiki.cern.ch/twiki/bin/viewauth/AtlasComputing/ConfiguredFactory
+
+from AthenaCommon.CfgGetter import addTool
+
+addTool("SiLorentzAngleTool.SiLorentzAngleToolConfig.getSCTLorentzAngleTool", "SCTLorentzAngleTool")
+addTool("SiLorentzAngleTool.SiLorentzAngleToolConfig.getPixelLorentzAngleTool", "PixelLorentzAngleTool")
diff --git a/InnerDetector/InDetConditions/SiLorentzAngleSvc/python/__init__.py b/InnerDetector/InDetConditions/SiLorentzAngleTool/python/__init__.py
similarity index 100%
rename from InnerDetector/InDetConditions/SiLorentzAngleSvc/python/__init__.py
rename to InnerDetector/InDetConditions/SiLorentzAngleTool/python/__init__.py
diff --git a/InnerDetector/InDetConditions/SiLorentzAngleSvc/share/testSCTLorentzAngle.py b/InnerDetector/InDetConditions/SiLorentzAngleTool/share/testSCTLorentzAngle.py
similarity index 94%
rename from InnerDetector/InDetConditions/SiLorentzAngleSvc/share/testSCTLorentzAngle.py
rename to InnerDetector/InDetConditions/SiLorentzAngleTool/share/testSCTLorentzAngle.py
index 2824eb152213f95815b99041e06e0111d039551f..0da2a95e94f9441854b464039d9b172ba4e4bb16 100644
--- a/InnerDetector/InDetConditions/SiLorentzAngleSvc/share/testSCTLorentzAngle.py
+++ b/InnerDetector/InDetConditions/SiLorentzAngleTool/share/testSCTLorentzAngle.py
@@ -69,10 +69,10 @@ from IOVDbSvc.CondDB import conddb
 IOVDbSvc.GlobalTag="OFLCOND-MC16-SDR-18"
 IOVDbSvc.OutputLevel = 3
 
-from SiLorentzAngleSvc.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
+from SiLorentzAngleTool.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
 sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup()
 
-from SiLorentzAngleSvc.SiLorentzAngleSvcConf import SCTSiLorentzAngleTestAlg
+from SiLorentzAngleTool.SiLorentzAngleToolConf import SCTSiLorentzAngleTestAlg
 job += SCTSiLorentzAngleTestAlg(SCTLorentzAngleTool=sctLorentzAngleToolSetup.SCTLorentzAngleTool)
 
 # Prepare EventSelector
diff --git a/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/PixelSiLorentzAngleCondAlg.cxx b/InnerDetector/InDetConditions/SiLorentzAngleTool/src/PixelSiLorentzAngleCondAlg.cxx
similarity index 100%
rename from InnerDetector/InDetConditions/SiLorentzAngleSvc/src/PixelSiLorentzAngleCondAlg.cxx
rename to InnerDetector/InDetConditions/SiLorentzAngleTool/src/PixelSiLorentzAngleCondAlg.cxx
diff --git a/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/PixelSiLorentzAngleCondAlg.h b/InnerDetector/InDetConditions/SiLorentzAngleTool/src/PixelSiLorentzAngleCondAlg.h
similarity index 97%
rename from InnerDetector/InDetConditions/SiLorentzAngleSvc/src/PixelSiLorentzAngleCondAlg.h
rename to InnerDetector/InDetConditions/SiLorentzAngleTool/src/PixelSiLorentzAngleCondAlg.h
index 0537d770ab0da0a4bfa3a2eae8c9b64fd8947f6d..6cc0db2b2612a8040618eaf445164c7a7af3e5bb 100644
--- a/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/PixelSiLorentzAngleCondAlg.h
+++ b/InnerDetector/InDetConditions/SiLorentzAngleTool/src/PixelSiLorentzAngleCondAlg.h
@@ -14,7 +14,7 @@
 #include "GaudiKernel/ICondSvc.h"
 #include "SiPropertiesTool/ISiPropertiesTool.h"
 
-#include "SiLorentzAngleSvc/SiLorentzAngleCondData.h"
+#include "SiLorentzAngleTool/SiLorentzAngleCondData.h"
 #include "InDetIdentifier/PixelID.h"
 #include "InDetReadoutGeometry/PixelDetectorManager.h"
 
diff --git a/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/SCTSiLorentzAngleCondAlg.cxx b/InnerDetector/InDetConditions/SiLorentzAngleTool/src/SCTSiLorentzAngleCondAlg.cxx
similarity index 100%
rename from InnerDetector/InDetConditions/SiLorentzAngleSvc/src/SCTSiLorentzAngleCondAlg.cxx
rename to InnerDetector/InDetConditions/SiLorentzAngleTool/src/SCTSiLorentzAngleCondAlg.cxx
diff --git a/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/SCTSiLorentzAngleCondAlg.h b/InnerDetector/InDetConditions/SiLorentzAngleTool/src/SCTSiLorentzAngleCondAlg.h
similarity index 98%
rename from InnerDetector/InDetConditions/SiLorentzAngleSvc/src/SCTSiLorentzAngleCondAlg.h
rename to InnerDetector/InDetConditions/SiLorentzAngleTool/src/SCTSiLorentzAngleCondAlg.h
index 189038555b487882f19679ff28c2926d562d3d17..f8819e3411897cf9b99e0671cf92d99077f15a2b 100644
--- a/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/SCTSiLorentzAngleCondAlg.h
+++ b/InnerDetector/InDetConditions/SiLorentzAngleTool/src/SCTSiLorentzAngleCondAlg.h
@@ -17,7 +17,7 @@
 #include "InDetConditionsSummaryService/ISiliconConditionsTool.h"
 #include "InDetReadoutGeometry/SiDetectorElementCollection.h"
 #include "SCT_ConditionsData/SCT_DCSFloatCondData.h"
-#include "SiLorentzAngleSvc/SiLorentzAngleCondData.h"
+#include "SiLorentzAngleTool/SiLorentzAngleCondData.h"
 #include "StoreGate/ReadCondHandleKey.h"
 #include "StoreGate/WriteCondHandleKey.h"
 
diff --git a/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/SCTSiLorentzAngleTestAlg.cxx b/InnerDetector/InDetConditions/SiLorentzAngleTool/src/SCTSiLorentzAngleTestAlg.cxx
similarity index 100%
rename from InnerDetector/InDetConditions/SiLorentzAngleSvc/src/SCTSiLorentzAngleTestAlg.cxx
rename to InnerDetector/InDetConditions/SiLorentzAngleTool/src/SCTSiLorentzAngleTestAlg.cxx
diff --git a/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/SCTSiLorentzAngleTestAlg.h b/InnerDetector/InDetConditions/SiLorentzAngleTool/src/SCTSiLorentzAngleTestAlg.h
similarity index 100%
rename from InnerDetector/InDetConditions/SiLorentzAngleSvc/src/SCTSiLorentzAngleTestAlg.h
rename to InnerDetector/InDetConditions/SiLorentzAngleTool/src/SCTSiLorentzAngleTestAlg.h
diff --git a/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/SiLorentzAngleCondData.cxx b/InnerDetector/InDetConditions/SiLorentzAngleTool/src/SiLorentzAngleCondData.cxx
similarity index 98%
rename from InnerDetector/InDetConditions/SiLorentzAngleSvc/src/SiLorentzAngleCondData.cxx
rename to InnerDetector/InDetConditions/SiLorentzAngleTool/src/SiLorentzAngleCondData.cxx
index ffbcb39219201de8050c13ae5102366fc7aaf280..5ecd26e9480204a0de60e835ed1b02f06c6b4779 100644
--- a/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/SiLorentzAngleCondData.cxx
+++ b/InnerDetector/InDetConditions/SiLorentzAngleTool/src/SiLorentzAngleCondData.cxx
@@ -7,7 +7,7 @@
  * @author Susumu.Oda@cern.ch
 **/
 
-#include "SiLorentzAngleSvc/SiLorentzAngleCondData.h"
+#include "SiLorentzAngleTool/SiLorentzAngleCondData.h"
 
 #include <limits>
 
diff --git a/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/SiLorentzAngleTool.cxx b/InnerDetector/InDetConditions/SiLorentzAngleTool/src/SiLorentzAngleTool.cxx
similarity index 100%
rename from InnerDetector/InDetConditions/SiLorentzAngleSvc/src/SiLorentzAngleTool.cxx
rename to InnerDetector/InDetConditions/SiLorentzAngleTool/src/SiLorentzAngleTool.cxx
diff --git a/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/SiLorentzAngleTool.h b/InnerDetector/InDetConditions/SiLorentzAngleTool/src/SiLorentzAngleTool.h
similarity index 98%
rename from InnerDetector/InDetConditions/SiLorentzAngleSvc/src/SiLorentzAngleTool.h
rename to InnerDetector/InDetConditions/SiLorentzAngleTool/src/SiLorentzAngleTool.h
index 37a02d769139f2022087f005a1828a89a13ea67f..80a054455c2816ff25696e88d1ae8557392fd6b0 100644
--- a/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/SiLorentzAngleTool.h
+++ b/InnerDetector/InDetConditions/SiLorentzAngleTool/src/SiLorentzAngleTool.h
@@ -15,7 +15,7 @@
 #include "GeoPrimitives/GeoPrimitives.h"
 #include "InDetReadoutGeometry/SiDetectorElementCollection.h"
 #include "MagFieldInterfaces/IMagFieldSvc.h"
-#include "SiLorentzAngleSvc/SiLorentzAngleCondData.h"
+#include "SiLorentzAngleTool/SiLorentzAngleCondData.h"
 #include "StoreGate/ReadCondHandleKey.h"
 
 //Gaudi Includes
diff --git a/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/components/SiLorentzAngleSvc_entries.cxx b/InnerDetector/InDetConditions/SiLorentzAngleTool/src/components/SiLorentzAngleTool_entries.cxx
similarity index 100%
rename from InnerDetector/InDetConditions/SiLorentzAngleSvc/src/components/SiLorentzAngleSvc_entries.cxx
rename to InnerDetector/InDetConditions/SiLorentzAngleTool/src/components/SiLorentzAngleTool_entries.cxx
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsServices/CMakeLists.txt b/InnerDetector/InDetConditions/TRT_ConditionsServices/CMakeLists.txt
index 5e629ca4b09e44f6d435dd755ad8fefcca0af63d..2c971cbeffc2a6593fe26697f5dc22234d282bbf 100644
--- a/InnerDetector/InDetConditions/TRT_ConditionsServices/CMakeLists.txt
+++ b/InnerDetector/InDetConditions/TRT_ConditionsServices/CMakeLists.txt
@@ -30,7 +30,6 @@ atlas_depends_on_subdirs( PUBLIC
                           DetectorDescription/GeoModel/GeoModelInterfaces
                           DetectorDescription/GeoModel/GeoModelUtilities
                           DetectorDescription/Identifier
-			  Event/EventInfo
                           Event/xAOD/xAODEventInfo
                           InnerDetector/InDetConditions/InDetCoolCoralClientUtils
                           InnerDetector/InDetDetDescr/InDetIdentifier
@@ -50,7 +49,7 @@ atlas_add_library( TRT_ConditionsServicesLib
                    PUBLIC_HEADERS TRT_ConditionsServices
                    PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${COOL_INCLUDE_DIRS}
                    LINK_LIBRARIES AthenaKernel GeoPrimitives EventPrimitives GaudiKernel TRT_ConditionsData StoreGateLib SGtests
-                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${COOL_LIBRARIES} AthenaBaseComps AthenaPoolUtilities DetDescrConditions GeoModelUtilities Identifier xAODEventInfo EventInfo InDetCoolCoralClientUtils InDetIdentifier InDetReadoutGeometry PathResolver )
+                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${COOL_LIBRARIES} AthenaBaseComps AthenaPoolUtilities DetDescrConditions GeoModelUtilities Identifier xAODEventInfo InDetCoolCoralClientUtils InDetIdentifier InDetReadoutGeometry PathResolver )
 
 atlas_add_component( TRT_ConditionsServices
                      src/components/*.cxx
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_DAQ_ConditionsSvc.cxx b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_DAQ_ConditionsSvc.cxx
index 285e51981ec2000e45f70efa9bfd1ae3d48158f9..be20e1a694704359470adc64608055d0156e2a2a 100644
--- a/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_DAQ_ConditionsSvc.cxx
+++ b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_DAQ_ConditionsSvc.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /*----------------------------------------------------
@@ -9,9 +9,6 @@
 
 // Header Includes
 #include "GaudiKernel/IIncidentSvc.h"
-#include "EventInfo/EventInfo.h"
-#include "EventInfo/EventID.h"
-
 #include "TRT_DAQ_ConditionsSvc.h"
 #include "AthenaPoolUtilities/CondAttrListCollection.h"
 
@@ -28,13 +25,11 @@ TRT_DAQ_ConditionsSvc::TRT_DAQ_ConditionsSvc( const std::string& name, ISvcLocat
   AthService( name, pSvcLocator ),
   m_evtStore("StoreGateSvc",name),
   m_detStore("DetectorStore",name),
-  m_EventInfoKey("ByteStreamEventInfo"),
   m_FolderName(run1FolderName),
   m_TRT_ID_Helper(0),
   m_EnabledRods(0)
 {
   // Get properties from job options
-  declareProperty( "EventInfoKey", m_EventInfoKey );
   declareProperty( "FolderName", m_FolderName );
   declareProperty( "EventStore", m_evtStore );
   declareProperty( "DetectorStore", m_detStore );
@@ -223,51 +218,10 @@ void TRT_DAQ_ConditionsSvc::handle( const Incident& inc ) {
 
   // BeginEvent handler
   if ( inc.type() == "BeginEvent" ) {
-
     // Retrieve COOL Folder at beginning of event to cut down on StoreGate accesses.
     // Contents won't change during event.
     sc= m_detStore->retrieve( m_EnabledRods, m_FolderName );
     if (sc.isFailure()) ATH_MSG_ERROR("The folder "<<m_FolderName<<" could not be retrieved");
-   
-
-    /* FOR TESTING THE CALLBACK
-    // Get the run number
-    const EventInfo* evtInfo;
-    sc = m_evtStore->retrieve(evtInfo,m_EventInfoKey);
-    if ( sc.isFailure() || !evtInfo ) {
-      ATH_MSG_WARNING( "Couldn't get " << m_EventInfoKey << " from StoreGate." );
-      return;
-    }
-    if ( !evtInfo->event_ID() ) {
-      ATH_MSG_WARNING( m_EventInfoKey << " object has no EventID object." );
-      return;
-    }
-    int runNum = evtInfo->event_ID()->run_number();
-    int lumiBlock = evtInfo->event_ID()->lumi_block();
-
-    ATH_MSG_INFO( "Run " << runNum << ", lumiblock " << lumiBlock );
-    */
-
-    /* FOR TESTING FOLDER ACCESS
-    CondAttrListCollection::name_const_iterator chanNameMapItr;
-    if ( m_EnabledRods->name_size() == 0 ) {
-      ATH_MSG_FATAL( "This CondAttrListCollection has no entries in it's ChanNameMap." );
-      return;
-    }
-    for ( chanNameMapItr = m_EnabledRods->name_begin();
-	  chanNameMapItr != m_EnabledRods->name_end(); ++chanNameMapItr ) {
-      int chanNum = (*chanNameMapItr).first;
-      std::string chanName = (*chanNameMapItr).second;
-      CondAttrListCollection::iov_const_iterator chanIOVPair;
-      chanIOVPair = m_EnabledRods->chanIOVPair( chanNum );
-      if ( chanIOVPair == m_EnabledRods->iov_end() ) {
-	ATH_MSG_INFO( "Channel " << chanNum << " (" << chanName << ") not found." );
-	return;
-      }
-      ATH_MSG_INFO( "Channel " << chanNum << " (" << chanName << ") enabled in this event." );
-    }
-    */
-
   }
 
   return;
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_DAQ_ConditionsSvc.h b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_DAQ_ConditionsSvc.h
index 096cf161981a4e1ea04647012f8f30f1cd1d585b..0e1d29c39e9e9b7a2a1bd94ff048de64074f393a 100644
--- a/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_DAQ_ConditionsSvc.h
+++ b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_DAQ_ConditionsSvc.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef TRT_DAQ_CONDITIONSSVC_H
@@ -70,7 +70,6 @@ class TRT_DAQ_ConditionsSvc : public AthService,
   ServiceHandle<StoreGateSvc> m_detStore;
 
   // jobOptions properties
-  std::string m_EventInfoKey;
   std::string m_FolderName;
 
   // Straw Helpers
diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/CMakeLists.txt b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/CMakeLists.txt
index beb81329593d00419f320df58af43627b45f6844..d18d34bbc21b0d7bf6357db5986d82547d40c290 100644
--- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/CMakeLists.txt
+++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/CMakeLists.txt
@@ -9,6 +9,7 @@ atlas_subdir( InDetReadoutGeometry )
 atlas_depends_on_subdirs( PUBLIC
                           Control/AthenaBaseComps
                           Control/AthenaKernel
+                          Control/CxxUtils
                           Control/StoreGate
                           DetectorDescription/AtlasDetDescr
                           DetectorDescription/GeoModel/GeoModelUtilities
@@ -37,6 +38,6 @@ atlas_add_library( InDetReadoutGeometry
                    PUBLIC_HEADERS InDetReadoutGeometry
                    INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS}
                    DEFINITIONS ${CLHEP_DEFINITIONS}
-                   LINK_LIBRARIES ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} ${GEOMODEL_LIBRARIES} AthenaKernel AtlasDetDescr GeoModelUtilities GeoPrimitives Identifier GaudiKernel InDetIdentifier TrkDetElementBase TrkSurfaces TrkEventPrimitives StoreGateLib SGtests AthenaBaseComps DetDescrConditions
+                   LINK_LIBRARIES ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} ${GEOMODEL_LIBRARIES} AthenaKernel CxxUtils AtlasDetDescr GeoModelUtilities GeoPrimitives Identifier GaudiKernel InDetIdentifier TrkDetElementBase TrkSurfaces TrkEventPrimitives StoreGateLib SGtests AthenaBaseComps DetDescrConditions
                    PRIVATE_LINK_LIBRARIES AthenaPoolUtilities IdDictDetDescr TRT_ConditionsData )
 
diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..e7b2f6455b3d494d5f0e1dacb0168ca892f4e59f
--- /dev/null
+++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetDetDescr/InDetReadoutGeometry
diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/InDetDetectorManager.h b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/InDetDetectorManager.h
index f78d94baa0d455936d47161fd77409228fecc842..5765370a8b25920b0d22dced1512d14052932777 100755
--- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/InDetDetectorManager.h
+++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/InDetDetectorManager.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -26,6 +26,14 @@
 
 #include "DetDescrConditions/AlignableTransformContainer.h"
 
+#include "CxxUtils/checker_macros.h"
+
+#include <atomic>
+#include <string>
+#include <map>
+#include <set>
+#include <list>
+
 class StoreGateSvc;
 class AlignableTransform;
 class Identifier; 
@@ -33,10 +41,8 @@ class AtlasDetectorID;
 class GeoVAlignmentStore;
 class CondAttrListCollection;
 
-#include <string>
-#include <map>
-#include <set>
-#include <list>
+// mutable Athena::MsgStreamMember issues warnings.
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;
 
 namespace InDetDD {
 
@@ -184,8 +190,9 @@ namespace InDetDD {
       std::set<std::string>                     m_folders;
       std::set<std::string>                     m_specialFolders;
       std::set<std::string>                     m_globalFolders; // new time-dependent global folders
-      mutable bool                              m_suppressWarnings;
-    
+      mutable std::atomic_bool                  m_suppressWarnings;
+
+      static const LevelInfo s_invalidLevel;
     };
 
 } // namespace InDetDD
diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/PixelModuleDesign.h b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/PixelModuleDesign.h
index c07431ea306d114a23eb330d12a3f4a2d60dc1fa..1155f300323b9d5f4252cc8795dc16bc2f43ecde 100755
--- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/PixelModuleDesign.h
+++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/PixelModuleDesign.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -20,6 +20,7 @@
 #include "InDetReadoutGeometry/PixelReadoutScheme.h"
 
 // Other includes
+#include "CxxUtils/CachedUniquePtr.h"
 #include "InDetIdentifier/PixelID.h"
 
 namespace Trk{
@@ -77,7 +78,7 @@ namespace InDetDD {
 			bool is3D=false);
     
       // Destructor:
-      virtual ~PixelModuleDesign();
+      virtual ~PixelModuleDesign() = default;
       
       ///////////////////////////////////////////////////////////////////
       // Const methods:
@@ -238,7 +239,7 @@ namespace InDetDD {
     private:
       PixelDiodeMap m_diodeMap;
       PixelReadoutScheme m_readoutScheme;
-      mutable Trk::RectangleBounds * m_bounds;
+      CxxUtils::CachedUniquePtr<Trk::RectangleBounds> m_bounds;
       bool m_is3D;
     
     };
diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiCommonItems.h b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiCommonItems.h
index a50148bad4d80ec58387813acdbd5214aa139d78..3dbdfcfc4068071b801ec09688da0d50b91f04de 100755
--- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiCommonItems.h
+++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiCommonItems.h
@@ -15,11 +15,19 @@ class AtlasDetectorID;
 
 // Message Stream Member
 #include "AthenaKernel/MsgStreamMember.h"
-#include "GaudiKernel/ServiceHandle.h"
-#include "CLHEP/Geometry/Transform3D.h"
+#include "CxxUtils/checker_macros.h"
+#include "InDetCondTools/ISiLorentzAngleTool.h"
 #include "GeoPrimitives/GeoPrimitives.h"
 #include "GeoModelKernel/RCBase.h"
-#include "InDetCondTools/ISiLorentzAngleTool.h"
+
+
+#include "GaudiKernel/ServiceHandle.h"
+#include "CLHEP/Geometry/Transform3D.h"
+
+#include <mutex>
+
+// mutable Athena::MsgStreamMember issues warnings.
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;
 
 namespace InDetDD {
 
@@ -59,9 +67,10 @@ namespace InDetDD {
           mutable Athena::MsgStreamMember m_msg;
           
           const AtlasDetectorID* m_idHelper; 
-          mutable HepGeom::Transform3D m_solenoidFrame;
+          mutable HepGeom::Transform3D m_solenoidFrame ATLAS_THREAD_SAFE; // Guarded by m_mutex
           const ISiLorentzAngleTool *m_lorentzAngleTool;
-        
+
+          mutable std::mutex m_mutex;
     };
     
     
@@ -73,7 +82,10 @@ namespace InDetDD {
     
     inline const HepGeom::Transform3D & SiCommonItems::solenoidFrame() const
     {
+      std::lock_guard<std::mutex> lock{m_mutex};
       return m_solenoidFrame;
+      // This reference might be changed by setSolenoidFrame.
+      // However, it occurrs very rarely.
     }
     
     
diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorElement.h b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorElement.h
index 6400ac183d1cc78cbd2c35b3f4bab3309e557fb5..2c052109eb443981bc68791a4eae2ec005257a03 100644
--- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorElement.h
+++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorElement.h
@@ -13,6 +13,7 @@
 #include "TrkDetElementBase/TrkDetElementBase.h"
 
 // Data member classes
+#include "CxxUtils/CachedUniquePtr.h"
 #include "Identifier/Identifier.h"
 #include "Identifier/IdentifierHash.h"
 #include "InDetReadoutGeometry/SiDetectorDesign.h"
@@ -22,11 +23,12 @@
 #include "InDetReadoutGeometry/SiCommonItems.h"
 #include "InDetReadoutGeometry/SiCellId.h"
 #include "InDetReadoutGeometry/InDetDD_Defs.h"
-#include "CLHEP/Geometry/Point3D.h"
 #include "GeoPrimitives/CLHEPtoEigenConverter.h"
 #include "GeoPrimitives/GeoPrimitives.h"
 #include "GeoModelKernel/GeoDefinitions.h"
 
+#include "CLHEP/Geometry/Point3D.h"
+
 #include <atomic>
 #include <mutex>
 
@@ -625,16 +627,16 @@ namespace InDetDD {
     
       mutable std::recursive_mutex m_mutex;
 
-      mutable Amg::Transform3D m_transform; // Will be guarded by m_mutex
-      mutable HepGeom::Transform3D m_transformCLHEP; // Will be guarded by m_mutex
+      mutable Amg::Transform3D m_transform ATLAS_THREAD_SAFE; // Guarded by m_mutex
+      mutable HepGeom::Transform3D m_transformCLHEP ATLAS_THREAD_SAFE; // Guarded by m_mutex
 
-      mutable Amg::Vector3D m_normal; // Will be guarded by m_mutex
-      mutable Amg::Vector3D m_etaAxis; // Will be guarded by m_mutex
-      mutable HepGeom::Vector3D<double> m_etaAxisCLHEP; // Will be guarded by m_mutex
-      mutable Amg::Vector3D m_phiAxis; // Will be guarded by m_mutex
-      mutable HepGeom::Vector3D<double> m_phiAxisCLHEP; // Will be guarded by m_mutex
-      mutable Amg::Vector3D m_center; // Will be guarded by m_mutex
-      mutable HepGeom::Vector3D<double> m_centerCLHEP; // Will be guarded by m_mutex
+      mutable Amg::Vector3D m_normal ATLAS_THREAD_SAFE; // Guarded by m_mutex
+      mutable Amg::Vector3D m_etaAxis ATLAS_THREAD_SAFE; // Guarded by m_mutex
+      mutable HepGeom::Vector3D<double> m_etaAxisCLHEP ATLAS_THREAD_SAFE; // Guarded by m_mutex
+      mutable Amg::Vector3D m_phiAxis ATLAS_THREAD_SAFE; // Guarded by m_mutex
+      mutable HepGeom::Vector3D<double> m_phiAxisCLHEP ATLAS_THREAD_SAFE; // Guarded by m_mutex
+      mutable Amg::Vector3D m_center ATLAS_THREAD_SAFE; // Guarded by m_mutex
+      mutable HepGeom::Vector3D<double> m_centerCLHEP ATLAS_THREAD_SAFE; // Guarded by m_mutex
 
       mutable std::atomic<double> m_minZ;
       mutable std::atomic<double> m_maxZ;
@@ -643,8 +645,8 @@ namespace InDetDD {
       mutable std::atomic<double> m_minPhi;
       mutable std::atomic<double> m_maxPhi;
 
-      mutable std::atomic<Trk::Surface*> m_surface;
-      mutable std::vector<const Trk::Surface*> m_surfaces; // Will be guarded by m_mutex
+      CxxUtils::CachedUniquePtr<Trk::Surface> m_surface;
+      mutable std::vector<const Trk::Surface*> m_surfaces ATLAS_THREAD_SAFE; // Guarded by m_mutex
 
       const GeoAlignmentStore* m_geoAlignStore{};
     };
@@ -766,7 +768,7 @@ namespace InDetDD {
     inline void SiDetectorElement::updateAllCaches() const
     {
       if (!m_cacheValid) updateCache();
-      if (!m_surface) surface();
+      if (not m_surface) surface();
     }
     
     
diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SurfaceCache.h b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SurfaceCache.h
index 8c112a5b97cac3e7074b1f006d8c1cff73490367..07e3e24584765e7fd05f21d95afe8a97ea4615e7 100755
--- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SurfaceCache.h
+++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SurfaceCache.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -49,13 +49,13 @@ namespace InDetDD {
       ///delete assignment
       SurfaceCache & operator = (const SurfaceCache &) = delete;
     
-      const Amg::Transform3D* transform() {return (m_transform);}
+      const Amg::Transform3D* transform() const {return (m_transform);}
       
-      const Amg::Vector3D* center() {return (m_center);}
+      const Amg::Vector3D* center() const {return (m_center);}
       
-      const Amg::Vector3D*  normal() {return (m_normal);}
+      const Amg::Vector3D*  normal() const {return (m_normal);}
       
-      const Trk::SurfaceBounds* bounds() {return (m_bounds);}
+      const Trk::SurfaceBounds* bounds() const {return (m_bounds);}
       
     
     private:
diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/TRT_BarrelDescriptor.h b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/TRT_BarrelDescriptor.h
index 244ff8ec08b3e208eea72f22f7f442ac2819a8a7..c9c0c73e17f12adae75e7e495d41332d48bd1749 100755
--- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/TRT_BarrelDescriptor.h
+++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/TRT_BarrelDescriptor.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -10,8 +10,9 @@
 
 #ifndef TRT_BarrelDescriptor_h
 #define TRT_BarrelDescriptor_h 1
-#include "GeoPrimitives/GeoPrimitives.h"
 #include "GeoModelKernel/RCBase.h"
+#include "CxxUtils/CachedUniquePtr.h"
+#include "GeoPrimitives/GeoPrimitives.h"
 #include "GeoModelKernel/GeoXF.h"
 #include <vector>
 
@@ -92,7 +93,7 @@ namespace InDetDD {
 
     protected:
       
-      virtual ~TRT_BarrelDescriptor();
+      virtual ~TRT_BarrelDescriptor() = default;
       
     private:
       
@@ -108,8 +109,7 @@ namespace InDetDD {
       const GeoXF::Function *m_f;
       size_t                 m_o;
 
-      mutable Trk::CylinderBounds * m_bounds;
-
+      CxxUtils::CachedUniquePtr<Trk::CylinderBounds> m_bounds;
     };
 }
 #include "TRT_BarrelDescriptor.icc"
diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/TRT_BarrelElement.h b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/TRT_BarrelElement.h
index fcd4d0a8b427ac47fbb83626e7bb63fa98ab0872..4ef4b18957f6870fa662ac312d9bd4887b962c0f 100755
--- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/TRT_BarrelElement.h
+++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/TRT_BarrelElement.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -13,6 +13,7 @@
 #include "InDetReadoutGeometry/TRT_BarrelCode.h"
 #include "InDetReadoutGeometry/TRT_BarrelDescriptor.h"
 #include "InDetReadoutGeometry/TRT_BaseElement.h"
+#include <atomic>
 
 class TRT_ID;
 
@@ -149,9 +150,6 @@ namespace InDetDD {
     const TRT_BarrelElement    *m_previousInPhi;
     const TRT_BarrelElement    *m_nextInR;
     const TRT_BarrelElement    *m_previousInR;
-
-    mutable Trk::Surface*       m_surface;
-    
   };
   
 
diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/TRT_BaseElement.h b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/TRT_BaseElement.h
index a59add9b67b6c009de8bd3e0e0fdf357f3610a62..9212062630613c8552fe009f8fa0b90245ef0665 100755
--- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/TRT_BaseElement.h
+++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/TRT_BaseElement.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -13,6 +13,9 @@
 
 #include "TrkDetElementBase/TrkDetElementBase.h"
 
+#include "CxxUtils/CachedUniquePtr.h"
+#include "CxxUtils/checker_macros.h"
+
 #include "Identifier/IdentifierHash.h"
 #include "Identifier/Identifier.h"
 
@@ -20,6 +23,8 @@
 #include "CLHEP/Geometry/Transform3D.h"
 #include "CLHEP/Geometry/Point3D.h"
 
+#include <atomic>
+#include <mutex>
 #include <vector>
 
 namespace Trk {
@@ -214,6 +219,9 @@ namespace InDetDD {
     /** Helper method for cache dealing */
     void deleteCache() const;
 
+    void createStrawSurfaces() const;
+    void createStrawSurfacesCache() const;
+
   protected:
 
     Identifier                                          m_id;
@@ -222,15 +230,16 @@ namespace InDetDD {
     const TRT_Conditions*                               m_conditions;
     
     // Amg cache for the straw surfaces 
-    mutable std::vector<Trk::StraightLineSurface*>*     m_strawSurfaces;
-    mutable std::vector<SurfaceCache*>*                 m_strawSurfacesCache;
+    mutable std::atomic<std::vector<Trk::StraightLineSurface*>*> m_strawSurfaces;
+    mutable std::atomic<std::vector<SurfaceCache*>*> m_strawSurfacesCache;
     
     //!< helper element surface for the cache   
-    mutable SurfaceCache*                               m_surfaceCache;
+    CxxUtils::CachedUniquePtr<SurfaceCache> m_surfaceCache;
 
-    mutable Trk::Surface * m_surface;
-    mutable std::vector<const Trk::Surface*> m_surfaces;
+    CxxUtils::CachedUniquePtr<Trk::Surface> m_surface;
+    mutable std::vector<const Trk::Surface*> m_surfaces ATLAS_THREAD_SAFE; // Guarded by m_mutex
 
+    mutable std::mutex m_mutex;
   };
     
 }
diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/TRT_Conditions.h b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/TRT_Conditions.h
index fd3d53b578a62cc4ac78a90a379aeada54d5e74d..be435ec9657bdf13a5c1f20cd85efaadfcb332ca 100755
--- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/TRT_Conditions.h
+++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/TRT_Conditions.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -11,10 +11,13 @@
 #ifndef INDETREADOUTGEOMETRY_TRT_CONDITIONS_H
 #define INDETREADOUTGEOMETRY_TRT_CONDITIONS_H
 
-#include "GeoPrimitives/GeoPrimitives.h"
 #include "GeoModelKernel/RCBase.h"
+#include "CxxUtils/checker_macros.h"
+#include "GeoPrimitives/GeoPrimitives.h"
 #include "CLHEP/Geometry/Transform3D.h"
 
+#include <mutex>
+
 namespace TRTCond {
   class StrawDxContainer;
 }
@@ -39,9 +42,10 @@ namespace InDetDD {
       void setSolenoidFrame(const HepGeom::Transform3D & frame);
 
     private:
-      mutable const TRTCond::StrawDxContainer* m_dxContainer;
-      mutable HepGeom::Transform3D m_solenoidFrame;
-  
+      const TRTCond::StrawDxContainer* m_dxContainer;
+      mutable HepGeom::Transform3D m_solenoidFrame ATLAS_THREAD_SAFE; // Guarded by m_mutex
+      mutable std::mutex m_mutex;
+
   };
 
 } // end namespace
diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/TRT_EndcapDescriptor.h b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/TRT_EndcapDescriptor.h
index a6edf251a9cf89fa09ba9497765cb8ee24e98645..394a9c1adf89330edb1520553dfa5e14755cca59 100755
--- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/TRT_EndcapDescriptor.h
+++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/TRT_EndcapDescriptor.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -10,8 +10,9 @@
 
 #ifndef TRT_EndcapDescriptor_h
 #define TRT_EndcapDescriptor_h 1
-#include "GeoPrimitives/GeoPrimitives.h"
 #include "GeoModelKernel/RCBase.h"
+#include "CxxUtils/CachedUniquePtr.h"
+#include "GeoPrimitives/GeoPrimitives.h"
 #include "GeoModelKernel/GeoXF.h"
 
 namespace Trk{
@@ -73,7 +74,7 @@ namespace InDetDD {
     protected:
       
       
-      virtual ~TRT_EndcapDescriptor();
+      virtual ~TRT_EndcapDescriptor() = default;
       
       
     private:
@@ -111,8 +112,7 @@ namespace InDetDD {
       size_t                 m_o;
       
       // Bounds
-      mutable Trk::CylinderBounds * m_bounds;
-
+      CxxUtils::CachedUniquePtr<Trk::CylinderBounds> m_bounds;
 
     };
 }
diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/TRT_EndcapElement.h b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/TRT_EndcapElement.h
index 10fe067ac08385fa23abbbc4c53d853f2fc49663..351c969d8a2e300a8e9e536350ccaa854aabf597 100755
--- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/TRT_EndcapElement.h
+++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/TRT_EndcapElement.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -13,6 +13,7 @@
 #include "InDetReadoutGeometry/TRT_EndcapCode.h"
 #include "InDetReadoutGeometry/TRT_BaseElement.h"
 #include "InDetReadoutGeometry/TRT_EndcapDescriptor.h"
+#include <atomic>
 
 class TRT_ID;
 
@@ -125,9 +126,6 @@ namespace InDetDD {
       const TRT_EndcapDescriptor *m_descriptor;
       const TRT_EndcapElement    *m_nextInZ;
       const TRT_EndcapElement    *m_previousInZ;
-    
-      mutable Trk::Surface       * m_surface;
-    
   };
   
 }
diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/InDetDetectorManager.cxx b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/InDetDetectorManager.cxx
index 090b5e9d86c01629875544c017ec98726eb23702..ae8514eb2cef70331012c42f192b7bbe102171c3 100755
--- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/InDetDetectorManager.cxx
+++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/InDetDetectorManager.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 
@@ -86,10 +86,9 @@ namespace InDetDD
   // Return the level in the hierarchy (user defined) corresponding to the key.
     const InDetDetectorManager::LevelInfo& InDetDetectorManager::getLevel(const std::string & key) const 
     {
-        static LevelInfo invalidLevel;
         std::map<std::string, LevelInfo>::const_iterator iter;
         iter = m_keys.find(key);
-        if (iter == m_keys.end()) return invalidLevel;
+        if (iter == m_keys.end()) return s_invalidLevel;
         return iter->second;
     }
 
@@ -440,5 +439,6 @@ namespace InDetDD
         return false;
     }
 
+    const InDetDetectorManager::LevelInfo InDetDetectorManager::s_invalidLevel;
 
 } // namespace InDetDD
diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/PixelDetectorManager.cxx b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/PixelDetectorManager.cxx
index 1272a3136a65456d4ced36c09b0b0a504ca78875..9139354154ec9b80da2f56c320456ed137118dbe 100755
--- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/PixelDetectorManager.cxx
+++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/PixelDetectorManager.cxx
@@ -421,8 +421,7 @@ namespace InDetDD {
         Amg::Transform3D shift = Amg::Translation3D(basex+bowx,0,0) * Amg::RotationMatrix3D::Identity();
 
         const AlignableTransform* cpat = *pat;
-        AlignableTransform *pat_update=const_cast<AlignableTransform*>(cpat);
-        AlignableTransform::AlignTransMem_citr this_trans=pat_update->findIdent(trans_iter->identify());
+        AlignableTransform::AlignTransMem_citr this_trans=cpat->findIdent(trans_iter->identify());
         HepGeom::Transform3D newtrans = Amg::EigenTransformToCLHEP(shift)*this_trans->transform();
 
         /** Verbose level debug section for transforms **/
diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/PixelModuleDesign.cxx b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/PixelModuleDesign.cxx
index 573c1cf92e9a239533da66c934c010067632d191..5b874a21196fcefff83c6f31bde7ccf6cf61c32d 100755
--- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/PixelModuleDesign.cxx
+++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/PixelModuleDesign.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -46,16 +46,9 @@ PixelModuleDesign::PixelModuleDesign(const double thickness,
   m_readoutScheme(circuitsPerColumn,circuitsPerRow,
 		  cellColumnsPerCircuit,cellRowsPerCircuit,
 		  diodeColumnsPerCircuit,diodeRowsPerCircuit),
-  m_bounds(0),
+  m_bounds(),
   m_is3D(is3D)
 {
-  //  m_bounds = new Trk::RectangleBounds(0.5*width(), 0.5*length());
-}
-
-// Destructor:
-PixelModuleDesign::~PixelModuleDesign()
-{
-  delete m_bounds;
 }
 
 // Returns distance to nearest detector edge 
@@ -231,7 +224,7 @@ PixelModuleDesign::bounds() const
 {
   // We create on demand as width and length are 0 when PixeModuleDesign first gets
   // created.
-  if (!m_bounds) m_bounds = new Trk::RectangleBounds(0.5*width(), 0.5*length());
+  if (not m_bounds) m_bounds.set(std::make_unique<Trk::RectangleBounds>(0.5*width(), 0.5*length()));
   return *m_bounds;
 }
 
diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiCommonItems.cxx b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiCommonItems.cxx
index 9df5ae1d295cac4047d90c57b2f6244b04ed9207..46e095a29d9649716d3692343a8904fa109a7aa8 100755
--- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiCommonItems.cxx
+++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiCommonItems.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetReadoutGeometry/SiCommonItems.h"
@@ -9,12 +9,14 @@ namespace InDetDD {
 SiCommonItems::SiCommonItems(const AtlasDetectorID* const idHelper)
   :  m_msg("SiDetectorElement"),
      m_idHelper(idHelper), 
-     m_lorentzAngleTool(nullptr)
+     m_lorentzAngleTool(nullptr),
+     m_mutex{}
 {}
 
 void   
 SiCommonItems::setSolenoidFrame(const HepGeom::Transform3D & transform) const
 {
+  std::lock_guard<std::mutex> lock{m_mutex};
   m_solenoidFrame = transform;
 }
 
diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx
index bd2a80a8c96527e1dfcdff2cab45d98914471b17..bf87647bbb2ee913a1491ad6d30020bdc8b326ab 100644
--- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx
+++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx
@@ -63,7 +63,7 @@ SiDetectorElement::SiDetectorElement(const Identifier &id,
   m_firstTime(true),
   m_isStereo(false),
   m_mutex(),
-  m_surface(nullptr),
+  m_surface{},
   m_surfaces{},
   m_geoAlignStore(geoAlignStore)
 {
@@ -86,7 +86,7 @@ SiDetectorElement::SiDetectorElement(const Identifier &id,
   m_hitDepth = m_design->depthAxis();
   ///
   
-  commonConstructor();
+ commonConstructor();
 }
 
 void
@@ -137,13 +137,10 @@ SiDetectorElement::commonConstructor()
 // Destructor:
 SiDetectorElement::~SiDetectorElement()
 {
-  delete m_surface;
-
   // The design is reference counted so that it will not be deleted until the last element is deleted.
   m_design->unref();
 
   m_commonItems->unref();
-
 }
 
 void 
@@ -792,9 +789,7 @@ SiDetectorElement::sinStereoLocal(const HepGeom::Point3D<double> &globalPos) con
 const Trk::Surface & 
 SiDetectorElement::surface() const
 {
-  if (!m_surface) {
-    m_surface = new Trk::PlaneSurface(*this);
-  }
+  if (not m_surface) m_surface.set(std::make_unique<Trk::PlaneSurface>(*this));
   return *m_surface;
 }
   
diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/TRT_BarrelDescriptor.cxx b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/TRT_BarrelDescriptor.cxx
index d6ed3d40064f3bbf9963c610bf0e92cca74d2628..7e071c0dbef33baa6e8b6df7ee302ee0783683ec 100755
--- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/TRT_BarrelDescriptor.cxx
+++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/TRT_BarrelDescriptor.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetReadoutGeometry/TRT_BarrelDescriptor.h"
@@ -17,18 +17,10 @@ TRT_BarrelDescriptor::TRT_BarrelDescriptor()
     m_innerTubeRadius(2*CLHEP::mm), // FIXME: Hardwired for now!!
     m_f(NULL),
     m_o(0),
-    m_bounds(0)
-
-{
-}
-
-
-TRT_BarrelDescriptor::~TRT_BarrelDescriptor()
+    m_bounds()
 {
-  delete m_bounds;
 }
 
-
 void TRT_BarrelDescriptor::addStraw(double xPos, double yPos) {
 
   m_x.push_back(xPos);
@@ -45,7 +37,7 @@ void TRT_BarrelDescriptor::setStrawTransformField(const GeoXF::Function *xf, siz
 const Trk::SurfaceBounds & 
 TRT_BarrelDescriptor::strawBounds() const
 {
-  if (!m_bounds) m_bounds = new Trk::CylinderBounds(m_innerTubeRadius, 0.5*m_length);
+  if (not m_bounds) m_bounds.set(std::make_unique<Trk::CylinderBounds>(m_innerTubeRadius, 0.5*m_length));
   return *m_bounds;
 }
 
diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/TRT_BarrelElement.cxx b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/TRT_BarrelElement.cxx
index e44a52697d0ef947a756c29857e2305552ea19e4..834d334c72e54fb2e2d34b15dfca324e33d3228f 100755
--- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/TRT_BarrelElement.cxx
+++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/TRT_BarrelElement.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "Identifier/Identifier.h"
@@ -36,9 +36,7 @@ TRT_BarrelElement::TRT_BarrelElement(const GeoVFullPhysVol *volume,
   m_nextInPhi(NULL),
   m_previousInPhi(NULL),
   m_nextInR(NULL),
-  m_previousInR(NULL),
-  m_surface(0)
-		      
+  m_previousInR(NULL)
 {
   m_descriptor->ref();
 }
@@ -47,7 +45,6 @@ TRT_BarrelElement::TRT_BarrelElement(const GeoVFullPhysVol *volume,
 TRT_BarrelElement::~TRT_BarrelElement()
 {
   m_descriptor->unref();
-  delete m_surface;
 }
 
 
@@ -171,7 +168,7 @@ const Trk::SurfaceBounds& TRT_BarrelElement::strawBounds() const
 
 const Trk::Surface& TRT_BarrelElement::elementSurface() const 
 {
-  if (!m_surface) m_surface = new Trk::PlaneSurface(*this);
+  if (not m_surface) m_surface.set(std::make_unique<Trk::PlaneSurface>(*this));
   return *m_surface;
 }
    
@@ -222,10 +219,10 @@ void TRT_BarrelElement::createSurfaceCache() const
   // create the element bounds
   Trk::RectangleBounds * elementBounds = new Trk::RectangleBounds(0.5*elementWidth, 0.5*strawLength());
   // create the surface cache
-  m_surfaceCache = new SurfaceCache(transform, center, normal, elementBounds);
-  // creaete the surface (only if needed, links are still ok even if cache update)
-  if (!m_surface) m_surface = new Trk::PlaneSurface(*this);
+  m_surfaceCache.set(std::make_unique<SurfaceCache>(transform, center, normal, elementBounds));
 
+  // creaete the surface (only if needed, links are still ok even if cache update)
+  if (not m_surface) elementSurface();
 }
 
 
diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/TRT_BaseElement.cxx b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/TRT_BaseElement.cxx
index b4fd30cbe943d141c60d9a44679cb38fd60bbf28..e7408f3bf2356aa2fdcab8d04062f914ea96d5e3 100755
--- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/TRT_BaseElement.cxx
+++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/TRT_BaseElement.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetReadoutGeometry/SurfaceCache.h"
@@ -28,9 +28,10 @@ namespace InDetDD {
         m_conditions(conditions),
         m_strawSurfaces(nullptr),
         m_strawSurfacesCache(nullptr),
-        m_surfaceCache(nullptr),
-        m_surface(nullptr),
-        m_surfaces{}
+        m_surfaceCache{},
+        m_surface{},
+        m_surfaces{},
+        m_mutex{}
     {
         m_idHash = m_idHelper->straw_layer_hash(id);  
         m_conditions->ref();
@@ -60,26 +61,26 @@ namespace InDetDD {
     
     const Trk::SurfaceBounds& TRT_BaseElement::bounds() const
     {
-        if (!m_surfaceCache) createSurfaceCache();
+        if (not m_surfaceCache) createSurfaceCache();
         return *(m_surfaceCache->bounds());
     }
     
     const Amg::Transform3D& TRT_BaseElement::transform() const
     {	
-        if (!m_surfaceCache) createSurfaceCache();
+        if (not m_surfaceCache) createSurfaceCache();
         return *(m_surfaceCache->transform());
     }    
 
 
     const Amg::Vector3D& TRT_BaseElement::center() const
     {  
-        if (!m_surfaceCache) createSurfaceCache();
+        if (not m_surfaceCache) createSurfaceCache();
         return *(m_surfaceCache->center());
     }
     
     const Amg::Vector3D& TRT_BaseElement::normal() const
     {
-        if (!m_surfaceCache) createSurfaceCache();
+        if (not m_surfaceCache) createSurfaceCache();
         return *(m_surfaceCache->normal());
     }
     
@@ -88,8 +89,7 @@ namespace InDetDD {
     {
         int straw = m_idHelper->straw(id);
         // Create vector of all straws.
-        if (!m_strawSurfaces) 
-            m_strawSurfaces = new std::vector<Trk::StraightLineSurface*>(nStraws(), 0);
+        if (!m_strawSurfaces) createStrawSurfaces();
         Trk::Surface * surfacePtr = (*m_strawSurfaces)[straw];
         if (!surfacePtr) {
             createSurfaceCache(id);
@@ -101,6 +101,7 @@ namespace InDetDD {
 
     const std::vector<const Trk::Surface*>& TRT_BaseElement::surfaces() const 
     {
+        std::lock_guard<std::mutex> lock{m_mutex};
         if (!m_surfaces.size()){
             m_surfaces.reserve(nStraws());
             for (unsigned is = 0; is<nStraws(); ++is)
@@ -118,7 +119,7 @@ namespace InDetDD {
     const Amg::Transform3D& TRT_BaseElement::transform(const Identifier & id) const 
     {
         int straw = m_idHelper->straw(id);
-        if (!m_strawSurfacesCache) m_strawSurfacesCache = new std::vector<SurfaceCache*>(nStraws(), 0);
+        if (!m_strawSurfacesCache) createStrawSurfacesCache();
         SurfaceCache* sCachePtr = (*m_strawSurfacesCache)[straw];
         if (!sCachePtr) {
             createSurfaceCache(id);
@@ -130,7 +131,7 @@ namespace InDetDD {
 
     const Amg::Transform3D& TRT_BaseElement::strawTransform(unsigned int straw) const 
     {
-        if (!m_strawSurfacesCache) m_strawSurfacesCache = new std::vector<SurfaceCache*>(nStraws(), 0);
+      if (!m_strawSurfacesCache) createStrawSurfacesCache();
         SurfaceCache* sCachePtr = (*m_strawSurfacesCache)[straw];
         if (!sCachePtr) {
             Identifier id =  m_idHelper->straw_id(identify(), straw);
@@ -154,7 +155,7 @@ namespace InDetDD {
     const Amg::Vector3D& TRT_BaseElement::center(const Identifier & id) const 
     {
         int straw = m_idHelper->straw(id);
-        if (!m_strawSurfacesCache) m_strawSurfacesCache = new std::vector<SurfaceCache*>(nStraws(), 0);
+        if (!m_strawSurfacesCache) createStrawSurfacesCache();
         SurfaceCache* sCachePtr = (*m_strawSurfacesCache)[straw];
         if (!sCachePtr) {
             createSurfaceCache(id);
@@ -167,8 +168,7 @@ namespace InDetDD {
     const Trk::StraightLineSurface& TRT_BaseElement::strawSurface(int straw) const
     {
         // Create vector of all straws.
-        if (!m_strawSurfaces) 
-            m_strawSurfaces      = new std::vector<Trk::StraightLineSurface *>(nStraws(), 0);
+        if (!m_strawSurfaces) createStrawSurfaces();
         Trk::StraightLineSurface* surfacePtr = (*m_strawSurfaces)[straw];
         if (!surfacePtr) {
             // get the straw identifier to the given straw number and element identifier
@@ -181,7 +181,7 @@ namespace InDetDD {
 
     const Amg::Transform3D& TRT_BaseElement::strawTransform(int straw) const 
     {
-       if (!m_strawSurfacesCache) m_strawSurfacesCache = new std::vector<SurfaceCache*>(nStraws(), 0);
+       if (!m_strawSurfacesCache) createStrawSurfacesCache();
        SurfaceCache* sCachePtr = (*m_strawSurfacesCache)[straw];
        if (!sCachePtr) {
            Identifier id =  m_idHelper->straw_id(identify(), straw);
@@ -194,7 +194,7 @@ namespace InDetDD {
     
     const Amg::Vector3D& TRT_BaseElement::strawCenter(int straw) const 
     {
-        if (!m_strawSurfacesCache) m_strawSurfacesCache = new std::vector<SurfaceCache*>(nStraws(), 0);
+        if (!m_strawSurfacesCache) createStrawSurfacesCache();
         SurfaceCache* sCachePtr = (*m_strawSurfacesCache)[straw];
         if (!sCachePtr) {
             Identifier id =  m_idHelper->straw_id(identify(), straw);
@@ -215,7 +215,7 @@ namespace InDetDD {
     
     const HepGeom::Transform3D TRT_BaseElement::transformCLHEP() const
     {	
-        return Amg::EigenTransformToCLHEP((*m_surfaceCache->transform()));
+        return Amg::EigenTransformToCLHEP(*(m_surfaceCache->transform()));
     }
 
     const HepGeom::Point3D<double> TRT_BaseElement::centerCLHEP() const
@@ -260,8 +260,8 @@ namespace InDetDD {
     {
 
       // should not happen, but worth the protection
-      if (!m_strawSurfacesCache) m_strawSurfacesCache = new std::vector<SurfaceCache*>(nStraws(),0);
-      if (!m_strawSurfaces) m_strawSurfaces = new std::vector<Trk::StraightLineSurface*>(nStraws(), 0);
+      if (!m_strawSurfacesCache) createStrawSurfacesCache();
+      if (!m_strawSurfaces) createStrawSurfaces();
 
       int straw =  m_idHelper->straw(id);
 
@@ -300,17 +300,13 @@ namespace InDetDD {
 
         // for all straws
         if (m_strawSurfacesCache) {
-            for (size_t i=0; i<m_strawSurfacesCache->size(); i++) {
+            for (size_t i=0; i<m_strawSurfacesCache.load()->size(); i++) {
                 delete (*m_strawSurfacesCache)[i];
                 (*m_strawSurfacesCache)[i] = 0;
             }
         }
         delete m_strawSurfacesCache;
         m_strawSurfacesCache = 0;
-
-        // for the element surface
-        delete m_surfaceCache;
-        m_surfaceCache = 0;
     }
 
 
@@ -319,7 +315,7 @@ namespace InDetDD {
         // delete the caches first
         deleteCache();
         // Strawlayer caches
-        if (!m_surfaceCache) createSurfaceCache();
+        if (not m_surfaceCache) createSurfaceCache();
         // Loop over all straws and request items that get cached.
         for (unsigned int iStraw=0; iStraw < nStraws(); iStraw++) {
             Identifier strawId = m_idHelper->straw_id(identify(),iStraw);
@@ -339,7 +335,7 @@ namespace InDetDD {
     {
         // delete the information about the straws
         if (m_strawSurfaces) {
-            for (size_t i=0; i<m_strawSurfaces->size(); i++) {
+            for (size_t i=0; i<m_strawSurfaces.load()->size(); i++) {
                 delete (*m_strawSurfaces)[i];
             }
         }
@@ -350,5 +346,25 @@ namespace InDetDD {
 
     }
 
+    void TRT_BaseElement::createStrawSurfaces() const {
+        if (m_strawSurfaces!=nullptr) return;
+        std::vector<Trk::StraightLineSurface*>* expected{nullptr};
+        std::vector<Trk::StraightLineSurface*>* desired{new std::vector<Trk::StraightLineSurface*>(nStraws(), 0)};
+        if (not m_strawSurfaces.compare_exchange_strong(expected, desired)) {
+            // This happens if more than one threads try to set m_strawSurfaces.
+            delete desired;
+            desired = nullptr;
+        }
+    }
 
+    void TRT_BaseElement::createStrawSurfacesCache() const {
+        if (m_strawSurfacesCache!=nullptr) return;
+        std::vector<SurfaceCache*>* expected{nullptr};
+        std::vector<SurfaceCache*>* desired{new std::vector<SurfaceCache*>(nStraws(), 0)};
+        if (not m_strawSurfacesCache.compare_exchange_strong(expected, desired)) {
+            // This happens if more than one threads try to set m_strawSurfaces.
+            delete desired;
+            desired = nullptr;
+        }
+    }
 }
diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/TRT_Conditions.cxx b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/TRT_Conditions.cxx
index ac5974f9876776e127434bf86cdca341ced76359..bf1fbd4fec6ac0a1c02b5de7dec8fee9562758f9 100755
--- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/TRT_Conditions.cxx
+++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/TRT_Conditions.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetReadoutGeometry/TRT_Conditions.h"
@@ -7,7 +7,8 @@
 namespace InDetDD {
 
 TRT_Conditions::TRT_Conditions()
-  : m_dxContainer(0)
+  : m_dxContainer(0),
+    m_mutex{}
 {}
 
 const TRTCond::StrawDxContainer* 
@@ -25,12 +26,16 @@ TRT_Conditions::setDxContainer(const TRTCond::StrawDxContainer* container)
 const HepGeom::Transform3D &
 TRT_Conditions::solenoidFrame() const
 {
+  std::lock_guard<std::mutex> lock{m_mutex};
   return m_solenoidFrame;
+  // This reference might be changed by setSolenoidFrame.
+  // However, it occurrs very rarely.
 }
  
 void 
 TRT_Conditions::setSolenoidFrame(const HepGeom::Transform3D & frame)
 {
+  std::lock_guard<std::mutex> lock{m_mutex};
   m_solenoidFrame = frame;
 }
 
diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/TRT_DetectorManager.cxx b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/TRT_DetectorManager.cxx
index df691eebd2257b7fd2f5ba2cde1a3e576d35fd87..43f1ab2de4755001267d3af4f962deb340a07782 100755
--- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/TRT_DetectorManager.cxx
+++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/TRT_DetectorManager.cxx
@@ -363,7 +363,7 @@ namespace InDetDD {
     // Register the call back for this key and the corresponding level in
     // in the hierarchy.
     // DEPRECATED
-    void TRT_DetectorManager::addKey(const std::string & key, int level)
+    void TRT_DetectorManager::addKey ATLAS_NOT_THREAD_SAFE (const std::string & key, int level)
     {
         if(msgLvl(MSG::DEBUG))
             msg(MSG::DEBUG) << "Registering alignmentCallback with key " << key << ", at level " << level 
diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/TRT_EndcapDescriptor.cxx b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/TRT_EndcapDescriptor.cxx
index 205496e203937b54c8926b0252c3618d0e3edb86..fc31fde3b64ca10b7fdf6d213ee4cce11bfa6fb2 100755
--- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/TRT_EndcapDescriptor.cxx
+++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/TRT_EndcapDescriptor.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetReadoutGeometry/TRT_EndcapDescriptor.h"
@@ -21,26 +21,16 @@ TRT_EndcapDescriptor::TRT_EndcapDescriptor():
   m_innerTubeRadius(2*CLHEP::mm),  // FIXME: Hardwired for now!!
   m_f(NULL),
   m_o(0),
-  m_bounds(0)
+  m_bounds()
 {
 
 }
 
-
-TRT_EndcapDescriptor::~TRT_EndcapDescriptor()
-{
-  delete m_bounds;
-}
-
-
-
 void TRT_EndcapDescriptor::setStrawTransformField(const GeoXF::Function *xf, size_t offsetInto) {
   m_f=xf;
   m_o=offsetInto;
 }
 
-
-
 unsigned int  &TRT_EndcapDescriptor::nStraws() {
   return m_nStraws;
 }
@@ -64,7 +54,7 @@ double &  TRT_EndcapDescriptor::innerRadius() {
 const Trk::SurfaceBounds & 
 TRT_EndcapDescriptor::strawBounds() const
 {
-  if (!m_bounds) m_bounds = new Trk::CylinderBounds(m_innerTubeRadius, 0.5*m_strawLength);
+  if (not m_bounds) m_bounds.set(std::make_unique<Trk::CylinderBounds>(m_innerTubeRadius, 0.5*m_strawLength));
   return *m_bounds;
 }
 
diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/TRT_EndcapElement.cxx b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/TRT_EndcapElement.cxx
index c5637d308b56a475d283d09d610756780d9c660d..f4a344c78530eb2a0421b84f631b862c1699b43a 100755
--- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/TRT_EndcapElement.cxx
+++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/TRT_EndcapElement.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetReadoutGeometry/TRT_EndcapElement.h"
@@ -38,9 +38,7 @@ namespace InDetDD {
         m_code(isPositive,wheelIndex,strawLayIndex,phiIndex),
         m_descriptor(descriptor),
         m_nextInZ(NULL),
-        m_previousInZ(NULL),
-        m_surface(0)
-
+        m_previousInZ(NULL)
     {
         m_descriptor->ref();
     }
@@ -49,7 +47,6 @@ namespace InDetDD {
     TRT_EndcapElement::~TRT_EndcapElement()
     {
         m_descriptor->unref();
-        delete m_surface;
     }
 
     unsigned int TRT_EndcapElement::nStraws() const
@@ -203,7 +200,7 @@ namespace InDetDD {
 
     const Trk::Surface& TRT_EndcapElement::elementSurface() const 
     {
-        if (!m_surface) m_surface = new Trk::DiscSurface(*this);
+        if (not m_surface) m_surface.set(std::make_unique<Trk::DiscSurface>(*this));
         return *m_surface;
     }
 
@@ -242,10 +239,9 @@ namespace InDetDD {
         Trk::DiscBounds* bounds = new Trk::DiscBounds(rMin, rMax, phiHalfWidth);
         Amg::Vector3D*  center = new Amg::Vector3D(transform->translation());
         Amg::Vector3D*  normal = new Amg::Vector3D(transform->rotation().col(2));
-        m_surfaceCache = new SurfaceCache(transform, center, normal, bounds);
+        m_surfaceCache.set(std::make_unique<SurfaceCache>(transform, center, normal, bounds));
         // create the surface if needed 
-        if (!m_surface) m_surface = new Trk::DiscSurface(*this);
-
+        if (not m_surface) elementSurface();
     }
 
 
diff --git a/InnerDetector/InDetDetDescr/SCT_Cabling/SCT_Cabling/SCT_OnlineId.h b/InnerDetector/InDetDetDescr/SCT_Cabling/SCT_Cabling/SCT_OnlineId.h
index b8d328d9d431b8aeeeb2b3c5a6479684093f2482..73938ec07793746e68a81df5198d065fd1e39df2 100644
--- a/InnerDetector/InDetDetDescr/SCT_Cabling/SCT_Cabling/SCT_OnlineId.h
+++ b/InnerDetector/InDetDetDescr/SCT_Cabling/SCT_Cabling/SCT_OnlineId.h
@@ -58,7 +58,7 @@ public:
   unsigned int index() const;
   
   ///Is the rod in range?
-  static bool rodIdInRange(std::uint32_t r);
+  bool rodIdInRange(std::uint32_t r) const;
   
   ///constants for evaluating hash indices of the online id. The hashing formula is in 'index()'
   enum {
diff --git a/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_OnlineId.cxx b/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_OnlineId.cxx
index c1b55e48d42ed2f23a8715644e9c0aea6c8b5aff..d5f737e206913221be79247a08eb6f541bcb3013 100644
--- a/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_OnlineId.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_OnlineId.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 /*
  *  SCT_OnlineId.cxx
@@ -90,7 +90,7 @@ bool SCT_OnlineId::fibreInRange(std::uint32_t f) const{
 }
 
 //
-bool SCT_OnlineId::rodIdInRange(std::uint32_t r) {
+bool SCT_OnlineId::rodIdInRange(std::uint32_t r) const {
   const std::uint32_t lowestRodId(0x210000);
   const std::uint32_t highestRodId=0x24010F;
   return ((r >=lowestRodId) and (r<=highestRodId)) ;
diff --git a/InnerDetector/InDetDigitization/FastSiDigitization/python/FastSiDigitizationConfig.py b/InnerDetector/InDetDigitization/FastSiDigitization/python/FastSiDigitizationConfig.py
index f661898dcc597fdb09a2cf74f4e7c60769ab916d..216d0071c5757764c57c56ced89ad70231cb36e7 100644
--- a/InnerDetector/InDetDigitization/FastSiDigitization/python/FastSiDigitizationConfig.py
+++ b/InnerDetector/InDetDigitization/FastSiDigitization/python/FastSiDigitizationConfig.py
@@ -83,7 +83,7 @@ def commonPixelFastDigitizationConfig(name,**kwargs):
     # SiLorentzAngleTool for PixelFastDigitizationTool
     from AthenaCommon.AppMgr import ToolSvc
     if not hasattr(ToolSvc, "PixelLorentzAngleTool"):
-        from SiLorentzAngleSvc.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup
+        from SiLorentzAngleTool.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup
         pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup()
     kwargs.setdefault("LorentzAngleTool", ToolSvc.PixelLorentzAngleTool)
 
@@ -125,7 +125,7 @@ def commonSCT_FastDigitizationConfig(name,**kwargs):
 
     # SiLorentzAngleTool for SCT_FastDigitizationTool
     from AthenaCommon.AppMgr import ToolSvc
-    from SiLorentzAngleSvc.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
+    from SiLorentzAngleTool.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
     sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup()
     kwargs.setdefault("LorentzAngleTool", sctLorentzAngleToolSetup.SCTLorentzAngleTool)
 
diff --git a/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfig.py b/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfig.py
index f676c1442aea57981d5f2908ee28f48ed28cc537..971dd4962dc84303a802dcbf1f59e0d8ef401c10 100644
--- a/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfig.py
+++ b/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfig.py
@@ -47,7 +47,7 @@ def SensorSimPlanarTool(name="SensorSimPlanarTool", **kwargs):
          pixelSiPropertiesToolSetup = PixelSiPropertiesToolSetup()
          pixelSiPropertiesToolSetup.setup()
     if not hasattr(ToolSvc, "PixelLorentzAngleTool"):
-        from SiLorentzAngleSvc.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup
+        from SiLorentzAngleTool.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup
         pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup()
     kwargs.setdefault("SiPropertiesTool", ToolSvc.PixelSiPropertiesTool)
     kwargs.setdefault("LorentzAngleTool", ToolSvc.PixelLorentzAngleTool)
@@ -60,7 +60,7 @@ def SensorSim3DTool(name="SensorSim3DTool", **kwargs):
          pixelSiPropertiesToolSetup = PixelSiPropertiesToolSetup()
          pixelSiPropertiesToolSetup.setup()
     if not hasattr(ToolSvc, "PixelLorentzAngleTool"):
-        from SiLorentzAngleSvc.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup
+        from SiLorentzAngleTool.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup
         pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup()
     kwargs.setdefault("SiPropertiesTool", ToolSvc.PixelSiPropertiesTool)
     return CfgMgr.SensorSim3DTool(name, **kwargs)
diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfig.py b/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfig.py
index 0f8996f573ed2209c0b6d7692f2609dae632bf55..a753c90b1b327a9b6e1026ab88f90d0b693e7675 100644
--- a/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfig.py
+++ b/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfig.py
@@ -54,7 +54,7 @@ def getSCT_SurfaceChargesGenerator(name="SCT_SurfaceChargesGenerator", **kwargs)
         from SCT_ConditionsTools.SCT_ConditionsToolsConf import SCT_RadDamageSummaryTool
         ToolSvc += SCT_RadDamageSummaryTool(name = "InDetSCT_RadDamageSummaryTool")
     ## SiLorentzAngleTool for SCT_SurfaceChargesGenerator
-    from SiLorentzAngleSvc.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
+    from SiLorentzAngleTool.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
     sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup()
 
     kwargs.setdefault("FixedTime", -999)
diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..5b6a560431a3db0d0e0bb715c1a8292a984f2f9b
--- /dev/null
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetEventCnv/InDetEventAthenaPool
diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetLowBetaCandidateCnv.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetLowBetaCandidateCnv.cxx
index fa83294187da74c15a6576b3e2b394be5aac4b30..8979a60dfe06bb3766753b2599873eaed6fb7926 100644
--- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetLowBetaCandidateCnv.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetLowBetaCandidateCnv.cxx
@@ -28,7 +28,7 @@ InDetLowBetaCandidate_PERS* InDetLowBetaCandidateCnv::createPersistent(InDet::In
 InDet::InDetLowBetaCandidate* InDetLowBetaCandidateCnv::createTransient() {
   ATH_MSG_DEBUG("InDetLowBetaCandidateCnv::createTransient ");
   
-  static pool::Guid tlp1_guid("8C24589F-FBAA-4686-9254-B5C360A94733");
+  const pool::Guid tlp1_guid("8C24589F-FBAA-4686-9254-B5C360A94733");
 
   InDet::InDetLowBetaCandidate *trans_cont(0);
   
diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetLowBetaContainerCnv.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetLowBetaContainerCnv.cxx
index c731090f9c25dcba5e3f03c2ef415caeb2b60674..5935d17948eb72acab95747dcc259ad65da31cf2 100644
--- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetLowBetaContainerCnv.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetLowBetaContainerCnv.cxx
@@ -30,7 +30,7 @@ InDetLowBetaContainer_PERS *InDetLowBetaContainerCnv::createPersistent(InDet::In
 InDet::InDetLowBetaContainer *InDetLowBetaContainerCnv::createTransient() {
   ATH_MSG_DEBUG("InDetLowBetaContainerCnv::createTransient called");
 
-  static pool::Guid tlp1_guid("2EBE2034-8157-477B-B327-D37BE8A0317D");
+  const pool::Guid tlp1_guid("2EBE2034-8157-477B-B327-D37BE8A0317D");
 
   InDet::InDetLowBetaContainer *p_collection = 0;
   if (compareClassGuid(tlp1_guid)) {
diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCollectionCnv.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCollectionCnv.cxx
index 39be5b68628e14e7f37b731a0f0b0162413e2cf2..aaa95ca0363bb497236024d910cdedc7e52f2288 100644
--- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCollectionCnv.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCollectionCnv.cxx
@@ -20,10 +20,10 @@ InDetSimDataCollection* InDetSimDataCollectionCnv::createTransient() {
     InDetSimDataCollectionCnv_p3   converter_p3;
 
     InDetSimDataCollection       *trans_cont(0);
-    static const pool::Guid   p3_guid("1430AA7B-EE92-5A41-92F3-5DD5367D6BAA");
-    static const pool::Guid   p2_guid("C648CA66-013D-44AC-B0D9-99BFB0060E84");
-    static const pool::Guid   p1_guid("333EF996-1672-4AB8-917D-187F908F1EDE");
-    static const pool::Guid   old_guid("5A50C32E-C036-4A49-AE97-716D53210BE1");
+    const pool::Guid   p3_guid("1430AA7B-EE92-5A41-92F3-5DD5367D6BAA");
+    const pool::Guid   p2_guid("C648CA66-013D-44AC-B0D9-99BFB0060E84");
+    const pool::Guid   p1_guid("333EF996-1672-4AB8-917D-187F908F1EDE");
+    const pool::Guid   old_guid("5A50C32E-C036-4A49-AE97-716D53210BE1");
 
     if( this->compareClassGuid(p3_guid)) {
         std::auto_ptr< InDetSimDataCollection_p3 >   col_vect( this->poolReadObject< InDetSimDataCollection_p3 >() );
diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetTrackCnv.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetTrackCnv.cxx
index 718b57922360865e2bc260ba6bc78cbbeac84849..678a345f52f68ef2d89d792c430cba395f96b06c 100644
--- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetTrackCnv.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetTrackCnv.cxx
@@ -32,8 +32,8 @@ StatusCode InDetTrackCnv::initialize()
 void 
 InDetTrackCnv::readObjectFromPool( const std::string& token )
 {
-    static pool::Guid p2_guid( "4E3778E2-1497-4F10-8746-AA02319FAC83" );
-    static pool::Guid p1_guid( "8380F7AC-4A8F-4382-95A5-1234E43D3B08" );
+    const pool::Guid p2_guid( "4E3778E2-1497-4F10-8746-AA02319FAC83" );
+    const pool::Guid p1_guid( "8380F7AC-4A8F-4382-95A5-1234E43D3B08" );
 
    // set the POOL token which will be used for reading from POOL
    setToken( token );
diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/PixelClusterContainerCnv.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/PixelClusterContainerCnv.cxx
index 8504cdc5a64a1514e61584177d0b82e840b8a930..f3bc60d9f8258c0516eca3c4bf1b587fa7af57ac 100644
--- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/PixelClusterContainerCnv.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/PixelClusterContainerCnv.cxx
@@ -66,10 +66,10 @@ StatusCode PixelClusterContainerCnv::initialize() {
 
 
 InDet::PixelClusterContainer* PixelClusterContainerCnv::createTransient() {
-  static pool::Guid   p0_guid("37B00A31-EA80-45DF-9A3F-2721EC0F0DA6"); // before t/p split
-  static pool::Guid   p1_guid("9DB54746-8C4E-4A56-8B4C-0E5D42905218"); // with PixelCluster_tlp1
-  static pool::Guid   p2_guid("DE48E26B-9E03-4EAD-86B9-351AD88D060E"); // with pixelCluster_p2
-  static pool::Guid   p3_guid("7BF0F163-B227-434C-86A6-16130E005E6C"); // with pixelCluster_p3
+  const pool::Guid   p0_guid("37B00A31-EA80-45DF-9A3F-2721EC0F0DA6"); // before t/p split
+  const pool::Guid   p1_guid("9DB54746-8C4E-4A56-8B4C-0E5D42905218"); // with PixelCluster_tlp1
+  const pool::Guid   p2_guid("DE48E26B-9E03-4EAD-86B9-351AD88D060E"); // with pixelCluster_p2
+  const pool::Guid   p3_guid("7BF0F163-B227-434C-86A6-16130E005E6C"); // with pixelCluster_p3
   ATH_MSG_DEBUG("createTransient(): main converter");
   InDet::PixelClusterContainer* p_collection(0);
   if( compareClassGuid(p3_guid) ) {
diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/PixelGangedClusterAmbiguitiesCnv.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/PixelGangedClusterAmbiguitiesCnv.cxx
index 12bf6d5a06a4ad21b0728a26ec6b3f4899df7ddc..26699ff884359890ab08cfc87051302f97df50da 100644
--- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/PixelGangedClusterAmbiguitiesCnv.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/PixelGangedClusterAmbiguitiesCnv.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /**
@@ -10,24 +10,22 @@
 
 #include "PixelGangedClusterAmbiguitiesCnv.h"
 #include "InDetEventTPCnv/InDetPrepRawData/PixelGangedClusterAmbiguities_p1.h"
-#include "InDetEventTPCnv/InDetPrepRawData/PixelGangedClusterAmbiguitiesCnv_p1.h"
-static PixelGangedClusterAmbiguitiesCnv_p1   TPconverter;
 
 PixelGangedClusterAmbiguities_PERS* PixelGangedClusterAmbiguitiesCnv::createPersistent(InDet::PixelGangedClusterAmbiguities* transObj) {
     ATH_MSG_DEBUG("PixelGangedClusterAmbiguities write");
-    PixelGangedClusterAmbiguities_PERS *persObj = TPconverter.createPersistent( transObj, msg() );
+    PixelGangedClusterAmbiguities_PERS *persObj = m_TPconverter.createPersistent( transObj, msg() );
     ATH_MSG_DEBUG("Success");
     return persObj; 
 }
     
 InDet::PixelGangedClusterAmbiguities* PixelGangedClusterAmbiguitiesCnv::createTransient() {
-    static pool::Guid   p1_guid("FE36CE7E-EADF-481F-A55A-26DA0030DFAA");
-//     static pool::Guid   p0_guid("380D8BB9-B34F-470F-92CC-06C3D60F7BE4");
+    const pool::Guid   p1_guid("FE36CE7E-EADF-481F-A55A-26DA0030DFAA");
+//     const pool::Guid   p0_guid("380D8BB9-B34F-470F-92CC-06C3D60F7BE4");
     if( compareClassGuid(p1_guid) ) {
         // using unique_ptr ensures deletion of the persistent object
         std::unique_ptr< InDet::PixelGangedClusterAmbiguities_p1 > col_vect( poolReadObject< InDet::PixelGangedClusterAmbiguities_p1 >() );
         ATH_MSG_DEBUG("Reading PixelGangedClusterAmbiguities_p1"); 
-        return TPconverter.createTransient( col_vect.get(), msg() );
+        return m_TPconverter.createTransient( col_vect.get(), msg() );
     }
 //     else if( compareClassGuid(p0_guid) ) {
 //         dont think there was a "before T/P" split converter
diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/PixelGangedClusterAmbiguitiesCnv.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/PixelGangedClusterAmbiguitiesCnv.h
index 758951702bf4292826e727a9b549aadd49f7366f..0544c746e312519f2d0ce96c80bd14db217538b8 100644
--- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/PixelGangedClusterAmbiguitiesCnv.h
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/PixelGangedClusterAmbiguitiesCnv.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /** 
@@ -14,6 +14,7 @@
 #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h"
 #include "InDetPrepRawData/PixelGangedClusterAmbiguities.h"
 #include "InDetEventTPCnv/InDetPrepRawData/PixelGangedClusterAmbiguities_p1.h"
+#include "InDetEventTPCnv/InDetPrepRawData/PixelGangedClusterAmbiguitiesCnv_p1.h"
 
 // the latest persistent representation type of PixelGangedClusterAmbiguities
 typedef  InDet::PixelGangedClusterAmbiguities_p1  PixelGangedClusterAmbiguities_PERS;
@@ -27,6 +28,8 @@ public:
 protected:
   virtual PixelGangedClusterAmbiguities_PERS*   createPersistent (InDet::PixelGangedClusterAmbiguities* transObj);
   virtual InDet::PixelGangedClusterAmbiguities*        createTransient ();
+private:
+  PixelGangedClusterAmbiguitiesCnv_p1 m_TPconverter;
 };
 
 #endif
diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/PixelRDO_ContainerCnv.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/PixelRDO_ContainerCnv.cxx
index 4d922261b3337d737fb1f727ea53ad14884bbfab..a9558b57ac05100347a19deb3070b0b1dc7743b2 100644
--- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/PixelRDO_ContainerCnv.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/PixelRDO_ContainerCnv.cxx
@@ -123,9 +123,9 @@ PixelRDO_Container_PERS* PixelRDO_ContainerCnv::createPersistent(PixelRDO_Contai
 //================================================================
 PixelRDO_Container* PixelRDO_ContainerCnv::createTransient() {
 
-  static pool::Guid   p0_guid("7F2C09B6-0B47-4957-8BBA-EDC665A290AC"); // with Pixel1RawData
-  static pool::Guid   TP1_guid("DA76970C-E019-43D2-B2F9-25660DCECD9D"); // for t/p separated version with InDetRawDataContainer_p1
-  static pool::Guid   TP2_guid("7138342E-0A80-4A32-A387-2842A01C2539"); // for t/p separated version with InDetRawDataContainer_p2
+  const pool::Guid   p0_guid("7F2C09B6-0B47-4957-8BBA-EDC665A290AC"); // with Pixel1RawData
+  const pool::Guid   TP1_guid("DA76970C-E019-43D2-B2F9-25660DCECD9D"); // for t/p separated version with InDetRawDataContainer_p1
+  const pool::Guid   TP2_guid("7138342E-0A80-4A32-A387-2842A01C2539"); // for t/p separated version with InDetRawDataContainer_p2
   ATH_MSG_DEBUG("createTransient(): main converter");
 
   if( compareClassGuid(TP2_guid) ) {
diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_ClusterContainerCnv.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_ClusterContainerCnv.cxx
index 0818e7b2c89c7311aee68be7474d4309cdc4a616..4ce7fb35838d467cc92dfcbc13cbccb008195bde 100644
--- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_ClusterContainerCnv.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_ClusterContainerCnv.cxx
@@ -69,10 +69,10 @@ StatusCode SCT_ClusterContainerCnv::initialize() {
 
 InDet::SCT_ClusterContainer* SCT_ClusterContainerCnv::createTransient() {
   //  MsgStream log(msgSvc(), "SCT_ClusterContainerCnv" );
-  static pool::Guid   p0_guid("A180F372-0D52-49C3-8AA0-0939CB0B8179"); // before t/p split
-  static pool::Guid   p1_guid("657F6546-F5CD-4166-9567-16AD9C96D286"); // with SCT_Cluster_tlp1
-  static pool::Guid   p2_guid("ECE7D831-0F31-4E6F-A6BE-2ADDE90083BA"); // with SCT_Cluster_p2
-  static pool::Guid   p3_guid("623F5836-369F-4A94-9DD4-DAD728E93C13"); // with SCT_Cluster_p3
+  const pool::Guid   p0_guid("A180F372-0D52-49C3-8AA0-0939CB0B8179"); // before t/p split
+  const pool::Guid   p1_guid("657F6546-F5CD-4166-9567-16AD9C96D286"); // with SCT_Cluster_tlp1
+  const pool::Guid   p2_guid("ECE7D831-0F31-4E6F-A6BE-2ADDE90083BA"); // with SCT_Cluster_p2
+  const pool::Guid   p3_guid("623F5836-369F-4A94-9DD4-DAD728E93C13"); // with SCT_Cluster_p3
 
   //ATH_MSG_DEBUG("createTransient(): main converter");
   InDet::SCT_ClusterContainer* p_collection(nullptr);
diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_FlaggedCondDataCnv.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_FlaggedCondDataCnv.cxx
index d9224ba12851cae052f0412750fd50b75a852c6d..299160dca6baac013784be1836b545ae5542ebfc 100644
--- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_FlaggedCondDataCnv.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_FlaggedCondDataCnv.cxx
@@ -24,7 +24,7 @@ SCT_FlaggedCondDataCnv::createPersistent(SCT_FlaggedCondData* transCont) {
 SCT_FlaggedCondData*
 SCT_FlaggedCondDataCnv::createTransient() {
   MsgStream log(msgSvc(), "SCT_FlaggedCondDataCnv");
-  static pool::Guid p1_guid("0C10E502-F02B-440B-9E8F-6A8C31915D7C");
+  const pool::Guid p1_guid("0C10E502-F02B-440B-9E8F-6A8C31915D7C");
   if (compareClassGuid(p1_guid)) {
     /** using auto_ptr ensures deletion of the persistent object */
     std::auto_ptr<SCT_FlaggedCondData_p1> col_vect( poolReadObject< SCT_FlaggedCondData_p1 >() );
diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RDO_ContainerCnv.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RDO_ContainerCnv.cxx
index 74a877fda4ac40c994113ececfaafc2a3c034a76..3e16fae0d1553a0f3db43e9b6fa773b9fdfc4809 100644
--- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RDO_ContainerCnv.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RDO_ContainerCnv.cxx
@@ -143,12 +143,12 @@ SCT_RDO_Container_PERS* SCT_RDO_ContainerCnv::createPersistent(SCT_RDO_Container
 //================================================================
 SCT_RDO_Container* SCT_RDO_ContainerCnv::createTransient() {
 
-  static pool::Guid   p0_guid("B82A1D11-3F86-4F07-B380-B61BA2DAF3A9"); // with SCT1_RawData
-  static pool::Guid   TP1_guid("DA76970C-E019-43D2-B2F9-25660DCECD9D"); // for t/p separated version with InDetRawDataContainer_p1
-  static pool::Guid   SCT_TP1_guid("8E13963E-13E5-4D10-AA8B-73F00AFF8FA8"); // for t/p separated version with SCT_RawDataContainer_p1
-  static pool::Guid   SCT_TP2_guid("D1258125-2CBA-476E-8578-E09D54F477E1"); // for t/p separated version with SCT_RawDataContainer_p2
-  static pool::Guid   SCT_TP3_guid("5FBC8D4D-7B4D-433A-8487-0EA0C870CBDB"); // for t/p separated version with SCT_RawDataContainer_p3
-  static pool::Guid   SCT_TP4_guid("6C7540BE-E85C-4777-BC1C-A9FF11460F54"); // for t/p separated version with SCT_RawDataContainer_p4
+  const pool::Guid   p0_guid("B82A1D11-3F86-4F07-B380-B61BA2DAF3A9"); // with SCT1_RawData
+  const pool::Guid   TP1_guid("DA76970C-E019-43D2-B2F9-25660DCECD9D"); // for t/p separated version with InDetRawDataContainer_p1
+  const pool::Guid   SCT_TP1_guid("8E13963E-13E5-4D10-AA8B-73F00AFF8FA8"); // for t/p separated version with SCT_RawDataContainer_p1
+  const pool::Guid   SCT_TP2_guid("D1258125-2CBA-476E-8578-E09D54F477E1"); // for t/p separated version with SCT_RawDataContainer_p2
+  const pool::Guid   SCT_TP3_guid("5FBC8D4D-7B4D-433A-8487-0EA0C870CBDB"); // for t/p separated version with SCT_RawDataContainer_p3
+  const pool::Guid   SCT_TP4_guid("6C7540BE-E85C-4777-BC1C-A9FF11460F54"); // for t/p separated version with SCT_RawDataContainer_p4
 
 #ifdef SCT_DEBUG
   ATH_MSG_DEBUG("createTransient(): main converter");
diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_DriftCircleContainerCnv.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_DriftCircleContainerCnv.cxx
index 23d13c3cbc9d8a4ccf1d4db24ef09da79c1c5c27..986cdee679239d4a18276252a31eb0cbd642e64e 100644
--- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_DriftCircleContainerCnv.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_DriftCircleContainerCnv.cxx
@@ -66,9 +66,9 @@ StatusCode TRT_DriftCircleContainerCnv::initialize() {
 
 InDet::TRT_DriftCircleContainer* TRT_DriftCircleContainerCnv::createTransient() {
 
-  static pool::Guid   p0_guid("A99630C5-3D7C-4DB4-9E6C-FC3CEF981895"); // before t/p split
-  static pool::Guid   p1_guid("42B48D79-AF4E-4D45-AAA9-A2BA5A033534"); // with TRT_DriftCircle_tlp1
-  static pool::Guid   p2_guid("36195EDE-941C-424B-81A1-E04C867C35D8"); // with TRT_DriftCircle_p2
+  const pool::Guid   p0_guid("A99630C5-3D7C-4DB4-9E6C-FC3CEF981895"); // before t/p split
+  const pool::Guid   p1_guid("42B48D79-AF4E-4D45-AAA9-A2BA5A033534"); // with TRT_DriftCircle_tlp1
+  const pool::Guid   p2_guid("36195EDE-941C-424B-81A1-E04C867C35D8"); // with TRT_DriftCircle_p2
   ATH_MSG_DEBUG("createTransient(): main converter");
   InDet::TRT_DriftCircleContainer* p_collection(0);
   if( compareClassGuid(p2_guid) ) {
diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_ContainerCnv.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_ContainerCnv.cxx
index 1004b4dc54d856def9761c1c8f374d8a663cf43e..0f39ff830d8a60687be355572024c7f633a42ab2 100644
--- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_ContainerCnv.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_ContainerCnv.cxx
@@ -122,10 +122,10 @@ TRT_RDO_Container_PERS* TRT_RDO_ContainerCnv::createPersistent(TRT_RDO_Container
 //================================================================
 TRT_RDO_Container* TRT_RDO_ContainerCnv::createTransient() {
 
-  static pool::Guid   p0_guid("5DB01CED-F6FD-4866-A1C6-E046641E44F5"); // with TRT_LoLumRawData
-  static pool::Guid   p1_guid("CFBDB7A8-C788-4EE7-A260-3C8B680234FE"); // with TRT_RDORawData
-  static pool::Guid   TP1_guid("DA76970C-E019-43D2-B2F9-25660DCECD9D"); // for t/p separated version with InDetRawDataContainer_p1
-  static pool::Guid   TP2_guid("7138342E-0A80-4A32-A387-2842A01C2539"); // for t/p separated version with InDetRawDataContainer_p2
+  const pool::Guid   p0_guid("5DB01CED-F6FD-4866-A1C6-E046641E44F5"); // with TRT_LoLumRawData
+  const pool::Guid   p1_guid("CFBDB7A8-C788-4EE7-A260-3C8B680234FE"); // with TRT_RDORawData
+  const pool::Guid   TP1_guid("DA76970C-E019-43D2-B2F9-25660DCECD9D"); // for t/p separated version with InDetRawDataContainer_p1
+  const pool::Guid   TP2_guid("7138342E-0A80-4A32-A387-2842A01C2539"); // for t/p separated version with InDetRawDataContainer_p2
   ATH_MSG_DEBUG("createTransient(): main converter");
 
   if( compareClassGuid(TP2_guid) ) {
diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_ContainerCnv_p1.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_ContainerCnv_p1.cxx
index c6798a99dd2b521bc99e54e561addb5a747e6413..f3241b70bebff63a959d033620a1165f9a58c0c4 100644
--- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_ContainerCnv_p1.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_ContainerCnv_p1.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 // Andrei Gaponenko <agaponenko@lbl.gov>, 2006 
@@ -58,7 +58,7 @@ namespace {
 }
 
 //================================================================
-void TRT_RDO_ContainerCnv_p1::transToPers(const TRT_RDO_Container* trans, TRT_RDO_Container_p1* pers, MsgStream &log) {
+void TRT_RDO_ContainerCnv_p1::transToPers ATLAS_NOT_THREAD_SAFE (const TRT_RDO_Container* trans, TRT_RDO_Container_p1* pers, MsgStream &log) {
   // Copy objects from InDetRawDataContainer collections to simple vector
 
   unsigned null_count(0);
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/InDetEventTPCnv/InDetLowBetaInfo/InDetLowBetaCandidateCnv_tlp1.h b/InnerDetector/InDetEventCnv/InDetEventTPCnv/InDetEventTPCnv/InDetLowBetaInfo/InDetLowBetaCandidateCnv_tlp1.h
index 83c1e0a38edea08073c10c671ccbb9198b0883ea..abc0586e40890d68a339412ce482765ee3bc23f4 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/InDetEventTPCnv/InDetLowBetaInfo/InDetLowBetaCandidateCnv_tlp1.h
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/InDetEventTPCnv/InDetLowBetaInfo/InDetLowBetaCandidateCnv_tlp1.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef InDetLowBetaCandidateCnv_TLP1_H
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetLowBetaInfo/InDetLowBetaCandidateCnv_tlp1.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetLowBetaInfo/InDetLowBetaCandidateCnv_tlp1.cxx
index a6da6b05f8f16899dc097bf206fea5ee1c1385ba..009a96b38816f3b4ad78d7ad82be01d8d3bd16e3 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetLowBetaInfo/InDetLowBetaCandidateCnv_tlp1.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetLowBetaInfo/InDetLowBetaCandidateCnv_tlp1.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetEventTPCnv/InDetLowBetaInfo/InDetLowBetaCandidateCnv_tlp1.h"
@@ -16,7 +16,7 @@ void InDetLowBetaCandidateCnv_tlp1::setPStorage(InDetLowBetaCandidate_tlp1* stor
 }
 
 
-void T_TPCnv<InDet::InDetLowBetaCandidate, InDetLowBetaCandidate_tlp1 >::persToTrans(const InDetLowBetaCandidate_tlp1 *pers,
+void T_TPCnv<InDet::InDetLowBetaCandidate, InDetLowBetaCandidate_tlp1 >::persToTrans ATLAS_NOT_THREAD_SAFE (const InDetLowBetaCandidate_tlp1 *pers,
 											    InDet::InDetLowBetaCandidate *trans,
 											    MsgStream &msg) {
   setPStorage(const_cast<InDetLowBetaCandidate_tlp1*>(pers));
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetLowBetaInfo/InDetLowBetaContainerCnv_tlp1.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetLowBetaInfo/InDetLowBetaContainerCnv_tlp1.cxx
index 5fc314510efb95e3a72d13320dbbf66c391344fe..8c32046c88637126d1b32b133289daf2b49492e5 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetLowBetaInfo/InDetLowBetaContainerCnv_tlp1.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetLowBetaInfo/InDetLowBetaContainerCnv_tlp1.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetEventTPCnv/InDetLowBetaInfo/InDetLowBetaContainerCnv_tlp1.h"
@@ -21,7 +21,7 @@ void InDetLowBetaContainerCnv_tlp1::setPStorage(
 }
 
 void T_TPCnv<InDet::InDetLowBetaContainer, InDetLowBetaContainer_tlp1>::
-persToTrans (const InDetLowBetaContainer_tlp1 *pers,
+persToTrans ATLAS_NOT_THREAD_SAFE (const InDetLowBetaContainer_tlp1 *pers,
              InDet::InDetLowBetaContainer *trans,
              MsgStream &msg) {
   this->setTLPersObject(const_cast<InDetLowBetaContainer_tlp1*>(pers));
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelGangedClusterAmbiguitiesCnv_p1.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelGangedClusterAmbiguitiesCnv_p1.cxx
index e88a6af7f1ea1f15db49cefbdd7904b64f74caab..140c825e10f2a30c16a2694b1bc8536a2e9fab70 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelGangedClusterAmbiguitiesCnv_p1.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelGangedClusterAmbiguitiesCnv_p1.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetPrepRawData/PixelGangedClusterAmbiguities.h"
@@ -22,7 +22,8 @@
 #include "AthenaKernel/IThinningSvc.h"
 
 
-void PixelGangedClusterAmbiguitiesCnv_p1::transToPers(const InDet::PixelGangedClusterAmbiguities* transObj, InDet::PixelGangedClusterAmbiguities_p1* persObj, MsgStream &log) 
+void PixelGangedClusterAmbiguitiesCnv_p1::transToPers ATLAS_NOT_THREAD_SAFE
+(const InDet::PixelGangedClusterAmbiguities* transObj, InDet::PixelGangedClusterAmbiguities_p1* persObj, MsgStream &log)
 {
 //   if (log.level() <= MSG::DEBUG) log << MSG::DEBUG  << " ***  Writing InDet::PixelGangedClusterAmbiguities" << endmsg;
   
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetRIO_OnTrack/PixelClusterOnTrackCnv_p2.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetRIO_OnTrack/PixelClusterOnTrackCnv_p2.cxx
index cfed0f93cffddc1118e76615d51534db9e8a97fa..05bb16bd4a89270ec462d6c403cb98afa7ad937b 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetRIO_OnTrack/PixelClusterOnTrackCnv_p2.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetRIO_OnTrack/PixelClusterOnTrackCnv_p2.cxx
@@ -52,38 +52,24 @@ void PixelClusterOnTrackCnv_p2::persToTrans( const InDet::PixelClusterOnTrack_p2
 
 
 void PixelClusterOnTrackCnv_p2::transToPers( const InDet::PixelClusterOnTrack *transObj, InDet::PixelClusterOnTrack_p2 *persObj, MsgStream &log ) {
-
-    const Trk::RIO_OnTrack* tobj = static_cast<const Trk::RIO_OnTrack *>(transObj);
-    m_eventCnvTool->prepareRIO_OnTrack(const_cast<Trk::RIO_OnTrack *>(tobj));
-    //m_eventCnvTool->prepareRIO_OnTrack(const_cast<Trk::RIO_OnTrack *>(transObj));
-    persObj->m_id = transObj->identify().get_compact();
-    persObj->m_localParams = toPersistent( &m_localParCnv, &transObj->localParameters(), log );
-    Trk::ErrorMatrix pMat;
-    EigenHelpers::eigenMatrixToVector(pMat.values, transObj->localCovariance(), "PixelClusterOnTrackCnv_p2");
-    persObj->m_localErrMat = toPersistent( &m_errorMxCnv, &pMat, log );
-
-    persObj->m_idDE = transObj->idDE();
-    persObj->m_isbroad = transObj->isBroadCluster();
-
-    persObj->m_hasClusterAmbiguity = transObj->hasClusterAmbiguity();
-    persObj->m_isFake              = transObj->isFake();
-    persObj->m_energyLoss          = transObj->energyLoss();
-
-    if(!transObj->prepRawDataLink().dataID().empty()){
-      persObj->m_prdLink.m_contName          = transObj->prepRawDataLink().dataID();
-      persObj->m_prdLink.m_elementIndex     = transObj->prepRawDataLink().index();
-    }else{
-        persObj->m_prdLink.m_contName         = "";
-        persObj->m_prdLink.m_elementIndex     = 0;
-    }
-
-   //std::cout << "PixelClusterOnTrackCnv_p2::transToPers() "
-   //          << transObj->m_identifier
-   //          << " [" << transObj->m_rio.dataID() << "/" << transObj->m_rio.index() << "]"
-   //          << ": " << persObj->m_prdLink.m_contName
-   //          << " (" << persObj->m_prdLink.m_elementIndex
-   //          << ")" << std::endl;
-   //transObj->dump(std::cout) << std::endl;
+  if (transObj==nullptr or persObj==nullptr) return;
+
+  persObj->m_id = transObj->identify().get_compact();
+  persObj->m_localParams = toPersistent( &m_localParCnv, &transObj->localParameters(), log );
+  Trk::ErrorMatrix pMat;
+  EigenHelpers::eigenMatrixToVector(pMat.values, transObj->localCovariance(), "PixelClusterOnTrackCnv_p2");
+  persObj->m_localErrMat = toPersistent( &m_errorMxCnv, &pMat, log );
+  persObj->m_idDE = transObj->idDE();
+  persObj->m_isbroad = transObj->isBroadCluster();
+  persObj->m_hasClusterAmbiguity = transObj->hasClusterAmbiguity();
+  persObj->m_isFake              = transObj->isFake();
+  persObj->m_energyLoss          = transObj->energyLoss();
+
+  const std::string pixelClusContName{"PixelClusters"};
+  ElementLink<InDet::PixelClusterContainer>::index_type hashAndIndex{0};
+  bool isFound{m_eventCnvTool->getHashAndIndex<InDet::PixelClusterContainer, InDet::PixelClusterOnTrack>(transObj, pixelClusContName, hashAndIndex)};
+  persObj->m_prdLink.m_contName = (isFound ? pixelClusContName : "");
+  persObj->m_prdLink.m_elementIndex = hashAndIndex;
 }
 
 StatusCode PixelClusterOnTrackCnv_p2::initialize(MsgStream &/*log*/) {
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetRIO_OnTrack/TRT_DriftCircleOnTrackCnv_p2.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetRIO_OnTrack/TRT_DriftCircleOnTrackCnv_p2.cxx
index 7abd3842ef0a5e3ee51b6b0de3303d7c29d25fa3..b71543888021909ff52785c39cebde3ff2d52b48 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetRIO_OnTrack/TRT_DriftCircleOnTrackCnv_p2.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetRIO_OnTrack/TRT_DriftCircleOnTrackCnv_p2.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 //-----------------------------------------------------------------------------
@@ -48,38 +48,24 @@ void TRT_DriftCircleOnTrackCnv_p2::persToTrans( const InDet::TRT_DriftCircleOnTr
 
 
 void TRT_DriftCircleOnTrackCnv_p2::transToPers( const InDet::TRT_DriftCircleOnTrack    *transObj, InDet::TRT_DriftCircleOnTrack_p2 *persObj, MsgStream &log) {
-    //std::cout<<"WRITING TRT_DriftCircleOnTrackCnv_p2"<<std::endl;
-    const Trk::RIO_OnTrack* tobj = static_cast<const Trk::RIO_OnTrack *>(transObj);
-    m_eventCnvTool->prepareRIO_OnTrack(const_cast<Trk::RIO_OnTrack *>(tobj));
-    // persObj->m_RIO = baseToPersistent( &m_RIOCnv, transObj, log );
-    persObj->m_id = transObj->identify().get_identifier32().get_compact();
-    persObj->m_localParams = toPersistent( &m_localParCnv, &transObj->localParameters(), log );
-    Trk::ErrorMatrix pMat;
-    EigenHelpers::eigenMatrixToVector(pMat.values, transObj->localCovariance(), "TRT_DriftCircleOnTrackCnv_p2");
-    persObj->m_localErrMat = toPersistent( &m_errorMxCnv, &pMat, log );   
-    // m_globalPosition - transient?
-    
-    persObj->m_idDE      = transObj->idDE();
-    persObj->m_status    = static_cast<unsigned int>( transObj->status() );
-    persObj->m_highLevel = transObj->highLevel();
-   
-//new variables  
-    persObj->m_localAngle	       = transObj->localAngle();
-    persObj->m_positionAlongWire = transObj->positionAlongWire();   
-   
-    // added in 12.5
-    persObj->m_timeOverThreshold = (float) transObj->timeOverThreshold();
-//   m_elementLinkConverter.resetForCnv(persObj->m_elementLinkToIDCTRT_DriftCircleContainerNames);
-//   m_elementLinkConverter.transToPers(&transObj->m_rio,&persObj->m_elementLinkToIDCTRT_DriftCircleContainer,log);
-    //m_elCnv.transToPers(&transObj->m_rio,&persObj->m_prdLink,log);  
-
-    if (!transObj->prepRawDataLink().dataID().empty()) {
-      persObj->m_prdLink.m_contName          = transObj->prepRawDataLink().dataID();// New suggestion from RD - above crashes
-      persObj->m_prdLink.m_elementIndex     = transObj->prepRawDataLink().index();
-    }else{
-        persObj->m_prdLink.m_contName         = "";
-        persObj->m_prdLink.m_elementIndex     = 0;
-    }
+  if (transObj==nullptr or persObj==nullptr) return;
 
+  persObj->m_id = transObj->identify().get_identifier32().get_compact();
+  persObj->m_localParams = toPersistent( &m_localParCnv, &transObj->localParameters(), log );
+  Trk::ErrorMatrix pMat;
+  EigenHelpers::eigenMatrixToVector(pMat.values, transObj->localCovariance(), "TRT_DriftCircleOnTrackCnv_p2");
+  persObj->m_localErrMat = toPersistent( &m_errorMxCnv, &pMat, log );
+  persObj->m_idDE      = transObj->idDE();
+  persObj->m_status    = static_cast<unsigned int>( transObj->status() );
+  persObj->m_highLevel = transObj->highLevel();
+  persObj->m_localAngle	       = transObj->localAngle();
+  persObj->m_positionAlongWire = transObj->positionAlongWire();
+  // added in 12.5
+  persObj->m_timeOverThreshold = static_cast<float>(transObj->timeOverThreshold());
 
+  const std::string trtCircleContName{"TRT_DriftCircles"};
+  ElementLink<InDet::TRT_DriftCircleContainer>::index_type hashAndIndex{0};
+  bool isFound{m_eventCnvTool->getHashAndIndex<InDet::TRT_DriftCircleContainer, InDet::TRT_DriftCircleOnTrack>(transObj, trtCircleContName, hashAndIndex)};
+  persObj->m_prdLink.m_contName = (isFound ? trtCircleContName : "");
+  persObj->m_prdLink.m_elementIndex = hashAndIndex;
 }
diff --git a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py
index b757c825632442e6f342dd82d02828f45ba78859..6b51841abe78d7f6084c994bf3707368deacfbbc 100644
--- a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py
+++ b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py
@@ -419,7 +419,7 @@ if dumpPixInfo:
 
     from AthenaCommon.AppMgr import ToolSvc
     if not hasattr(ToolSvc, "PixelLorentzAngleTool"):
-        from SiLorentzAngleSvc.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup
+        from SiLorentzAngleTool.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup
         pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup()
 
     from InDetPrepRawDataToxAOD.InDetPrepRawDataToxAODConf import PixelPrepDataToxAOD
diff --git a/InnerDetector/InDetEventCnv/InDetSimEventAthenaPool/CMakeLists.txt b/InnerDetector/InDetEventCnv/InDetSimEventAthenaPool/CMakeLists.txt
index a66d9c330e5d4e1588246387e1d2dde155adccaf..1f012ea1101e610cffeebddf0dc35e70f24ab4fc 100644
--- a/InnerDetector/InDetEventCnv/InDetSimEventAthenaPool/CMakeLists.txt
+++ b/InnerDetector/InDetEventCnv/InDetSimEventAthenaPool/CMakeLists.txt
@@ -44,7 +44,7 @@ find_package( AthenaPoolUtilitiesTest )
 
 if( ATHENAPOOLUTILITIESTEST_FOUND )
   set( INDETSIMEVENTATHENAPOOL_REFERENCE_TAG
-       InDetSimEventAthenaPoolReference-01-00-00 )
+       InDetSimEventAthenaPoolReference-02-00-00 )
   run_tpcnv_test( InDetSimEventTPCnv_HITS   HITS.04919495._000416
                    REFERENCE_TAG ${INDETSIMEVENTATHENAPOOL_REFERENCE_TAG} )
 else()
diff --git a/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/share/testSCTDecode.py b/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/share/testSCTDecode.py
index f67b4de2e4d7c14dbbe46f9891f6f33b003ac03c..4e62db0218b731ba55a24939348a9963cad2bfcb 100644
--- a/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/share/testSCTDecode.py
+++ b/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/share/testSCTDecode.py
@@ -101,8 +101,8 @@ topSequence.InDetSCTRawDataProvider.ProviderTool.Decoder.OutputLevel = INFO
 topSequence.InDetSCTEventFlagWriter.OutputLevel = DEBUG
 
 # Set up SCT clsutering
-from SiLorentzAngleSvc.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
-from SiLorentzAngleSvc.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup
+from SiLorentzAngleTool.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
+from SiLorentzAngleTool.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup
 sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup()
 from SiClusterizationTool.SiClusterizationToolConf import InDet__ClusterMakerTool
 InDetClusterMakerTool = InDet__ClusterMakerTool(name = "InDetClusterMakerTool",
diff --git a/InnerDetector/InDetExample/InDetAlignExample/share/ElectronEoverPTracking.py b/InnerDetector/InDetExample/InDetAlignExample/share/ElectronEoverPTracking.py
index d0c8b10b17be291d4a55f63f88921979324c5774..48d91adf59a564f49c7dd3d5148c0bd45388bf7c 100755
--- a/InnerDetector/InDetExample/InDetAlignExample/share/ElectronEoverPTracking.py
+++ b/InnerDetector/InDetExample/InDetAlignExample/share/ElectronEoverPTracking.py
@@ -22,7 +22,7 @@ topSequence = AlgSequence()
 #
 # SiLorentzAngleTool
 #
-from SiLorentzAngleSvc.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
+from SiLorentzAngleTool.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
 sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup()
 #
 # load SCT ROT creator, we overwrite the defaults for it
diff --git a/InnerDetector/InDetExample/InDetDetDescrExample/share/ReadSiDetectorElements_jobOptions.py b/InnerDetector/InDetExample/InDetDetDescrExample/share/ReadSiDetectorElements_jobOptions.py
index f417a79e9e75413ded1a36a9903af7da29da5331..14186022d588cb838fe0966082dbe3acc4b7ed3f 100644
--- a/InnerDetector/InDetExample/InDetDetDescrExample/share/ReadSiDetectorElements_jobOptions.py
+++ b/InnerDetector/InDetExample/InDetDetDescrExample/share/ReadSiDetectorElements_jobOptions.py
@@ -64,7 +64,7 @@ from SiPropertiesTool.PixelSiPropertiesToolSetup import PixelSiPropertiesToolSet
 pixelSiPropertiesToolSetup = PixelSiPropertiesToolSetup()
 pixelSiPropertiesToolSetup.setup()
 pixelSiPropertiesTool = pixelSiPropertiesToolSetup.getTool()
-from SiLorentzAngleSvc.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup
+from SiLorentzAngleTool.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup
 pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup()
 pixelLorentzAngleTool = pixelLorentzAngleToolSetup.PixelLorentzAngleTool
 
@@ -77,7 +77,7 @@ ReadPixelElements.SiConditionsTool   = pixelDCSConditionsTool
 # SCT
 #
 # Silicon Lorentz angle tool
-from SiLorentzAngleSvc.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
+from SiLorentzAngleTool.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
 sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup()
 sctLorentzAngleTool = sctLorentzAngleToolSetup.SCTLorentzAngleTool
 sctSiliconConditionsTool = sctLorentzAngleToolSetup.sctSiliconConditionsTool
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py
index e84ea5da7869ac6532bbe0539d4edeea1bc0aa01..ef043d6801ff0feb932f8d9f153b89667eb7ad51 100644
--- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py
@@ -103,7 +103,7 @@ if DetFlags.haveRIO.pixel_on():
       condSeq += PixelConfigCondAlg(name="PixelConfigCondAlg")
 
     if not hasattr(ToolSvc, "PixelLorentzAngleTool"):
-        from SiLorentzAngleSvc.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup
+        from SiLorentzAngleTool.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup
         pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup()
 
 
@@ -267,7 +267,7 @@ if DetFlags.haveRIO.SCT_on():
     InDetSCT_ConditionsSummaryToolWithoutFlagged.ConditionsTools = condTools
         
     # Setup Lorentz angle tool.
-    from SiLorentzAngleSvc.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
+    from SiLorentzAngleTool.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
 
     forceUseDB = False
     forceUseGeoModel = False
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py
index b1b74a7ec6e2bbaaac04da208d447e4bf34873bd..fe6329886ca02ea3c56510969f69995d3b08cd93 100755
--- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py
@@ -52,7 +52,7 @@ if InDetFlags.doPixelClusterSplitting() and not InDetFlags.doSLHC():
         # --- a better solution is needed...
 
         if not hasattr(ToolSvc, "PixelLorentzAngleTool"):
-            from SiLorentzAngleSvc.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup
+            from SiLorentzAngleTool.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup
             pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup()
 
         from SiClusterizationTool.SiClusterizationToolConf import InDet__NnClusterizationFactory
@@ -96,7 +96,7 @@ if InDetFlags.doPixelClusterSplitting() and not InDetFlags.doSLHC():
             print NnClusterizationFactory
 elif InDetFlags.doPixelClusterSplitting():
     if not hasattr(ToolSvc, "PixelLorentzAngleTool"):
-        from SiLorentzAngleSvc.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup
+        from SiLorentzAngleTool.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup
         pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup()
 
     from SiClusterizationTool.SiClusterizationToolConf import InDet__TruthClusterizationFactory
@@ -134,7 +134,7 @@ if InDetFlags.loadRotCreator():
         # tool to always make conservative pixel cluster errors
         # SiLorentzAngleTool
         if not hasattr(ToolSvc, "PixelLorentzAngleTool"):
-            from SiLorentzAngleSvc.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup
+            from SiLorentzAngleTool.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup
             pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup()
         from SiClusterOnTrackTool.SiClusterOnTrackToolConf import InDet__PixelClusterOnTrackTool
         if InDetFlags.doDBM():
@@ -197,7 +197,7 @@ if InDetFlags.loadRotCreator():
 
     if DetFlags.haveRIO.SCT_on():
         # SiLorentzAngleTool
-        from SiLorentzAngleSvc.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
+        from SiLorentzAngleTool.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
         sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup()
         from SiClusterOnTrackTool.SiClusterOnTrackToolConf import InDet__SCT_ClusterOnTrackTool
         SCT_ClusterOnTrackTool = InDet__SCT_ClusterOnTrackTool ("InDetSCT_ClusterOnTrackTool",
@@ -258,7 +258,7 @@ if InDetFlags.loadRotCreator():
     if DetFlags.haveRIO.pixel_on():
         # SiLorentzAngleTool
         if not hasattr(ToolSvc, "PixelLorentzAngleTool"):
-            from SiLorentzAngleSvc.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup
+            from SiLorentzAngleTool.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup
             pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup()
         #
         # tool to always make conservative pixel cluster errors
@@ -290,7 +290,7 @@ if InDetFlags.loadRotCreator():
     
     if DetFlags.haveRIO.SCT_on():
         # SiLorentzAngleTool
-        from SiLorentzAngleSvc.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
+        from SiLorentzAngleTool.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
         sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup()
         #
         # tool to always make conservative sct cluster errors
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecPreProcessingSilicon.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecPreProcessingSilicon.py
index 57a5bf0ee8aeccebd52942f84f6919c9bf214675..3eba016b1616abee8cd22b58a96be55e1407a804 100644
--- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecPreProcessingSilicon.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecPreProcessingSilicon.py
@@ -28,10 +28,10 @@ if InDetFlags.doPRDFormation():
       # --- SiLorentzAngleTool
       #
       if not hasattr(ToolSvc, "PixelLorentzAngleTool"):
-        from SiLorentzAngleSvc.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup
+        from SiLorentzAngleTool.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup
         pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup()
 
-      from SiLorentzAngleSvc.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
+      from SiLorentzAngleTool.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
       sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup()
 
       #
diff --git a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigConditions.py b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigConditions.py
index dcef2787056408ab08cd40841088153dad1573f0..a6e0389c9113d00a6c13ccfe75854787c40d6b38 100644
--- a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigConditions.py
+++ b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigConditions.py
@@ -190,13 +190,13 @@ class PixelConditionsServicesSetup:
     ToolSvc += TrigSiPropertiesTool
 
     if not hasattr(condSeq, 'PixelSiLorentzAngleCondAlg'):
-      from SiLorentzAngleSvc.SiLorentzAngleSvcConf import PixelSiLorentzAngleCondAlg
+      from SiLorentzAngleTool.SiLorentzAngleToolConf import PixelSiLorentzAngleCondAlg
       condSeq += PixelSiLorentzAngleCondAlg(name="PixelSiLorentzAngleCondAlg", 
                                             SiPropertiesTool=TrigSiPropertiesTool,
                                             UseMagFieldSvc = True,
                                             UseMagFieldDcs = (not athenaCommonFlags.isOnline()))
 
-    from SiLorentzAngleSvc.SiLorentzAngleSvcConf import SiLorentzAngleTool
+    from SiLorentzAngleTool.SiLorentzAngleToolConf import SiLorentzAngleTool
     TrigPixelLorentzAngleTool = SiLorentzAngleTool(name=self.instanceName('PixelLorentzAngleTool'), DetectorName="Pixel", SiLorentzAngleCondData="PixelSiLorentzAngleCondData")
 
     ToolSvc += TrigPixelLorentzAngleTool
@@ -427,7 +427,7 @@ class SCT_ConditionsToolsSetup:
     from AthenaCommon.AlgSequence import AthSequencer
     condSeq = AthSequencer("AthCondSeq")
     if not hasattr(condSeq, "SCTSiLorentzAngleCondAlg"):
-      from SiLorentzAngleSvc.SiLorentzAngleSvcConf import SCTSiLorentzAngleCondAlg
+      from SiLorentzAngleTool.SiLorentzAngleToolConf import SCTSiLorentzAngleCondAlg
       from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
       condSeq += SCTSiLorentzAngleCondAlg(name = "SCTSiLorentzAngleCondAlg",
                                           SiConditionsTool = sctSiliconConditionsTool,
@@ -436,7 +436,7 @@ class SCT_ConditionsToolsSetup:
       sctSiLorentzAngleCondAlg = condSeq.SCTSiLorentzAngleCondAlg
 
     "Inititalize Lorentz angle Tool"
-    from SiLorentzAngleSvc.SiLorentzAngleSvcConf import SiLorentzAngleTool
+    from SiLorentzAngleTool.SiLorentzAngleToolConf import SiLorentzAngleTool
     SCTLorentzAngleTool = SiLorentzAngleTool(name=instanceName, DetectorName="SCT", SiLorentzAngleCondData="SCTSiLorentzAngleCondData")
     SCTLorentzAngleTool.UseMagFieldSvc = True #may need also MagFieldSvc instance
     
diff --git a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py
index bfc77bbc0089b24498f9910954fef2d5e5ebff4d..d9c5eb709bce514e4350f0064a94cc425f110b4a 100755
--- a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py
+++ b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py
@@ -22,7 +22,7 @@ from AthenaCommon.CfgGetter import getPublicTool,getPrivateTool
 TrigPixelLorentzAngleTool = getPublicTool("PixelLorentzAngleTool")
 TrigSCTLorentzAngleTool = getPrivateTool("SCTLorentzAngleTool") 
 
-from SiLorentzAngleSvc.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
+from SiLorentzAngleTool.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
 sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup()
 
 #
diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/ElectronEoverPTracking.py b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/ElectronEoverPTracking.py
index 50868637b9b5649fc379fbf7683f801fd721cbea..e46f6e1db332269577536d42f8a2031f9eb9715b 100755
--- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/ElectronEoverPTracking.py
+++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/ElectronEoverPTracking.py
@@ -20,7 +20,7 @@ topSequence = AlgSequence()
 ###############################################################################
 ###############################################################################
 # SiLorentzAngleTool
-from SiLorentzAngleSvc.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
+from SiLorentzAngleTool.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
 sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup()
 #
 # load SCT ROT creator, we overwrite the defaults for it
diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/CMakeLists.txt b/InnerDetector/InDetMonitoring/PixelMonitoring/CMakeLists.txt
index 71730b7c224a08719bf80417a2e201b834eb0aca..1aa1e1e716e8a157cc23a26dd9db801e496fa4fa 100644
--- a/InnerDetector/InDetMonitoring/PixelMonitoring/CMakeLists.txt
+++ b/InnerDetector/InDetMonitoring/PixelMonitoring/CMakeLists.txt
@@ -19,7 +19,7 @@ atlas_depends_on_subdirs(
    PRIVATE
    Database/AthenaPOOL/AthenaPoolUtilities
    DetectorDescription/GeoPrimitives
-   Event/EventInfo
+   Event/xAOD/xAODEventInfo
    Event/EventPrimitives
    InnerDetector/InDetConditions/InDetConditionsSummaryService
    InnerDetector/InDetConditions/PixelConditionsServices
@@ -44,7 +44,7 @@ atlas_add_component( PixelMonitoring
    INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
    LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaMonitoringLib AtlasDetDescr
    GaudiKernel InDetRawData InDetPrepRawData LumiBlockCompsLib TrkTrack
-   AthenaPoolUtilities GeoPrimitives EventInfo EventPrimitives InDetIdentifier
+   AthenaPoolUtilities GeoPrimitives xAODEventInfo EventPrimitives InDetIdentifier
    InDetReadoutGeometry InDetRIO_OnTrack LWHists TrkParameters TrkSpacePoint
    TrkTrackSummary TrkToolInterfaces PixelCablingLib PixelGeoModelLib PathResolver 
    InDetTrackSelectionToolLib )
diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMainMon.h b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMainMon.h
index 12e994d3993773bc19f67338ddb8677ea2c59c9f..b7a41aeaa2fb216260c52502d3be969b38858f91 100755
--- a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMainMon.h
+++ b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMainMon.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef PIXMAINMON_H_
@@ -21,7 +21,6 @@
 #include "AtlasDetDescr/AtlasDetectorID.h"
 #include "LumiBlockComps/ILuminosityTool.h"
 #include "PixelGeoModel/IBLParameterSvc.h"
-#include "EventInfo/EventInfo.h"
 #include "xAODEventInfo/EventInfo.h"
 #include "StoreGate/ReadHandleKey.h"
 #include "InDetConditionsSummaryService/IInDetConditionsTool.h"
@@ -211,7 +210,6 @@ class PixelMainMon : public ManagedMonitorToolBase {
   SG::ReadHandleKey<TrackCollection> m_TracksName;
   SG::ReadHandleKey<InDetTimeCollection> m_PixelBCIDName;
   SG::ReadHandleKey<xAOD::EventInfo> m_eventxAODInfoKey;
-  SG::ReadHandleKey<EventInfo> m_eventInfoKey;
 
   std::string m_detector_error_name;
   std::string m_histTitleExt;
diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Hits.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Hits.cxx
index 82130edd0202bf4e866e375c310019ddfcda86a1..50c90a7378d3c1399edc86d53ad25550d14cfacc 100644
--- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Hits.cxx
+++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Hits.cxx
@@ -31,7 +31,6 @@
 #include "PixelMonitoring/PixelMon2DProfilesLW.h"
 #include "PixelMonitoring/PixelMonModules.h"
 
-#include "EventInfo/TriggerInfo.h"
 #include "PixelCabling/IPixelCablingSvc.h"
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -470,11 +469,11 @@ StatusCode PixelMainMon::fillHitsMon(void)  // Called once per event
   }
 
   int lvl1idATLAS(-1);
-  auto thisEventInfo = SG::makeHandle(m_eventInfoKey);
+  SG::ReadHandle<xAOD::EventInfo> thisEventInfo(m_eventxAODInfoKey);
   if(!(thisEventInfo.isValid())) {
     ATH_MSG_WARNING("No EventInfo object found");
   } else {
-    lvl1idATLAS = (int)((thisEventInfo->trigger_info()->extendedLevel1ID()) & 0xf);
+    lvl1idATLAS = (int)((thisEventInfo->extendedLevel1ID()) & 0xf);
   }
 
   // retrieve Pixel RDO container from storegate
diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMainMon.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMainMon.cxx
index 7482d602487a6488208ee098bd8f33cfaa85db42..67a8b1c8a7bd1521e043f3d5570bb1f839703c06 100755
--- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMainMon.cxx
+++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMainMon.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -130,7 +130,6 @@ PixelMainMon::PixelMainMon(const std::string& type, const std::string& name, con
   m_currentTime = 0;
   m_runNum = 0;
   m_idHelper = 0;
-  m_eventInfoKey = "ByteStreamEventInfo";
   m_eventxAODInfoKey = "EventInfo";
   // Initalize all pointers for histograms
 
@@ -387,7 +386,6 @@ StatusCode PixelMainMon::initialize() {
   ATH_CHECK(m_Pixel_SiClustersName.initialize());
   ATH_CHECK(m_TracksName.initialize());
   ATH_CHECK(m_PixelBCIDName.initialize());
-  ATH_CHECK(m_eventInfoKey.initialize());
   ATH_CHECK(m_eventxAODInfoKey.initialize());
   // Retrieve tools
   if (detStore()->retrieve(m_pixelid, "PixelID").isFailure()) {
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTErrMonTool.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTErrMonTool.h
old mode 100755
new mode 100644
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTHitEffMonTool.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTHitEffMonTool.h
old mode 100755
new mode 100644
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTLorentzMonTool.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTLorentzMonTool.h
old mode 100755
new mode 100644
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTMotherTrigMonTool.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTMotherTrigMonTool.h
old mode 100755
new mode 100644
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTRatioNoiseMonTool.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTRatioNoiseMonTool.h
old mode 100755
new mode 100644
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTSummaryMonTool.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTSummaryMonTool.h
old mode 100755
new mode 100644
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTTracksMonTool.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTTracksMonTool.h
old mode 100755
new mode 100644
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCT_ClusterStruct.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCT_ClusterStruct.h
old mode 100755
new mode 100644
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTErrMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTErrMonTool.cxx
old mode 100755
new mode 100644
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitEffMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitEffMonTool.cxx
old mode 100755
new mode 100644
index dad87c1380863b9bc8e895012b95a3fa1c02de8d..c509749d608a808272203552ba655ca35b9654ea
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitEffMonTool.cxx
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitEffMonTool.cxx
@@ -71,7 +71,7 @@ namespace {// anonymous namespace for functions at file scope
   };
   const std::string histogramPathRe[] = {
     "SCT/SCTEC/eff/perLumiBlock", "SCT/SCTB/eff/perLumiBlock", "SCT/SCTEA/eff/perLumiBlock"
-  };// 23.01.2015
+  };
 
   template< typename T > Identifier
   surfaceOnTrackIdentifier(const T &tsos, const bool useTrackParameters = true) {
@@ -87,7 +87,7 @@ namespace {// anonymous namespace for functions at file scope
     return result;
   }
 
-  constexpr Double_t radianDegrees(180. / 3.1415927);
+  constexpr Double_t radianDegrees(180. / M_PI);
 
   float
   amgPseudoRapidity(const Amg::Vector3D &position) {
@@ -371,11 +371,8 @@ SCTHitEffMonTool::initialize() {
 
 StatusCode
 SCTHitEffMonTool::bookHistograms() {
-  //  if (not isNewRun) return StatusCode::SUCCESS;                                                                   //
-  // hidetoshi 14.01.22
   if (not newRunFlag()) {
-    return StatusCode::SUCCESS;                                                                         // hidetoshi
-                                                                                                        // 14.01.22
+    return StatusCode::SUCCESS;
   }
   if (m_isCosmic) {
     WARNING("Running on cosmics: releasing d0 cut and forcing use of TRT timing");
@@ -403,7 +400,7 @@ SCTHitEffMonTool::bookHistograms() {
       MonGroup(this, m_path + histogramPathRe[ENDCAP_C_INDEX], run, ATTRIB_UNMANAGED),
       MonGroup(this, m_path + histogramPathRe[BARREL_INDEX], run, ATTRIB_UNMANAGED),
       MonGroup(this, m_path + histogramPathRe[ENDCAP_A_INDEX], run, ATTRIB_UNMANAGED)
-    }};// 23.01.2015
+    }};
 
     std::array < MonGroup, N_REGIONS + 1 > histGroupShift = {{
       MonGroup(this, m_path + histogramPath[ENDCAP_C_INDEX], run, ATTRIB_UNMANAGED),
@@ -427,7 +424,7 @@ SCTHitEffMonTool::bookHistograms() {
     m_Eff_hashCodeHisto->GetXaxis()->SetTitle("Module Hash Code");
     m_Eff_hashCodeHisto->GetYaxis()->SetTitle("Efficiency");
     CHECK(bookEffHisto(m_Eff_LumiBlockHisto_Total, histGroupE[GENERAL_INDEX], "effLumiBlock",
-                       "Efficiency vs Luminosity block", NBINS_LBs, 0.5, NBINS_LBs + 0.5));// 02.09.2016
+                       "Efficiency vs Luminosity block", NBINS_LBs, 0.5, NBINS_LBs + 0.5));
     m_Eff_LumiBlockHisto_Total->GetXaxis()->SetTitle("Luminosity block");
     m_Eff_LumiBlockHisto_Total->GetYaxis()->SetTitle("Efficiency");
     CHECK(bookEffHisto(m_effdistribution, histGroupE[GENERAL_INDEX], "SctEffDistribution",
@@ -481,7 +478,7 @@ SCTHitEffMonTool::bookHistograms() {
     }};
     std::array < TString, N_REGIONS > effLumiName = {{
       "m_eff_Lumi_", "eff_Lumi_", "p_eff_Lumi_"
-    }};// 23.01.2015
+    }};
     std::array < TString, N_REGIONS > sumeff = {{
       "summaryeffm", "summaryeff", "summaryeffp"
     }};
@@ -494,11 +491,11 @@ SCTHitEffMonTool::bookHistograms() {
     TString sumefftitle[3] = {
       "Summary Module Efficiency in Endcap C", "Summary Module Efficiency in Barrel",
       "Summary Module Efficiency in Endcap A"
-    };// 30.11.2014
+    };
     TString sumefftitleBCID[3] = {
       "Summary Module Efficiency in Endcap C for First BC", "Summary Module Efficiency in Barrel for First BC",
       "Summary Module Efficiency in Endcap A for First BC"
-    };// 30.11.2014
+    };
     std::array < TString, 12 > selecName = {{
       "All", "Module", "nHits", "TRTPhase", "Enclosed", "Phi", "Chi2", "Face", "Guard", "Bad chip", "d0", "pT"
     }};
@@ -540,7 +537,7 @@ SCTHitEffMonTool::bookHistograms() {
                              effLumiName[isub] + i + "_" + j,
                              "Efficiency vs LumiBlock of" + layerName[isub] + i + " / side " + j + " in " +
                              subDetName[isub],
-                             NBINS_LBs, 0.5, NBINS_LBs + 0.5));// 23.01.2015
+                             NBINS_LBs, 0.5, NBINS_LBs + 0.5));
           m_effLumiBlock[detIndex][j]->GetXaxis()->SetTitle("Luminosity Block");
           m_effLumiBlock[detIndex][j]->GetYaxis()->SetTitle("Efficiency");
         }
@@ -579,20 +576,20 @@ SCTHitEffMonTool::bookHistograms() {
                          2 * n_layers[isub], 0., n_layers[isub]));
       unsigned int limit[3] = {
         N_DISKSx2, N_BARRELSx2, N_DISKSx2
-      };// 30.11.2014
+      };
       for (unsigned int i(0); i != limit[isub]; i++) {
         LayerSideFormatter layerSide(i, isub);
         // use dedicated title for the bin labels (from 0_1 to 3_0)
         m_Eff_summaryHisto[isub]->GetXaxis()->SetBinLabel(i + 1, layerSide.dedicated_title().c_str());
         m_Eff_summaryHistoFirstBCID[isub]->GetXaxis()->SetBinLabel(i + 1, layerSide.dedicated_title().c_str());
         m_Eff_summaryHisto_old[isub]->GetXaxis()->SetBinLabel(i + 1, layerSide.title().c_str());
-      }// 30.11.2014
+      }
       m_Eff_summaryHisto[isub]->GetYaxis()->SetTitle("Efficiency");
       m_Eff_summaryHistoFirstBCID[isub]->GetYaxis()->SetTitle("Efficiency");
       m_Eff_summaryHisto_old[isub]->GetYaxis()->SetTitle("Efficiency");
 
       CHECK(bookEffHisto(m_Eff_LumiBlockHisto[isub], histGroupE[isub], "effLumiBlock",
-                         "Efficiency vs Luminosity block in " + subDetName[isub], NBINS_LBs, 0.5, NBINS_LBs + 0.5));// 20.01.2015
+                         "Efficiency vs Luminosity block in " + subDetName[isub], NBINS_LBs, 0.5, NBINS_LBs + 0.5));
       m_Eff_LumiBlockHisto[isub]->GetXaxis()->SetTitle("Luminosity block");
       m_Eff_LumiBlockHisto[isub]->GetYaxis()->SetTitle("Efficiency");
 
@@ -697,7 +694,7 @@ SCTHitEffMonTool::bookHistograms() {
 
       if (m_superDetailed) {
         // CHECK (bookEffHisto(m_Eff_LumiBlockHisto[isub], histGroupE[isub],"effLumiBlock", "Efficiency v Luminosity
-        // block",1000,1,1001));20.01.2015
+        // block",1000,1,1001));
         CHECK(bookEffHisto(m_inEffStrip[isub], histGroupE[isub],
                            "StripInEfficiency" + subDetNameShort[isub], "Strips inefficiencies in " + subDetName[isub],
                            n_mod[isub] * 2, f_mod[isub] * 2 - 0.5, (f_mod[isub] + n_mod[isub]) * 2 - 0.5, N_STRIPS,
@@ -732,15 +729,8 @@ SCTHitEffMonTool::bookHistograms() {
   return StatusCode::SUCCESS;
 }
 
-// StatusCode SCTHitEffMonTool::bookHistograms( bool /*isNewEventsBlock*/, bool /*isNewLumiBlock*/, bool isNewRun )
-//    // hidetoshi 14.01.22
 StatusCode
-SCTHitEffMonTool::bookHistogramsRecurrent() {                                                                       // hidetoshi
-                                                                                                                    // 14.01.22
-  //  if (not isNewRun) return StatusCode::SUCCESS;                                                                   //
-  // hidetoshi 14.01.22
-  //  if (not newRunFlag()) return StatusCode::SUCCESS;
-  //                                                                         // hidetoshi 14.01.22
+SCTHitEffMonTool::bookHistogramsRecurrent() {
   if (m_isCosmic) {
     WARNING("Running on cosmics: releasing d0 cut and forcing use of TRT timing");
   }
@@ -767,7 +757,7 @@ SCTHitEffMonTool::bookHistogramsRecurrent() {
       MonGroup(this, m_path + histogramPathRe[ENDCAP_C_INDEX], run, ATTRIB_UNMANAGED),
       MonGroup(this, m_path + histogramPathRe[BARREL_INDEX], run, ATTRIB_UNMANAGED),
       MonGroup(this, m_path + histogramPathRe[ENDCAP_A_INDEX], run, ATTRIB_UNMANAGED)
-    }};// 23.01.2015
+    }};
 
     std::array < MonGroup, N_REGIONS + 1 > histGroupShift = {{
       MonGroup(this, m_path + histogramPath[ENDCAP_C_INDEX], run, ATTRIB_UNMANAGED),
@@ -787,11 +777,11 @@ SCTHitEffMonTool::bookHistogramsRecurrent() {
       m_Eff_TotalBCID->GetXaxis()->SetBinLabel(i + 1, subDetName[i]);
     }
     CHECK(bookEffHisto(m_Eff_hashCodeHisto, histGroupE[GENERAL_INDEX], "effHashCode", "Efficiency vs module Hash code",
-                       n_mod[GENERAL_INDEX] * 2, -0.5, n_mod[GENERAL_INDEX] * 2 - 0.5));// 26.11.2014
+                       n_mod[GENERAL_INDEX] * 2, -0.5, n_mod[GENERAL_INDEX] * 2 - 0.5));
     m_Eff_hashCodeHisto->GetXaxis()->SetTitle("Module Hash Code");
-    m_Eff_hashCodeHisto->GetYaxis()->SetTitle("Efficiency");// 15.12.2014
+    m_Eff_hashCodeHisto->GetYaxis()->SetTitle("Efficiency");
     CHECK(bookEffHisto(m_Eff_LumiBlockHisto_Total, histGroupE[GENERAL_INDEX], "effLumiBlock",
-                       "Efficiency vs Luminosity block", NBINS_LBs, 0.5, NBINS_LBs + 0.5));// 02.09.2016
+                       "Efficiency vs Luminosity block", NBINS_LBs, 0.5, NBINS_LBs + 0.5));
 
     if (m_detailed) {
       CHECK(bookEffHisto(m_SCTNHitHisto, histGroupE[BARREL_INDEX], "SCTNHit", "Number of total SCT hits", 30, -0.5,
@@ -835,7 +825,7 @@ SCTHitEffMonTool::bookHistogramsRecurrent() {
     }};
     std::array < TString, N_REGIONS > effLumiName = {{
       "m_eff_Lumi_", "eff_Lumi_", "p_eff_Lumi_"
-    }};// 23.01.2015
+    }};
     // inefficiency plots, i.e. 1 - efficiency
     std::array< TString, N_REGIONS > ineffMapName = {{
       "ineffm_", "ineff_", "ineffp_"
@@ -899,7 +889,7 @@ SCTHitEffMonTool::bookHistogramsRecurrent() {
                              effLumiName[isub] + i + "_" + j,
                              "Efficiency vs LumiBlock" + layerName[isub] + i + " / side " + j + " in " +
                              subDetName[isub],
-                             150, 1, 3001));// 23.01.2015
+                             150, 1, 3001));
           m_effLumiBlock[detIndex][j]->GetXaxis()->SetTitle("Luminosity Block");
           m_effLumiBlock[detIndex][j]->GetYaxis()->SetTitle("Efficiency");
         }
@@ -937,18 +927,18 @@ SCTHitEffMonTool::bookHistogramsRecurrent() {
                          2 * n_layers[isub], 0., n_layers[isub]));
       unsigned int limit[3] = {
         N_DISKSx2, N_BARRELSx2, N_DISKSx2
-      };// 30.11.2014
+      };
       for (unsigned int i(0); i != limit[isub]; i++) {
         LayerSideFormatter layerSide(i, isub);
         m_Eff_summaryHisto[isub]->GetXaxis()->SetBinLabel(i + 1, layerSide.dedicated_title().c_str());
         m_Eff_summaryHistoFirstBCID[isub]->GetXaxis()->SetBinLabel(i + 1, layerSide.dedicated_title().c_str());
         m_Eff_summaryHisto_old[isub]->GetXaxis()->SetBinLabel(i + 1, layerSide.title().c_str());
-      }// 30.11.2014
+      }
       m_Eff_summaryHisto[isub]->GetYaxis()->SetTitle("Efficiency");
       m_Eff_summaryHistoFirstBCID[isub]->GetYaxis()->SetTitle("Efficiency");
       m_Eff_summaryHisto_old[isub]->GetYaxis()->SetTitle("Efficiency");
       CHECK(bookEffHisto(m_Eff_LumiBlockHisto[isub], histGroupE[isub], "effLumiBlock",
-                         "Efficiency vs Luminosity block in " + subDetName[isub], NBINS_LBs, 0.5, NBINS_LBs + 0.5));// 20.01.2015
+                         "Efficiency vs Luminosity block in " + subDetName[isub], NBINS_LBs, 0.5, NBINS_LBs + 0.5));
       m_Eff_LumiBlockHisto[isub]->GetXaxis()->SetTitle("Luminosity block");
       m_Eff_LumiBlockHisto[isub]->GetYaxis()->SetTitle("Efficiency");
 
@@ -1052,8 +1042,6 @@ SCTHitEffMonTool::bookHistogramsRecurrent() {
       }
 
       if (m_superDetailed) {
-        // CHECK (bookEffHisto(m_Eff_LumiBlockHisto[isub], histGroupE[isub],"effLumiBlock", "Efficiency v Luminosity
-        // block",1000,1,1001));//20.01.2015
         CHECK(bookEffHisto(m_inEffStrip[isub], histGroupE[isub],
                            "StripInEfficiency" + subDetNameShort[isub], "Strips inefficiencies in " + subDetName[isub],
                            n_mod[isub] * 2, f_mod[isub] * 2 - 0.5, (f_mod[isub] + n_mod[isub]) * 2 - 0.5, N_STRIPS,
@@ -1692,9 +1680,9 @@ SCTHitEffMonTool::fillHistograms() {
       VERBOSE("Candidate passed all cuts");
       m_Eff_summaryHisto_old[isub]->Fill(layerPlusHalfSide, eff); // in order to calculate m_EffsummaryIncBadMod
       m_Eff_summaryHisto[isub]->Fill(dedicated_layerPlusHalfSide, eff); // adjustment for dedicated_title()
-      m_Eff_hashCodeHisto->Fill(Double_t(sideHash), eff);// 15.12.2014
-      m_Eff_LumiBlockHisto[isub]->Fill(pEvent->lumiBlock(), eff);// 20.01.2015
-      m_Eff_LumiBlockHisto_Total->Fill(pEvent->lumiBlock(), eff);// 02.09.2016
+      m_Eff_hashCodeHisto->Fill(Double_t(sideHash), eff);
+      m_Eff_LumiBlockHisto[isub]->Fill(pEvent->lumiBlock(), eff);
+      m_Eff_LumiBlockHisto_Total->Fill(pEvent->lumiBlock(), eff);
       if (BCIDpos <= 0) {
         m_Eff_summaryHistoFirstBCID[isub]->Fill(dedicated_layerPlusHalfSide, eff); // adjustment for dedicated_title()
       }
@@ -1722,7 +1710,6 @@ SCTHitEffMonTool::fillHistograms() {
         m_Eff_nGoodTrk[isub]->Fill(nTrkGood, eff);
       }
       if (m_superDetailed) {
-        // m_Eff_LumiBlockHisto[isub]->Fill(pEvent->lumiBlock(), eff);//20.01.2015
         chipPos = (side == 1) ? 11 - chipPos : chipPos;
         m_inEffChip[isub]->Fill(sideHash, chipPos, int(eff == 0));
         m_inEffStrip[isub]->Fill(sideHash, xl / 79.95e-3 + 768. / 2., int(eff == 0));
@@ -1758,7 +1745,7 @@ SCTHitEffMonTool::fillHistograms() {
       if( BCIDpos <= 0 ){
         m_effMapFirstBCID[histnumber][side]->Fill(ieta, iphi, eff);
       }
-      m_effLumiBlock[histnumber][side]->Fill(pEvent->lumiBlock(), eff);// 23.01.2015
+      m_effLumiBlock[histnumber][side]->Fill(pEvent->lumiBlock(), eff);
 
       if (testOffline) {
         m_ineffMap[histnumber][side]->Fill(ieta, iphi, 1); // dummyfill for testing
@@ -1821,11 +1808,8 @@ SCTHitEffMonTool::fillHistograms() {
   return StatusCode::SUCCESS;
 }
 
-// StatusCode SCTHitEffMonTool::procHistograms(bool /*isEndOfEventsBlock*/, bool /*isEndOfLumiBlock*/, bool
-// /*isEndOfRun*/){ // hidetoshi 14.01.22
 StatusCode
-SCTHitEffMonTool::procHistograms() {                                                                             // hidetoshi
-                                                                                                                 // 14.01.22
+SCTHitEffMonTool::procHistograms() {
   if (m_superDetailed) {
     SG::ReadCondHandle<InDetDD::SiDetectorElementCollection> sctDetEle(m_SCTDetEleCollKey);
     const InDetDD::SiDetectorElementCollection* elements(sctDetEle.retrieve());
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitsNoiseMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitsNoiseMonTool.cxx
old mode 100755
new mode 100644
index 2234eb8c6c334876e0fafbca32c4515ce9292f2a..e18850fb3b3977cb3e0338278aa16addc0c3dc17
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitsNoiseMonTool.cxx
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitsNoiseMonTool.cxx
@@ -243,7 +243,6 @@ SCTHitsNoiseMonTool::SCTHitsNoiseMonTool(const std::string &type,
   m_occTriggerECp_lb{},
   m_occTriggerECm_lb{},
   m_eventsTrigger_lb(0),
-  // Add 09.09.2016
   m_BARHO(nullptr),
   m_BARHOTrigger(nullptr),
   m_ECmHO(nullptr),
@@ -252,7 +251,6 @@ SCTHitsNoiseMonTool::SCTHitsNoiseMonTool(const std::string &type,
   m_ECpHOTrigger(nullptr),
   m_SCTHO(nullptr),
   m_SCTHOTrigger(nullptr),
-  //
   m_HallHitsBAR_vsLB(nullptr),
   m_HSPHitsBAR_vsLB(nullptr),
   m_HallHitsECm_vsLB(nullptr),
@@ -266,7 +264,6 @@ SCTHitsNoiseMonTool::SCTHitsNoiseMonTool(const std::string &type,
   m_NoisyModulesWithHO100_vsLB(nullptr),
   m_NoisyModulesWithHO1000_vsLB(nullptr),
   m_NoisyModulesWithHO10000_vsLB(nullptr),
-  //
   m_HallHitsTriggerBAR_vsLB(nullptr),
   m_HSPHitsTriggerBAR_vsLB(nullptr),
   m_HallHitsTriggerECm_vsLB(nullptr),
@@ -381,46 +378,44 @@ SCTHitsNoiseMonTool::bookHistograms() {
   for (unsigned int det(0); det != N_REGIONS; ++det) {
     if (doSystem[det]) {
       if (m_doTrackHits and bookGeneralTrackTimeHistos(det).isFailure()) {
-        msg(MSG::WARNING) << "Error in bookGeneralTrackTimeHistos()" << endmsg;
+        ATH_MSG_WARNING("Error in bookGeneralTrackTimeHistos()");
       }
       if (m_doTrackHits and bookGeneralTrackHits(det).isFailure()) {
-        msg(MSG::WARNING) << "Error in bookGeneralTrackHits()" << endmsg;
+        ATH_MSG_WARNING("Error in bookGeneralTrackHits()");
       }
       if (bookGeneralNoiseOccupancyMaps(det).isFailure()) {
-        msg(MSG::WARNING) << "Error in bookGeneralNoiseOccupancyMaps()" << endmsg;
+        ATH_MSG_WARNING("Error in bookGeneralNoiseOccupancyMaps()");
       }
       if (bookGeneralHitOccupancyMaps(det).isFailure()) {
-        msg(MSG::WARNING) << "Error in bookGeneralHitOccupancyMaps()" << endmsg;
+        ATH_MSG_WARNING("Error in bookGeneralHitOccupancyMaps()");
       }
       if (bookGeneralHits(det).isFailure()) {
-        msg(MSG::WARNING) << "Error in bookGeneralHits()" << endmsg;
+        ATH_MSG_WARNING("Error in bookGeneralHits()");
       }
       // offline only?
       if (bookGeneralCluSize(det).isFailure()) {
-        msg(MSG::WARNING) << "Error in bookGeneralSize()" << endmsg;
+        ATH_MSG_WARNING("Error in bookGeneralSize()");
       }
       //
     }
   }
 
   if (bookSPvsEventNumber().isFailure()) {
-    msg(MSG::WARNING) << "Error in bookSPvsEventNumber()" << endmsg;
+    ATH_MSG_WARNING("Error in bookSPvsEventNumber()");
   }
   if (bookNoiseDistributions().isFailure()) {
-    msg(MSG::WARNING) << "Error in bookNoiseDistributions()" << endmsg;
+    ATH_MSG_WARNING("Error in bookNoiseDistributions()");
   }
 
   if (m_boolhitmaps) {
     if (book1DHitHists().isFailure()) {
-      msg(MSG::WARNING) << "Error in barrel book1DHitHists()" << endmsg;
+      ATH_MSG_WARNING("Error in barrel book1DHitHists()");
     }
     // Only want these histograms when running the code offline
   }
 
   if (bookClusterSize().isFailure()) {
-    if (msgLvl(MSG::WARNING)) {
-      msg(MSG::WARNING) << "Error in bookClusterSize()" << endmsg;
-    }
+    ATH_MSG_WARNING("Error in bookClusterSize()");
   }
 
   if (newRunFlag()) {
@@ -431,23 +426,23 @@ SCTHitsNoiseMonTool::bookHistograms() {
     m_ncluHisto->GetXaxis()->SetTitle("Total SCT Hits");
     m_ncluHisto->GetYaxis()->SetTitle("Entries");
     if (clu.regHist(m_ncluHisto).isFailure()) {
-      msg(MSG::WARNING) << "Cannot book Histogram:" << stem + "sct_hits" << endmsg;
+      ATH_MSG_WARNING("Cannot book Histogram:" << stem + "sct_hits");
     }
     if (m_booltxscan) {
       if (newEventsBlockFlag()) {
         // book histograms for TX scans
         m_hitsvstrigger = TH1F_LW::create("hits_vs_trigger", "Hits vs Trigger Type", 32, -0.5, 31.5);
         if (clu.regHist(m_hitsvstrigger).isFailure()) {
-          msg(MSG::WARNING) << "Cannot book Histogram:" << stem + "hitsvstrigger" << endmsg;
+          ATH_MSG_WARNING("Cannot book Histogram:" << stem + "hitsvstrigger");
         }
         m_hitsvsL1ID = TH1F_LW::create("hits_vs_L1ID", "Hits vs L1ID", 1000, 0., 10000.);
         if (clu.regHist(m_hitsvsL1ID).isFailure()) {
-          msg(MSG::WARNING) << "Cannot book Histogram:" << stem + "hitsvsL1ID" << endmsg;
+          ATH_MSG_WARNING("Cannot book Histogram:" << stem + "hitsvsL1ID");
         }
       }
     }
     if (initializeNoiseMaps().isFailure()) {
-      msg(MSG::WARNING) << "Failed to initalize noise occupancy maps!" << endmsg;
+      ATH_MSG_WARNING("Failed to initalize noise occupancy maps!");
     }
   }
 
@@ -472,46 +467,44 @@ SCTHitsNoiseMonTool::bookHistogramsRecurrent() {
   for (unsigned int det(0); det != N_REGIONS; ++det) {
     if (doSystem[det]) {
       if (m_doTrackHits and bookGeneralTrackTimeHistos(det).isFailure()) {
-        msg(MSG::WARNING) << "Error in bookGeneralTrackTimeHistos()" << endmsg;
+        ATH_MSG_WARNING("Error in bookGeneralTrackTimeHistos()");
       }
       if (m_doTrackHits and bookGeneralTrackHits(det).isFailure()) {
-        msg(MSG::WARNING) << "Error in bookGeneralTrackHits()" << endmsg;
+        ATH_MSG_WARNING("Error in bookGeneralTrackHits()");
       }
       if (bookGeneralNoiseOccupancyMaps(det).isFailure()) {
-        msg(MSG::WARNING) << "Error in bookGeneralNoiseOccupancyMaps()" << endmsg;
+        ATH_MSG_WARNING("Error in bookGeneralNoiseOccupancyMaps()");
       }
       if (bookGeneralHitOccupancyMaps(det).isFailure()) {
-        msg(MSG::WARNING) << "Error in bookGeneralHitOccupancyMaps()" << endmsg;
+        ATH_MSG_WARNING("Error in bookGeneralHitOccupancyMaps()");
       }
       if (bookGeneralHits(det).isFailure()) {
-        msg(MSG::WARNING) << "Error in bookGeneralHits()" << endmsg;
+        ATH_MSG_WARNING("Error in bookGeneralHits()");
       }
       // offline only?
       if (bookGeneralCluSize(det).isFailure()) {
-        msg(MSG::WARNING) << "Error in bookGeneralSize()" << endmsg;
+        ATH_MSG_WARNING("Error in bookGeneralSize()");
       }
       //
     }
   }
 
   if (bookSPvsEventNumber().isFailure()) {
-    msg(MSG::WARNING) << "Error in bookSPvsEventNumber()" << endmsg;
+    ATH_MSG_WARNING("Error in bookSPvsEventNumber()");
   }
   if (bookNoiseDistributions().isFailure()) {
-    msg(MSG::WARNING) << "Error in bookNoiseDistributions()" << endmsg;
+    ATH_MSG_WARNING("Error in bookNoiseDistributions()");
   }
 
   if (m_boolhitmaps) {
     if (book1DHitHists().isFailure()) {
-      msg(MSG::WARNING) << "Error in barrel book1DHitHists()" << endmsg;
+      ATH_MSG_WARNING("Error in barrel book1DHitHists()");
     }
     // Only want these histograms when running the code offline
   }
 
   if (bookClusterSize().isFailure()) {
-    if (msgLvl(MSG::WARNING)) {
-      msg(MSG::WARNING) << "Error in bookClusterSize()" << endmsg;
-    }
+    ATH_MSG_WARNING("Error in bookClusterSize()");
   }
 
   std::string stem = m_stream + "/SCT/GENERAL/hits/summary";
@@ -521,21 +514,21 @@ SCTHitsNoiseMonTool::bookHistogramsRecurrent() {
   m_ncluHisto->GetXaxis()->SetTitle("Event Number");
   m_ncluHisto->GetYaxis()->SetTitle("Num of SCT Hits");
   if (clu.regHist(m_ncluHisto).isFailure()) {
-    msg(MSG::WARNING) << "Cannot book Histogram:" << stem + "sct_hits" << endmsg;
+    ATH_MSG_WARNING("Cannot book Histogram:" << stem + "sct_hits");
   }
   if (m_booltxscan) {
     // book histograms for TX scans
     m_hitsvstrigger = TH1F_LW::create("hits_vs_trigger", "Hits vs Trigger Type", 32, -0.5, 31.5);
     if (clu.regHist(m_hitsvstrigger).isFailure()) {
-      msg(MSG::WARNING) << "Cannot book Histogram:" << stem + "hitsvstrigger" << endmsg;
+      ATH_MSG_WARNING("Cannot book Histogram:" << stem + "hitsvstrigger");
     }
     m_hitsvsL1ID = TH1F_LW::create("hits_vs_L1ID", "Hits vs L1ID", 1000, 0., 10000.);
     if (clu.regHist(m_hitsvsL1ID).isFailure()) {
-      msg(MSG::WARNING) << "Cannot book Histogram:" << stem + "hitsvsL1ID" << endmsg;
+      ATH_MSG_WARNING("Cannot book Histogram:" << stem + "hitsvsL1ID");
     }
   }
   if (initializeNoiseMaps().isFailure()) {
-    msg(MSG::WARNING) << "Failed to initalize noise occupancy maps!" << endmsg;
+    ATH_MSG_WARNING("Failed to initalize noise occupancy maps!");
   }
 
   return StatusCode::SUCCESS;
@@ -551,9 +544,7 @@ SCTHitsNoiseMonTool::fillHistograms() {
   ++m_numberOfEventsRecent;
   SG::ReadHandle<xAOD::EventInfo> pEvent(m_eventInfoKey);
   if (not pEvent.isValid()) {
-    if (msgLvl(MSG::ERROR)) {
-      msg(MSG::ERROR) << "Could not retrieve event info!" << endmsg;
-    }
+    ATH_MSG_ERROR("Could not retrieve event info!");
     return StatusCode::RECOVERABLE;
   }
   int tmp_lb = pEvent->lumiBlock();
@@ -572,7 +563,6 @@ SCTHitsNoiseMonTool::fillHistograms() {
     m_occTriggerBAR_lb[m_current_lb] = 0;
     m_occTriggerECp_lb[m_current_lb] = 0;
     m_occTriggerECm_lb[m_current_lb] = 0;
-    // add 09.09.2016
     m_noisyMWithHO100[m_current_lb] = 0;
     m_noisyMWithHO1000[m_current_lb] = 0;
     m_noisyMWithHO10000[m_current_lb] = 0;
@@ -614,7 +604,6 @@ SCTHitsNoiseMonTool::fillHistograms() {
         if ((1E5) * m_occSumUnbiased_lb[*planeIterator] / m_events_lb > 10000.) {
           m_noisyM10000[m_current_lb]++;
         }
-        // 09.09.2016
         m_hitocc_lb[m_current_lb] += m_hitoccSumUnbiased_lb[*planeIterator] / m_events_lb;
         m_hitoccBAR_lb[m_current_lb] += m_hitoccSumUnbiasedBAR_lb[*planeIterator] / m_events_lb;
         m_hitoccECp_lb[m_current_lb] += m_hitoccSumUnbiasedECp_lb[*planeIterator] / m_events_lb;
@@ -643,7 +632,6 @@ SCTHitsNoiseMonTool::fillHistograms() {
         if ((1E5) * m_occSumUnbiasedTrigger_lb[*planeIterator] / m_eventsTrigger_lb > 10000.) {
           m_noisyMTrigger10000[m_current_lb]++;
         }
-        // add 09.09.2016
         m_hitoccTrigger_lb[m_current_lb] += (1E5) * m_hitoccSumUnbiasedTrigger_lb[*planeIterator] / m_eventsTrigger_lb;
         m_hitoccTriggerBAR_lb[m_current_lb] += (1E5) * m_hitoccSumUnbiasedTriggerBAR_lb[*planeIterator] /
 	  m_eventsTrigger_lb;
@@ -669,7 +657,6 @@ SCTHitsNoiseMonTool::fillHistograms() {
       m_occSumUnbiasedTriggerBAR_lb[*planeIterator] = 0;
       m_occSumUnbiasedTriggerECp_lb[*planeIterator] = 0;
       m_occSumUnbiasedTriggerECm_lb[*planeIterator] = 0;
-      // 09.09.2016
       m_hitoccSumUnbiased_lb[*planeIterator] = 0;
       m_hitoccSumUnbiasedBAR_lb[*planeIterator] = 0;
       m_hitoccSumUnbiasedECp_lb[*planeIterator] = 0;
@@ -683,76 +670,62 @@ SCTHitsNoiseMonTool::fillHistograms() {
       if (bec == ENDCAP_C)nlinksECm++;
       nlinks++;
     }
-    //std::cout <<"Line660: Number of links = "<<nlinks << std::endl;
     if (nlinks >0){
       m_occ_lb[m_current_lb] /= nlinks;
       m_occTrigger_lb[m_current_lb] /= nlinks;
-      // 09.09.2016
       m_hitocc_lb[m_current_lb] /= nlinks;
       m_hitoccTrigger_lb[m_current_lb] /= nlinks;
     }
     if (nlinksBAR >0){
       m_occBAR_lb[m_current_lb] /= nlinksBAR;
       m_occTriggerBAR_lb[m_current_lb] /= nlinksBAR;
-      // 09.09.2016
       m_hitoccBAR_lb[m_current_lb] /= nlinksBAR;
       m_hitoccTriggerBAR_lb[m_current_lb] /= nlinksBAR;
     }
     if (nlinksECp >0){
       m_occECp_lb[m_current_lb] /= nlinksECp;
       m_occTriggerECp_lb[m_current_lb] /= nlinksECp;
-      // 09.09.2016
       m_hitoccECp_lb[m_current_lb] /= nlinksECp;
       m_hitoccTriggerECp_lb[m_current_lb] /= nlinksECp;
     }
     if (nlinksECm >0){
       m_occECm_lb[m_current_lb] /= nlinksECm;
       m_occTriggerECm_lb[m_current_lb] /= nlinksECm;
-      // 09.09.2016
       m_hitoccECm_lb[m_current_lb] /= nlinksECm;
       m_hitoccTriggerECm_lb[m_current_lb] /= nlinksECm;
     }
-    //
     m_events_lb = 0;
     m_eventsTrigger_lb = 0;
   }
   m_current_lb = pEvent->lumiBlock();
   // If track hits are selected, make the vector of track rdo identifiers
   if (m_doTrackHits) {
-    if (makeVectorOfTrackRDOIdentifiers().isFailure() and msgLvl(MSG::WARNING)) {
-      msg(MSG::WARNING) << "Couldn't make vector of track RDO identifiers" << endmsg;
+    if (makeVectorOfTrackRDOIdentifiers().isFailure()) {
+      ATH_MSG_WARNING("Couldn't make vector of track RDO identifiers");
     }
   }
-  if (generalHistsandNoise().isFailure() and msgLvl(MSG::WARNING)) {
-    msg(MSG::WARNING) << "Error in generalHists" << endmsg;
+  if (generalHistsandNoise().isFailure()) {
+    ATH_MSG_WARNING("Error in generalHists");
   }
-  if (makeSPvsEventNumber().isFailure() and msgLvl(MSG::WARNING)) {
-    msg(MSG::WARNING) << "Error in makeSPvsEventNumber" << endmsg;
+  if (makeSPvsEventNumber().isFailure()) {
+    ATH_MSG_WARNING("Error in makeSPvsEventNumber");
   }
 
   if (m_environment == AthenaMonManager::online) {
     if ((m_numberOfEvents % m_checkrate) == 0) {
       if (checkNoiseMaps(true).isFailure()) {
-        if (msgLvl(MSG::WARNING)) {
-          msg(MSG::WARNING) << "Error in checkNoiseMaps(true)" << endmsg;
-        }
+        ATH_MSG_WARNING("Error in checkNoiseMaps(true)");
       }
     }
     if ((m_current_lb % m_checkrecent == 0) && (m_current_lb > m_last_reset_lb)) {
       if (checkNoiseMaps(true).isFailure()) {
-        if (msgLvl(MSG::WARNING)) {
-          msg(MSG::WARNING) << "Error in checkNoiseMaps(true)" << endmsg;
-        }
+        ATH_MSG_WARNING("Error in checkNoiseMaps(true)");
       }
       if (resetNoiseMapsRecent().isFailure()) {
-        if (msgLvl(MSG::WARNING)) {
-          msg(MSG::WARNING) << "Error in resetNoiseMapsRecent" << endmsg;
-        }
+        ATH_MSG_WARNING("Error in resetNoiseMapsRecent");
       }
       if (resetHitMapHists().isFailure()) {
-        if (msgLvl(MSG::WARNING)) {
-          msg(MSG::WARNING) << "Error in resetHitMapsRecent" << endmsg;
-        }
+        ATH_MSG_WARNING("Error in resetHitMapsRecent");
       }
       m_last_reset_lb = m_current_lb;
       m_numberOfEventsRecent = 0;
@@ -774,9 +747,7 @@ SCTHitsNoiseMonTool::procHistograms() {
 
   if (endOfEventsBlock) {
     if (checkNoiseMaps(true).isFailure()) {
-      if (msgLvl(MSG::WARNING)) {
-        msg(MSG::WARNING) << "Error in checkNoiseMaps(true)" << endmsg;
-      }
+      ATH_MSG_WARNING("Error in checkNoiseMaps(true)");
     }
   }
   return StatusCode::SUCCESS;
@@ -809,9 +780,7 @@ SCTHitsNoiseMonTool::generalHistsandNoise() {
   SG::ReadHandle<SCT_RDO_Container> p_rdocontainer(m_dataObjectName);
   SG::ReadHandle<xAOD::EventInfo> pEvent(m_eventInfoKey);
   if (not pEvent.isValid()) {
-    if (msgLvl(MSG::ERROR)) {
-      msg(MSG::ERROR) << "Could not retrieve event info!" << endmsg;
-    }
+    ATH_MSG_ERROR("Could not retrieve event info!");
     return StatusCode::FAILURE;
   }
   unsigned int current_lb = pEvent->lumiBlock();
@@ -1060,9 +1029,7 @@ SCTHitsNoiseMonTool::generalHistsandNoise() {
       if (diff < 0) {
         num = 0;
         m_skipEvents++;
-        if (msgLvl(MSG::WARNING)) {
-          msg(MSG::WARNING) << "Too many reconstructed space points for number of real hits" << endmsg;
-        }
+        ATH_MSG_WARNING("Too many reconstructed space points for number of real hits");
       }
       if (den > 0) {
         sumocc = num / static_cast<float> (den);
@@ -1109,7 +1076,7 @@ SCTHitsNoiseMonTool::generalHistsandNoise() {
         }
       }
 
-      { // hit occupancy 09.09.2016
+      { // hit occupancy
         float sumhitocc(0.);
         sumhitocc = static_cast<float> (numberOfHitsFromAllRDOs) / static_cast<float> (N_STRIPS);
         m_hitoccSumUnbiased[theWaferIdentifierOfTheRDOCollection] += sumhitocc;
@@ -1267,9 +1234,7 @@ SCTHitsNoiseMonTool::generalHistsandNoise() {
   // Fill Cluster size histogram
   SG::ReadHandle<InDet::SCT_ClusterContainer> p_clucontainer(m_clusContainerKey);
   if (not p_clucontainer.isValid()) {
-    if (msgLvl(MSG::WARNING)) {
-      msg(MSG::WARNING) << "Couldn't retrieve clusters" << endmsg;
-    }
+    ATH_MSG_WARNING("Couldn't retrieve clusters");
   }
   InDet::SCT_ClusterContainer::const_iterator clucol_it = p_clucontainer->begin();
   InDet::SCT_ClusterContainer::const_iterator lastcluCol = p_clucontainer->end();
@@ -1318,9 +1283,7 @@ SCTHitsNoiseMonTool::generalHistsandNoise() {
 
   if ((m_numberOfEvents % m_checkrate) == 0) {
     if (checkHists(false).isFailure()) {
-      if (msgLvl(MSG::WARNING)) {
-        msg(MSG::WARNING) << "Error in checkHists(false)" << endmsg;
-      }
+      ATH_MSG_WARNING("Error in checkHists(false)");
     }
   }
 
@@ -1353,9 +1316,7 @@ SCTHitsNoiseMonTool::book1DHitHists() {
       if (bec == BARREL) {
         h1Factory(formattedPosition, histotitle, BarrelHitHists, m_phitmapHistoVector, FIRST_STRIP - 0.5,
                   LAST_STRIP + 0.5, N_BINS);
-        if (msgLvl(MSG::DEBUG)) {
-          msg(MSG::DEBUG) << "Have registered the barrel hists" << endmsg;
-        }
+        ATH_MSG_DEBUG("Have registered the barrel hists");
       } else if (m_doPositiveEndcap && bec == ENDCAP_A) {
         h1Factory(formattedPosition, histotitle, PlusECHitHists, m_phitmapHistoVector, FIRST_STRIP - 0.5,
                   LAST_STRIP + 0.5, N_BINS);
@@ -1363,9 +1324,7 @@ SCTHitsNoiseMonTool::book1DHitHists() {
         h1Factory(formattedPosition, histotitle, MinusECHitHists, m_phitmapHistoVector, FIRST_STRIP - 0.5,
                   LAST_STRIP + 0.5, N_BINS);
       }
-      if (msgLvl(MSG::DEBUG)) {
-        msg(MSG::DEBUG) << "Have registered the hists" << endmsg;
-      }
+      ATH_MSG_DEBUG("Have registered the hists");
     }
   }
   return StatusCode::SUCCESS;
@@ -1376,7 +1335,7 @@ SCTHitsNoiseMonTool::bookGeneralHits(const unsigned int systemIndex) {
   const SCT_Monitoring::Bec bec(index2Bec(systemIndex));
 
   if (bec == INVALID_SYSTEM) {
-    msg(MSG::FATAL) << "Invalid subsystem index, should be 0-2, was " << systemIndex << endmsg;
+    ATH_MSG_FATAL("Invalid subsystem index, should be 0-2, was " << systemIndex);
     return StatusCode::FAILURE;
   }
   const string paths[] = {
@@ -1427,7 +1386,7 @@ SCTHitsNoiseMonTool::bookGeneralHits(const unsigned int systemIndex) {
     }
 
     default: {
-      msg(MSG::FATAL) << "Invalid barrel/endcap indicator, should be -2, 0 or 2, was " << bec << endmsg;
+      ATH_MSG_FATAL("Invalid barrel/endcap indicator, should be -2, 0 or 2, was " << bec);
       return StatusCode::FAILURE;
 
       break;
@@ -1557,7 +1516,7 @@ SCTHitsNoiseMonTool::bookGeneralCluSize(const unsigned int systemIndex) {
   };
 
   if (bec == INVALID_SYSTEM) {
-    msg(MSG::FATAL) << "Invalid subsystem index, should be 0-2, was " << systemIndex << endmsg;
+    ATH_MSG_FATAL("Invalid subsystem index, should be 0-2, was " << systemIndex);
     return StatusCode::FAILURE;
   }
   VecH1_t &clusterSizeVector = *(clusterSizeArray[systemIndex]);
@@ -1592,7 +1551,7 @@ SCTHitsNoiseMonTool::bookGeneralNoiseOccupancyMaps(const unsigned int systemInde
   const SCT_Monitoring::Bec bec(index2Bec(systemIndex));
 
   if (bec == INVALID_SYSTEM) {
-    msg(MSG::FATAL) << "Invalid subsystem index, should be 0-2, was " << systemIndex << endmsg;
+    ATH_MSG_FATAL("Invalid subsystem index, should be 0-2, was " << systemIndex);
     return StatusCode::FAILURE;
   }
   if (newRunFlag()) {
@@ -1642,21 +1601,21 @@ SCTHitsNoiseMonTool::bookGeneralNoiseOccupancyMaps(const unsigned int systemInde
       m_NallHitsECm_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_NallHitsECm_vsLB->GetYaxis()->SetTitle("Average number of all Hits");
       if (noiseOccMaps.regHist(m_NallHitsECm_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book NallHitsECm_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book NallHitsECm_vsLB");
       }
       m_NSPHitsECm_vsLB = TProfile_LW::create("h_NSPHitsECm_vsLB", "Average num of SP Hits in ECm vs LB", SCT_Monitoring::NBINS_LBs, 0.5,
                                        SCT_Monitoring::NBINS_LBs + 0.5);
       m_NSPHitsECm_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_NSPHitsECm_vsLB->GetYaxis()->SetTitle("Average number of SP Hits");
       if (noiseOccMaps.regHist(m_NSPHitsECm_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book NSPHitsECm_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book NSPHitsECm_vsLB");
       }
       m_ECmNO_vsLB =
         TProfile_LW::create("ECCNO_vsLB", "NO vs LB for the EndCap C (SP noise)", SCT_Monitoring::NBINS_LBs, 0.5, SCT_Monitoring::NBINS_LBs + 0.5);
       m_ECmNO_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_ECmNO_vsLB->GetYaxis()->SetTitle("Noise Occupancy [10^{-5}]");
       if (noiseOccMaps.regHist(m_ECmNO_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book ECmNO_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book ECmNO_vsLB");
       }
       m_NallHitsTriggerECm_vsLB = TProfile_LW::create("h_NallHitsTriggerECm_vsLB",
                                                "Average num of all Hits in ECm with trigger vs LB", SCT_Monitoring::NBINS_LBs, 0.5,
@@ -1664,7 +1623,7 @@ SCTHitsNoiseMonTool::bookGeneralNoiseOccupancyMaps(const unsigned int systemInde
       m_NallHitsTriggerECm_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_NallHitsTriggerECm_vsLB->GetYaxis()->SetTitle("Average number of all Hits");
       if (noiseOccMaps.regHist(m_NallHitsTriggerECm_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book NallHitsTriggerECm_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book NallHitsTriggerECm_vsLB");
       }
       m_NSPHitsTriggerECm_vsLB = TProfile_LW::create("h_NSPHitsTriggerECm_vsLB",
                                               "Average num of SP Hits in ECm with trigger vs LB", SCT_Monitoring::NBINS_LBs, 0.5,
@@ -1672,14 +1631,14 @@ SCTHitsNoiseMonTool::bookGeneralNoiseOccupancyMaps(const unsigned int systemInde
       m_NSPHitsTriggerECm_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_NSPHitsTriggerECm_vsLB->GetYaxis()->SetTitle("Average number of SP Hits");
       if (noiseOccMaps.regHist(m_NSPHitsTriggerECm_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book NSPHitsTriggerECm_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book NSPHitsTriggerECm_vsLB");
       }
       m_ECmNOTrigger_vsLB = TProfile_LW::create("ECCNOTrigger_vsLB", "NO with trigger vs LB for the EndCap C (SP noise)",
                                          SCT_Monitoring::NBINS_LBs, 0.5, SCT_Monitoring::NBINS_LBs + 0.5);
       m_ECmNOTrigger_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_ECmNOTrigger_vsLB->GetYaxis()->SetTitle("Noise Occupancy [10^{-5}]");
       if (noiseOccMaps.regHist(m_ECmNOTrigger_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book ECmNOTrigger_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book ECmNOTrigger_vsLB");
       }
     }
     if (systemIndex == 1) { // BAR
@@ -1688,20 +1647,20 @@ SCTHitsNoiseMonTool::bookGeneralNoiseOccupancyMaps(const unsigned int systemInde
       m_NallHitsBAR_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_NallHitsBAR_vsLB->GetYaxis()->SetTitle("Average number of all Hits");
       if (noiseOccMaps.regHist(m_NallHitsBAR_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book NallHitsBAR_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book NallHitsBAR_vsLB");
       }
       m_NSPHitsBAR_vsLB = TProfile_LW::create("h_NSPHitsBAR_vsLB", "Average num of SP Hits in Barrel vs LB", SCT_Monitoring::NBINS_LBs, 0.5,
                                        SCT_Monitoring::NBINS_LBs + 0.5);
       m_NSPHitsBAR_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_NSPHitsBAR_vsLB->GetYaxis()->SetTitle("Average number of SP Hits");
       if (noiseOccMaps.regHist(m_NSPHitsBAR_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book NSPHitsBAR_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book NSPHitsBAR_vsLB");
       }
       m_BARNO_vsLB = TProfile_LW::create("BARNO_vsLB", "NO vs LB for the Barrel (SP noise)", SCT_Monitoring::NBINS_LBs, 0.5, SCT_Monitoring::NBINS_LBs + 0.5);
       m_BARNO_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_BARNO_vsLB->GetYaxis()->SetTitle("Noise Occupancy [10^{-5}]");
       if (noiseOccMaps.regHist(m_BARNO_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book BARNO_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book BARNO_vsLB");
       }
       m_NallHitsTriggerBAR_vsLB = TProfile_LW::create("h_NallHitsTriggerBAR_vsLB",
                                                "Average num of all Hits in Barrel with trigger vs LB", SCT_Monitoring::NBINS_LBs, 0.5,
@@ -1709,7 +1668,7 @@ SCTHitsNoiseMonTool::bookGeneralNoiseOccupancyMaps(const unsigned int systemInde
       m_NallHitsTriggerBAR_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_NallHitsTriggerBAR_vsLB->GetYaxis()->SetTitle("Average number of all Hits");
       if (noiseOccMaps.regHist(m_NallHitsTriggerBAR_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book NallHitsTriggerBAR_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book NallHitsTriggerBAR_vsLB");
       }
       m_NSPHitsTriggerBAR_vsLB = TProfile_LW::create("h_NSPHitsTriggerBAR_vsLB",
                                               "Average num of SP Hits in Barrel with trigger vs LB", SCT_Monitoring::NBINS_LBs, 0.5,
@@ -1717,14 +1676,14 @@ SCTHitsNoiseMonTool::bookGeneralNoiseOccupancyMaps(const unsigned int systemInde
       m_NSPHitsTriggerBAR_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_NSPHitsTriggerBAR_vsLB->GetYaxis()->SetTitle("Average number of SP Hits");
       if (noiseOccMaps.regHist(m_NSPHitsTriggerBAR_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book NSPHitsTriggerBAR_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book NSPHitsTriggerBAR_vsLB");
       }
       m_BARNOTrigger_vsLB = TProfile_LW::create("BARNOTrigger_vsLB", "NO with trigger vs LB for the Barrel (SP noise)",
                                          SCT_Monitoring::NBINS_LBs, 0.5, SCT_Monitoring::NBINS_LBs + 0.5);
       m_BARNOTrigger_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_BARNOTrigger_vsLB->GetYaxis()->SetTitle("Noise Occupancy [10^{-5}]");
       if (noiseOccMaps.regHist(m_BARNOTrigger_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book BARNOTrigger_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book BARNOTrigger_vsLB");
       }
     }
     if (systemIndex == 2) { // ECp=ECA
@@ -1733,21 +1692,21 @@ SCTHitsNoiseMonTool::bookGeneralNoiseOccupancyMaps(const unsigned int systemInde
       m_NallHitsECp_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_NallHitsECp_vsLB->GetYaxis()->SetTitle("Average number of all Hits");
       if (noiseOccMaps.regHist(m_NallHitsECp_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book NallHitsECp_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book NallHitsECp_vsLB");
       }
       m_NSPHitsECp_vsLB = TProfile_LW::create("h_NSPHitsECp_vsLB", "Average num of SP Hits in ECp vs LB", SCT_Monitoring::NBINS_LBs, 0.5,
                                        SCT_Monitoring::NBINS_LBs + 0.5);
       m_NSPHitsECp_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_NSPHitsECp_vsLB->GetYaxis()->SetTitle("Average number of SP Hits");
       if (noiseOccMaps.regHist(m_NSPHitsECp_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book NSPHitsECp_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book NSPHitsECp_vsLB");
       }
       m_ECpNO_vsLB =
         TProfile_LW::create("ECANO_vsLB", "NO vs LB for the EndCap A (SP noise)", SCT_Monitoring::NBINS_LBs, 0.5, SCT_Monitoring::NBINS_LBs + 0.5);
       m_ECpNO_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_ECpNO_vsLB->GetYaxis()->SetTitle("Noise Occupancy [10^{-5}]");
       if (noiseOccMaps.regHist(m_ECpNO_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book ECpNO_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book ECpNO_vsLB");
       }
       m_NallHitsTriggerECp_vsLB = TProfile_LW::create("h_NallHitsTriggerECp_vsLB",
                                                "Average num of all Hits in ECp with trigger vs LB", SCT_Monitoring::NBINS_LBs, 0.5,
@@ -1755,7 +1714,7 @@ SCTHitsNoiseMonTool::bookGeneralNoiseOccupancyMaps(const unsigned int systemInde
       m_NallHitsTriggerECp_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_NallHitsTriggerECp_vsLB->GetYaxis()->SetTitle("Average number of all Hits");
       if (noiseOccMaps.regHist(m_NallHitsTriggerECp_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book NallHitsTriggerECp_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book NallHitsTriggerECp_vsLB");
       }
       m_NSPHitsTriggerECp_vsLB = TProfile_LW::create("h_NSPHitsTriggerECp_vsLB",
                                               "Average num of SP Hits in ECp with trigger vs LB", SCT_Monitoring::NBINS_LBs, 0.5,
@@ -1763,27 +1722,26 @@ SCTHitsNoiseMonTool::bookGeneralNoiseOccupancyMaps(const unsigned int systemInde
       m_NSPHitsTriggerECp_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_NSPHitsTriggerECp_vsLB->GetYaxis()->SetTitle("Average number of SP Hits");
       if (noiseOccMaps.regHist(m_NSPHitsTriggerECp_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book NSPHitsTriggerECp_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book NSPHitsTriggerECp_vsLB");
       }
       m_ECpNOTrigger_vsLB = TProfile_LW::create("ECANOTrigger_vsLB", "NO with trigger vs LB for the EndCap A (SP noise)",
                                          SCT_Monitoring::NBINS_LBs, 0.5, SCT_Monitoring::NBINS_LBs + 0.5);
       m_ECpNOTrigger_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_ECpNOTrigger_vsLB->GetYaxis()->SetTitle("Noise Occupancy [10^{-5}]");
       if (noiseOccMaps.regHist(m_ECpNOTrigger_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book ECpNOTrigger_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book ECpNOTrigger_vsLB");
       }
     }
   }
   return StatusCode::SUCCESS;
 }
 
-// 09.09.2016
 StatusCode
 SCTHitsNoiseMonTool::bookGeneralHitOccupancyMaps(const unsigned int systemIndex) {
   const SCT_Monitoring::Bec bec(index2Bec(systemIndex));
 
   if (bec == INVALID_SYSTEM) {
-    msg(MSG::FATAL) << "Invalid subsystem index, should be 0-2, was " << systemIndex << endmsg;
+    ATH_MSG_FATAL("Invalid subsystem index, should be 0-2, was " << systemIndex);
     return StatusCode::FAILURE;
   }
   if (newRunFlag()) {
@@ -1836,20 +1794,20 @@ SCTHitsNoiseMonTool::bookGeneralHitOccupancyMaps(const unsigned int systemIndex)
       m_HallHitsECm_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_HallHitsECm_vsLB->GetYaxis()->SetTitle("Average number of all Hits");
       if (hitOccMaps.regHist(m_HallHitsECm_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book HallHitsECm_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book HallHitsECm_vsLB");
       }
       m_HSPHitsECm_vsLB = TProfile_LW::create("h_HSPHitsECm_vsLB", "Average num of SP Hits in ECm vs LB", SCT_Monitoring::NBINS_LBs, 0.5,
                                        SCT_Monitoring::NBINS_LBs + 0.5);
       m_HSPHitsECm_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_HSPHitsECm_vsLB->GetYaxis()->SetTitle("Average number of SP Hits");
       if (hitOccMaps.regHist(m_HSPHitsECm_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book HSPHitsECm_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book HSPHitsECm_vsLB");
       }
       m_ECmHO_vsLB = TProfile_LW::create("ECCHO_vsLB", "HO vs LB for the EndCap C", SCT_Monitoring::NBINS_LBs, 0.5, SCT_Monitoring::NBINS_LBs + 0.5);
       m_ECmHO_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_ECmHO_vsLB->GetYaxis()->SetTitle("Hit Occupancy [10^{-5}]");
       if (hitOccMaps.regHist(m_ECmHO_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book ECmHO_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book ECmHO_vsLB");
       }
       m_HallHitsTriggerECm_vsLB = TProfile_LW::create("h_HallHitsTriggerECm_vsLB",
                                                "Average num of all Hits in ECm with trigger vs LB", SCT_Monitoring::NBINS_LBs, 0.5,
@@ -1857,7 +1815,7 @@ SCTHitsNoiseMonTool::bookGeneralHitOccupancyMaps(const unsigned int systemIndex)
       m_HallHitsTriggerECm_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_HallHitsTriggerECm_vsLB->GetYaxis()->SetTitle("Average number of all Hits");
       if (hitOccMaps.regHist(m_HallHitsTriggerECm_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book HallHitsTriggerECm_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book HallHitsTriggerECm_vsLB");
       }
       m_HSPHitsTriggerECm_vsLB = TProfile_LW::create("h_HSPHitsTriggerECm_vsLB",
                                               "Average num of SP Hits in ECm with trigger vs LB", SCT_Monitoring::NBINS_LBs, 0.5,
@@ -1865,14 +1823,14 @@ SCTHitsNoiseMonTool::bookGeneralHitOccupancyMaps(const unsigned int systemIndex)
       m_HSPHitsTriggerECm_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_HSPHitsTriggerECm_vsLB->GetYaxis()->SetTitle("Average number of SP Hits");
       if (hitOccMaps.regHist(m_HSPHitsTriggerECm_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book HSPHitsTriggerECm_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book HSPHitsTriggerECm_vsLB");
       }
       m_ECmHOTrigger_vsLB = TProfile_LW::create("ECCHOTrigger_vsLB", "HO with trigger vs LB for the EndCap C (SP noise)",
                                          SCT_Monitoring::NBINS_LBs, 0.5, SCT_Monitoring::NBINS_LBs + 0.5);
       m_ECmHOTrigger_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_ECmHOTrigger_vsLB->GetYaxis()->SetTitle("Hit Occupancy [10^{-5}]");
       if (hitOccMaps.regHist(m_ECmHOTrigger_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book ECmHOTrigger_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book ECmHOTrigger_vsLB");
       }
     }
     if (systemIndex == 1) { // BAR
@@ -1881,20 +1839,20 @@ SCTHitsNoiseMonTool::bookGeneralHitOccupancyMaps(const unsigned int systemIndex)
       m_HallHitsBAR_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_HallHitsBAR_vsLB->GetYaxis()->SetTitle("Average number of all Hits");
       if (hitOccMaps.regHist(m_HallHitsBAR_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book HallHitsBAR_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book HallHitsBAR_vsLB");
       }
       m_HSPHitsBAR_vsLB = TProfile_LW::create("h_HSPHitsBAR_vsLB", "Average num of SP Hits in Barrel vs LB", SCT_Monitoring::NBINS_LBs, 0.5,
                                        SCT_Monitoring::NBINS_LBs + 0.5);
       m_HSPHitsBAR_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_HSPHitsBAR_vsLB->GetYaxis()->SetTitle("Average number of SP Hits");
       if (hitOccMaps.regHist(m_HSPHitsBAR_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book HSPHitsBAR_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book HSPHitsBAR_vsLB");
       }
       m_BARHO_vsLB = TProfile_LW::create("BARHO_vsLB", "HO vs LB for the Barrel (SP noise)", SCT_Monitoring::NBINS_LBs, 0.5, SCT_Monitoring::NBINS_LBs + 0.5);
       m_BARHO_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_BARHO_vsLB->GetYaxis()->SetTitle("Hit Occupancy [10^{-5}]");
       if (hitOccMaps.regHist(m_BARHO_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book BARHO_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book BARHO_vsLB");
       }
       m_HallHitsTriggerBAR_vsLB = TProfile_LW::create("h_HallHitsTriggerBAR_vsLB",
                                                "Average num of all Hits in Barrel with trigger vs LB", SCT_Monitoring::NBINS_LBs, 0.5,
@@ -1902,7 +1860,7 @@ SCTHitsNoiseMonTool::bookGeneralHitOccupancyMaps(const unsigned int systemIndex)
       m_HallHitsTriggerBAR_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_HallHitsTriggerBAR_vsLB->GetYaxis()->SetTitle("Average number of all Hits");
       if (hitOccMaps.regHist(m_HallHitsTriggerBAR_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book HallHitsTriggerBAR_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book HallHitsTriggerBAR_vsLB");
       }
       m_HSPHitsTriggerBAR_vsLB = TProfile_LW::create("h_HSPHitsTriggerBAR_vsLB",
                                               "Average num of SP Hits in Barrel with trigger vs LB", SCT_Monitoring::NBINS_LBs, 0.5,
@@ -1910,14 +1868,14 @@ SCTHitsNoiseMonTool::bookGeneralHitOccupancyMaps(const unsigned int systemIndex)
       m_HSPHitsTriggerBAR_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_HSPHitsTriggerBAR_vsLB->GetYaxis()->SetTitle("Average number of SP Hits");
       if (hitOccMaps.regHist(m_HSPHitsTriggerBAR_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book HSPHitsTriggerBAR_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book HSPHitsTriggerBAR_vsLB");
       }
       m_BARHOTrigger_vsLB = TProfile_LW::create("BARHOTrigger_vsLB", "HO with trigger vs LB for the Barrel (SP noise)",
                                          SCT_Monitoring::NBINS_LBs, 0.5, SCT_Monitoring::NBINS_LBs + 0.5);
       m_BARHOTrigger_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_BARHOTrigger_vsLB->GetYaxis()->SetTitle("Hit Occupancy [10^{-5}]");
       if (hitOccMaps.regHist(m_BARHOTrigger_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book BARHOTrigger_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book BARHOTrigger_vsLB");
       }
     }
     if (systemIndex == 2) { // ECp=ECA
@@ -1926,21 +1884,21 @@ SCTHitsNoiseMonTool::bookGeneralHitOccupancyMaps(const unsigned int systemIndex)
       m_HallHitsECp_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_HallHitsECp_vsLB->GetYaxis()->SetTitle("Average number of all Hits");
       if (hitOccMaps.regHist(m_HallHitsECp_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book HallHitsECp_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book HallHitsECp_vsLB");
       }
       m_HSPHitsECp_vsLB = TProfile_LW::create("h_HSPHitsECp_vsLB", "Average num of SP Hits in ECp vs LB", SCT_Monitoring::NBINS_LBs, 0.5,
                                        SCT_Monitoring::NBINS_LBs + 0.5);
       m_HSPHitsECp_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_HSPHitsECp_vsLB->GetYaxis()->SetTitle("Average number of SP Hits");
       if (hitOccMaps.regHist(m_HSPHitsECp_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book HSPHitsECp_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book HSPHitsECp_vsLB");
       }
       m_ECpHO_vsLB =
         TProfile_LW::create("ECAHO_vsLB", "HO vs LB for the EndCap A (SP noise)", SCT_Monitoring::NBINS_LBs, 0.5, SCT_Monitoring::NBINS_LBs + 0.5);
       m_ECpHO_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_ECpHO_vsLB->GetYaxis()->SetTitle("Hit Occupancy [10^{-5}]");
       if (hitOccMaps.regHist(m_ECpHO_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book ECpHO_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book ECpHO_vsLB");
       }
       m_HallHitsTriggerECp_vsLB = TProfile_LW::create("h_HallHitsTriggerECp_vsLB",
                                                "Average num of all Hits in ECp with trigger vs LB", SCT_Monitoring::NBINS_LBs, 0.5,
@@ -1948,7 +1906,7 @@ SCTHitsNoiseMonTool::bookGeneralHitOccupancyMaps(const unsigned int systemIndex)
       m_HallHitsTriggerECp_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_HallHitsTriggerECp_vsLB->GetYaxis()->SetTitle("Average number of all Hits");
       if (hitOccMaps.regHist(m_HallHitsTriggerECp_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book HallHitsTriggerECp_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book HallHitsTriggerECp_vsLB");
       }
       m_HSPHitsTriggerECp_vsLB = TProfile_LW::create("h_HSPHitsTriggerECp_vsLB",
                                               "Average num of SP Hits in ECp with trigger vs LB", SCT_Monitoring::NBINS_LBs, 0.5,
@@ -1956,14 +1914,14 @@ SCTHitsNoiseMonTool::bookGeneralHitOccupancyMaps(const unsigned int systemIndex)
       m_HSPHitsTriggerECp_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_HSPHitsTriggerECp_vsLB->GetYaxis()->SetTitle("Average number of SP Hits");
       if (hitOccMaps.regHist(m_HSPHitsTriggerECp_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book HSPHitsTriggerECp_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book HSPHitsTriggerECp_vsLB");
       }
       m_ECpHOTrigger_vsLB = TProfile_LW::create("ECAHOTrigger_vsLB", "HO with trigger vs LB for the EndCap A (SP noise)",
                                          SCT_Monitoring::NBINS_LBs, 0.5, SCT_Monitoring::NBINS_LBs + 0.5);
       m_ECpHOTrigger_vsLB->GetXaxis()->SetTitle("LumiBlock");
       m_ECpHOTrigger_vsLB->GetYaxis()->SetTitle("Hit Occupancy [10^{-5}]");
       if (hitOccMaps.regHist(m_ECpHOTrigger_vsLB).isFailure()) {
-        msg(MSG::WARNING) << "Couldn't book ECpHOTrigger_vsLB" << endmsg;
+        ATH_MSG_WARNING("Couldn't book ECpHOTrigger_vsLB");
       }
     }
   }
@@ -1987,7 +1945,7 @@ SCTHitsNoiseMonTool::checkNoiseMaps(bool final) {
       ////////////////////////////////////////////////////////
       if (m_environment == AthenaMonManager::online) { // Reset histos for online so there is proper weighting of events
         if (resetNoiseMapHists().isFailure()) {
-          msg(MSG::WARNING) << "Failed to reset noise occupancy maps!" << endmsg;
+          ATH_MSG_WARNING("Failed to reset noise occupancy maps!");
         }
       }
       if (m_occSumUnbiased.size() && m_numberOfEvents) {
@@ -2065,7 +2023,6 @@ SCTHitsNoiseMonTool::checkNoiseMaps(bool final) {
         }
       }
 
-      // Add 09.09.2016
       if (m_hitoccSumUnbiased.size() && m_numberOfEvents) {
         for (std::map<Identifier, float>::iterator it = m_hitoccSumUnbiased.begin(); it != m_hitoccSumUnbiased.end();
              it++) {
@@ -2157,7 +2114,6 @@ SCTHitsNoiseMonTool::checkNoiseMaps(bool final) {
 	m_occTriggerBAR_lb[m_current_lb] = 0;
 	m_occTriggerECp_lb[m_current_lb] = 0;
 	m_occTriggerECm_lb[m_current_lb] = 0;
-	// 09.09.2016
 	m_noisyMWithHO100[m_current_lb] = 0;
 	m_noisyMWithHO1000[m_current_lb] = 0;
 	m_noisyMWithHO10000[m_current_lb] = 0;
@@ -2200,7 +2156,6 @@ SCTHitsNoiseMonTool::checkNoiseMaps(bool final) {
 	    if ((1E5) * m_occSumUnbiased_lb[*planeIterator] / m_events_lb > 10000.) {
 	      m_noisyM10000[m_current_lb]++;
 	    }
-	    // 09.09.2016
 	    m_hitocc_lb[m_current_lb] += (1E5) * m_hitoccSumUnbiased_lb[*planeIterator] / m_events_lb;
 	    m_hitoccBAR_lb[m_current_lb] += (1E5) * m_hitoccSumUnbiasedBAR_lb[*planeIterator] / m_events_lb;
 	    m_hitoccECp_lb[m_current_lb] += (1E5) * m_hitoccSumUnbiasedECp_lb[*planeIterator] / m_events_lb;
@@ -2232,7 +2187,6 @@ SCTHitsNoiseMonTool::checkNoiseMaps(bool final) {
 	    if ((1E5) * m_occSumUnbiasedTrigger_lb[*planeIterator] / m_eventsTrigger_lb > 10000.) {
 	      m_noisyMTrigger10000[m_current_lb]++;
 	    }
-	    // 09.09.2016
 	    m_hitoccTrigger_lb[m_current_lb] += (1E5) * m_hitoccSumUnbiasedTrigger_lb[*planeIterator] /
 	      m_eventsTrigger_lb;
 	    m_hitoccTriggerBAR_lb[m_current_lb] += (1E5) * m_hitoccSumUnbiasedTriggerBAR_lb[*planeIterator] /
@@ -2256,32 +2210,27 @@ SCTHitsNoiseMonTool::checkNoiseMaps(bool final) {
 	  if (bec == ENDCAP_C)nlinksECm++;
 	  nlinks++;
 	}
-	//
 	if (nlinks >0){
 	  m_occ_lb[m_current_lb] /= nlinks;
 	  m_occTrigger_lb[m_current_lb] /= nlinks;
-	  // 09.09.2016
 	  m_hitocc_lb[m_current_lb] /= nlinks;
 	  m_hitoccTrigger_lb[m_current_lb] /= nlinks;
 	}
 	if (nlinksBAR >0){
 	  m_occBAR_lb[m_current_lb] /= nlinksBAR;
 	  m_occTriggerBAR_lb[m_current_lb] /= nlinksBAR;
-	  // 09.09.2016
 	  m_hitoccBAR_lb[m_current_lb] /= nlinksBAR;
 	  m_hitoccTriggerBAR_lb[m_current_lb] /= nlinksBAR;
 	}
 	if (nlinksECp >0){
 	  m_occECp_lb[m_current_lb] /= nlinksECp;
 	  m_occTriggerECp_lb[m_current_lb] /= nlinksECp;
-	  // 09.09.2016
 	  m_hitoccECp_lb[m_current_lb] /= nlinksECp;
 	  m_hitoccTriggerECp_lb[m_current_lb] /= nlinksECp;
 	}
 	if (nlinksECm >0){
 	  m_occECm_lb[m_current_lb] /= nlinksECm;
 	  m_occTriggerECm_lb[m_current_lb] /= nlinksECm;
-	  // 09.09.2016
 	  m_hitoccECm_lb[m_current_lb] /= nlinksECm;
 	  m_hitoccTriggerECm_lb[m_current_lb] /= nlinksECm;
 	}
@@ -2301,7 +2250,6 @@ SCTHitsNoiseMonTool::checkNoiseMaps(bool final) {
       m_NoisyModulesTrigger100_vsLB->Reset();
       m_NoisyModulesTrigger1000_vsLB->Reset();
       m_NoisyModulesTrigger10000_vsLB->Reset();
-      // 09.09.2016
       m_BARHO_vsLB->Reset();
       m_ECmHO_vsLB->Reset();
       m_ECpHO_vsLB->Reset();
@@ -2361,7 +2309,6 @@ SCTHitsNoiseMonTool::checkNoiseMaps(bool final) {
 	  m_NoisyModulesTrigger10000_vsLB->Fill(bin, m_noisyMTrigger10000[bin]);
 	}
       }
-      // 09.09.2016
       for (int bin = 1; bin <= SCT_Monitoring::NBINS_LBs; bin++) {
 	if (m_hitoccBAR_lb[bin] != 0) {
 	  m_BARHO_vsLB->Fill(bin, m_hitoccBAR_lb[bin]);
@@ -2437,7 +2384,6 @@ SCTHitsNoiseMonTool::initializeNoiseMaps() {
     m_occSumUnbiasedTriggerBAR_lb[*planeIterator] = 0.;
     m_occSumUnbiasedTriggerECp_lb[*planeIterator] = 0.;
     m_occSumUnbiasedTriggerECm_lb[*planeIterator] = 0.;
-    // 09.09.2016
     m_hitoccSumUnbiased[*planeIterator] = 0.;
     m_hitoccSumUnbiasedTrigger[*planeIterator] = 0.;
     m_hitoccSumUnbiasedRecent[*planeIterator] = 0.;
@@ -2463,63 +2409,62 @@ SCTHitsNoiseMonTool::initializeNoiseMaps() {
 StatusCode
 SCTHitsNoiseMonTool::resetNoiseMapHists() {
   if (resetVecProf2(m_pnoiseoccupancymapHistoVector).isFailure()) {
-    msg(MSG::WARNING) << "Failed to reset noiseoccupancymapHistoVector!" << endmsg;
+    ATH_MSG_WARNING("Failed to reset noiseoccupancymapHistoVector!");
   }
   if (resetVecProf2(m_pnoiseoccupancymapHistoVectorECp).isFailure()) {
-    msg(MSG::WARNING) << "Failed to reset noiseoccupancymapHistoVectorECp!" << endmsg;
+    ATH_MSG_WARNING("Failed to reset noiseoccupancymapHistoVectorECp!");
   }
   if (resetVecProf2(m_pnoiseoccupancymapHistoVectorECm).isFailure()) {
-    msg(MSG::WARNING) << "Failed to reset noiseoccupancymapHistoVectorECm!" << endmsg;
+    ATH_MSG_WARNING("Failed to reset noiseoccupancymapHistoVectorECm!");
   }
   if (m_environment == AthenaMonManager::online) {
     if (resetVecProf2(m_pnoiseoccupancymapHistoVectorRecent).isFailure()) {
-      msg(MSG::WARNING) << "Failed to reset noiseoccupancymapHistoVectorRecent!" << endmsg;
+      ATH_MSG_WARNING("Failed to reset noiseoccupancymapHistoVectorRecent!");
     }
     if (resetVecProf2(m_pnoiseoccupancymapHistoVectorECpRecent).isFailure()) {
-      msg(MSG::WARNING) << "Failed to reset noiseoccupancymapHistoVectorECpRecent!" << endmsg;
+      ATH_MSG_WARNING("Failed to reset noiseoccupancymapHistoVectorECpRecent!");
     }
     if (resetVecProf2(m_pnoiseoccupancymapHistoVectorECmRecent).isFailure()) {
-      msg(MSG::WARNING) << "Failed to reset noiseoccupancymapHistoVectorECmRecent!" << endmsg;
+      ATH_MSG_WARNING("Failed to reset noiseoccupancymapHistoVectorECmRecent!");
     }
   }
   if (resetVecProf2(m_pnoiseoccupancymapHistoVectorTrigger).isFailure()) {
-    msg(MSG::WARNING) << "Failed to reset noiseoccupancymapHistoVectorTrigger!" << endmsg;
+    ATH_MSG_WARNING("Failed to reset noiseoccupancymapHistoVectorTrigger!");
   }
   if (resetVecProf2(m_pnoiseoccupancymapHistoVectorECpTrigger).isFailure()) {
-    msg(MSG::WARNING) << "Failed to reset noiseoccupancymapHistoVectorECpTrigger!" << endmsg;
+    ATH_MSG_WARNING("Failed to reset noiseoccupancymapHistoVectorECpTrigger!");
   }
   if (resetVecProf2(m_pnoiseoccupancymapHistoVectorECmTrigger).isFailure()) {
-    msg(MSG::WARNING) << "Failed to reset noiseoccupancymapHistoVectorECmTrigger!" << endmsg;
+    ATH_MSG_WARNING("Failed to reset noiseoccupancymapHistoVectorECmTrigger!");
   }
-  // 09.09.2016
   if (resetVecProf2(m_phitoccupancymapHistoVector).isFailure()) {
-    msg(MSG::WARNING) << "Failed to reset hitoccupancymapHistoVector!" << endmsg;
+    ATH_MSG_WARNING("Failed to reset hitoccupancymapHistoVector!");
   }
   if (resetVecProf2(m_phitoccupancymapHistoVectorECp).isFailure()) {
-    msg(MSG::WARNING) << "Failed to reset hitoccupancymapHistoVectorECp!" << endmsg;
+    ATH_MSG_WARNING("Failed to reset hitoccupancymapHistoVectorECp!");
   }
   if (resetVecProf2(m_phitoccupancymapHistoVectorECm).isFailure()) {
-    msg(MSG::WARNING) << "Failed to reset hitoccupancymapHistoVectorECm!" << endmsg;
+    ATH_MSG_WARNING("Failed to reset hitoccupancymapHistoVectorECm!");
   }
   if (m_environment == AthenaMonManager::online) {
     if (resetVecProf2(m_phitoccupancymapHistoVectorRecent).isFailure()) {
-      msg(MSG::WARNING) << "Failed to reset hitoccupancymapHistoVectorRecent!" << endmsg;
+      ATH_MSG_WARNING("Failed to reset hitoccupancymapHistoVectorRecent!");
     }
     if (resetVecProf2(m_phitoccupancymapHistoVectorECpRecent).isFailure()) {
-      msg(MSG::WARNING) << "Failed to reset hitoccupancymapHistoVectorECpRecent!" << endmsg;
+      ATH_MSG_WARNING("Failed to reset hitoccupancymapHistoVectorECpRecent!");
     }
     if (resetVecProf2(m_phitoccupancymapHistoVectorECmRecent).isFailure()) {
-      msg(MSG::WARNING) << "Failed to reset hitoccupancymapHistoVectorECmRecent!" << endmsg;
+      ATH_MSG_WARNING("Failed to reset hitoccupancymapHistoVectorECmRecent!");
     }
   }
   if (resetVecProf2(m_phitoccupancymapHistoVectorTrigger).isFailure()) {
-    msg(MSG::WARNING) << "Failed to reset hitoccupancymapHistoVectorTrigger!" << endmsg;
+    ATH_MSG_WARNING("Failed to reset hitoccupancymapHistoVectorTrigger!");
   }
   if (resetVecProf2(m_phitoccupancymapHistoVectorECpTrigger).isFailure()) {
-    msg(MSG::WARNING) << "Failed to reset hitoccupancymapHistoVectorECpTrigger!" << endmsg;
+    ATH_MSG_WARNING("Failed to reset hitoccupancymapHistoVectorECpTrigger!");
   }
   if (resetVecProf2(m_phitoccupancymapHistoVectorECmTrigger).isFailure()) {
-    msg(MSG::WARNING) << "Failed to reset hitoccupancymapHistoVectorECmTrigger!" << endmsg;
+    ATH_MSG_WARNING("Failed to reset hitoccupancymapHistoVectorECmTrigger!");
   }
 
 
@@ -2531,7 +2476,6 @@ SCTHitsNoiseMonTool::resetNoiseMapHists() {
   m_ECpNOTrigger->Reset();
   m_SCTNO->Reset();
   m_SCTNOTrigger->Reset();
-  // 09.09.2016
   m_BARHO->Reset();
   m_BARHOTrigger->Reset();
   m_ECmHO->Reset();
@@ -2559,7 +2503,7 @@ SCTHitsNoiseMonTool::resetNoiseMapsRecent() {
   for (std::map<Identifier, float>::iterator it = m_hitoccSumUnbiasedRecent.begin();
        it != m_hitoccSumUnbiasedRecent.end(); ++it) {
     it->second = 0.0;
-  }// 09.09.2016
+  }
   return StatusCode::SUCCESS;
 }
 
@@ -2573,40 +2517,40 @@ StatusCode
 SCTHitsNoiseMonTool::resetHitMapHists() {
   if (m_environment == AthenaMonManager::online) {
     if (resetVecH2(m_ptrackhitsHistoVectorRecent).isFailure()) {
-      msg(MSG::WARNING) << "Failed to reset ptrackhitsHistoVectorRecent!" << endmsg;
+      ATH_MSG_WARNING("Failed to reset ptrackhitsHistoVectorRecent!");
     }
     if (resetVecH2(m_ptrackhitsHistoVectorRecentECp).isFailure()) {
-      msg(MSG::WARNING) << "Failed to reset ptrackhitsHistoVectorRecentECp!" << endmsg;
+      ATH_MSG_WARNING("Failed to reset ptrackhitsHistoVectorRecentECp!");
     }
     if (resetVecH2(m_ptrackhitsHistoVectorRecentECm).isFailure()) {
-      msg(MSG::WARNING) << "Failed to reset ptrackhitsHistoVectorRecentECm!" << endmsg;
+      ATH_MSG_WARNING("Failed to reset ptrackhitsHistoVectorRecentECm!");
     }
     if (resetVecH1(m_tbinHistoVectorRecent).isFailure()) {
-      msg(MSG::WARNING) << "Failed to reset m_tbinHistoVectorRecent!" << endmsg;
+      ATH_MSG_WARNING("Failed to reset m_tbinHistoVectorRecent!");
     }
     if (resetVecH1(m_tbinHistoVectorRecentECp).isFailure()) {
-      msg(MSG::WARNING) << "Failed to reset m_tbinHistoVectorRecentECp!" << endmsg;
+      ATH_MSG_WARNING("Failed to reset m_tbinHistoVectorRecentECp!");
     }
     if (resetVecH1(m_tbinHistoVectorRecentECm).isFailure()) {
-      msg(MSG::WARNING) << "Failed to reset m_tbinHistoVectorRecentECm!" << endmsg;
+      ATH_MSG_WARNING("Failed to reset m_tbinHistoVectorRecentECm!");
     }
     if (resetVecH2(m_phitsHistoVectorRecent).isFailure()) {
-      msg(MSG::WARNING) << "Failed to reset m_phitsHistoVectorRecent!" << endmsg;
+      ATH_MSG_WARNING("Failed to reset m_phitsHistoVectorRecent!");
     }
     if (resetVecH2(m_phitsHistoVectorRecentECp).isFailure()) {
-      msg(MSG::WARNING) << "Failed to reset m_phitsHistoVectorRecentECp!" << endmsg;
+      ATH_MSG_WARNING("Failed to reset m_phitsHistoVectorRecentECp!");
     }
     if (resetVecH2(m_phitsHistoVectorRecentECm).isFailure()) {
-      msg(MSG::WARNING) << "Failed to reset m_phitsHistoVectorRecentECm!" << endmsg;
+      ATH_MSG_WARNING("Failed to reset m_phitsHistoVectorRecentECm!");
     }
     if (resetVecH1(m_clusizeHistoVectorRecent).isFailure()) {
-      msg(MSG::WARNING) << "Failed to reset m_clusizeHistoVectorRecent!" << endmsg;
+      ATH_MSG_WARNING("Failed to reset m_clusizeHistoVectorRecent!");
     }
     if (resetVecH1(m_clusizeHistoVectorRecentECp).isFailure()) {
-      msg(MSG::WARNING) << "Failed to reset m_clusizeHistoVectorRecentECp!" << endmsg;
+      ATH_MSG_WARNING("Failed to reset m_clusizeHistoVectorRecentECp!");
     }
     if (resetVecH1(m_clusizeHistoVectorRecentECm).isFailure()) {
-      msg(MSG::WARNING) << "Failed to reset m_clusizeHistoVectorRecentECm!" << endmsg;
+      ATH_MSG_WARNING("Failed to reset m_clusizeHistoVectorRecentECm!");
     }
     m_tbinHistoRecent->Reset();
     m_tbinHistoRecentECp->Reset();
@@ -2704,7 +2648,7 @@ SCTHitsNoiseMonTool::bookNoiseDistributions() {
       m_BARNO->SetBins(bins, xbins);
     }
     if (NoiseDistributions.regHist(m_BARNO).isFailure()) {
-      msg(MSG::WARNING) << "Couldn't book BARNO" << endmsg;
+      ATH_MSG_WARNING("Couldn't book BARNO");
     }
 
     std::string barrelNO_title = "NO Distribution for the Barrel for " + m_NOTrigger + " trigger";
@@ -2715,7 +2659,7 @@ SCTHitsNoiseMonTool::bookNoiseDistributions() {
       m_BARNOTrigger->SetBins(bins, xbins);
     }
     if (NoiseDistributions.regHist(m_BARNOTrigger).isFailure()) {
-      msg(MSG::WARNING) << "Couldn't book BARNOTrigger" << endmsg;
+      ATH_MSG_WARNING("Couldn't book BARNOTrigger");
     }
 
     m_ECmNO = new TH1F("ECCNOdistribution", "NO Distribution for the EndCap C", bins, xmin, xmax);
@@ -2725,7 +2669,7 @@ SCTHitsNoiseMonTool::bookNoiseDistributions() {
       m_ECmNO->SetBins(bins, xbins);
     }
     if (NoiseDistributions.regHist(m_ECmNO).isFailure()) {
-      msg(MSG::WARNING) << "Couldn't book ECmNO" << endmsg;
+      ATH_MSG_WARNING("Couldn't book ECmNO");
     }
 
     std::string ECmNO_title = "NO Distribution for the EndCap C for " + m_NOTrigger + " trigger";
@@ -2736,7 +2680,7 @@ SCTHitsNoiseMonTool::bookNoiseDistributions() {
       m_ECmNOTrigger->SetBins(bins, xbins);
     }
     if (NoiseDistributions.regHist(m_ECmNOTrigger).isFailure()) {
-      msg(MSG::WARNING) << "Couldn't book ECmNOTrigger" << endmsg;
+      ATH_MSG_WARNING("Couldn't book ECmNOTrigger");
     }
 
     m_ECpNO = new TH1F("ECANOdistribution", "NO Distribution for the EndCap A", bins, xmin, xmax);
@@ -2746,7 +2690,7 @@ SCTHitsNoiseMonTool::bookNoiseDistributions() {
       m_ECpNO->SetBins(bins, xbins);
     }
     if (NoiseDistributions.regHist(m_ECpNO).isFailure()) {
-      msg(MSG::WARNING) << "Couldn't book ECpNO" << endmsg;
+      ATH_MSG_WARNING("Couldn't book ECpNO");
     }
 
     std::string ECpNO_title = "NO Distribution for the EndCap A for " + m_NOTrigger + " trigger";
@@ -2757,7 +2701,7 @@ SCTHitsNoiseMonTool::bookNoiseDistributions() {
       m_ECpNOTrigger->SetBins(bins, xbins);
     }
     if (NoiseDistributions.regHist(m_ECpNOTrigger).isFailure()) {
-      msg(MSG::WARNING) << "Couldn't book ECpNOTrigger" << endmsg;
+      ATH_MSG_WARNING("Couldn't book ECpNOTrigger");
     }
 
     m_SCTNO = new TH1F("SCTNOdistribution", "NO Distribution for the SCT", bins, xmin, xmax);
@@ -2767,7 +2711,7 @@ SCTHitsNoiseMonTool::bookNoiseDistributions() {
       m_SCTNO->SetBins(bins, xbins);
     }
     if (NoiseDistributions.regHist(m_SCTNO).isFailure()) {
-      msg(MSG::WARNING) << "Couldn't book NO" << endmsg;
+      ATH_MSG_WARNING("Couldn't book NO");
     }
 
     std::string NO_title = "NO Distribution for the SCT for " + m_NOTrigger + " trigger";
@@ -2778,14 +2722,14 @@ SCTHitsNoiseMonTool::bookNoiseDistributions() {
       m_SCTNOTrigger->SetBins(bins, xbins);
     }
     if (NoiseDistributions.regHist(m_SCTNOTrigger).isFailure()) {
-      msg(MSG::WARNING) << "Couldn't book NOTrigger" << endmsg;
+      ATH_MSG_WARNING("Couldn't book NOTrigger");
     }
 
     m_SCTNO_vsLB = TProfile_LW::create("NO_vsLB", "NO vs LB for all region (SP noise)", SCT_Monitoring::NBINS_LBs, 0.5, SCT_Monitoring::NBINS_LBs + 0.5);
     m_SCTNO_vsLB->GetXaxis()->SetTitle("LumiBlock");
     m_SCTNO_vsLB->GetYaxis()->SetTitle("Noise Occupancy [10^{-5}]");
     if (NoiseDistributions.regHist(m_SCTNO_vsLB).isFailure()) {
-      msg(MSG::WARNING) << "Couldn't book SCTNO_vsLB" << endmsg;
+      ATH_MSG_WARNING("Couldn't book SCTNO_vsLB");
     }
 
     m_NoisyModulesTrigger100_vsLB = TProfile_LW::create("NoisyModulesTrigger100_vsLB",
@@ -2794,7 +2738,7 @@ SCTHitsNoiseMonTool::bookNoiseDistributions() {
     m_NoisyModulesTrigger100_vsLB->GetXaxis()->SetTitle("LumiBlock");
     m_NoisyModulesTrigger100_vsLB->GetYaxis()->SetTitle("Noisy Modules");
     if (NoiseDistributions.regHist(m_NoisyModulesTrigger100_vsLB).isFailure()) {
-      msg(MSG::WARNING) << "Couldn't book NoisyModulesTrigger100_vsLB" << endmsg;
+      ATH_MSG_WARNING("Couldn't book NoisyModulesTrigger100_vsLB");
     }
 
     m_NoisyModulesTrigger1000_vsLB = TProfile_LW::create("NoisyModulesTrigger1000_vsLB",
@@ -2803,7 +2747,7 @@ SCTHitsNoiseMonTool::bookNoiseDistributions() {
     m_NoisyModulesTrigger1000_vsLB->GetXaxis()->SetTitle("LumiBlock");
     m_NoisyModulesTrigger1000_vsLB->GetYaxis()->SetTitle("Noisy Modules");
     if (NoiseDistributions.regHist(m_NoisyModulesTrigger1000_vsLB).isFailure()) {
-      msg(MSG::WARNING) << "Couldn't book NoisyModulesTrigger1000_vsLB" << endmsg;
+      ATH_MSG_WARNING("Couldn't book NoisyModulesTrigger1000_vsLB");
     }
 
     m_NoisyModulesTrigger10000_vsLB = TProfile_LW::create("NoisyModulesTrigger10000_vsLB",
@@ -2812,7 +2756,7 @@ SCTHitsNoiseMonTool::bookNoiseDistributions() {
     m_NoisyModulesTrigger10000_vsLB->GetXaxis()->SetTitle("LumiBlock");
     m_NoisyModulesTrigger10000_vsLB->GetYaxis()->SetTitle("Noisy Modules");
     if (NoiseDistributions.regHist(m_NoisyModulesTrigger10000_vsLB).isFailure()) {
-      msg(MSG::WARNING) << "Couldn't book NoisyModulesTrigger10000_vsLB" << endmsg;
+      ATH_MSG_WARNING("Couldn't book NoisyModulesTrigger10000_vsLB");
     }
 
     m_SCTNOTrigger_vsLB = TProfile_LW::create("NOTrigger_vsLB", "NO with trigger vs LB for all region (SP noise)", SCT_Monitoring::NBINS_LBs,
@@ -2820,7 +2764,7 @@ SCTHitsNoiseMonTool::bookNoiseDistributions() {
     m_SCTNOTrigger_vsLB->GetXaxis()->SetTitle("LumiBlock");
     m_SCTNOTrigger_vsLB->GetYaxis()->SetTitle("Noise Occupancy [10^{-5}]");
     if (NoiseDistributions.regHist(m_SCTNOTrigger_vsLB).isFailure()) {
-      msg(MSG::WARNING) << "Couldn't book SCTNOTrigger_vsLB" << endmsg;
+      ATH_MSG_WARNING("Couldn't book SCTNOTrigger_vsLB");
     }
 
     m_NoisyModules100_vsLB = TProfile_LW::create("NoisyModules100_vsLB", "NoisyModules100 vs LB for all region (SP noise)",
@@ -2828,7 +2772,7 @@ SCTHitsNoiseMonTool::bookNoiseDistributions() {
     m_NoisyModules100_vsLB->GetXaxis()->SetTitle("LumiBlock");
     m_NoisyModules100_vsLB->GetYaxis()->SetTitle("Noisy Modules");
     if (NoiseDistributions.regHist(m_NoisyModules100_vsLB).isFailure()) {
-      msg(MSG::WARNING) << "Couldn't book NoisyModules100_vsLB" << endmsg;
+      ATH_MSG_WARNING("Couldn't book NoisyModules100_vsLB");
     }
 
     m_NoisyModules1000_vsLB = TProfile_LW::create("NoisyModules1000_vsLB", "NoisyModules1000 vs LB for all region (SP noise)",
@@ -2836,7 +2780,7 @@ SCTHitsNoiseMonTool::bookNoiseDistributions() {
     m_NoisyModules1000_vsLB->GetXaxis()->SetTitle("LumiBlock");
     m_NoisyModules1000_vsLB->GetYaxis()->SetTitle("Noisy Modules");
     if (NoiseDistributions.regHist(m_NoisyModules1000_vsLB).isFailure()) {
-      msg(MSG::WARNING) << "Couldn't book NoisyModules1000_vsLB" << endmsg;
+      ATH_MSG_WARNING("Couldn't book NoisyModules1000_vsLB");
     }
 
     m_NoisyModules10000_vsLB = TProfile_LW::create("NoisyModules10000_vsLB", "NoisyModules10000 vs LB for all region (SP noise)",
@@ -2844,9 +2788,8 @@ SCTHitsNoiseMonTool::bookNoiseDistributions() {
     m_NoisyModules10000_vsLB->GetXaxis()->SetTitle("LumiBlock");
     m_NoisyModules10000_vsLB->GetYaxis()->SetTitle("Noisy Modules");
     if (NoiseDistributions.regHist(m_NoisyModules10000_vsLB).isFailure()) {
-      msg(MSG::WARNING) << "Couldn't book NoisyModules10000_vsLB" << endmsg;
+      ATH_MSG_WARNING("Couldn't book NoisyModules10000_vsLB");
     }
-    // 09.09.2016
     m_BARHO = new TH1F("barrelHOdistribution", "HO Distribution for the Barrel", bins, xmin, xmax);
     m_BARHO->GetXaxis()->SetTitle("Hit Occupancy [10^{-5}]");
     m_BARHO->GetYaxis()->SetTitle("Modules");
@@ -2854,7 +2797,7 @@ SCTHitsNoiseMonTool::bookNoiseDistributions() {
       m_BARHO->SetBins(bins, xbins);
     }
     if (NoiseDistributions.regHist(m_BARHO).isFailure()) {
-      msg(MSG::WARNING) << "Couldn't book BARHO" << endmsg;
+      ATH_MSG_WARNING("Couldn't book BARHO");
     }
 
     std::string barrelHO_title = "HO Distribution for the Barrel for " + m_NOTrigger + " trigger";
@@ -2865,7 +2808,7 @@ SCTHitsNoiseMonTool::bookNoiseDistributions() {
       m_BARHOTrigger->SetBins(bins, xbins);
     }
     if (NoiseDistributions.regHist(m_BARHOTrigger).isFailure()) {
-      msg(MSG::WARNING) << "Couldn't book BARHOTrigger" << endmsg;
+      ATH_MSG_WARNING("Couldn't book BARHOTrigger");
     }
     m_ECmHO = new TH1F("ECCHOdistribution", "HO Distribution for the EndCap C", bins, xmin, xmax);
 
@@ -2875,7 +2818,7 @@ SCTHitsNoiseMonTool::bookNoiseDistributions() {
       m_ECmHO->SetBins(bins, xbins);
     }
     if (NoiseDistributions.regHist(m_ECmHO).isFailure()) {
-      msg(MSG::WARNING) << "Couldn't book ECmHO" << endmsg;
+      ATH_MSG_WARNING("Couldn't book ECmHO");
     }
 
     std::string ECmHO_title = "HO Distribution for the EndCap C for " + m_NOTrigger + " trigger";
@@ -2886,7 +2829,7 @@ SCTHitsNoiseMonTool::bookNoiseDistributions() {
       m_ECmHOTrigger->SetBins(bins, xbins);
     }
     if (NoiseDistributions.regHist(m_ECmHOTrigger).isFailure()) {
-      msg(MSG::WARNING) << "Couldn't book ECmHOTrigger" << endmsg;
+      ATH_MSG_WARNING("Couldn't book ECmHOTrigger");
     }
 
     m_ECpHO = new TH1F("ECAHOdistribution", "HO Distribution for the EndCap A", bins, xmin, xmax);
@@ -2896,7 +2839,7 @@ SCTHitsNoiseMonTool::bookNoiseDistributions() {
       m_ECpHO->SetBins(bins, xbins);
     }
     if (NoiseDistributions.regHist(m_ECpHO).isFailure()) {
-      msg(MSG::WARNING) << "Couldn't book ECpHO" << endmsg;
+      ATH_MSG_WARNING("Couldn't book ECpHO");
     }
 
     std::string ECpHO_title = "HO Distribution for the EndCap A for " + m_NOTrigger + " trigger";
@@ -2907,7 +2850,7 @@ SCTHitsNoiseMonTool::bookNoiseDistributions() {
       m_ECpHOTrigger->SetBins(bins, xbins);
     }
     if (NoiseDistributions.regHist(m_ECpHOTrigger).isFailure()) {
-      msg(MSG::WARNING) << "Couldn't book ECpHOTrigger" << endmsg;
+      ATH_MSG_WARNING("Couldn't book ECpHOTrigger");
     }
 
     m_SCTHO = new TH1F("SCTHOdistribution", "HO Distribution for the SCT", bins, xmin, xmax);
@@ -2917,7 +2860,7 @@ SCTHitsNoiseMonTool::bookNoiseDistributions() {
       m_SCTHO->SetBins(bins, xbins);
     }
     if (NoiseDistributions.regHist(m_SCTHO).isFailure()) {
-      msg(MSG::WARNING) << "Couldn't book HO" << endmsg;
+      ATH_MSG_WARNING("Couldn't book HO");
     }
 
     std::string HO_title = "HO Distribution for the SCT for " + m_NOTrigger + " trigger";
@@ -2928,14 +2871,14 @@ SCTHitsNoiseMonTool::bookNoiseDistributions() {
       m_SCTHOTrigger->SetBins(bins, xbins);
     }
     if (NoiseDistributions.regHist(m_SCTHOTrigger).isFailure()) {
-      msg(MSG::WARNING) << "Couldn't book HOTrigger" << endmsg;
+      ATH_MSG_WARNING("Couldn't book HOTrigger");
     }
 
     m_SCTHO_vsLB = TProfile_LW::create("HO_vsLB", "HO vs LB for all region (SP noise)", SCT_Monitoring::NBINS_LBs, 0.5, SCT_Monitoring::NBINS_LBs + 0.5);
     m_SCTHO_vsLB->GetXaxis()->SetTitle("LumiBlock");
     m_SCTHO_vsLB->GetYaxis()->SetTitle("Hit Occupancy [10^{-5}]");
     if (NoiseDistributions.regHist(m_SCTHO_vsLB).isFailure()) {
-      msg(MSG::WARNING) << "Couldn't book SCTHO_vsLB" << endmsg;
+      ATH_MSG_WARNING("Couldn't book SCTHO_vsLB");
     }
 
     m_NoisyModulesWithHOTrigger100_vsLB = TProfile_LW::create("NoisyModulesWithHOTrigger100_vsLB",
@@ -2944,7 +2887,7 @@ SCTHitsNoiseMonTool::bookNoiseDistributions() {
     m_NoisyModulesWithHOTrigger100_vsLB->GetXaxis()->SetTitle("LumiBlock");
     m_NoisyModulesWithHOTrigger100_vsLB->GetYaxis()->SetTitle("Noisy Modules with HO");
     if (NoiseDistributions.regHist(m_NoisyModulesWithHOTrigger100_vsLB).isFailure()) {
-      msg(MSG::WARNING) << "Couldn't book NoisyModulesWithHOTrigger100_vsLB" << endmsg;
+      ATH_MSG_WARNING("Couldn't book NoisyModulesWithHOTrigger100_vsLB");
     }
 
     m_NoisyModulesWithHOTrigger1000_vsLB = TProfile_LW::create("NoisyModulesWithHOTrigger1000_vsLB",
@@ -2953,7 +2896,7 @@ SCTHitsNoiseMonTool::bookNoiseDistributions() {
     m_NoisyModulesWithHOTrigger1000_vsLB->GetXaxis()->SetTitle("LumiBlock");
     m_NoisyModulesWithHOTrigger1000_vsLB->GetYaxis()->SetTitle("Noisy Modules with HO");
     if (NoiseDistributions.regHist(m_NoisyModulesWithHOTrigger1000_vsLB).isFailure()) {
-      msg(MSG::WARNING) << "Couldn't book NoisyModulesWithHOTrigger1000_vsLB" << endmsg;
+      ATH_MSG_WARNING("Couldn't book NoisyModulesWithHOTrigger1000_vsLB");
     }
 
     m_NoisyModulesWithHOTrigger10000_vsLB = TProfile_LW::create("NoisyModulesWithHOTrigger10000_vsLB",
@@ -2962,7 +2905,7 @@ SCTHitsNoiseMonTool::bookNoiseDistributions() {
     m_NoisyModulesWithHOTrigger10000_vsLB->GetXaxis()->SetTitle("LumiBlock");
     m_NoisyModulesWithHOTrigger10000_vsLB->GetYaxis()->SetTitle("Noisy Modules with HO");
     if (NoiseDistributions.regHist(m_NoisyModulesWithHOTrigger10000_vsLB).isFailure()) {
-      msg(MSG::WARNING) << "Couldn't book NoisyModulesWithHOTrigger10000_vsLB" << endmsg;
+      ATH_MSG_WARNING("Couldn't book NoisyModulesWithHOTrigger10000_vsLB");
     }
 
     m_SCTHOTrigger_vsLB = TProfile_LW::create("HOTrigger_vsLB", "HO with trigger vs LB for all region (SP noise)", SCT_Monitoring::NBINS_LBs,
@@ -2970,7 +2913,7 @@ SCTHitsNoiseMonTool::bookNoiseDistributions() {
     m_SCTHOTrigger_vsLB->GetXaxis()->SetTitle("LumiBlock");
     m_SCTHOTrigger_vsLB->GetYaxis()->SetTitle("Hit Occupancy [10^{-5}]");
     if (NoiseDistributions.regHist(m_SCTHOTrigger_vsLB).isFailure()) {
-      msg(MSG::WARNING) << "Couldn't book SCTHOTrigger_vsLB" << endmsg;
+      ATH_MSG_WARNING("Couldn't book SCTHOTrigger_vsLB");
     }
 
     m_NoisyModulesWithHO100_vsLB = TProfile_LW::create("NoisyModulesWithHO100_vsLB",
@@ -2979,7 +2922,7 @@ SCTHitsNoiseMonTool::bookNoiseDistributions() {
     m_NoisyModulesWithHO100_vsLB->GetXaxis()->SetTitle("LumiBlock");
     m_NoisyModulesWithHO100_vsLB->GetYaxis()->SetTitle("Noisy Modules with HO");
     if (NoiseDistributions.regHist(m_NoisyModulesWithHO100_vsLB).isFailure()) {
-      msg(MSG::WARNING) << "Couldn't book NoisyModulesWithHO100_vsLB" << endmsg;
+      ATH_MSG_WARNING("Couldn't book NoisyModulesWithHO100_vsLB");
     }
 
     m_NoisyModulesWithHO1000_vsLB = TProfile_LW::create("NoisyModulesWithHO1000_vsLB",
@@ -2988,7 +2931,7 @@ SCTHitsNoiseMonTool::bookNoiseDistributions() {
     m_NoisyModulesWithHO1000_vsLB->GetXaxis()->SetTitle("LumiBlock");
     m_NoisyModulesWithHO1000_vsLB->GetYaxis()->SetTitle("Noisy Modules with HO");
     if (NoiseDistributions.regHist(m_NoisyModulesWithHO1000_vsLB).isFailure()) {
-      msg(MSG::WARNING) << "Couldn't book NoisyModulesWithHO1000_vsLB" << endmsg;
+      ATH_MSG_WARNING("Couldn't book NoisyModulesWithHO1000_vsLB");
     }
 
     m_NoisyModulesWithHO10000_vsLB = TProfile_LW::create("NoisyModulesWithHO10000_vsLB",
@@ -2997,7 +2940,7 @@ SCTHitsNoiseMonTool::bookNoiseDistributions() {
     m_NoisyModulesWithHO10000_vsLB->GetXaxis()->SetTitle("LumiBlock");
     m_NoisyModulesWithHO10000_vsLB->GetYaxis()->SetTitle("Noisy Modules with HO");
     if (NoiseDistributions.regHist(m_NoisyModulesWithHO10000_vsLB).isFailure()) {
-      msg(MSG::WARNING) << "Couldn't book NoisyModulesWithHO10000_vsLB" << endmsg;
+      ATH_MSG_WARNING("Couldn't book NoisyModulesWithHO10000_vsLB");
     }
   }
   return StatusCode::SUCCESS;
@@ -3071,9 +3014,7 @@ SCTHitsNoiseMonTool::makeSPvsEventNumber() {
 
   // get space points for SCT from TDS
   if (not SCT_spcontainer.isValid()) {
-    if (msgLvl(MSG::WARNING)) {
-      msg(MSG::WARNING) << "Si SpacePoint container for SCT not found" << endmsg;
-    }
+    ATH_MSG_WARNING("Si SpacePoint container for SCT not found");
     return StatusCode::FAILURE;
   }
   int sct_nspacepoints(0);
@@ -3150,43 +3091,34 @@ SCTHitsNoiseMonTool::makeVectorOfTrackRDOIdentifiers() {
   m_RDOsOnTracks.clear();
   SG::ReadHandle<SCT_RDO_Container> p_rdocontainer(m_dataObjectName);
   if (not p_rdocontainer.isValid()) {
-    msg(MSG::FATAL) << "Could not find the data object " << m_dataObjectName.key() << " !" << endmsg;
+    ATH_MSG_FATAL("Could not find the data object " << m_dataObjectName.key() << " !");
     return StatusCode::FAILURE;
   } else {
-    if (msgLvl(MSG::DEBUG)) {
-      msg(MSG::DEBUG) << "Data object " << m_dataObjectName.key() << " found" << endmsg;
-    }
+    ATH_MSG_DEBUG("Data object " << m_dataObjectName.key() << " found");
   }
   
   SG::ReadHandle<TrackCollection> tracks(m_tracksName);
   if (not tracks.isValid()) {
-    msg(MSG::FATAL) << "No tracks for you!" << endmsg;
+    ATH_MSG_FATAL("No tracks for you!");
     return StatusCode::FAILURE;
   }
   // Only do for events with less than some number of tracks
   if (tracks->size() > m_maxTracks) {
-    if (msgLvl(MSG::DEBUG)) {
-      msg(MSG::DEBUG) << "The event has more than " << m_maxTracks
-                      << " tracks. Don't do hits-on-track-hists" << endmsg;
-    }
+    ATH_MSG_DEBUG("The event has more than " << m_maxTracks
+                  << " tracks. Don't do hits-on-track-hists");
     return StatusCode::SUCCESS;
   }
   // assemble list of rdo ids associated with tracks
   for (int i = 0; i < (int) tracks->size(); i++) {
     const Trk::Track *track = (*tracks)[i];
     if (track == 0) {
-      if (msgLvl(MSG::WARNING)) {
-        msg(MSG::WARNING) << "no pointer to track!!!" << endmsg;
-      }
+      ATH_MSG_WARNING("no pointer to track!!!");
       break;
     }
     // Get pointer to track state on surfaces
     const DataVector<const Trk::TrackStateOnSurface> *trackStates = track->trackStateOnSurfaces();
     if (trackStates == 0) {
-      if (msgLvl(MSG::WARNING)) {
-        msg(MSG::WARNING) <<
-	  "for current track is TrackStateOnSurfaces == Null, no data will be written for this track" << endmsg;
-      }
+      ATH_MSG_WARNING("for current track is TrackStateOnSurfaces == Null, no data will be written for this track");
     }else {// Loop over all track states on surfaces
       for (DataVector<const Trk::TrackStateOnSurface>::const_iterator it = trackStates->begin();
            it != trackStates->end(); it++) {
@@ -3197,9 +3129,7 @@ SCTHitsNoiseMonTool::makeVectorOfTrackRDOIdentifiers() {
           // Get Pointer to prepRawDataObject
           const InDet::SiCluster *RawDataClus = dynamic_cast<const InDet::SiCluster *>(clus->prepRawData());
           if (RawDataClus == 0) {
-            if (msgLvl(MSG::WARNING)) {
-              msg(MSG::WARNING) << "SiCluster WITHOUT prepRawData!!!!" << endmsg;
-            }
+            ATH_MSG_WARNING("SiCluster WITHOUT prepRawData!!!!");
             break;
           }
           // if Cluster is in SCT ...
@@ -3211,9 +3141,7 @@ SCTHitsNoiseMonTool::makeVectorOfTrackRDOIdentifiers() {
       }
     }
   }
-  if (msgLvl(MSG::DEBUG)) {
-    msg(MSG::DEBUG) << "JEGN!! num RDOs on tracks is " << m_RDOsOnTracks.size() << endmsg;
-  }
+  ATH_MSG_DEBUG("JEGN!! num RDOs on tracks is " << m_RDOsOnTracks.size());
   return StatusCode::SUCCESS;
 }
 
@@ -3223,7 +3151,7 @@ SCTHitsNoiseMonTool::bookGeneralTrackHits(const unsigned int systemIndex) {
   const SCT_Monitoring::Bec bec(index2Bec(systemIndex));
 
   if (bec == INVALID_SYSTEM) {
-    msg(MSG::FATAL) << "Invalid subsystem index, should be 0-2, was " << systemIndex << endmsg;
+    ATH_MSG_FATAL("Invalid subsystem index, should be 0-2, was " << systemIndex);
     return StatusCode::FAILURE;
   }
   const string paths[] = {
@@ -3427,7 +3355,7 @@ SCTHitsNoiseMonTool::h2Factory(const std::string &name, const std::string &title
   tmp->SetYTitle("Index in the direction of #phi");
   bool success(registry.regHist(tmp).isSuccess());
   if (not success) {
-    msg(MSG::WARNING) << "Cannot book SCT histogram: " << name << endmsg;
+    ATH_MSG_WARNING("Cannot book SCT histogram: " << name);
   }
   storageVector.push_back(tmp);
   return success ? tmp : NULL;
@@ -3442,7 +3370,7 @@ SCTHitsNoiseMonTool::h2IFactory(const std::string &name, const std::string &titl
   tmp->SetYTitle("Time bin");
   bool success(registry.regHist(tmp).isSuccess());
   if (not success) {
-    msg(MSG::WARNING) << "Cannot book SCT histogram: " << name << endmsg;
+    ATH_MSG_WARNING("Cannot book SCT histogram: " << name);
   }
   return success ? tmp : NULL;
 }
@@ -3456,7 +3384,7 @@ SCTHitsNoiseMonTool::prof2DFactory(const std::string &name, const std::string &t
   tmp->SetYTitle("Index in the direction of #phi");
   bool success(registry.regHist(tmp).isSuccess());
   if (not success) {
-    msg(MSG::WARNING) << "Cannot book SCT histogram: " << name << endmsg;
+    ATH_MSG_WARNING("Cannot book SCT histogram: " << name);
   }
   return success ? tmp : NULL;
 }
@@ -3470,7 +3398,7 @@ SCTHitsNoiseMonTool::profFactory(const std::string &name, const std::string &tit
   tmp->SetYTitle("Fraction of 01X");
   bool success(registry.regHist(tmp).isSuccess());
   if (not success) {
-    msg(MSG::WARNING) << "Cannot book SCT histogram: " << name << endmsg;
+    ATH_MSG_WARNING("Cannot book SCT histogram: " << name);
   }
   return success ? tmp : NULL;
 }
@@ -3485,7 +3413,7 @@ SCTHitsNoiseMonTool::profFactory(const std::string &name, const std::string &tit
   tmp->GetXaxis()->SetBinLabel(3, "Endcap A");
   bool success(registry.regHist(tmp).isSuccess());
   if (not success) {
-    msg(MSG::WARNING) << "Cannot book SCT histogram: " << name << endmsg;
+    ATH_MSG_WARNING("Cannot book SCT histogram: " << name);
   }
   return success ? tmp : NULL;
 }
@@ -3510,7 +3438,7 @@ SCTHitsNoiseMonTool::prof2Factory(const std::string &name, const std::string &ti
   tmp->SetYTitle("Index in the direction of #phi");
   bool success(registry.regHist(tmp).isSuccess());
   if (not success) {
-    msg(MSG::WARNING) << "Cannot book SCT histogram: " << name << endmsg;
+    ATH_MSG_WARNING("Cannot book SCT histogram: " << name);
   }
   storageVector.push_back(tmp);
   return success ? tmp : NULL;
@@ -3523,7 +3451,7 @@ SCTHitsNoiseMonTool::h1Factory(const std::string &name, const std::string &title
   bool success(registry.regHist(tmp).isSuccess());
 
   if (not success) {
-    msg(MSG::WARNING) << "Cannot book SCT histogram: " << name << endmsg;
+    ATH_MSG_WARNING("Cannot book SCT histogram: " << name);
   }
   return success ? tmp : NULL;
 }
@@ -3535,7 +3463,7 @@ SCTHitsNoiseMonTool::h1Factory(const std::string &name, const std::string &title
   bool success(registry.regHist(tmp).isSuccess());
 
   if (not success) {
-    msg(MSG::WARNING) << "Cannot book SCT histogram: " << name << endmsg;
+    ATH_MSG_WARNING("Cannot book SCT histogram: " << name);
   }
   storageVector.push_back(tmp);
   return success ? tmp : NULL;
@@ -3548,7 +3476,7 @@ SCTHitsNoiseMonTool::th1Factory(const std::string &name, const std::string &titl
   bool success(registry.regHist(tmp).isSuccess());
 
   if (not success) {
-    msg(MSG::WARNING) << "Cannot book SCT histogram: " << name << endmsg;
+    ATH_MSG_WARNING("Cannot book SCT histogram: " << name);
   }
   return success ? tmp : NULL;
 }
@@ -3560,7 +3488,7 @@ SCTHitsNoiseMonTool::th1Factory(const std::string &name, const std::string &titl
   bool success(registry.regHist(tmp).isSuccess());
 
   if (not success) {
-    msg(MSG::WARNING) << "Cannot book SCT histogram: " << name << endmsg;
+    ATH_MSG_WARNING("Cannot book SCT histogram: " << name);
   }
   storageVector.push_back(tmp);
   return success ? tmp : NULL;
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonTool.cxx
old mode 100755
new mode 100644
index a578cbcbb60ce42f2e7b1c812d10cc95b4c3f544..cf4ccd067287e18fc9734eb3ebfef3e874b2b289
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonTool.cxx
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonTool.cxx
@@ -9,7 +9,6 @@
  *    Modified by Yuta
  */
 #include "SCT_Monitoring/SCTLorentzMonTool.h"
-#include "deletePointers.h"
 #include "SCT_NameFormatter.h"
 #include <cmath>
 #include <type_traits>
@@ -85,22 +84,16 @@ StatusCode SCTLorentzMonTool::initialize() {
 // ====================================================================================================
 //                       SCTLorentzMonTool :: bookHistograms
 // ====================================================================================================
-// StatusCode SCTLorentzMonTool::bookHistograms( bool /*isNewEventsBlock*/, bool isNewLumiBlock, bool isNewRun
-// )//suppress 'unused' compiler warning     // hidetoshi 14.01.21
 StatusCode
-SCTLorentzMonTool::bookHistogramsRecurrent( ) {                                                                                              //
-                                                                                                                                             // hidetoshi
-                                                                                                                                             // 14.01.21
+SCTLorentzMonTool::bookHistogramsRecurrent( ) {
   m_path = "";
   if (newRunFlag()) {
-    m_numberOfEvents = 0;                                                                                                                        //
-                                                                                                                                                 // hidetoshi
-                                                                                                                                                 // 14.01.21
+    m_numberOfEvents = 0;
   }
   ATH_MSG_DEBUG("initialize being called");
   // Booking  Track related Histograms
   if (bookLorentzHistos().isFailure()) {
-    msg(MSG::WARNING) << "Error in bookLorentzHistos()" << endmsg;                                // hidetoshi 14.01.22
+    ATH_MSG_WARNING("Error in bookLorentzHistos()");
   }
   return StatusCode::SUCCESS;
 }
@@ -109,19 +102,15 @@ SCTLorentzMonTool::bookHistogramsRecurrent( ) {
 //                       SCTLorentzMonTool :: bookHistograms
 // ====================================================================================================
 StatusCode
-SCTLorentzMonTool::bookHistograms( ) {                                                                                                      //
-                                                                                                                                            // hidetoshi
-                                                                                                                                            // 14.01.21
+SCTLorentzMonTool::bookHistograms( ) {
   m_path = "";
-  m_numberOfEvents = 0;                                                                                                                                  //
-                                                                                                                                                         // hidetoshi
-                                                                                                                                                         // 14.01.21
+  m_numberOfEvents = 0;
   ATH_MSG_DEBUG("initialize being called");
   /* Retrieve TrackToVertex extrapolator tool */
   ATH_CHECK(m_trackToVertexTool.retrieve());
   // Booking  Track related Histograms
   if (bookLorentzHistos().isFailure()) {
-    msg(MSG::WARNING) << "Error in bookLorentzHistos()" << endmsg;                                // hidetoshi 14.01.22
+    ATH_MSG_WARNING("Error in bookLorentzHistos()");
   }
   return StatusCode::SUCCESS;
 }
@@ -167,7 +156,7 @@ SCTLorentzMonTool::fillHistograms() {
 
   SG::ReadHandle<TrackCollection> tracks(m_tracksName);
   if (not tracks.isValid()) {
-    msg(MSG::WARNING) << " TrackCollection not found: Exit SCTLorentzTool" << m_tracksName.key() << endmsg;
+    ATH_MSG_WARNING(" TrackCollection not found: Exit SCTLorentzTool" << m_tracksName.key());
     return StatusCode::SUCCESS;
   }
   TrackCollection::const_iterator trkitr = tracks->begin();
@@ -177,21 +166,20 @@ SCTLorentzMonTool::fillHistograms() {
     // Get track
     const Trk::Track *track = (*trkitr);
     if (not track) {
-      msg(MSG::ERROR) << "no pointer to track!!!" << endmsg;
+      ATH_MSG_ERROR("no pointer to track!!!");
       continue;
     }
 
     // Get pointer to track state on surfaces
     const DataVector<const Trk::TrackStateOnSurface> *trackStates = track->trackStateOnSurfaces();
     if (not trackStates) {
-      msg(MSG::WARNING) << "for current track, TrackStateOnSurfaces == Null, no data will be written for this track" <<
-      endmsg;
+      ATH_MSG_WARNING("for current track, TrackStateOnSurfaces == Null, no data will be written for this track");
       continue;
     }
 
     const Trk::TrackSummary *summary = track->trackSummary();
     if (not summary) {
-      msg(MSG::WARNING) << " null trackSummary" << endmsg;
+      ATH_MSG_WARNING(" null trackSummary");
       continue;
     }
 
@@ -229,7 +217,7 @@ SCTLorentzMonTool::fillHistograms() {
             int nStrip = rdoList.size();
             const Trk::TrackParameters *trkp = dynamic_cast<const Trk::TrackParameters *>((*it)->trackParameters());
             if (not trkp) {
-              msg(MSG::WARNING) << " Null pointer to MeasuredTrackParameters" << endmsg;
+              ATH_MSG_WARNING(" Null pointer to MeasuredTrackParameters");
               continue;
             }
 
@@ -245,7 +233,7 @@ SCTLorentzMonTool::fillHistograms() {
               pTrack[2] = trkp->momentum().z();
               int iflag = findAnglesToWaferSurface(pTrack, sinAlpha, clus->identify(), elements, thetaToWafer, phiToWafer);
               if (iflag < 0) {
-                msg(MSG::WARNING) << "Error in finding track angles to wafer surface" << endmsg;
+                ATH_MSG_WARNING("Error in finding track angles to wafer surface");
                 continue; // Let's think about this (later)... continue, break or return?
               }
 
@@ -256,7 +244,7 @@ SCTLorentzMonTool::fillHistograms() {
                   (summary->get(Trk::numberOfSCTHits) > 6)// && // #SCTHits >6
                   ) {
                 passesCuts = true;
-              }// 01.02.2015
+              }
               else if ((track->perigeeParameters()->parameters()[Trk::qOverP] < 0.) && // use negative track only
                        (fabs(perigee->parameters()[Trk::d0]) < 1.) && // d0 < 1mm
                        (fabs(perigee->parameters()[Trk::z0] * sin(perigee->parameters()[Trk::theta])) < 1.) && // d0 <
@@ -299,9 +287,7 @@ SCTLorentzMonTool::fillHistograms() {
 //                             SCTLorentzMonTool :: procHistograms
 // ====================================================================================================
 StatusCode
-SCTLorentzMonTool::procHistograms() {                                                                                                                //
-                                                                                                                                                     // hidetoshi
-                                                                                                                                                     // 14.01.21
+SCTLorentzMonTool::procHistograms() {
   if (endOfRunFlag()) {
     ATH_MSG_DEBUG("finalHists()");
     ATH_MSG_DEBUG("Total Rec Event Number: " << m_numberOfEvents);
@@ -323,14 +309,11 @@ SCTLorentzMonTool::checkHists(bool /*fromFinalize*/) {
 //                              SCTLorentzMonTool :: bookLorentzHistos
 // ====================================================================================================
 StatusCode
-SCTLorentzMonTool::bookLorentzHistos() {                                                                                                                //
-                                                                                                                                                        // hidetoshi
-                                                                                                                                                        // 14.01.22
+SCTLorentzMonTool::bookLorentzHistos() {
   const int nLayers(4);
   const int nSides(2);
   string stem = m_path + "/SCT/GENERAL/lorentz/";
-  //    MonGroup Lorentz(this,m_path+"SCT/GENERAL/lorentz",expert,run);        // hidetoshi 14.01.21
-  MonGroup Lorentz(this, m_path + "SCT/GENERAL/lorentz", run, ATTRIB_UNMANAGED);     // hidetoshi 14.01.21
+  MonGroup Lorentz(this, m_path + "SCT/GENERAL/lorentz", run, ATTRIB_UNMANAGED);
 
   string hNum[nLayers] = {
     "0", "1", "2", "3"
@@ -386,23 +369,6 @@ SCTLorentzMonTool::bookLorentzHistos() {
   if (success == 0) {
     return StatusCode::FAILURE;
   }
-  //  }
-  //   
-  //   
-  //   
-  //   
-  //   
-  //   
-  //   
-  //   
-  //   
-  //   
-  //   
-  //   
-  //   
-  //   
-  //                                                                                                                 //
-  // hidetoshi 14.01.22
   return StatusCode::SUCCESS;
 }
 
@@ -413,9 +379,7 @@ SCTLorentzMonTool::pFactory(const std::string &name, const std::string &title, i
   bool success(registry.regHist(tmp).isSuccess());
 
   if (not success) {
-    if (msgLvl(MSG::ERROR)) {
-      msg(MSG::ERROR) << "Cannot book SCT histogram: " << name << endmsg;
-    }
+    ATH_MSG_ERROR("Cannot book SCT histogram: " << name);
     iflag = 0;
   }else {
     iflag = 1;
@@ -433,9 +397,7 @@ SCTLorentzMonTool::h1Factory(const std::string &name, const std::string &title,
   bool success(registry.regHist(tmp).isSuccess());
 
   if (not success) {
-    if (msgLvl(MSG::ERROR)) {
-      msg(MSG::ERROR) << "Cannot book SCT histogram: " << name << endmsg;
-    }
+    ATH_MSG_ERROR("Cannot book SCT histogram: " << name);
   }
   storageVector.push_back(tmp);
   return success;
@@ -454,9 +416,8 @@ SCTLorentzMonTool::findAnglesToWaferSurface(const float (&vec)[3], const float &
   const IdentifierHash waferHash = m_pSCTHelper->wafer_hash(waferId);
   const InDetDD::SiDetectorElement *element = elements->getDetectorElement(waferHash);
   if (!element) {
-    MsgStream log(msgSvc(), name());
-    log << MSG::ERROR << "findAnglesToWaferSurface:  failed to find detector element for id=" <<
-    m_pSCTHelper->show_to_string(id) << endmsg;
+    ATH_MSG_ERROR("findAnglesToWaferSurface:  failed to find detector element for id=" <<
+                  m_pSCTHelper->show_to_string(id));
     return iflag;
   }
 
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTMotherTrigMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTMotherTrigMonTool.cxx
old mode 100755
new mode 100644
index 78240d503e516252f8e2653c6e9e8f455940a7ea..b935037b7828667be53b6f783bef387ac235f7a3
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTMotherTrigMonTool.cxx
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTMotherTrigMonTool.cxx
@@ -30,7 +30,7 @@ SCTMotherTrigMonTool::SCTMotherTrigMonTool(const std::string &type, const std::s
 StatusCode
 SCTMotherTrigMonTool::initialize() {
   if (ManagedMonitorToolBase::initialize().isFailure()) {
-    msg(MSG::ERROR) << "Could not initialize Monitor tool base!" << endmsg;
+    ATH_MSG_ERROR("Could not initialize Monitor tool base!");
     return StatusCode::FAILURE;
   }
 
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTRatioNoiseMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTRatioNoiseMonTool.cxx
old mode 100755
new mode 100644
index 7cc6669cdaa563ae9eb4cf83af343b7b53329d4a..778dc20c4bc13cd22a811df912cdb5edc55835a6
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTRatioNoiseMonTool.cxx
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTRatioNoiseMonTool.cxx
@@ -8,7 +8,6 @@
  *
  */
 #include "SCT_Monitoring/SCTRatioNoiseMonTool.h"
-#include "deletePointers.h"
 #include "SCT_NameFormatter.h"
 #include <cmath>
 
@@ -277,7 +276,7 @@ SCTRatioNoiseMonTool::bookHistogramsRecurrent() {
   }
   // Booking  Track related Histograms
   if (bookRatioNoiseHistos().isFailure()) {
-    msg(MSG::WARNING) << "Error in bookRatioNoiseHistos()" << endmsg;
+    ATH_MSG_WARNING("Error in bookRatioNoiseHistos()");
   }
   return StatusCode::SUCCESS;
 }
@@ -299,7 +298,7 @@ SCTRatioNoiseMonTool::bookHistograms() {
   }
   // Booking  Track related Histograms
   if (bookRatioNoiseHistos().isFailure()) {
-    msg(MSG::WARNING) << "Error in bookRatioNoiseHistos()" << endmsg;
+    ATH_MSG_WARNING("Error in bookRatioNoiseHistos()");
   }
 
   return StatusCode::SUCCESS;
@@ -800,9 +799,7 @@ SCTRatioNoiseMonTool::procHistograms() {
   m_NOECCSide->SetBinContent(m_NOECCSide->GetNbinsX(), m_NOECCSide->GetBinContent(
                                m_NOECCSide->GetNbinsX()) + m_NOECCSide->GetBinContent(m_NOECCSide->GetNbinsX() + 1));
 
-  if (msgLvl(MSG::DEBUG)) {
-    msg(MSG::DEBUG) << "Total Rec Event Number: " << m_numberOfEvents << endmsg;
-  }
+  ATH_MSG_DEBUG("Total Rec Event Number: " << m_numberOfEvents);
   return StatusCode::SUCCESS;
 }
 
@@ -830,10 +827,10 @@ SCTRatioNoiseMonTool::checkHists(bool /*fromFinalize*/) {
 //                              SCTRatioNoiseMonTool :: bookRatioNoiseHistos
 // ====================================================================================================
 StatusCode
-SCTRatioNoiseMonTool::bookRatioNoiseHistos() {      // hidetoshi 14.01.22
-  if (newRunFlag()) {                                         // hidetoshi 14.01.22
+SCTRatioNoiseMonTool::bookRatioNoiseHistos() {
+  if (newRunFlag()) {
     string stem = m_path + "/SCT/GENERAL/RatioNoise/";
-    MonGroup RatioNoise(this, m_path + "SCT/GENERAL/RatioNoise", run, ATTRIB_UNMANAGED); // hidetoshi 14.01.22
+    MonGroup RatioNoise(this, m_path + "SCT/GENERAL/RatioNoise", run, ATTRIB_UNMANAGED);
 
     string hNumBarrel[N_BARRELS] = {
       "0", "1", "2", "3"
@@ -1090,7 +1087,7 @@ SCTRatioNoiseMonTool::pFactory(const std::string &name, const std::string &title
   bool success(registry.regHist(tmp).isSuccess());
 
   if (not success) {
-    msg(MSG::WARNING) << "Cannot book SCT histogram: " << name << endmsg;
+    ATH_MSG_WARNING("Cannot book SCT histogram: " << name);
   }
   return success ? tmp : NULL;
 }
@@ -1102,7 +1099,7 @@ SCTRatioNoiseMonTool::h1Factory(const std::string &name, const std::string &titl
   bool success(registry.regHist(tmp).isSuccess());
 
   if (not success) {
-    msg(MSG::WARNING) << "Cannot book SCT histogram: " << name << endmsg;
+    ATH_MSG_WARNING("Cannot book SCT histogram: " << name);
   }
   return success ? tmp : NULL;
 }
@@ -1115,7 +1112,7 @@ SCTRatioNoiseMonTool::h2Factory(const std::string &name, const std::string &titl
   bool success(registry.regHist(tmp).isSuccess());
 
   if (not success) {
-    msg(MSG::WARNING) << "Cannot book SCT histogram: " << name << endmsg;
+    ATH_MSG_WARNING("Cannot book SCT histogram: " << name);
   }
   return success ? tmp : NULL;
 }
@@ -1127,7 +1124,7 @@ SCTRatioNoiseMonTool::h1Factory(const std::string &name, const std::string &titl
   bool success(registry.regHist(tmp).isSuccess());
 
   if (not success) {
-    msg(MSG::WARNING) << "Cannot book SCT histogram: " << name << endmsg;
+    ATH_MSG_WARNING("Cannot book SCT histogram: " << name);
   }
   storageVector.push_back(tmp);
   return success ? tmp : NULL;
@@ -1153,7 +1150,7 @@ SCTRatioNoiseMonTool::prof2Factory(const std::string &name, const std::string &t
   tmp->SetYTitle("Index in the direction of #phi");
   bool success(registry.regHist(tmp).isSuccess());
   if (not success) {
-    msg(MSG::WARNING) << "Cannot book SCT histogram: " << name << endmsg;
+    ATH_MSG_WARNING("Cannot book SCT histogram: " << name);
   }
   storageVector.push_back(tmp);
   return success ? tmp : NULL;
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTSummaryMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTSummaryMonTool.cxx
old mode 100755
new mode 100644
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTTracksMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTTracksMonTool.cxx
index 9d281448370713649c446eba41ea7f8d08e00988..69914f5e1c3e0a1955e49dd4ca8eef351f4400d8 100644
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTTracksMonTool.cxx
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTTracksMonTool.cxx
@@ -8,7 +8,6 @@
  *    Also uses code from InDet::SCT_ResidualPullCalculator
  */
 #include "SCT_Monitoring/SCTTracksMonTool.h"
-#include "deletePointers.h"
 #include "SCT_NameFormatter.h"
 #include <cmath>
 #include "AthenaKernel/errorcheck.h"
@@ -153,24 +152,19 @@ StatusCode SCTTracksMonTool::initialize() {
 // ====================================================================================================
 //                       SCTTracksMonTool :: bookHistograms
 // ====================================================================================================
-// StatusCode SCTTracksMonTool::bookHistograms( bool /*isNewEventsBlock*/, bool isNewLumiBlock, bool isNewRun )  //
-// hidetoshi 14.01.21
 StatusCode
-SCTTracksMonTool::bookHistogramsRecurrent() {                                                        // hidetoshi
-                                                                                                     // 14.01.21
+SCTTracksMonTool::bookHistogramsRecurrent() {
   ATH_MSG_DEBUG("SCTTracksMonTool::bookHistograms");
   m_path = (m_useIDGlobal) ? ("/InDetGlobal/") : ("");
   if (newRunFlag()) {
-    m_numberOfEvents = 0;                                                                              // hidetoshi
-                                                                                                       // 14.01.21
+    m_numberOfEvents = 0;
   }
   CHECK(detStore()->retrieve(m_pSCTHelper, "SCT_ID"));
   if (m_doUnbiasedCalc) {
     CHECK(m_updator.retrieve());
   }
   // Booking  Track related Histograms
-  CHECK(bookGeneralHistos());                                                                                   // hidetoshi
-                                                                                                                // 14.01.21
+  CHECK(bookGeneralHistos());
   const bool doThisSubsystem[N_REGIONS] = {
     m_doNegativeEndcap, true, m_doPositiveEndcap
   };
@@ -178,8 +172,7 @@ SCTTracksMonTool::bookHistogramsRecurrent() {
     "endcap C", "barrel", "endcap A"
   };
   for (unsigned int sys(0); sys != N_REGIONS; ++sys) {
-    if (doThisSubsystem[sys] and bookTrackHistos(index2Bec(sys)).isFailure()) {                                 // hidetoshi
-                                                                                                                // 14.01.22
+    if (doThisSubsystem[sys] and bookTrackHistos(index2Bec(sys)).isFailure()) {
       ATH_MSG_WARNING("Error in booking track histograms for " << names[sys]);
     }
   }
@@ -190,24 +183,19 @@ SCTTracksMonTool::bookHistogramsRecurrent() {
 // ====================================================================================================
 //                       SCTTracksMonTool :: bookHistograms
 // ====================================================================================================
-// StatusCode SCTTracksMonTool::bookHistograms( bool /*isNewEventsBlock*/, bool isNewLumiBlock, bool isNewRun ) //
-// hidetoshi 14.01.21
 StatusCode
-SCTTracksMonTool::bookHistograms() {                                                                // hidetoshi
-                                                                                                    // 14.01.21
+SCTTracksMonTool::bookHistograms() {
   ATH_MSG_DEBUG("SCTTracksMonTool::bookHistograms");
   m_path = (m_useIDGlobal) ? ("/InDetGlobal/") : ("");
   if (newRunFlag()) {
-    m_numberOfEvents = 0;                                                                            // hidetoshi
-                                                                                                     // 14.11.27
+    m_numberOfEvents = 0;
   }
   CHECK(detStore()->retrieve(m_pSCTHelper, "SCT_ID"));
   if (m_doUnbiasedCalc) {
     CHECK(m_updator.retrieve());
   }
   // Booking  Track related Histograms
-  CHECK(bookGeneralHistos());                                                                                   // hidetoshi
-                                                                                                                // 14.01.21
+  CHECK(bookGeneralHistos());
   const bool doThisSubsystem[N_REGIONS] = {
     m_doNegativeEndcap, true, m_doPositiveEndcap
   };
@@ -215,8 +203,7 @@ SCTTracksMonTool::bookHistograms() {
     "endcap C", "barrel", "endcap A"
   };
   for (unsigned int sys(0); sys != N_REGIONS; ++sys) {
-    if (doThisSubsystem[sys] and bookTrackHistos(index2Bec(sys)).isFailure()) {                               // hidetoshi
-                                                                                                              // 14.01.22
+    if (doThisSubsystem[sys] and bookTrackHistos(index2Bec(sys)).isFailure()) {
       ATH_MSG_WARNING("Error in booking track histograms for " << names[sys]);
     }
   }
@@ -241,7 +228,7 @@ SCTTracksMonTool::fillHistograms() {
       m_psctresiduals_summaryHistoVector[n]->GetXaxis()->SetTitle("Residuals [mm]");
       m_psctpulls_summaryHistoVector[n]->GetXaxis()->SetTitle("Pull");
     }
-    if (m_environment != AthenaMonManager::online) { // 27.11.2014
+    if (m_environment != AthenaMonManager::online) {
       for (int mm = 0; mm < N_DISKSx2; mm++) {
         m_psctresidualsHistoVectorECm[mm]->GetXaxis()->SetTitle("Index in the direction of #eta");
         m_psctresidualsHistoVectorECm[mm]->GetYaxis()->SetTitle("Index in the direction of #phi");
@@ -358,13 +345,13 @@ SCTTracksMonTool::fillHistograms() {
     VecProf2_t *pullsHistogramArray[3];
     Prof2_t residualsHistogram(0);
     Prof2_t pullsHistogram(0);
-    if (m_environment != AthenaMonManager::online) { // 27.11.2014
+    if (m_environment != AthenaMonManager::online) {
       residualsHistogramArray[0] = &m_psctresidualsHistoVectorECm;
       residualsHistogramArray[1] = &m_psctresidualsHistoVector;
       residualsHistogramArray[2] = &m_psctresidualsHistoVectorECp;
       pullsHistogramArray[0] = &m_psctpullsHistoVectorECm;
       pullsHistogramArray[1] = &m_psctpullsHistoVector;
-      pullsHistogramArray[2] = &m_psctpullsHistoVectorECp;// 27.11.2014
+      pullsHistogramArray[2] = &m_psctpullsHistoVectorECp;
     }
 
     VecH1_t *residualsSummaryHistogramArray[3] = {
@@ -435,16 +422,16 @@ SCTTracksMonTool::fillHistograms() {
                   if (doThisDetector) {
                     residualsSummaryHistogram = (*residualsSummaryHistogramArray[subsystemIndex])[element];
                     pullsSummaryHistogram = (*pullsSummaryHistogramArray[subsystemIndex])[element];
-                    if (m_environment != AthenaMonManager::online) { // 27.11.2014
-                      residualsHistogram = (*residualsHistogramArray[subsystemIndex])[element]; // 27.11.2014
-                      pullsHistogram = (*pullsHistogramArray[subsystemIndex])[element];// 27.11.2014
+                    if (m_environment != AthenaMonManager::online) {
+                      residualsHistogram = (*residualsHistogramArray[subsystemIndex])[element];
+                      pullsHistogram = (*pullsHistogramArray[subsystemIndex])[element];
                       if (residualsHistogram) {
                         residualsHistogram->Fill(eta, phi, local_residual);
                       }
                       if (bigPull and pullsHistogram) {
                         pullsHistogram->Fill(eta, phi, local_pull);
                       }
-                    } // 27.11.2014
+                    }
                     if (residualsSummaryHistogram) {
                       residualsSummaryHistogram->Fill(local_residual, 1.);
                     }
@@ -484,11 +471,10 @@ SCTTracksMonTool::fillHistograms() {
                                     if (doThisDetector){
                                         residualsSummaryHistogram =
                                            (*residualsSummaryHistogramArray[subsystemIndex])[element];
-                                        if(m_environment != AthenaMonManager::online){ // 27.11.2014
+                                        if(m_environment != AthenaMonManager::online){
                                             residualsHistogram = (*residualsHistogramArray[subsystemIndex])[element];
-                                               //27.11.2014
                                             if (residualsHistogram) residualsHistogram->Fill(eta, phi, local_residual);
-                                        } //27.11.2014
+                                        }
                                         if (residualsSummaryHistogram) residualsSummaryHistogram->Fill(local_residual,
                                            1.);
                                         if(bec == 0) m_totalBarrelResidual->Fill(local_residual, 1.);
@@ -507,12 +493,12 @@ SCTTracksMonTool::fillHistograms() {
                + (LocalTrackParameters[Trk::locY] - clus->localParameters()[Trk::locY]) * sinAlpha);
                                         residualsSummaryHistogram = (bec == BARREL) ? 0 :
                                          +(*residualsSummaryHistogramArray[subsystemIndex])[element];
-                                        if(m_environment != AthenaMonManager::online){ // 27.11.2014
+                                        if(m_environment != AthenaMonManager::online){
                                             residualsHistogram = (bec == BARREL) ? 0 :
                                              +(*residualsHistogramArray[subsystemIndex])[layer];//!!! this is 'layer' in
-                                             +the original code, others are elements //27.11.2014
+                                             +the original code, others are elements
                                             if (residualsHistogram) residualsHistogram->Fill(eta, phi, local_residual);
-                                        } //27.11.2014
+                                        }
                                         if (residualsSummaryHistogram) residualsSummaryHistogram->Fill(local_residual,
                                          +1.);
                                         if(bec == 0) m_totalBarrelResidual->Fill(local_residual, 1.);
@@ -545,7 +531,7 @@ SCTTracksMonTool::fillHistograms() {
   m_trk_N->Fill(goodTrks_N);
   m_trk_nclu_totHisto->Fill(local_tot_trkhits, 1.);
   if (m_environment == AthenaMonManager::online) {
-    if (m_numberOfEvents == 1 || (m_numberOfEvents > 1 && m_numberOfEvents % m_checkrate == 0)) {// 30.11.2014
+    if (m_numberOfEvents == 1 || (m_numberOfEvents > 1 && m_numberOfEvents % m_checkrate == 0)) {
       ATH_MSG_DEBUG("Calling checkHists(false); false := during run");
       if (checkHists(false).isFailure()) {
         ATH_MSG_WARNING("Error in checkHists(false)");
@@ -589,12 +575,8 @@ SCTTracksMonTool::fillHistograms() {
 //                             SCTTracksMonTool :: procHistograms
 // ====================================================================================================
 StatusCode
-SCTTracksMonTool::procHistograms() {                                                                           //  hidetoshi
-                                                                                                               // 14.01.21
-  if (endOfRunFlag()) {                                                                                                              //
-                                                                                                                                     // 
-                                                                                                                                     // hidetoshi
-                                                                                                                                     // 14.01.21
+SCTTracksMonTool::procHistograms() {
+  if (endOfRunFlag()) {
     ATH_MSG_DEBUG("SCTTracksMonTool::procHistograms");
     ATH_MSG_DEBUG("Total Rec Event Number: " << m_numberOfEvents);
     ATH_MSG_DEBUG("Calling checkHists(true); true := end of run");
@@ -633,7 +615,7 @@ SCTTracksMonTool::checkHists(bool /*fromFinalize*/) {
   const int negativeEndCap(0);
 
 
-  if (m_environment != AthenaMonManager::online) { // 27.11.2014
+  if (m_environment != AthenaMonManager::online) {
     const VecProf2_t *residuals[3] = {
       &m_psctresidualsHistoVectorECm, &m_psctresidualsHistoVector, &m_psctresidualsHistoVectorECp
     };
@@ -642,10 +624,10 @@ SCTTracksMonTool::checkHists(bool /*fromFinalize*/) {
     };
     const VecH2_t *pullsRms[3] = {
       &m_psctpullsRMSHistoVectorECm, &m_psctpullsRMSHistoVector, &m_psctpullsRMSHistoVectorECp
-    };// 27.11.2014
+    };
     const VecH2_t *residualsRms[3] = {
       &m_psctresidualsRMSHistoVectorECm, &m_psctresidualsRMSHistoVector, &m_psctresidualsRMSHistoVectorECp
-    };// 27.11.2014
+    };
 
     for (int thisDetector(negativeEndCap); thisDetector != N_REGIONS; ++thisDetector) {
       if (doDetector[thisDetector]) {
@@ -669,7 +651,7 @@ SCTTracksMonTool::checkHists(bool /*fromFinalize*/) {
       }
     }
     //  (*residualsRms[0])[0]->GetXaxis()->SetTitle("Index in the direction of #eta");
-  } // 27.11.2014
+  }
     // Now checking RMS and Means of Pulls 1D Histos
   TF1 pullgaus("pullgaus", "gaus");
   pullgaus.SetParameter(1, 0.);
@@ -734,15 +716,11 @@ SCTTracksMonTool::calculatePull(const float residual, const float trkErr, const
 // ====================================================================================================
 //                              SCTTracksMonTool :: bookGeneralHistos
 // ====================================================================================================
-//  StatusCode SCTTracksMonTool::bookGeneralHistos(bool isNewRun,bool /*isNewLumiBlock*/){  // hidetoshi 14.01.22
 StatusCode
-SCTTracksMonTool::bookGeneralHistos() {                                        // hidetoshi 14.01.22
-  //    if(isNewRun){                                                            // hidetoshi 14.01.22
-  if (newRunFlag()) {                                                                   // hidetoshi 14.11.27
+SCTTracksMonTool::bookGeneralHistos() {
+  if (newRunFlag()) {
     string stem(m_path + "/SCT/GENERAL/tracks/");
-    //    MonGroup Tracks(this,m_path+"SCT/GENERAL/tracks",expert,run);          // hidetoshi 14.01.21
-    MonGroup Tracks(this, m_path + "SCT/GENERAL/tracks", run, ATTRIB_UNMANAGED);      // hidetoshi 14.01.21
-    // MonGroup TracksPerLB(this,m_path+"SCT/GENERAL/tracks",expert,lumiBlock);
+    MonGroup Tracks(this, m_path + "SCT/GENERAL/tracks", run, ATTRIB_UNMANAGED);
 
     // Book histogram of number of tracks per region
     m_tracksPerRegion = new TH1F("tracksPerRegion", "Number of tracks in eta regions", 3, 0, 3);
@@ -834,7 +812,6 @@ SCTTracksMonTool::bookGeneralHistos() {                                        /
     m_trk_eta->GetXaxis()->SetTitle("#eta");
     CHECK(Tracks.regHist(m_trk_eta));
 
-    // m_psctresidualsRMSHistoVector[0]->GetXaxis()->SetTitle("Index in the direction of #eta"); test
     if (m_environment == AthenaMonManager::online) {
       m_nTracks = new TH1I("sct_tracks_vs_en", "Number of Tracks vs Event Number", m_evtsbins, 1, m_evtsbins + 1);
       m_nTracks->GetXaxis()->SetTitle("Event Number");
@@ -845,18 +822,14 @@ SCTTracksMonTool::bookGeneralHistos() {                                        /
       m_nTracks_pos = 0;
       CHECK(Tracks.regHist(m_nTracks));
     }
-  }                               // hidetoshi 14.01.22
+  }
   return StatusCode::SUCCESS;
 }
 
-// StatusCode SCTTracksMonTool::bookTrackHistos(const bool isNewRun, const SCT_Monitoring::Bec becVal){ // hidetoshi
-// 14.01.22
 StatusCode
-SCTTracksMonTool::bookTrackHistos(const SCT_Monitoring::Bec becVal) {                       // hidetoshi 14.01.22
-  //  if(not isNewRun) return StatusCode::SUCCESS;                                                     // hidetoshi
-  // 14.01.22
+SCTTracksMonTool::bookTrackHistos(const SCT_Monitoring::Bec becVal) {
   if (not newRunFlag()) {
-    return StatusCode::SUCCESS;                                                           // hidetoshi 14.11.27
+    return StatusCode::SUCCESS;
   }
   const string pathDelimiter("/");
   const string streamDelimiter("_");
@@ -871,10 +844,10 @@ SCTTracksMonTool::bookTrackHistos(const SCT_Monitoring::Bec becVal) {
   };
   const string localPathsResi[N_REGIONS] = {
     "SCT/SCTEC/tracks", "SCT/SCTB/tracks", "SCT/SCTEA/tracks"
-  };// 07.01.2015
+  };
   const string localPathsPull[N_REGIONS] = {
     "SCT/SCTEC/tracks", "SCT/SCTB/tracks", "SCT/SCTEA/tracks"
-  };// 07.01.2015
+  };
   const unsigned int limits[N_REGIONS] = {
     N_DISKSx2, N_BARRELSx2, N_DISKSx2
   };
@@ -896,17 +869,16 @@ SCTTracksMonTool::bookTrackHistos(const SCT_Monitoring::Bec becVal) {
   const unsigned int limit(limits[systemIndex]);
   VecH1_t *p_residualsSummary(residualsSummaryArray[systemIndex]), *p_pullsSummary(pullsSummaryArray[systemIndex]);
 
-  //  MonGroup endCapTracks(this, m_path+localPath, expert, run);            // hidetoshi 14.01.21
-  MonGroup endCapTracks(this, m_path + localPath, run, ATTRIB_UNMANAGED);      // hidetoshi 14.01.21
-  MonGroup endCapTracksResi(this, m_path + localPathResi, run, ATTRIB_UNMANAGED);// 07.01.2015
-  MonGroup endCapTracksPull(this, m_path + localPathPull, run, ATTRIB_UNMANAGED);// 07.01.2015
+  MonGroup endCapTracks(this, m_path + localPath, run, ATTRIB_UNMANAGED);
+  MonGroup endCapTracksResi(this, m_path + localPathResi, run, ATTRIB_UNMANAGED);
+  MonGroup endCapTracksPull(this, m_path + localPathPull, run, ATTRIB_UNMANAGED);
 
   p_residualsSummary->clear();
   p_pullsSummary->clear();
 
   string stem(m_stream + pathDelimiter + localPath + pathDelimiter);
   for (unsigned int i(0); i != limit; ++i) {
-    LayerSideFormatter layerSide(i, systemIndex);// 30.11.2014
+    LayerSideFormatter layerSide(i, systemIndex);
     string streamResidual(string("residuals") + abbreviation + streamDelimiter + layerSide.name());
     string streamPull(string("pulls") + abbreviation + streamDelimiter + layerSide.name());
     string titleResidual(string("SCT Residuals for ") + polarityString + ": " + layerSide.title());
@@ -917,8 +889,7 @@ SCTTracksMonTool::bookTrackHistos(const SCT_Monitoring::Bec becVal) {
   }
 
 
-  if (m_environment != AthenaMonManager::online) { // 27.11.2014
-    // if(1){//27.11
+  if (m_environment != AthenaMonManager::online) {
     VecProf2_t *residualsArray[] = {
       &m_psctresidualsHistoVectorECm, &m_psctresidualsHistoVector, &m_psctresidualsHistoVectorECp
     };
@@ -952,7 +923,7 @@ SCTTracksMonTool::bookTrackHistos(const SCT_Monitoring::Bec becVal) {
 
       CHECK(p2Factory(streamResidual, titleResidual, becVal, endCapTracksResi, *p_residuals));
       CHECK(p2Factory(streamPull, titlePull, becVal, endCapTracksPull, *p_pulls));
-    } // 27.11.2014
+    }
 
     for (unsigned int i(0); i != limit; ++i) {
       LayerSideFormatter layerSide(i, systemIndex);
@@ -966,7 +937,7 @@ SCTTracksMonTool::bookTrackHistos(const SCT_Monitoring::Bec becVal) {
       CHECK(h2Factory(streamResidual, titleResidual, becVal, endCapTracksResi, *p_residualsRms));
       CHECK(h2Factory(streamPull, titlePull, becVal, endCapTracksPull, *p_pullsRms));
     }
-  } // 27.11.2014
+  }
 
   return StatusCode::SUCCESS;
 }
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCT_NameFormatter.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCT_NameFormatter.h
index 8cab566b35e8ef8bbdaf1b46f82692f722c96038..498959900e5d37bec8e2e69bda75572910f36f0e 100644
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCT_NameFormatter.h
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCT_NameFormatter.h
@@ -20,7 +20,7 @@ private:
     const unsigned int m_element;
     const std::string m_layerStr;
     const std::string m_sideStr;
-    unsigned int m_region;// 30.11.2014
+    unsigned int m_region;
 public:
     LayerSideFormatter(const unsigned int i) : m_element(i), m_layerStr(std::to_string(i / 2)), m_sideStr(std::to_string(
                                                                                                             i % 2)),
@@ -29,7 +29,7 @@ public:
     }
 
     LayerSideFormatter(const unsigned int i, const unsigned int m) : m_element(i), m_layerStr(std::to_string(i / 2)),
-      m_sideStr(std::to_string(i % 2)), m_region(m) {// 30.11.2014
+      m_sideStr(std::to_string(i % 2)), m_region(m) {
       // nop
     }
 
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/deletePointers.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/deletePointers.h
deleted file mode 100644
index eba2e1356f324a8851518efcdaf4c2293a221c3b..0000000000000000000000000000000000000000
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/deletePointers.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-/**
- * @file deletePointers.h
- * @author Shaun Roe
- * @date 1/09/2009
- * Header file for declaration and definition of templated functions to
- * delete a pointer and a container of pointers.
- * The template may be further specialized to delete a map of pointers (not done here)
- *
- **/
-#ifndef SCTMonitoring_deletePointers_h
-#define SCTMonitoring_deletePointers_h
-#include <algorithm>
-namespace SCT_Monitoring {
-///Delete a pointer and set it to zero. Suitable for use in a 'std::for_each' algorithm
-// @todo check the type is really a pointer
-  template <class PointerType>
-  void
-  deletePointer(PointerType &p) {
-    delete p;
-    p = 0;
-  }
-
-///Delete a container of pointers and then clear it
-  template<class C>
-  void
-  deletePtrArray(C &container) {
-    std::for_each(container.begin(), container.end(), deletePointer<typename C::value_type>);
-
-    container.clear();
-  }
-}// end of namespace
-
-#endif
\ No newline at end of file
diff --git a/InnerDetector/InDetMonitoring/TRT_Monitoring/CMakeLists.txt b/InnerDetector/InDetMonitoring/TRT_Monitoring/CMakeLists.txt
index 2a00f918142fac684220d6fb1eb14012fce695b1..089e390212a8c4c83eab515cf6aaf04716d13836 100644
--- a/InnerDetector/InDetMonitoring/TRT_Monitoring/CMakeLists.txt
+++ b/InnerDetector/InDetMonitoring/TRT_Monitoring/CMakeLists.txt
@@ -18,7 +18,6 @@ atlas_depends_on_subdirs( PUBLIC
                           Control/AthContainers
                           DetectorDescription/AtlasDetDescr
                           DetectorDescription/Identifier
-                          Event/EventInfo
                           Event/EventPrimitives
                           Event/xAOD/xAODEventInfo
                           Event/xAOD/xAODTrigger
@@ -43,7 +42,7 @@ atlas_add_component( TRT_Monitoring
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} AthenaMonitoringLib GaudiKernel InDetRawData LumiBlockCompsLib CommissionEvent AthContainers AtlasDetDescr Identifier xAODEventInfo xAODTrigger EventInfo EventPrimitives TRT_ConditionsServicesLib InDetIdentifier InDetReadoutGeometry InDetRIO_OnTrack LWHists TrkTrack TrkTrackSummary TrkToolInterfaces )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} AthenaMonitoringLib GaudiKernel InDetRawData LumiBlockCompsLib CommissionEvent AthContainers AtlasDetDescr Identifier xAODEventInfo xAODTrigger EventPrimitives TRT_ConditionsServicesLib InDetIdentifier InDetReadoutGeometry InDetRIO_OnTrack LWHists TrkTrack TrkTrackSummary TrkToolInterfaces )
 
 # Install files from the package:
 atlas_install_headers( TRT_Monitoring )
diff --git a/InnerDetector/InDetMonitoring/TRT_Monitoring/TRT_Monitoring/TRT_Monitoring_Tool.h b/InnerDetector/InDetMonitoring/TRT_Monitoring/TRT_Monitoring/TRT_Monitoring_Tool.h
index 905d285c7524f28fe5c4c141e36ba67a78381fe9..b52230686c726aad22d4ac6f7fc570e3d88f6d93 100644
--- a/InnerDetector/InDetMonitoring/TRT_Monitoring/TRT_Monitoring/TRT_Monitoring_Tool.h
+++ b/InnerDetector/InDetMonitoring/TRT_Monitoring/TRT_Monitoring/TRT_Monitoring_Tool.h
@@ -1,6 +1,6 @@
 // -*- c++ -*-
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef TRT_MONITORING_TOOL_H
@@ -12,7 +12,6 @@
 // Data handles
 #include "StoreGate/ReadHandleKey.h"
 #include "TrkTrack/TrackCollection.h"
-#include "EventInfo/EventInfo.h"
 #include "CommissionEvent/ComTime.h"
 #include "xAODTrigger/TrigDecision.h"
 #include "xAODEventInfo/EventInfo.h"
@@ -158,7 +157,6 @@ private:
 	SG::ReadHandleKey<TrackCollection> m_trackCollectionKey{this, "TRTTracksObjectName", "Tracks", "Name of tracks container"};
 	// NOTE: this property is not used anywhere, is it ok to change its name?
 	SG::ReadHandleKey<TrackCollection> m_combTrackCollectionKey{this, "track_collection_hole_finder", "CombinedInDetTracks", "Name of tracks container used for hole finder"};
-	SG::ReadHandleKey<EventInfo> m_eventInfoKey{this, "EventInfo", "ByteStreamEventInfo", "Name of EventInfo object"};
 	SG::ReadHandleKey<xAOD::EventInfo> m_xAODEventInfoKey{this, "xAODEventInfo", "EventInfo", "Name of EventInfo object"};
 	SG::ReadHandleKey<InDetTimeCollection> m_TRT_BCIDCollectionKey{this, "TRTBCIDCollectionName", "TRT_BCID", "Name of TRT BCID collection"};
 	SG::ReadHandleKey<ComTime> m_comTimeObjectKey{this, "ComTimeObjectName", "TRT_Phase", "Name of ComTime object"};
diff --git a/InnerDetector/InDetMonitoring/TRT_Monitoring/src/TRT_Monitoring_Tool.cxx b/InnerDetector/InDetMonitoring/TRT_Monitoring/src/TRT_Monitoring_Tool.cxx
index b54aad98739063dcf72dd9b9f9c400d0235d600f..e0a57db301f6e6fab56c9f3d245a3feff556bffa 100644
--- a/InnerDetector/InDetMonitoring/TRT_Monitoring/src/TRT_Monitoring_Tool.cxx
+++ b/InnerDetector/InDetMonitoring/TRT_Monitoring/src/TRT_Monitoring_Tool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "TRT_Monitoring/TRT_Monitoring_Tool.h"
@@ -21,8 +21,6 @@
 #include "TRT_ConditionsServices/ITRT_ByteStream_ConditionsSvc.h"
 #include "TRT_ConditionsServices/ITRT_StrawNeighbourSvc.h"
 #include "InDetConditionsSummaryService/IInDetConditionsSvc.h"
-#include "EventInfo/TriggerInfo.h"
-#include "EventInfo/EventID.h"
 #include "xAODTrigger/TrigDecision.h"
 
 #include "EventPrimitives/EventPrimitivesHelpers.h"
@@ -609,7 +607,6 @@ StatusCode TRT_Monitoring_Tool::initialize() {
 	ATH_CHECK( m_rdoContainerKey.initialize() );
 	ATH_CHECK( m_trackCollectionKey.initialize() );
 	ATH_CHECK( m_combTrackCollectionKey.initialize() );
-	ATH_CHECK( m_eventInfoKey.initialize() );
 	ATH_CHECK( m_xAODEventInfoKey.initialize() );
 	ATH_CHECK( m_TRT_BCIDCollectionKey.initialize() );
 	ATH_CHECK( m_comTimeObjectKey.initialize() );
diff --git a/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/CMakeLists.txt b/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/CMakeLists.txt
index a08cf39d91427e802ec194054a6b06d02dc1ee37..cd3ae93527b62ba7cf40292a3371e44827d47ae0 100644
--- a/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/CMakeLists.txt
+++ b/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/CMakeLists.txt
@@ -23,7 +23,6 @@ atlas_depends_on_subdirs( PUBLIC
                           InnerDetector/InDetDetDescr/InDetReadoutGeometry
                           InnerDetector/InDetRecTools/TRT_DriftCircleTool
                           InnerDetector/InDetConditions/SCT_ConditionsData
-                          InnerDetector/InDetConditions/SiLorentzAngleSvc
                         )
 
 # Component(s) in the package:
diff --git a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/CMakeLists.txt b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/CMakeLists.txt
index 7a98df7a123745de020cd617a69ab734f1d27585..a62acee4850ceddc8c9f4d24729c7fa5ec5a1443 100644
--- a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/CMakeLists.txt
+++ b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/CMakeLists.txt
@@ -7,6 +7,7 @@ atlas_subdir( InDetCompetingRIOsOnTrack )
 
 # Declare the package's dependencies:
 atlas_depends_on_subdirs( PUBLIC
+                          Control/CxxUtils
                           InnerDetector/InDetRecEvent/InDetRIO_OnTrack
                           Tracking/TrkEvent/TrkCompetingRIOsOnTrack
                           PRIVATE
@@ -21,6 +22,6 @@ atlas_add_library( InDetCompetingRIOsOnTrack
                    src/*.cxx
                    PUBLIC_HEADERS InDetCompetingRIOsOnTrack
                    PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES InDetRIO_OnTrack TrkCompetingRIOsOnTrack
+                   LINK_LIBRARIES CxxUtils InDetRIO_OnTrack TrkCompetingRIOsOnTrack
                    PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} GaudiKernel TrkSurfaces )
 
diff --git a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/CompetingPixelClustersOnTrack.h b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/CompetingPixelClustersOnTrack.h
index 1d3aa42df21389815d02d35285ec73ed4f9689ea..b4051ac6e2f0a175e3a308ff9799e5e34de21e18 100755
--- a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/CompetingPixelClustersOnTrack.h
+++ b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/CompetingPixelClustersOnTrack.h
@@ -11,8 +11,8 @@
 
 // Trk
 #include "TrkCompetingRIOsOnTrack/CompetingRIOsOnTrack.h"
+#include "CxxUtils/CachedUniquePtr.h"
 #include "InDetRIO_OnTrack/PixelClusterOnTrack.h" // cannot forward declare
-#include <atomic>
 #include <iosfwd>
 
 class MsgStream;
@@ -104,7 +104,7 @@ private:
 
 
     /** The global Position */
-    mutable std::atomic<const Amg::Vector3D*> m_globalPosition;
+    CxxUtils::CachedUniquePtr<const Amg::Vector3D> m_globalPosition;
 
     /** The vector of contained InDet::PixelClusterOnTrack objects */
     std::vector<const InDet::PixelClusterOnTrack*>*   m_containedChildRots;
diff --git a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/CompetingSCT_ClustersOnTrack.h b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/CompetingSCT_ClustersOnTrack.h
index 4d535d492964fe1228d70c2e50fb4fceb3682d91..5f4b07ee0a6af0f4cafaea76862089b656414402 100755
--- a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/CompetingSCT_ClustersOnTrack.h
+++ b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/CompetingSCT_ClustersOnTrack.h
@@ -12,9 +12,9 @@
 // Trk
 #include "TrkCompetingRIOsOnTrack/CompetingRIOsOnTrack.h"
 #include "InDetRIO_OnTrack/SCT_ClusterOnTrack.h" // cannot fwd-declare because of covariant method
+#include "CxxUtils/CachedUniquePtr.h"
 
 #include <iosfwd>
-#include <atomic>
 
 class MsgStream;
 
@@ -106,7 +106,7 @@ private:
 
 
     /** The global position */
-    mutable std::atomic<const Amg::Vector3D*> m_globalPosition;
+    CxxUtils::CachedUniquePtr<const Amg::Vector3D> m_globalPosition;
 
     /** The vector of contained InDet::SCT_ClusterOnTrack objects */
     std::vector<const InDet::SCT_ClusterOnTrack*>*   m_containedChildRots;
@@ -138,14 +138,10 @@ inline const InDet::SCT_ClusterOnTrack& CompetingSCT_ClustersOnTrack::rioOnTrack
 }
 
 inline const Amg::Vector3D& CompetingSCT_ClustersOnTrack::globalPosition() const {
-    const Amg::Vector3D* ptr = m_globalPosition.load();
-    if(ptr) return *ptr;
-    const Amg::Vector3D* newptr = associatedSurface().localToGlobal(localParameters());
-    if(m_globalPosition.compare_exchange_strong(ptr, newptr)){
-       return *newptr; //new object is now stored in m_globalPosition
+    if (not m_globalPosition) {
+        m_globalPosition.set(std::unique_ptr<const Amg::Vector3D>(associatedSurface().localToGlobal(localParameters())));
     }
-    delete newptr; //Object was created on another thread, while this was running, so this is now unneeded.
-    return *ptr; //ptr was replaced with other object by compare_exchange_strong, this is now returned.
+    return *m_globalPosition;
 }
 
 inline unsigned int CompetingSCT_ClustersOnTrack::numberOfContainedROTs() const {
diff --git a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/CompetingTRT_DriftCirclesOnTrack.h b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/CompetingTRT_DriftCirclesOnTrack.h
index 22fe614c83a6441b9ec45cd5b0c3c4fce9de589c..177d5c07648553ef4c40530d8ee950161e5b831c 100755
--- a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/CompetingTRT_DriftCirclesOnTrack.h
+++ b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/CompetingTRT_DriftCirclesOnTrack.h
@@ -12,6 +12,7 @@
 // Trk
 #include "TrkCompetingRIOsOnTrack/CompetingRIOsOnTrack.h"
 #include "InDetRIO_OnTrack/TRT_DriftCircleOnTrack.h"
+#include "CxxUtils/CachedUniquePtr.h"
 #include <atomic>
 #include <iosfwd>
 
@@ -109,7 +110,7 @@ namespace InDet {
     const Trk::Surface* m_associatedSurface;
 
     //! The global Position
-    mutable std::atomic<const Amg::Vector3D*> m_globalPosition;
+    CxxUtils::CachedUniquePtr<const Amg::Vector3D> m_globalPosition;
 
     //! The vector of contained InDet::TRT_DriftCircleOnTrack objects
     std::vector<const InDet::TRT_DriftCircleOnTrack*>*   m_containedChildRots;
diff --git a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingPixelClustersOnTrack.cxx b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingPixelClustersOnTrack.cxx
index b3b8234e1d2e6df6e5f726cdd2d91c22e634a515..047359f83a5f4af8ad70cd49a50d1ca374045032 100755
--- a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingPixelClustersOnTrack.cxx
+++ b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingPixelClustersOnTrack.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -15,20 +15,23 @@
 // default constructor
 InDet::CompetingPixelClustersOnTrack::CompetingPixelClustersOnTrack():
         Trk::CompetingRIOsOnTrack(),
-        m_globalPosition(0),
+        m_globalPosition{},
         m_containedChildRots(0)
         {}
 
 // copy constructor
 InDet::CompetingPixelClustersOnTrack::CompetingPixelClustersOnTrack(const InDet::CompetingPixelClustersOnTrack& compROT) :
         Trk::CompetingRIOsOnTrack(compROT),
-        m_globalPosition(compROT.m_globalPosition ? new Amg::Vector3D(*compROT.m_globalPosition) : 0),
+        m_globalPosition{},
         m_containedChildRots(0) {
     m_containedChildRots = new std::vector< const InDet::PixelClusterOnTrack* >;
     std::vector< const InDet::PixelClusterOnTrack* >::const_iterator rotIter = compROT.m_containedChildRots->begin();
     for (; rotIter!=compROT.m_containedChildRots->end(); ++rotIter) {
         m_containedChildRots->push_back((*rotIter)->clone());
     }
+    if (compROT.m_globalPosition) {
+        m_globalPosition.set(std::make_unique<const Amg::Vector3D>(*compROT.m_globalPosition));
+    }
 }
 
 // explicit constructor
@@ -38,7 +41,7 @@ InDet::CompetingPixelClustersOnTrack::CompetingPixelClustersOnTrack(
     )
     :
     Trk::CompetingRIOsOnTrack( assgnProb),
-    m_globalPosition(0),
+    m_globalPosition{},
     m_containedChildRots(childrots)
 {
   // initialize local position and error matrix
@@ -52,9 +55,11 @@ InDet::CompetingPixelClustersOnTrack& InDet::CompetingPixelClustersOnTrack::oper
         // clear rots
         clearChildRotVector();
         delete m_containedChildRots;
-        delete m_globalPosition;
+        if (m_globalPosition) delete m_globalPosition.release().get();
         m_containedChildRots = new std::vector<const InDet::PixelClusterOnTrack*>;
-        m_globalPosition     = compROT.m_globalPosition ? new Amg::Vector3D(*compROT.m_globalPosition) : 0;
+        if (compROT.m_globalPosition) {
+            m_globalPosition.set(std::make_unique<const Amg::Vector3D>(*compROT.m_globalPosition));
+        }
         std::vector<const InDet::PixelClusterOnTrack*>::const_iterator rotIter = compROT.m_containedChildRots->begin();
         for (; rotIter!=compROT.m_containedChildRots->end(); ++rotIter)
             m_containedChildRots->push_back((*rotIter)->clone());
@@ -69,16 +74,15 @@ InDet::CompetingPixelClustersOnTrack& InDet::CompetingPixelClustersOnTrack::oper
         // clear rots
         clearChildRotVector();
         delete m_containedChildRots;
-        delete m_globalPosition;
+        if (m_globalPosition) delete m_globalPosition.release().get();
         m_containedChildRots = compROT.m_containedChildRots;
         compROT.m_containedChildRots = nullptr;
-        m_globalPosition = compROT.m_globalPosition.exchange(nullptr, std::memory_order_relaxed);
+        m_globalPosition = std::move(compROT.m_globalPosition);
     }
     return (*this);
 }
 
 InDet::CompetingPixelClustersOnTrack::~CompetingPixelClustersOnTrack() {
-    delete m_globalPosition;
     clearChildRotVector();
     delete m_containedChildRots;
 }
@@ -95,7 +99,7 @@ MsgStream& InDet::CompetingPixelClustersOnTrack::dump( MsgStream& out ) const {
         << "] competing Pixel RIO_OnTrack objects" << std::endl;
   Trk::CompetingRIOsOnTrack::dump(out);
   out << "  - GlobalPosition        : ";
-  if (m_globalPosition==NULL) out << "null pointer"<<std::endl;
+  if (not m_globalPosition) out << "null pointer"<<std::endl;
   else out << *m_globalPosition<<endmsg;
   return out;
 }
@@ -106,7 +110,7 @@ std::ostream& InDet::CompetingPixelClustersOnTrack::dump( std::ostream& out ) co
         << "] competing Pixel RIO_OnTrack objects" << std::endl;
   Trk::CompetingRIOsOnTrack::dump(out);
   out << "  - GlobalPosition        : ";
-  if (m_globalPosition==NULL) out << "null pointer"<<std::endl;
+  if (not m_globalPosition) out << "null pointer"<<std::endl;
   else out << *m_globalPosition<<std::endl;
   return out;
 }
@@ -117,13 +121,8 @@ bool InDet::CompetingPixelClustersOnTrack::ROTsHaveCommonSurface(const bool) con
 }
 
 const Amg::Vector3D& InDet::CompetingPixelClustersOnTrack::globalPosition() const {
-    const Amg::Vector3D* ptr = m_globalPosition.load();
-    if(ptr) return *ptr;
-    const Amg::Vector3D* newptr = associatedSurface().localToGlobal(localParameters());
-    if(m_globalPosition.compare_exchange_strong(ptr, newptr)){
-       return *newptr; //new object is now stored in m_globalPosition
+    if (not m_globalPosition) {
+        m_globalPosition.set(std::unique_ptr<const Amg::Vector3D>(associatedSurface().localToGlobal(localParameters())));
     }
-    delete newptr; //Object was created on another thread, while this was running, so this is now unneeded.
-    return *ptr; //ptr was replaced with other object by compare_exchange_strong, this is now returned.
+    return *m_globalPosition;
 }
-
diff --git a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingSCT_ClustersOnTrack.cxx b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingSCT_ClustersOnTrack.cxx
index ac3bdd91975da90dfdc5a9730fc9df3b8ed21b2a..5460461be317ad76859bbdd4c50e06591ef6f098 100755
--- a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingSCT_ClustersOnTrack.cxx
+++ b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingSCT_ClustersOnTrack.cxx
@@ -18,7 +18,7 @@
 // default constructor
 InDet::CompetingSCT_ClustersOnTrack::CompetingSCT_ClustersOnTrack():
         Trk::CompetingRIOsOnTrack(),
-        m_globalPosition(nullptr),
+        m_globalPosition{},
         m_containedChildRots(0)
         //
         {}
@@ -26,13 +26,16 @@ InDet::CompetingSCT_ClustersOnTrack::CompetingSCT_ClustersOnTrack():
 // copy constructor
 InDet::CompetingSCT_ClustersOnTrack::CompetingSCT_ClustersOnTrack(const InDet::CompetingSCT_ClustersOnTrack& compROT) :
         Trk::CompetingRIOsOnTrack(compROT),
-        m_globalPosition(compROT.m_globalPosition ? new Amg::Vector3D(*compROT.m_globalPosition) : nullptr),
+        m_globalPosition{},
         m_containedChildRots(0) {
     m_containedChildRots = new std::vector< const InDet::SCT_ClusterOnTrack* >;
     std::vector< const InDet::SCT_ClusterOnTrack* >::const_iterator rotIter = compROT.m_containedChildRots->begin();
     for (; rotIter!=compROT.m_containedChildRots->end(); ++rotIter) {
         m_containedChildRots->push_back((*rotIter)->clone());
     }
+    if (compROT.m_globalPosition) {
+        m_globalPosition.set(std::make_unique<const Amg::Vector3D>(*compROT.m_globalPosition));
+    }
 }
 
 // explicit constructor
@@ -43,7 +46,7 @@ InDet::CompetingSCT_ClustersOnTrack::CompetingSCT_ClustersOnTrack(
     
 ):
 Trk::CompetingRIOsOnTrack(assgnProb),
-m_globalPosition(nullptr),
+m_globalPosition{},
 m_containedChildRots(childrots)
 {
   // initialize local position and error matrix
@@ -58,14 +61,16 @@ InDet::CompetingSCT_ClustersOnTrack& InDet::CompetingSCT_ClustersOnTrack::operat
         // clear rots
         clearChildRotVector();
         delete m_containedChildRots;
-        delete m_globalPosition;
+        if (m_globalPosition) delete m_globalPosition.release().get();
         m_containedChildRots = new std::vector<const InDet::SCT_ClusterOnTrack*>;
 
         std::vector<const InDet::SCT_ClusterOnTrack*>::const_iterator rotIter = compROT.m_containedChildRots->begin();
         for (; rotIter!=compROT.m_containedChildRots->end(); ++rotIter)
             m_containedChildRots->push_back((*rotIter)->clone());
 
-        m_globalPosition     = compROT.m_globalPosition ? new Amg::Vector3D(*compROT.m_globalPosition) : nullptr;
+        if (compROT.m_globalPosition) {
+            m_globalPosition.set(std::make_unique<const Amg::Vector3D>(*compROT.m_globalPosition));
+        }
     }
     return (*this);
 }
@@ -73,7 +78,6 @@ InDet::CompetingSCT_ClustersOnTrack& InDet::CompetingSCT_ClustersOnTrack::operat
 InDet::CompetingSCT_ClustersOnTrack::~CompetingSCT_ClustersOnTrack() {
     clearChildRotVector();
     delete m_containedChildRots;
-    delete m_globalPosition;
 }
 
 void InDet::CompetingSCT_ClustersOnTrack::clearChildRotVector() {
@@ -90,8 +94,8 @@ MsgStream& InDet::CompetingSCT_ClustersOnTrack::dump( MsgStream& out ) const {
                     "over different surfaces") << "  (given prob>cut)" << std::endl;
   Trk::CompetingRIOsOnTrack::dump(out);
   out << "  - GlobalPosition        : ";
-  if (m_globalPosition==nullptr) out << "null pointer"<<endmsg;
-  else out << *m_globalPosition<<endmsg;
+  if (not m_globalPosition) out << "null pointer"<<endmsg;
+  else out << *m_globalPosition << endmsg;
   return out;
 }
 
@@ -103,8 +107,8 @@ std::ostream& InDet::CompetingSCT_ClustersOnTrack::dump( std::ostream& out ) con
                     "over different surfaces") << "  (given prob>cut)" << std::endl;
   Trk::CompetingRIOsOnTrack::dump(out);
   out << "  - GlobalPosition        : ";
-  if (m_globalPosition==nullptr) out << "null pointer"<<std::endl;
-  else out << *m_globalPosition<<std::endl;
+  if (not m_globalPosition) out << "null pointer"<<std::endl;
+  else out << *m_globalPosition << std::endl;
   return out;
 }
 
diff --git a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingTRT_DriftCirclesOnTrack.cxx b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingTRT_DriftCirclesOnTrack.cxx
index d56f06d795ef6df1ccf63f915a7e34699202a7f4..36cb7590723d46d05782040b50e12a1bbf75b6db 100755
--- a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingTRT_DriftCirclesOnTrack.cxx
+++ b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingTRT_DriftCirclesOnTrack.cxx
@@ -20,14 +20,14 @@
 InDet::CompetingTRT_DriftCirclesOnTrack::CompetingTRT_DriftCirclesOnTrack():
   Trk::CompetingRIOsOnTrack(),
   m_associatedSurface(0),
-  m_globalPosition(0),
+  m_globalPosition{},
   m_containedChildRots(0),
   m_ROTsHaveCommonSurface(8) {}
 
 // copy constructor
 InDet::CompetingTRT_DriftCirclesOnTrack::CompetingTRT_DriftCirclesOnTrack(const InDet::CompetingTRT_DriftCirclesOnTrack& compROT) :
   Trk::CompetingRIOsOnTrack(compROT),
-  m_globalPosition(compROT.m_globalPosition ? new Amg::Vector3D(*(compROT.m_globalPosition.load())) : 0),
+  m_globalPosition{},
   m_containedChildRots(0),
   m_ROTsHaveCommonSurface(compROT.m_ROTsHaveCommonSurface.load()) {
   if (compROT.m_associatedSurface) {
@@ -41,6 +41,9 @@ InDet::CompetingTRT_DriftCirclesOnTrack::CompetingTRT_DriftCirclesOnTrack(const
   for (; rotIter!=compROT.m_containedChildRots->end(); ++rotIter) {
     m_containedChildRots->push_back((*rotIter)->clone());
   }
+  if (compROT.m_globalPosition) {
+    m_globalPosition.set(std::make_unique<const Amg::Vector3D>(*(compROT.m_globalPosition)));
+  }
 }
 
 // explicit constructor
@@ -56,7 +59,7 @@ InDet::CompetingTRT_DriftCirclesOnTrack::CompetingTRT_DriftCirclesOnTrack(
 									  ):
   Trk::CompetingRIOsOnTrack(assgnProb),
   m_associatedSurface(sf),
-  m_globalPosition(0),
+  m_globalPosition{},
   m_containedChildRots(childrots),
   m_ROTsHaveCommonSurface(ROTsHaveComSrfc)
 {
@@ -75,7 +78,7 @@ InDet::CompetingTRT_DriftCirclesOnTrack& InDet::CompetingTRT_DriftCirclesOnTrack
     // clear rots
     clearChildRotVector();
     delete m_containedChildRots;
-    delete m_globalPosition;
+    if (m_globalPosition) delete m_globalPosition.release().get();
     // delete surface if not owned by detElement
     if (m_associatedSurface && !m_associatedSurface->associatedDetectorElement())
       delete m_associatedSurface;
@@ -86,7 +89,7 @@ InDet::CompetingTRT_DriftCirclesOnTrack& InDet::CompetingTRT_DriftCirclesOnTrack
     } else {
       m_associatedSurface = 0;
     }
-    m_globalPosition     = compROT.m_globalPosition ? new Amg::Vector3D(*compROT.m_globalPosition) : 0;
+    if (compROT.m_globalPosition) m_globalPosition.set(std::make_unique<const Amg::Vector3D>(*compROT.m_globalPosition));
     m_ROTsHaveCommonSurface     = compROT.m_ROTsHaveCommonSurface.load();
     std::vector<const InDet::TRT_DriftCircleOnTrack*>::const_iterator rotIter = compROT.m_containedChildRots->begin();
     for (; rotIter!=compROT.m_containedChildRots->end(); ++rotIter)
@@ -97,9 +100,9 @@ InDet::CompetingTRT_DriftCirclesOnTrack& InDet::CompetingTRT_DriftCirclesOnTrack
 
 InDet::CompetingTRT_DriftCirclesOnTrack::~CompetingTRT_DriftCirclesOnTrack() {
   // delete surface if not owned by detElement
-  if (m_associatedSurface && !m_associatedSurface->associatedDetectorElement())
+  if (m_associatedSurface && !m_associatedSurface->associatedDetectorElement()) {
     delete m_associatedSurface;
-  delete m_globalPosition;
+  }
   clearChildRotVector();
   delete m_containedChildRots;
 }
@@ -118,8 +121,8 @@ MsgStream& InDet::CompetingTRT_DriftCirclesOnTrack::dump( MsgStream& out ) const
                     "over different surfaces") << "  (given prob>cut)" << std::endl;
   Trk::CompetingRIOsOnTrack::dump(out);
   out << "  - GlobalPosition        : ";
-  if (m_globalPosition==NULL) out << "null pointer"<<endmsg;
-  else out << *m_globalPosition<<endmsg;
+  if (not m_globalPosition) out << "null pointer" << endmsg;
+  else out << *m_globalPosition << endmsg;
   return out;
 }
 
@@ -131,8 +134,8 @@ std::ostream& InDet::CompetingTRT_DriftCirclesOnTrack::dump( std::ostream& out )
                     "over different surfaces") << "  (given prob>cut)" << std::endl;
   Trk::CompetingRIOsOnTrack::dump(out);
   out << "  - GlobalPosition        : ";
-  if (m_globalPosition==NULL) out << "null pointer"<<std::endl;
-  else out << *m_globalPosition<<std::endl;
+  if (not m_globalPosition) out << "null pointer" << std::endl;
+  else out << *m_globalPosition << std::endl;
   return out;
 }
 
@@ -155,8 +158,7 @@ bool InDet::CompetingTRT_DriftCirclesOnTrack::ROTsHaveCommonSurface(const bool w
 
 
 const Amg::Vector3D& InDet::CompetingTRT_DriftCirclesOnTrack::globalPosition() const {
-  auto ptr = m_globalPosition.load();
-  if (ptr) return (*ptr);
+  if (m_globalPosition) return *m_globalPosition;
   // cannot use the localToGlobal transformation, because the local z-coordinate along
   // the wire is not known here. The contained TRT_DriftCircleOnTrack use the full
   // transformation => use the weighted mean of their GlobalPositions
@@ -179,13 +181,8 @@ const Amg::Vector3D& InDet::CompetingTRT_DriftCirclesOnTrack::globalPosition() c
   } else {
     globalPos = (*m_containedChildRots->begin())->globalPosition();
   }
-  auto newptr = new Amg::Vector3D(globalPos);
-  if(m_globalPosition.compare_exchange_strong(ptr, newptr)){
-     return *newptr; //new object is now stored in m_globalPosition for other threads
-  }
-  assert(ptr != nullptr);
-  delete newptr; //Object was created on another thread, while this was running, so this is now unneeded.
-  return *ptr; //ptr was replaced with other object by compare_exchange_strong, this is now returned.
+  m_globalPosition.set(std::make_unique<const Amg::Vector3D>(globalPos));
+  return *m_globalPosition;
   
 }
 
diff --git a/InnerDetector/InDetRecEvent/InDetPrepRawData/CMakeLists.txt b/InnerDetector/InDetRecEvent/InDetPrepRawData/CMakeLists.txt
index 15f4c0a5e7ae421ff9b1dd70b66187dfb2ecf998..2149394712e477415f048a4ab7b972ccdc024c3a 100644
--- a/InnerDetector/InDetRecEvent/InDetPrepRawData/CMakeLists.txt
+++ b/InnerDetector/InDetRecEvent/InDetPrepRawData/CMakeLists.txt
@@ -8,6 +8,7 @@ atlas_subdir( InDetPrepRawData )
 # Declare the package's dependencies:
 atlas_depends_on_subdirs( PUBLIC
                           Control/AthLinks
+                          Control/CxxUtils
                           Control/SGTools
                           DetectorDescription/GeoPrimitives
                           DetectorDescription/Identifier
@@ -28,12 +29,12 @@ atlas_add_library( InDetPrepRawData
                    PUBLIC_HEADERS InDetPrepRawData
                    INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS}
                    PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${EIGEN_LIBRARIES} AthLinks SGTools GeoPrimitives Identifier EventPrimitives GaudiKernel InDetReadoutGeometry TrkSurfaces TrkEventPrimitives TrkPrepRawData
+                   LINK_LIBRARIES ${EIGEN_LIBRARIES} AthLinks CxxUtils SGTools GeoPrimitives Identifier EventPrimitives GaudiKernel InDetReadoutGeometry TrkSurfaces TrkEventPrimitives TrkPrepRawData
                    PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} )
 
 atlas_add_dictionary( InDetPrepRawDataDict
                       InDetPrepRawData/InDetPrepRawDataDict.h
                       InDetPrepRawData/selection.xml
                       INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} AthLinks SGTools GeoPrimitives Identifier EventPrimitives GaudiKernel InDetReadoutGeometry TrkSurfaces TrkEventPrimitives TrkPrepRawData InDetPrepRawData EventContainers )
+                      LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} AthLinks CxxUtils SGTools GeoPrimitives Identifier EventPrimitives GaudiKernel InDetReadoutGeometry TrkSurfaces TrkEventPrimitives TrkPrepRawData InDetPrepRawData EventContainers )
 
diff --git a/InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/SiCluster.h b/InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/SiCluster.h
index fc668b7f792dc15ea05ebeef043931a87f02bec7..a479fe3f0e118b198f5af6c96e3c4fb7fb51a7fe 100755
--- a/InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/SiCluster.h
+++ b/InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/SiCluster.h
@@ -19,12 +19,13 @@
 // Base class
 #include "TrkPrepRawData/PrepRawData.h"
 
+#include "CxxUtils/CachedUniquePtr.h"
 #include "Identifier/Identifier.h"
 #include "InDetPrepRawData/SiWidth.h"
 #include "InDetReadoutGeometry/SiDetectorElement.h" // cant be forward declared
 #include "TrkSurfaces/Surface.h"
 
-#include <atomic>
+#include <memory>
 
 class PixelClusterContainerCnv;
 class SCT_ClusterContainerCnv;
@@ -113,7 +114,7 @@ class SiCluster :   public Trk::PrepRawData {
 
 	private:
 	InDet::SiWidth m_width; //col, row, and width in mm
-	mutable std::atomic<const Amg::Vector3D*> m_globalPosition;
+	CxxUtils::CachedUniquePtr<const Amg::Vector3D> m_globalPosition;
 	bool m_gangedPixel;
 	const InDetDD::SiDetectorElement* m_detEl;
 
@@ -134,14 +135,8 @@ inline const InDet::SiWidth&  SiCluster::width() const
 // return globalPosition:
 inline const Amg::Vector3D& SiCluster::globalPosition() const
 {
-  if (m_globalPosition==nullptr) {
-    const Amg::Vector3D* expected{nullptr};
-    const Amg::Vector3D* desired{m_detEl->surface(identify()).localToGlobal(localPosition())};
-    if (not m_globalPosition.compare_exchange_strong(expected, desired)) {
-      // This happens if more than one threads try to set m_globalPosition.
-      delete desired;
-      desired = nullptr;
-    }
+  if (not m_globalPosition) {
+    m_globalPosition.set(std::unique_ptr<const Amg::Vector3D>(m_detEl->surface(identify()).localToGlobal(localPosition())));
   }
   return *m_globalPosition;
 }
diff --git a/InnerDetector/InDetRecEvent/InDetPrepRawData/src/SiCluster.cxx b/InnerDetector/InDetRecEvent/InDetPrepRawData/src/SiCluster.cxx
index 004125d0d9b63bf154de9fbdb151bea9acc2cac9..67382e4eae4a39f545af996096c4e12403d1e4c7 100755
--- a/InnerDetector/InDetRecEvent/InDetPrepRawData/src/SiCluster.cxx
+++ b/InnerDetector/InDetRecEvent/InDetPrepRawData/src/SiCluster.cxx
@@ -28,7 +28,7 @@ SiCluster::SiCluster(
         ) :
         PrepRawData(RDOId, locpos, rdoList, locErrMat), //call base class constructor
         m_width(width),
-        m_globalPosition(0),
+        m_globalPosition{},
         m_gangedPixel(0),
         m_detEl(detEl) {}
 
@@ -44,21 +44,20 @@ SiCluster::SiCluster(
                     std::move(rdoList),
                     std::move(locErrMat)), //call base class constructor
         m_width(width),
-        m_globalPosition(0),
+        m_globalPosition{},
         m_gangedPixel(0),
         m_detEl(detEl) {}
 
 // Destructor:
 SiCluster::~SiCluster()
 {
-	delete m_globalPosition;
 	// do not delete m_detEl since owned by DetectorStore
 }
 
 // Default constructor:
 SiCluster::SiCluster():
 	PrepRawData(),
-	m_globalPosition(0),
+	m_globalPosition{},
 	m_gangedPixel(0),
 	m_detEl(0)
 {}
@@ -67,34 +66,37 @@ SiCluster::SiCluster():
 SiCluster::SiCluster(const SiCluster& RIO):
 	PrepRawData( RIO ),
 	m_width( RIO.m_width ),
-	m_globalPosition( 0 ),
+	m_globalPosition{},
 	m_gangedPixel( RIO.m_gangedPixel ),
 	m_detEl( RIO.m_detEl )
 
 {
-  // copy only if it exists
-  m_globalPosition = (RIO.m_globalPosition) ? new Amg::Vector3D(*RIO.m_globalPosition) : 0;
+        // copy only if it exists
+        if (RIO.m_globalPosition) {
+                m_globalPosition.set(std::make_unique<Amg::Vector3D>(*RIO.m_globalPosition));
+        }
 }
 
 //move constructor:
 SiCluster::SiCluster(SiCluster&& RIO):
         PrepRawData( std::move(RIO) ),
 	m_width( std::move(RIO.m_width) ),
-	m_globalPosition( RIO.m_globalPosition.load() ),
+	m_globalPosition( std::move(RIO.m_globalPosition) ),
 	m_gangedPixel( RIO.m_gangedPixel ),
 	m_detEl( RIO.m_detEl )
 
 {
-  RIO.m_globalPosition = nullptr;
 }
 
 //assignment operator
 SiCluster& SiCluster::operator=(const SiCluster& RIO){
-      if (&RIO !=this) {
+       if (&RIO !=this) {
                 Trk::PrepRawData::operator= (RIO);
-		delete m_globalPosition;
 		m_width = RIO.m_width;
-		m_globalPosition = (RIO.m_globalPosition) ? new Amg::Vector3D(*RIO.m_globalPosition) : 0;
+		if (m_globalPosition) delete m_globalPosition.release().get();
+		if (RIO.m_globalPosition) {
+                        m_globalPosition.set(std::make_unique<Amg::Vector3D>(*RIO.m_globalPosition));
+                }
 		m_gangedPixel = RIO.m_gangedPixel;
 		m_detEl =  RIO.m_detEl ;
        }
@@ -105,12 +107,11 @@ SiCluster& SiCluster::operator=(const SiCluster& RIO){
 SiCluster& SiCluster::operator=(SiCluster&& RIO){
       if (&RIO !=this) {
                 Trk::PrepRawData::operator= (std::move(RIO));
-		delete m_globalPosition;
-		m_width = RIO.m_width;
-		m_globalPosition = RIO.m_globalPosition.load();
-                RIO.m_globalPosition = nullptr;
-		m_gangedPixel = RIO.m_gangedPixel;
-		m_detEl =  RIO.m_detEl ;
+                m_width = RIO.m_width;
+                if (m_globalPosition) delete m_globalPosition.release().get();
+                m_globalPosition = std::move(RIO.m_globalPosition);
+                m_gangedPixel = RIO.m_gangedPixel;
+                m_detEl =  RIO.m_detEl ;
        }
        return *this;
 } 
@@ -122,8 +123,8 @@ MsgStream& SiCluster::dump( MsgStream&    stream) const
 	// have to do a lot of annoying checking to make sure that PRD is valid. 
 	{
 		stream << "at global coordinates (x,y,z) = ("<<this->globalPosition().x()<<", "
-			<<this->globalPosition().y()<<", "
-			<<this->globalPosition().z()<<")"<<std::endl;
+                       <<this->globalPosition().y()<<", "
+                       <<this->globalPosition().z()<<")"<<std::endl;
 	}
 	
 	if ( gangedPixel()==true ) 
diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/CMakeLists.txt b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/CMakeLists.txt
index f14486e6c059075931db0334b48dbfee53c34603..c356fc192d6bc098777486ec7290288ff4af1bd6 100644
--- a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/CMakeLists.txt
+++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/CMakeLists.txt
@@ -8,6 +8,7 @@ atlas_subdir( InDetRIO_OnTrack )
 # Declare the package's dependencies:
 atlas_depends_on_subdirs( PUBLIC
                           Control/AthLinks
+                          Control/CxxUtils
                           DetectorDescription/Identifier
                           GaudiKernel
                           InnerDetector/InDetRecEvent/InDetPrepRawData
@@ -27,12 +28,12 @@ atlas_add_library( InDetRIO_OnTrack
                    src/*.cxx
                    PUBLIC_HEADERS InDetRIO_OnTrack
                    PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES AthLinks Identifier GaudiKernel InDetPrepRawData TrkEventPrimitives TrkRIO_OnTrack EventContainers EventPrimitives
+                   LINK_LIBRARIES AthLinks CxxUtils Identifier GaudiKernel InDetPrepRawData TrkEventPrimitives TrkRIO_OnTrack EventContainers EventPrimitives
                    PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} InDetReadoutGeometry TrkSurfaces )
 
 atlas_add_dictionary( InDetRIO_OnTrackDict
                       InDetRIO_OnTrack/InDetRIO_OnTrackDict.h
                       InDetRIO_OnTrack/selection.xml
                       INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} AthLinks Identifier GaudiKernel InDetPrepRawData TrkEventPrimitives TrkRIO_OnTrack InDetReadoutGeometry TrkSurfaces InDetRIO_OnTrack EventContainers EventPrimitives)
+                      LINK_LIBRARIES ${ROOT_LIBRARIES} AthLinks CxxUtils Identifier GaudiKernel InDetPrepRawData TrkEventPrimitives TrkRIO_OnTrack InDetReadoutGeometry TrkSurfaces InDetRIO_OnTrack EventContainers EventPrimitives)
 
diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/SiClusterOnTrack.h b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/SiClusterOnTrack.h
index 709cb650c9af341c673b73b72eaa46b918fcfaa8..da6123160f8bef0d128ebcfdb443d5cf8bd8b5da 100755
--- a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/SiClusterOnTrack.h
+++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/SiClusterOnTrack.h
@@ -10,10 +10,9 @@
 #define TRKRIO_ONTRACK_SICLUSTERONTRACK_H
 
 #include "TrkRIO_OnTrack/RIO_OnTrack.h"
+#include "CxxUtils/CachedUniquePtr.h"
 #include "Identifier/IdentifierHash.h"
 
-#include <atomic>
-
 class SiClusterOnTrackCnv_p1;
 
 namespace Trk 
@@ -103,7 +102,7 @@ namespace InDet {
       /** The IdentifierHash - probably not used*/
       IdentifierHash                      m_idDE;
       /** The global position */
-      mutable std::atomic<const Amg::Vector3D*> m_globalPosition; // This may be replaced by CachedUniquePtr
+      CxxUtils::CachedUniquePtr<const Amg::Vector3D> m_globalPosition;
       bool m_isbroad;
   };
 
diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/TRT_DriftCircleOnTrack.h b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/TRT_DriftCircleOnTrack.h
index 98c8522e6d5c1095087b7355c0fd52dd27cddd6f..23a148021599efe77f560aec708229928c99665a 100755
--- a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/TRT_DriftCircleOnTrack.h
+++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/TRT_DriftCircleOnTrack.h
@@ -11,9 +11,9 @@
 
 // Base classes
 #include "TrkRIO_OnTrack/RIO_OnTrack.h"
+#include "CxxUtils/CachedUniquePtr.h"
 #include "TrkEventPrimitives/DriftCircleStatus.h"
 #include "TrkEventPrimitives/DriftCircleSide.h"
-#include "GaudiKernel/GaudiException.h"
 
 // InDet
 
@@ -22,6 +22,8 @@
 #include "InDetPrepRawData/TRT_DriftCircleContainer.h"
 #include "AthLinks/ElementLink.h"
 
+#include "GaudiKernel/GaudiException.h"
+
 #include <atomic>
 
 namespace Trk {
@@ -158,7 +160,7 @@ namespace InDet{
       void setGlobalPosition(Amg::Vector3D& loc3Dframe) const;   
  
       /** global position to be cached */
-      mutable std::atomic<const Amg::Vector3D*> m_globalPosition; // This may be replaced by CachedUniquePtr
+      CxxUtils::CachedUniquePtr<const Amg::Vector3D> m_globalPosition;
       
       /**local angle to be written out */     
       mutable std::atomic<float> m_localAngle;
diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/SCT_ClusterOnTrack.cxx b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/SCT_ClusterOnTrack.cxx
index d1bcf1e158baa2c3b9de13c512a21385eaf4ca48..dfda5beff5c8be6102741774fefd4b7f0a5ead7b 100755
--- a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/SCT_ClusterOnTrack.cxx
+++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/SCT_ClusterOnTrack.cxx
@@ -90,12 +90,12 @@ void InDet::SCT_ClusterOnTrack::setValues(const Trk::TrkDetElementBase* detEl, c
 const  Amg::Vector3D& InDet::SCT_ClusterOnTrack::globalPosition() const
   {
    //checking whether the globalposition is available
-   if(!m_globalPosition)
+   if (not m_globalPosition)
    {
     
     // calculate global position from the position of the strip and the position along the strip
      Amg::Vector2D lpos( localParameters().get(Trk::locX), m_positionAlongStrip );
-     m_globalPosition = detectorElement()->surface( identify() ).localToGlobal( lpos );            
+     m_globalPosition.set(std::unique_ptr<const Amg::Vector3D>(detectorElement()->surface( identify() ).localToGlobal( lpos )));            
    }
     
    return (*m_globalPosition);
diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/SiClusterOnTrack.cxx b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/SiClusterOnTrack.cxx
index acde8bb4711cee286e9db09525dc970d84ed6435..357c703d42af0cb8f4173deb3bc911d767f48053 100755
--- a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/SiClusterOnTrack.cxx
+++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/SiClusterOnTrack.cxx
@@ -6,13 +6,14 @@
 // SiClusterOnTrack.cxx, (c) ATLAS Detector software
 ///////////////////////////////////////////////////////////////////
 
-#include <new>
 #include "InDetRIO_OnTrack/SiClusterOnTrack.h"
 #include "TrkRIO_OnTrack/RIO_OnTrack.h"
 #include "TrkEventPrimitives/LocalParameters.h"
 #include "TrkSurfaces/Surface.h"
 #include "InDetPrepRawData/SiCluster.h"
 #include "GaudiKernel/MsgStream.h"
+#include <memory>
+#include <new>
 #include <ostream>
 #include <typeinfo>
 
@@ -25,7 +26,7 @@ InDet::SiClusterOnTrack::SiClusterOnTrack( const Trk::LocalParameters& locpars,
                                            bool isbroad) : 
   RIO_OnTrack(locpars, locerr, id), //call base class constructor
   m_idDE(idDE),
-  m_globalPosition(0),
+  m_globalPosition{},
   m_isbroad(isbroad)
 {}
 
@@ -39,7 +40,7 @@ InDet::SiClusterOnTrack::SiClusterOnTrack( const Trk::LocalParameters& locpars,
     : 
     RIO_OnTrack(locpars, locerr, id), //call base class constructor
     m_idDE(idDE),
-    m_globalPosition( new Amg::Vector3D(globalPosition) ),
+    m_globalPosition(std::make_unique<Amg::Vector3D>(globalPosition)),
     m_isbroad(isbroad)
 {}
 
@@ -47,14 +48,13 @@ InDet::SiClusterOnTrack::SiClusterOnTrack( const Trk::LocalParameters& locpars,
 // Destructor:
 InDet::SiClusterOnTrack::~SiClusterOnTrack()
 { 
-  delete m_globalPosition;
 }
 
 // Default constructor:
 InDet::SiClusterOnTrack::SiClusterOnTrack():
     Trk::RIO_OnTrack(),
     m_idDE(),
-    m_globalPosition(),
+    m_globalPosition{},
     m_isbroad(false)
 {}
 
@@ -63,17 +63,23 @@ InDet::SiClusterOnTrack::SiClusterOnTrack( const SiClusterOnTrack& rot)
     :
     RIO_OnTrack(rot),
     m_idDE(rot.m_idDE),
-    m_globalPosition(rot.m_globalPosition ? new  Amg::Vector3D(*rot.m_globalPosition) : 0),
+    m_globalPosition{},
     m_isbroad(rot.m_isbroad)
-{}
+{
+  if (rot.m_globalPosition) {
+    m_globalPosition.set(std::make_unique<const Amg::Vector3D>(*(rot.m_globalPosition)));
+  }
+}
 
 // assignment operator:
 InDet::SiClusterOnTrack& InDet::SiClusterOnTrack::operator=( const SiClusterOnTrack& rot){
     if ( &rot != this) {
-       delete m_globalPosition;
-         Trk::RIO_OnTrack::operator=(rot);
+       delete m_globalPosition.release().get();
+       Trk::RIO_OnTrack::operator=(rot);
        m_idDE           = rot.m_idDE;
-       m_globalPosition = rot.m_globalPosition ? new Amg::Vector3D(*rot.m_globalPosition) : 0;
+       if (rot.m_globalPosition) {
+         m_globalPosition.set(std::make_unique<const Amg::Vector3D>(*(rot.m_globalPosition)));
+       }
        m_isbroad        = rot.m_isbroad;
     }
     return *this;
@@ -84,16 +90,10 @@ InDet::SiClusterOnTrack& InDet::SiClusterOnTrack::operator=( const SiClusterOnTr
 
 const Amg::Vector3D& InDet::SiClusterOnTrack::globalPosition() const
 { 
-  if (m_globalPosition==nullptr) {
-    const Amg::Vector3D* expected{nullptr};
-    const Amg::Vector3D* desired{associatedSurface().localToGlobal(localParameters())};
-    if (not m_globalPosition.compare_exchange_strong(expected, desired)) {
-      // This happens if more than one threads try to set m_globalPosition.
-      delete desired;
-      desired = nullptr;
-    }
+  if (not m_globalPosition) {
+    m_globalPosition.set(std::unique_ptr<const Amg::Vector3D>(associatedSurface().localToGlobal(localParameters())));
   }
- return (*m_globalPosition);
+  return (*m_globalPosition);
 }
 
 MsgStream& InDet::SiClusterOnTrack::dump( MsgStream& sl ) const
@@ -104,7 +104,7 @@ MsgStream& InDet::SiClusterOnTrack::dump( MsgStream& sl ) const
 
     sl << "Global position (x,y,z) = (";
     this->globalPosition();
-    if ( m_globalPosition !=0 )
+    if (m_globalPosition)
     {
        sl  <<this->globalPosition().x()<<", "
                <<this->globalPosition().y()<<", "
@@ -124,7 +124,7 @@ std::ostream& InDet::SiClusterOnTrack::dump( std::ostream& sl ) const
 
     sl << "Global position (x,y,z) = (";
     this->globalPosition();
-    if ( m_globalPosition !=0 )
+    if (m_globalPosition)
     {
         sl  <<this->globalPosition().x()<<", "
             <<this->globalPosition().y()<<", "
diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/TRT_DriftCircleOnTrack.cxx b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/TRT_DriftCircleOnTrack.cxx
index f1875eb771ecb5e1c27ec7db4acee58844c9a201..f4ecaafff05d6b1e5d850b4e8dddfdd0148bdb67 100755
--- a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/TRT_DriftCircleOnTrack.cxx
+++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/TRT_DriftCircleOnTrack.cxx
@@ -13,11 +13,14 @@
 #include "TrkEventPrimitives/LocalParameters.h"
 #include "TrkSurfaces/Surface.h"
 #include "TrkSurfaces/StraightLineSurface.h"
-#include <cassert>
+
 #include "GaudiKernel/MsgStream.h"
-#include <ostream>
-#include <limits>
 
+#include <cassert>
+#include <limits>
+#include <memory>
+#include <ostream>
+#include <utility>
 
 // Constructor with parameters:
 InDet::TRT_DriftCircleOnTrack::TRT_DriftCircleOnTrack( 
@@ -30,7 +33,7 @@ InDet::TRT_DriftCircleOnTrack::TRT_DriftCircleOnTrack(
     const Trk::DriftCircleStatus status)
 	:
   Trk::RIO_OnTrack(driftRadius, errDriftRadius, RIO->identify()), //call base class constructor
-  m_globalPosition(0), 
+  m_globalPosition{},
   m_positionAlongWire(predictedLocZ),
   m_idDE(idDE),
   m_status(status),
@@ -40,7 +43,7 @@ InDet::TRT_DriftCircleOnTrack::TRT_DriftCircleOnTrack(
 {
   m_rio.setElement(RIO);
   const Trk::StraightLineSurface* slsf = dynamic_cast<const Trk::StraightLineSurface*>(&(m_detEl->surface(RIO->identify())));
-  if(slsf) m_globalPosition = slsf->localToGlobal(driftRadius, predictedTrackDirection, predictedLocZ);
+  if (slsf) m_globalPosition.set(std::unique_ptr<const Amg::Vector3D>(slsf->localToGlobal(driftRadius, predictedTrackDirection, predictedLocZ)));
   Amg::Vector3D  loc_gDirection = predictedTrackDirection; 
   const double dr = driftRadius[Trk::driftRadius];
   //scaling the direction with drift radius   
@@ -52,13 +55,13 @@ InDet::TRT_DriftCircleOnTrack::TRT_DriftCircleOnTrack(
 
 // Destructor:
 InDet::TRT_DriftCircleOnTrack::~TRT_DriftCircleOnTrack()
-{ delete m_globalPosition; }
+{}
 
 // default constructor:
 InDet::TRT_DriftCircleOnTrack::TRT_DriftCircleOnTrack()
 	:
   Trk::RIO_OnTrack(),
-  m_globalPosition(0),
+  m_globalPosition{},
   m_localAngle(std::numeric_limits<float>::quiet_NaN()),
   m_positionAlongWire(std::numeric_limits<float>::quiet_NaN()),
   m_rio(),
@@ -81,7 +84,7 @@ InDet::TRT_DriftCircleOnTrack::TRT_DriftCircleOnTrack
      bool highLevel,
      double timeOverThreshold)
      : Trk::RIO_OnTrack (driftRadius, errDriftRadius, id),
-       m_globalPosition(nullptr),
+       m_globalPosition{},
        m_localAngle(localAngle),
        m_positionAlongWire(predictedLocZ),
        m_rio(RIO),
@@ -96,7 +99,7 @@ InDet::TRT_DriftCircleOnTrack::TRT_DriftCircleOnTrack
 //copy constructor:
 InDet::TRT_DriftCircleOnTrack::TRT_DriftCircleOnTrack( const InDet::TRT_DriftCircleOnTrack& rot):
 	Trk::RIO_OnTrack(rot),
-  m_globalPosition(rot.m_globalPosition ? new Amg::Vector3D(*rot.m_globalPosition.load()) : 0 ),
+  m_globalPosition{},
   m_localAngle(rot.m_localAngle.load()),
   m_positionAlongWire(rot.m_positionAlongWire.load()),
   m_rio(rot.m_rio),
@@ -105,15 +108,21 @@ InDet::TRT_DriftCircleOnTrack::TRT_DriftCircleOnTrack( const InDet::TRT_DriftCir
   m_highLevel(rot.m_highLevel),
   m_timeOverThreshold(rot.m_timeOverThreshold),
   m_detEl(rot.m_detEl)
-{}
+{
+  if (rot.m_globalPosition) {
+    m_globalPosition.set(std::make_unique<const Amg::Vector3D>(*(rot.m_globalPosition)));
+  }
+}
 
 //assignment operator:
 InDet::TRT_DriftCircleOnTrack& InDet::TRT_DriftCircleOnTrack::operator=( const InDet::TRT_DriftCircleOnTrack& rot)
 { 
   if ( &rot != this) {
     Trk::RIO_OnTrack::operator= (rot);
-    delete m_globalPosition;
-    m_globalPosition        = (rot.m_globalPosition ? new Amg::Vector3D(*rot.m_globalPosition) : 0);
+    if (m_globalPosition) delete m_globalPosition.release().get();
+    if (rot.m_globalPosition) {
+      m_globalPosition.set(std::make_unique<const Amg::Vector3D>(*(rot.m_globalPosition)));
+    }
     m_rio                   = rot.m_rio;
     m_localAngle            = rot.m_localAngle.load();
     m_positionAlongWire     = rot.m_positionAlongWire.load();
@@ -131,8 +140,8 @@ InDet::TRT_DriftCircleOnTrack& InDet::TRT_DriftCircleOnTrack::operator=( InDet::
 { 
   if ( &rot != this) {
     Trk::RIO_OnTrack::operator= (rot);
-    delete m_globalPosition;
-    m_globalPosition        = rot.m_globalPosition.load();
+    if (m_globalPosition) delete m_globalPosition.release().get();
+    m_globalPosition        = std::move(rot.m_globalPosition);
     m_rio                   = rot.m_rio;
     m_localAngle            = rot.m_localAngle.load();
     m_positionAlongWire     = rot.m_positionAlongWire.load();
@@ -161,15 +170,7 @@ const Trk::Surface& InDet::TRT_DriftCircleOnTrack::associatedSurface() const
 void InDet::TRT_DriftCircleOnTrack::setGlobalPosition(Amg::Vector3D& loc3Dframe) const{
    const Trk::StraightLineSurface* slsf = dynamic_cast<const Trk::StraightLineSurface*>( &(associatedSurface()) );
    if(slsf) {
-     delete m_globalPosition;
-     m_globalPosition = nullptr;
-     const Amg::Vector3D* expected{nullptr};
-     const Amg::Vector3D* desired{new Amg::Vector3D(slsf->transform() * loc3Dframe)};
-     if (not m_globalPosition.compare_exchange_strong(expected, desired)) {
-       // This happens if more than one threads try to set m_globalPosition.
-       delete desired;
-       desired = nullptr;
-     }
+     m_globalPosition.set(std::make_unique<Amg::Vector3D>(slsf->transform() * loc3Dframe));
    }else{
     throw GaudiException("Dynamic_cast to StraightLineSurface failed!",             
                     	 "TRT_DriftCircleOnTrack::setGlobalPosition()", 
@@ -184,7 +185,7 @@ void InDet::TRT_DriftCircleOnTrack::setValues(const Trk::TrkDetElementBase* detE
 
 const Amg::Vector3D& InDet::TRT_DriftCircleOnTrack::globalPosition() const { 
   
-   if (!m_globalPosition)
+   if (not m_globalPosition)
    { 
 
     if (side()==Trk::NONE) 
@@ -241,7 +242,7 @@ std::ostream& InDet::TRT_DriftCircleOnTrack::dump( std::ostream& sl ) const
 
     sl << "Global position (x,y,z) = (";
     this->globalPosition();
-    if ( m_globalPosition !=0 )
+    if (m_globalPosition)
     {
         sl  <<this->globalPosition().x()<<", "
             <<this->globalPosition().y()<<", "
diff --git a/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/src/CompetingPixelClustersOnTrackTool.cxx b/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/src/CompetingPixelClustersOnTrackTool.cxx
index 8e8da7b4e95730c2d782b5d36fa2e766a0c5bb70..39b1e0c85a8af549c057229b6196c1d371042f7a 100755
--- a/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/src/CompetingPixelClustersOnTrackTool.cxx
+++ b/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/src/CompetingPixelClustersOnTrackTool.cxx
@@ -391,8 +391,9 @@ void InDet::CompetingPixelClustersOnTrackTool::updateCompetingROT(
     // update maximum assign prob index:
     compROT->m_indexMaxAssignProb = maximumAssignProbIndex;
     // delete global position (will be recreated by the competingROT itself)
-    delete compROT->m_globalPosition;
-    compROT->m_globalPosition = 0; // very important, otherwise segfault...
+    if (compROT->m_globalPosition) {
+        delete compROT->m_globalPosition.release().get();
+    }
     compROT->setLocalParametersAndErrorMatrix();
     if (msgLvl(MSG::DEBUG)) testCompetingROT(*compROT);
 }
@@ -543,8 +544,9 @@ StatusCode InDet::CompetingPixelClustersOnTrackTool::updateCompetingROTprobs(
     } // end for loop 
     compROT->m_assignProb = assgnProbVector; 
     // delete global position (will be recreated by the competingROT itself) 
-    delete compROT->m_globalPosition; 
-    compROT->m_globalPosition = 0; // very important, otherwise segfault... 
+    if (compROT->m_globalPosition) {
+        delete compROT->m_globalPosition.release().get();
+    }
     // recalc localParameters 
     compROT->setLocalParametersAndErrorMatrix();
 
diff --git a/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/src/CompetingSCT_ClustersOnTrackTool.cxx b/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/src/CompetingSCT_ClustersOnTrackTool.cxx
index 4c03a8418bc6d48d45a33d17ea59a4222caf5ebf..4490984037a3db021dc30e057acdbdcde09f053f 100755
--- a/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/src/CompetingSCT_ClustersOnTrackTool.cxx
+++ b/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/src/CompetingSCT_ClustersOnTrackTool.cxx
@@ -386,8 +386,9 @@ void InDet::CompetingSCT_ClustersOnTrackTool::updateCompetingROT(
     // update maximum assign prob index:
     compROT->m_indexMaxAssignProb = maximumAssignProbIndex;
     // delete global position (will be recreated by the competingROT itself)
-    delete compROT->m_globalPosition;
-    compROT->m_globalPosition = 0; // very important, otherwise segfault...
+    if (compROT->m_globalPosition) {
+        delete compROT->m_globalPosition.release().get();
+    }
     // delete localParameters
     compROT->setLocalParametersAndErrorMatrix();
     if (msgLvl(MSG::VERBOSE)) testCompetingROT(*compROT);
@@ -539,8 +540,9 @@ StatusCode InDet::CompetingSCT_ClustersOnTrackTool::updateCompetingROTprobs(
     } // end for loop 
     compROT->m_assignProb = assgnProbVector; 
     // delete global position (will be recreated by the competingROT itself) 
-    delete compROT->m_globalPosition; 
-    compROT->m_globalPosition = 0; // very important, otherwise segfault... 
+    if (compROT->m_globalPosition) {
+        delete compROT->m_globalPosition.release().get(); 
+    }
     // recalc localParameters 
     compROT->setLocalParametersAndErrorMatrix();
     if (msgLvl(MSG::DEBUG)) testCompetingROT(*compROT); 
diff --git a/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/src/CompetingTRT_DriftCirclesOnTrackTool.cxx b/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/src/CompetingTRT_DriftCirclesOnTrackTool.cxx
index 8be554aff34ad7ad3cad53084ad5c6919022b7bd..19e04cf777bbce85c35c785d6330978dcce556bb 100755
--- a/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/src/CompetingTRT_DriftCirclesOnTrackTool.cxx
+++ b/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/src/CompetingTRT_DriftCirclesOnTrackTool.cxx
@@ -718,8 +718,9 @@ void InDet::CompetingTRT_DriftCirclesOnTrackTool::updateCompetingROT(
         delete compROT->m_associatedSurface;
     compROT->m_associatedSurface=assocSurface;
     // delete global position (will be recreated in competingROT itself
-    delete compROT->m_globalPosition;
-    compROT->m_globalPosition = 0; // very important otherwise segfault in destructor...
+    if (compROT->m_globalPosition) {
+        delete compROT->m_globalPosition.release().get();
+    }
     //calling CompetingTRT_DriftCirclesOnTrack::setLocalParametersAndErrorMatrix() does not work here!
     // have to set the effective measurement and error matrix directly:
     //const_cast<InDet::CompetingTRT_DriftCirclesOnTrack*>(compROT)->setLocalParametersAndErrorMatrix();
diff --git a/InnerDetector/InDetValidation/InDetGeometryValidation/share/ReadSiDetectorElements_jobOptions.py b/InnerDetector/InDetValidation/InDetGeometryValidation/share/ReadSiDetectorElements_jobOptions.py
index b6702d3e9111310b70b2cf0816463923f175fbb2..74951c2704b5408c137f1d2e9c0617c88f593389 100644
--- a/InnerDetector/InDetValidation/InDetGeometryValidation/share/ReadSiDetectorElements_jobOptions.py
+++ b/InnerDetector/InDetValidation/InDetGeometryValidation/share/ReadSiDetectorElements_jobOptions.py
@@ -68,7 +68,7 @@ from SiPropertiesTool.PixelSiPropertiesToolSetup import PixelSiPropertiesToolSet
 pixelSiPropertiesToolSetup = PixelSiPropertiesToolSetup()
 pixelSiPropertiesToolSetup.setup()
 pixelSiPropertiesTool = pixelSiPropertiesToolSetup.getTool()
-from SiLorentzAngleSvc.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup
+from SiLorentzAngleTool.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup
 pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup()
 pixelLorentzAngleTool = pixelLorentzAngleToolSetup.PixelLorentzAngleTool
 
@@ -81,7 +81,7 @@ ReadPixelElements.SiConditionsTool   = pixelDCSConditionsTool
 # SCT
 #
 # Silicon Lorentz angle tool
-from SiLorentzAngleSvc.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
+from SiLorentzAngleTool.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
 sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup()
 sctLorentzAngleTool = sctLorentzAngleToolSetup.SCTLorentzAngleTool
 sctSiliconConditionsTool = sctLorentzAngleToolSetup.sctSiliconConditionsTool
diff --git a/LArCalorimeter/LArCalibUtils/python/LArHVScaleConfig.py b/LArCalorimeter/LArCalibUtils/python/LArHVScaleConfig.py
new file mode 100644
index 0000000000000000000000000000000000000000..fbe52c53e4564898296da689e8021e61578e9ea0
--- /dev/null
+++ b/LArCalorimeter/LArCalibUtils/python/LArHVScaleConfig.py
@@ -0,0 +1,80 @@
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+
+def LArHVScaleCfg(configFlags):
+    result=ComponentAccumulator()
+
+    if configFlags.Input.isMC:
+        result.merge(addFolders(configFlags,["/LAR/IdentifierOfl/HVLineToElectrodeMap<tag>LARHVLineToElectrodeMap-001</tag>"], "LAR_OFL", className="AthenaAttributeList"))
+
+    elif not configFlags.Common.isOnline:
+        from IOVDbSvc.IOVDbSvcConfig import addFolders, IOVDbSvcCfg
+        result.mergeAll(IOVDbSvcCfg(configFlags))
+        result.merge(addFolders(configFlags,["/LAR/DCS/HV/BARREl/I16"], "DCS_OFL", className="CondAttrListCollection"))
+        result.merge(addFolders(configFlags,["/LAR/DCS/HV/BARREL/I8"],  "DCS_OFL", className="CondAttrListCollection"))
+
+        result.merge(addFolders(configFlags,["/LAR/IdentifierOfl/HVLineToElectrodeMap"], "LAR_OFL", className="AthenaAttributeList"))
+        result.merge(addFolders(configFlags,["/LAR/HVPathologiesOfl/Pathologies"], "LAR_OFL", className="AthenaAttributeList"))
+
+        result.merge(addFolders(configFlags,["/LAR/ElecCalibFlat/HVScaleCorr"],"LAR_ONL", className="CondAttrListCollection"))
+
+        from LArBadChannelTool.LArBadChannelConfig import LArBadChannelCfg, LArBadFebCfg
+        result.merge(LArBadChannelCfg(configFlags))
+        result.merge(LArBadFebCfg(configFlags))
+
+        from LArRecUtils.LArRecUtilsConf import LArHVIdMappingAlg
+        hvmapalg = LArHVIdMappingAlg(ReadKey="/LAR/IdentifierOfl/HVLineToElectrodeMap",WriteKey="LArHVIdMap")
+        result.addCondAlgo(hvmapalg)
+
+        from LArRecUtils.LArRecUtilsConf import LArHVPathologyDbCondAlg
+        hvpath = LArHVPathologyDbCondAlg(PathologyFolder="/LAR/HVPathologiesOfl/Pathologies",
+                                         HVMappingKey="LArHVIdMap",
+                                         HVPAthologyKey="LArHVPathology")
+        result.addCondAlgo(hvpath)
+
+        from LArRecUtils.LArRecUtilsConf import LArHVCondAlg
+        hvcond = LArHVCondAlg("LArHVPathologyAlg",HVPathologies="LArHVPathology",OutputHVData="LArHVData")
+        result.addCondAlgo(hvcond)
+
+        from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArHVScaleCorrFlat_ as LArHVScaleCorrFlat
+        hvscaleflat = LArHVScaleCorrFlat("LArHVScaleCorrFlat",
+                                         ReadKey="/LAR/ElecCalibFlat/HVScaleCorr",
+                                         WriteKey='LArHVScaleCorr')
+        result.addCondAlgo(hvscaleflat)
+
+        from LArRecUtils.LArRecUtilsConf import LArHVScaleCorrCondAlg
+        hvscalecorrkey = "LArHVScaleCorrRecomputed"
+        if configFlags.Input.isMC:
+            hvscalecorrkey = "LArHVScaleCorr"
+
+        hvscale = LArHVScaleCorrCondAlg(keyHVdata="LArHVData",keyOutputCorr=hvscalecorrkey)
+        hvscale.UndoOnlineHVCorr=True
+        result.addCondAlgo(hvscale)
+
+    return result
+
+if __name__=="__main__":
+    from AthenaCommon.Configurable import Configurable
+    Configurable.configurableRun3Behavior=1
+    from AthenaConfiguration.AllConfigFlags import ConfigFlags
+
+    nThreads=1
+    ConfigFlags.Concurrency.NumThreads = nThreads
+    if nThreads>0:
+        ConfigFlags.Scheduler.ShowDataDeps = True
+        ConfigFlags.Scheduler.ShowDataFlow = True
+        ConfigFlags.Scheduler.ShowControlFlow = True
+        ConfigFlags.Concurrency.NumConcurrentEvents = nThreads
+
+    ConfigFlags.Input.Files = ["myESD-data.pool.root"]
+    ConfigFlags.lock()
+
+    from AthenaConfiguration.MainServicesConfig import MainServicesSerialCfg
+    from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
+    cfg=MainServicesSerialCfg()
+    cfg.merge(PoolReadCfg(ConfigFlags))
+
+    cfg.merge( LArHVScaleCfg(ConfigFlags) )
+
+    cfg.run(10)
diff --git a/LArCalorimeter/LArCalibUtils/src/LArHVCorrMaker.cxx b/LArCalorimeter/LArCalibUtils/src/LArHVCorrMaker.cxx
index 2fc0708ce896c10113c4bac27711d1d1e7c04bfa..2fe8f589b5bdf8cf73e09152afed23aaa62e2d6c 100755
--- a/LArCalorimeter/LArCalibUtils/src/LArHVCorrMaker.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArHVCorrMaker.cxx
@@ -14,8 +14,9 @@
 LArHVCorrMaker::LArHVCorrMaker(const std::string& name, ISvcLocator* pSvcLocator) 
   : AthAlgorithm(name, pSvcLocator),
     m_lar_on_id(0),
-    m_hvCorrTool("LArHVCorrTool")
+    m_hvCorrTool("LArHVCorrTool",this)
 {
+  declareProperty("HVCorrTool", m_hvCorrTool);
 }
 
 //---------------------------------------------------------------------------
diff --git a/LArCalorimeter/LArRecUtils/share/LArFCalTowerBuilderTool.ref b/LArCalorimeter/LArRecUtils/share/LArFCalTowerBuilderTool.ref
index f34b7e7551f47055e81379d0e21a4b943a842ac1..75bbc81bbf53a6c650ea41d97ca17732098b8867 100644
--- a/LArCalorimeter/LArRecUtils/share/LArFCalTowerBuilderTool.ref
+++ b/LArCalorimeter/LArRecUtils/share/LArFCalTowerBuilderTool.ref
@@ -1,14 +1,14 @@
-Thu Dec  6 05:33:31 CET 2018
+Mon Mar 11 15:46:25 CET 2019
 Preloading tcmalloc_minimal.so
 Py:Athena            INFO including file "AthenaCommon/Preparation.py"
-Py:Athena            INFO using release [AthenaWorkDir-22.0.1] [x86_64-slc6-gcc62-opt] [atlas-work3/fa0fd6d0989] -- built on [2018-12-06T0504]
+Py:Athena            INFO using release [WorkDir-22.0.1] [x86_64-centos7-gcc8-opt] [atlas-work3/27168cb1091] -- built on [2019-03-11T1355]
 Py:Athena            INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Py:Athena            INFO executing ROOT6Setup
 Py:Athena            INFO including file "AthenaCommon/Execution.py"
 Py:Athena            INFO including file "LArRecUtils/LArFCalTowerBuilderTool_test.py"
 SetGeometryVersion.py obtained major release version 22
 Py:Athena            INFO including file "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py"
-Py:ConfigurableDb    INFO Read module info for 5473 configurables from 53 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5462 configurables from 44 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 EventInfoMgtInit: Got release version  Athena-22.0.1
 Py:IOVDbSvc.CondDB    INFO Setting up conditions DB access to instance OFLP200
@@ -18,20 +18,19 @@ Py:Athena            INFO including file "CaloConditions/LArTTCellMap_ATLAS_jobO
 Py:Athena            INFO including file "CaloConditions/CaloTTIdMap_ATLAS_jobOptions.py"
 Py:Athena            INFO including file "TileIdCnv/TileIdCnv_jobOptions.py"
 Py:Athena            INFO including file "AthenaCommon/runbatch.py"
-[?1034hApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0
+ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0
 ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v30r5)
-                                          running on lxplus077.cern.ch on Thu Dec  6 05:33:48 2018
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
+                                          running on lxplus046.cern.ch on Mon Mar 11 15:46:42 2019
 ====================================================================================================================================
-ApplicationMgr       INFO Successfully loaded modules : AthenaServices
 ApplicationMgr       INFO Application Manager Configured successfully
 ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0
 StatusCodeSvc        INFO initialize
 AthDictLoaderSvc     INFO in initialize...
 AthDictLoaderSvc     INFO acquired Dso-registry
-ClassIDSvc           INFO  getRegistryEntries: read 3219 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3440 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO install f-a-t-a-l handler... (flag = -1)
 CoreDumpSvc          INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) 
 MetaDataSvc          INFO Initializing MetaDataSvc - package version AthenaServices-00-00-00
@@ -40,8 +39,8 @@ PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.x
 PoolSvc              INFO Set connectionsvc retry/timeout/IDLE timeout to  'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled
 PoolSvc              INFO Frontier compression level set to 5
 DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy-wigner.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
-DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-12-04T2300/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host lxplus077.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-03-10T2143/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host lxplus046.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc              INFO Setting up APR FileCatalog and Streams
 PoolSvc           WARNING Unable to locate catalog for prfile:poolcond/PoolCat_oflcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables
@@ -50,6 +49,7 @@ PoolSvc              INFO Resolved path (via ATLAS_POOLCOND_PATH) is /cvmfs/atla
 PoolSvc              INFO POOL WriteCatalog is xmlcatalog_file:PoolFileCatalog.xml
 DbSession            INFO     Open     DbSession    
 Domain[ROOT_All]     INFO >   Access   DbDomain     READ      [ROOT_All] 
+MetaDataSvc          INFO Found MetaDataTools = PublicToolHandleArray([])
 IOVDbSvc             INFO Opened read transaction for POOL PersistencySvc
 IOVDbSvc             INFO Only 5 POOL conditions files will be open at once
 IOVDbSvc             INFO Cache alignment will be done in 3 slices
@@ -70,7 +70,7 @@ IOVDbSvc             INFO Added taginfo remove for /CALO/Ofl/Identifier/CaloTTOn
 IOVDbSvc             INFO Added taginfo remove for /CALO/Ofl/Identifier/CaloTTPpmRxIdMapAtlas
 IOVDbSvc             INFO Added taginfo remove for /LAR/LArCellPositionShift
 IOVDbSvc             INFO Added taginfo remove for /LAR/Identifier/LArTTCellMapAtlas
-ClassIDSvc           INFO  getRegistryEntries: read 2134 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 2094 CLIDRegistry entries for module ALL
 ClassIDSvc           INFO  getRegistryEntries: read 17 CLIDRegistry entries for module ALL
 ClassIDSvc           INFO  getRegistryEntries: read 18 CLIDRegistry entries for module ALL
 DetDescrCnvSvc       INFO  initializing 
@@ -125,7 +125,7 @@ BarrelConstruction   INFO   Use sagging in geometry  ? 0
   multi-layered version of absorbers activated, mlabs == 1
 ================================================
 EventPersistenc...   INFO Added successfully Conversion service:DetDescrCnvSvc
-ClassIDSvc           INFO  getRegistryEntries: read 5819 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 5624 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a TileTBID helper object in the detector store
 IdDictDetDescrCnv    INFO in initialize
 IdDictDetDescrCnv    INFO in createObj: creating a IdDictManager object in the detector store
@@ -164,7 +164,7 @@ TileDddbManager      INFO n_tileSwitches = 1
 ClassIDSvc           INFO  getRegistryEntries: read 213 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a TileID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-12-04T2300/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/TileNeighbour_reduced.txt
+TileNeighbour        INFO Reading file  /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-centos7-gcc8-opt/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
 TileHWIDDetDesc...   INFO in createObj: creating a TileHWID helper object in the detector store
 TileHWID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -176,21 +176,23 @@ CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_ID helper object in th
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-12-04T2300/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/FCal2DNeighbors-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-12-04T2300/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/FCal3DNeighborsNext-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-12-04T2300/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/FCal3DNeighborsPrev-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-centos7-gcc8-opt/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-centos7-gcc8-opt/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-centos7-gcc8-opt/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
 CaloIDHelper_ID...   INFO in createObj: creating a LArMiniFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 LArMiniFCAL_ID       INFO  initialize_from_dict - LArCalorimeter dictionary does NOT contain miniFCAL description. Unable to initialize LArMiniFCAL_ID.
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 TileDetDescrMan...   INFO Entering create_elements()
-ClassIDSvc           INFO  getRegistryEntries: read 65 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 66 CLIDRegistry entries for module ALL
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
 CondInputLoader      INFO Initializing CondInputLoader...
 CondInputLoader      INFO Adding base classes:
 CondInputLoader      INFO Will create WriteCondHandle dependencies for the following DataObjects:
-ClassIDSvc           INFO  getRegistryEntries: read 8831 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 7104 CLIDRegistry entries for module ALL
+CaloMgrDetDescrCnv   INFO in createObj: creating a Calo Detector Manager object in the detector store
 CaloIdMgrDetDes...   INFO in createObj: creating a CaloDescrManager object in the detector store
+ClassIDSvc           INFO  getRegistryEntries: read 161 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a CaloDM_ID helper object in the detector store
 CaloDM_ID            INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -207,12 +209,12 @@ CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper ob
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-12-04T2300/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-12-04T2300/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-12-04T2300/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-centos7-gcc8-opt/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-centos7-gcc8-opt/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-centos7-gcc8-opt/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
 CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-12-04T2300/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/TileSuperCellNeighbour.txt
+TileNeighbour        INFO Reading file  /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-centos7-gcc8-opt/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIdMgrDetDes...   INFO  Finished 
 CaloIdMgrDetDes...   INFO Initializing CaloIdMgr from values in CaloIdMgrDetDescrCnv 
@@ -232,7 +234,6 @@ IOVDbSvc             INFO Disconnecting from COOLOFL_LAR/OFLP200
 Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] 06C9EAE8-6F5B-E011-BAAA-003048F0E7AC
 Domain[ROOT_All]     INFO                           /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0002.pool.root
 RootDatabase.open    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0002.pool.root File version:52200
-CaloMgrDetDescrCnv   INFO in createObj: creating a Calo Detector Manager object in the detector store
 Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A
 Domain[ROOT_All]     INFO                           /cvmfs/atlas-condb.cern.ch/repo/conditions/cond08/cond08_mc.000003.gen.COND/cond08_mc.000003.gen.COND._0064.pool.root
 RootDatabase.open    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond08/cond08_mc.000003.gen.COND/cond08_mc.000003.gen.COND._0064.pool.root File version:52200
@@ -6640,7 +6641,6 @@ towers
 6398 100 63 0 
 6399 100 64 0 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #1, run #1 1 events processed so far  <<<===
-MetaDataSvc          INFO MetaDataSvc::stop()
 /cvmfs/atlas-co...   INFO Database being retired...
 Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] 06C9EAE8-6F5B-E011-BAAA-003048F0E7AC
 /cvmfs/atlas-co...   INFO Database being retired...
@@ -6651,25 +6651,25 @@ IncidentProcAlg1     INFO Finalize
 CondInputLoader      INFO Finalizing CondInputLoader...
 IncidentProcAlg2     INFO Finalize
 IdDictDetDescrCnv    INFO in finalize
-IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 1/1 objs/chan/bytes 1/1/170 ((     0.14 ))s
+IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 1/1 objs/chan/bytes 1/1/170 ((     1.14 ))s
 IOVDbFolder          INFO Folder /CALO/Ofl/Identifier/CaloTTOnAttrIdMapAtlas (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 ((     0.00 ))s
 IOVDbFolder          INFO Folder /CALO/Ofl/Identifier/CaloTTOnOffIdMapAtlas (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 ((     0.00 ))s
 IOVDbFolder          INFO Folder /CALO/Ofl/Identifier/CaloTTPpmRxIdMapAtlas (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 ((     0.00 ))s
-IOVDbFolder          INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 1/1 objs/chan/bytes 1/1/195 ((     0.03 ))s
-IOVDbFolder          INFO Folder /LAR/Identifier/LArTTCellMapAtlas (PoolRef) db-read 1/0 objs/chan/bytes 1/1/173 ((     0.02 ))s
+IOVDbFolder          INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 1/1 objs/chan/bytes 1/1/195 ((     0.76 ))s
+IOVDbFolder          INFO Folder /LAR/Identifier/LArTTCellMapAtlas (PoolRef) db-read 1/0 objs/chan/bytes 1/1/173 ((     0.89 ))s
 IOVDbFolder       WARNING Folder /LAR/Identifier/LArTTCellMapAtlas is requested but no data retrieved
-IOVDbSvc             INFO  bytes in ((      0.19 ))s
+IOVDbSvc             INFO  bytes in ((      2.79 ))s
 IOVDbSvc             INFO Connection sqlite://;schema=mycool.db;dbname=OFLP200 : nConnect: 0 nFolders: 0 ReadTime: ((     0.00 ))s
-IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 2 nFolders: 3 ReadTime: ((     0.19 ))s
+IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 2 nFolders: 3 ReadTime: ((     2.79 ))s
 IOVDbSvc             INFO Connection COOLOFL_CALO/OFLP200 : nConnect: 1 nFolders: 3 ReadTime: ((     0.00 ))s
 AthDictLoaderSvc     INFO in finalize...
 ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
-cObjR_ALL            INFO Time User   : Tot=  480 [ms] Ave/Min/Max=  240(+-  230)/   10/  470 [ms] #=  2
-cObj_ALL             INFO Time User   : Tot= 0.58  [s] Ave/Min/Max= 0.29(+- 0.25)/ 0.04/ 0.54  [s] #=  2
-ChronoStatSvc        INFO Time User   : Tot= 3.84  [s]                                             #=  1
+cObjR_ALL            INFO Time User   : Tot=  450 [ms] Ave/Min/Max=  225(+-  215)/   10/  440 [ms] #=  2
+cObj_ALL             INFO Time User   : Tot= 0.52  [s] Ave/Min/Max= 0.26(+- 0.23)/ 0.03/ 0.49  [s] #=  2
+ChronoStatSvc        INFO Time User   : Tot= 2.71  [s]                                             #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/LArCalorimeter/LArRecUtils/src/LArAutoCorrNoiseTool.h b/LArCalorimeter/LArRecUtils/src/LArAutoCorrNoiseTool.h
index 479f407611a1e95a44eb45cce4f80c20ca761805..2b772f17eb6ebe12bcbd787d218f32381deb3d2c 100644
--- a/LArCalorimeter/LArRecUtils/src/LArAutoCorrNoiseTool.h
+++ b/LArCalorimeter/LArRecUtils/src/LArAutoCorrNoiseTool.h
@@ -31,7 +31,6 @@
 #include "LArElecCalib/ILArMCSymTool.h"
 #include "LArIdentifier/LArOnlineID.h"
 #include "LArIdentifier/LArOnline_SuperCellID.h"
-#include "CaloIdentifier/CaloIdManager.h"
 #include "CaloIdentifier/LArID.h"
 #include "GaudiKernel/IIncidentListener.h"
 #include "AthenaPoolUtilities/CondAttrListCollection.h"
diff --git a/LArCalorimeter/LArRecUtils/src/LArAutoCorrTotalTool.cxx b/LArCalorimeter/LArRecUtils/src/LArAutoCorrTotalTool.cxx
index 2c81adb18e3621283b498780d16bb603d4eb6305..56088671e7f1eb0320d4877d5704f1d8add24fad 100644
--- a/LArCalorimeter/LArRecUtils/src/LArAutoCorrTotalTool.cxx
+++ b/LArCalorimeter/LArRecUtils/src/LArAutoCorrTotalTool.cxx
@@ -8,6 +8,7 @@
 #include "LArIdentifier/LArOnlineID.h"
 #include "LArIdentifier/LArOnline_SuperCellID.h"
 #include "LArCabling/LArCablingLegacyService.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 #include <cmath>
 
 /////////////////////////////////////////////////////////////////////////////
@@ -23,7 +24,6 @@ LArAutoCorrTotalTool::LArAutoCorrTotalTool(const std::string& type,
     m_lar_on_id(nullptr),
     m_cablingService(nullptr),
     m_larmcsym("LArMCSymTool"),m_adc2mevTool("LArADC2MeVTool"),
-    m_calo_id_man(nullptr),
     m_lar_em_id(nullptr),
     m_lar_hec_id(nullptr),
     m_lar_fcal_id(nullptr),
@@ -77,16 +77,17 @@ StatusCode LArAutoCorrTotalTool::initialize()
   }
 
   //retrieves helpers for LArCalorimeter
-  m_calo_id_man  = CaloIdManager::instance();
+  const CaloCell_Base_ID* idHelper = nullptr;
   if ( m_isSC ) {
-    m_lar_em_id   = m_calo_id_man->getEM_SuperCell_ID();
-    m_lar_hec_id  = m_calo_id_man->getHEC_SuperCell_ID();
-    m_lar_fcal_id = m_calo_id_man->getFCAL_SuperCell_ID();
-  }  else  {
-    m_lar_em_id   = m_calo_id_man->getEM_ID();
-    m_lar_hec_id  = m_calo_id_man->getHEC_ID();
-    m_lar_fcal_id = m_calo_id_man->getFCAL_ID();
-  }  
+    ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_SuperCell_ID") );
+  }
+  else {
+    ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  }
+
+  m_lar_em_id   = idHelper->em_idHelper();
+  m_lar_hec_id  = idHelper->hec_idHelper();
+  m_lar_fcal_id = idHelper->fcal_idHelper();
   
 
 
diff --git a/LArCalorimeter/LArRecUtils/src/LArAutoCorrTotalTool.h b/LArCalorimeter/LArRecUtils/src/LArAutoCorrTotalTool.h
index c633bc200cb7ab2dd1f849d563f06a880ca7516b..3c099b7f676b801a026e16522a10f4c5756ad019 100644
--- a/LArCalorimeter/LArRecUtils/src/LArAutoCorrTotalTool.h
+++ b/LArCalorimeter/LArRecUtils/src/LArAutoCorrTotalTool.h
@@ -36,7 +36,6 @@
 #include "StoreGate/DataHandle.h"
 #include "LArElecCalib/ILArMCSymTool.h"
 #include "LArIdentifier/LArOnlineID.h"
-#include "CaloIdentifier/CaloIdManager.h"
 #include "CaloIdentifier/LArID.h"
 #include "GaudiKernel/IIncidentListener.h"
 
@@ -104,7 +103,6 @@ class LArAutoCorrTotalTool: public AthAlgTool,
   ToolHandle<ILArMCSymTool>     m_larmcsym;
   ToolHandle<ILArADC2MeVTool>   m_adc2mevTool;
   
-  const CaloIdManager* m_calo_id_man;
   const LArEM_Base_ID*    m_lar_em_id; 
   const LArHEC_Base_ID*   m_lar_hec_id;
   const LArFCAL_Base_ID*  m_lar_fcal_id;
diff --git a/LArCalorimeter/LArRecUtils/src/LArCellFakeProbElectronics.cxx b/LArCalorimeter/LArRecUtils/src/LArCellFakeProbElectronics.cxx
index a57a496306f4ec640e7118f7d96e6d4f57e5a220..af68292c7f044327cf787ab2f09e489dc67e3705 100644
--- a/LArCalorimeter/LArRecUtils/src/LArCellFakeProbElectronics.cxx
+++ b/LArCalorimeter/LArRecUtils/src/LArCellFakeProbElectronics.cxx
@@ -18,7 +18,6 @@ PURPOSE:  Scales down the energy of cells due to simulated
 #include "LArCellFakeProbElectronics.h"
 
 #include "CaloEvent/CaloCellContainer.h"
-#include "CaloIdentifier/CaloIdManager.h"
 #include "CaloIdentifier/CaloCell_ID.h"
 #include "CaloDetDescr/CaloDetDescrManager.h"
 #include "LArCabling/LArCablingLegacyService.h"
@@ -77,12 +76,10 @@ double  LArCellFakeProbElectronics::wtCell(const CaloCell * theCell ) const
 
 
   // get calo id helper
-  const CaloCell_ID* idHelper = CaloIdManager::instance()->getCaloCell_ID();
-  if ( idHelper == 0 )
-    {
-      ATH_MSG_ERROR( "cannot allocate CaloCell_ID helper!" );
-      return 1;
-    }
+  const CaloCell_ID* idHelper = nullptr;
+  if (detStore()->retrieve (idHelper, "CaloCell_ID").isFailure()) {
+    return 1;
+  }
   
   HWIdentifier id;
   try{
diff --git a/LArCalorimeter/LArRecUtils/src/LArFCalTowerBuilderTool.cxx b/LArCalorimeter/LArRecUtils/src/LArFCalTowerBuilderTool.cxx
index cc6edfaa6f19ec41cca4246ce8fd5e054618c825..04e29ec37bcb96312efc889bb15dead58a8e9ece 100644
--- a/LArCalorimeter/LArRecUtils/src/LArFCalTowerBuilderTool.cxx
+++ b/LArCalorimeter/LArRecUtils/src/LArFCalTowerBuilderTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 
@@ -7,8 +7,8 @@
 #include "LArFCalTowerStore.h"
 
 #include "CaloIdentifier/CaloCell_ID.h"
-#include "CaloIdentifier/CaloIdManager.h"
 #include "CaloIdentifier/LArFCAL_ID.h"
+#include "CaloDetDescr/CaloDetDescrManager.h"
 
 #include "CaloUtils/CaloTowerBuilderToolBase.h"
 
@@ -28,11 +28,12 @@ LArFCalTowerBuilderTool::LArFCalTowerBuilderTool(const std::string& name,
 						 const IInterface* parent)
   : CaloTowerBuilderToolBase(name,type,parent)
     , m_minEt(0.)
+    , m_cellIdHelper(nullptr)
+    , m_larFCalId(nullptr)
+    , m_theManager(nullptr)
 {
   // Et cut for minicells
   declareProperty("MinimumEt",m_minEt);
-  m_larFCalId = (CaloIdManager::instance())->getFCAL_ID();
-  // initialize intermediate store
 }
 
 LArFCalTowerBuilderTool::~LArFCalTowerBuilderTool(){
@@ -43,6 +44,11 @@ LArFCalTowerBuilderTool::~LArFCalTowerBuilderTool(){
 /////////////////////////////
 
 StatusCode LArFCalTowerBuilderTool::initializeTool(){
+  ATH_CHECK( detStore()->retrieve (m_cellIdHelper, "CaloCell_ID") );
+  m_larFCalId = m_cellIdHelper->fcal_idHelper();
+
+  ATH_CHECK( detStore()->retrieve (m_theManager, "CaloMgr") );
+
   // ignore other input!
   ATH_MSG_INFO( "CaloTowerBuilder for the FCal initiated"  );
 
@@ -191,7 +197,10 @@ void  LArFCalTowerBuilderTool::handle(const Incident&)
 StatusCode LArFCalTowerBuilderTool::rebuildLookup()
 {
   CaloTowerContainer theTowers (towerSeg());
-  if ( m_cellStore.buildLookUp(&theTowers) ) {
+  if ( m_cellStore.buildLookUp(*m_cellIdHelper,
+                               *m_theManager,
+                               &theTowers) )
+  {
     return StatusCode::SUCCESS;
   }
   return StatusCode::FAILURE;
diff --git a/LArCalorimeter/LArRecUtils/src/LArFCalTowerBuilderTool.h b/LArCalorimeter/LArRecUtils/src/LArFCalTowerBuilderTool.h
index d4a2987695160b7b1c6cacc9003d40f614daa6e5..8702d99873f1a323721bbce489de85cb044e7285 100644
--- a/LArCalorimeter/LArRecUtils/src/LArFCalTowerBuilderTool.h
+++ b/LArCalorimeter/LArRecUtils/src/LArFCalTowerBuilderTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef LARCLUSTERREC_LARFCALTOWERBUILDERTOOL_H
@@ -28,6 +28,7 @@ class LArFCalTowerStore;
 
 class CaloTowerContainer;
 class CaloTower;
+class CaloDetDescrManager;
 
 class LArFCAL_ID;
 
@@ -96,7 +97,9 @@ private:
   // FCal only
   static CaloCell_ID::SUBCALO m_caloIndex;
 
+  const CaloCell_ID* m_cellIdHelper;
   const LArFCAL_ID* m_larFCalId;
+  const CaloDetDescrManager* m_theManager;
 
   LArFCalTowerStore m_cellStore;
 };
diff --git a/LArCalorimeter/LArRecUtils/src/LArFCalTowerStore.cxx b/LArCalorimeter/LArRecUtils/src/LArFCalTowerStore.cxx
index 35cde60f2d59b5bb411941050a30dfcd2a5e376d..1b849095818946d7dd157f30b9a8740ed96315e0 100644
--- a/LArCalorimeter/LArRecUtils/src/LArFCalTowerStore.cxx
+++ b/LArCalorimeter/LArRecUtils/src/LArFCalTowerStore.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /********************************************************************
@@ -20,8 +20,7 @@ Updated:
 // include header files
 #include "Identifier/IdentifierHash.h"
 
-#include "CaloIdentifier/CaloIdManager.h"
-//#include "CaloIdentifier/CaloCell_ID.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 #include "CaloIdentifier/LArFCAL_ID.h"
 
 #include "CaloDetDescr/CaloDetDescrManager.h"
@@ -65,7 +64,9 @@ LArFCalTowerStore::~LArFCalTowerStore(){
 // Build LookUp Table //
 ////////////////////////
 
-bool LArFCalTowerStore::buildLookUp(CaloTowerContainer* theTowers)
+bool LArFCalTowerStore::buildLookUp(const CaloCell_ID& cellIdHelper,
+                                    const CaloDetDescrManager& theManager,
+                                    CaloTowerContainer* theTowers)
 {
   ///////////////////////
   // Store Preparation //
@@ -80,19 +81,11 @@ bool LArFCalTowerStore::buildLookUp(CaloTowerContainer* theTowers)
   MsgStream msg(theMsgSvc,"LArFCalTowerStore");
   
   // get cell id helper
-  const CaloCell_ID* cellIdHelper = (CaloIdManager::instance())->getCaloCell_ID();
-  const LArFCAL_ID* fcalIdHelper = (CaloIdManager::instance())->getFCAL_ID();
-
-  // get cell description manager
-  const CaloDetDescrManager* theManager = CaloDetDescrManager::instance();
-  if ( ! theManager->isInitialized() ){
-      msg << MSG::ERROR<< "CaloDetDescrManager is not initialized, module unusable!" << endmsg;
-      return false;
-    }
+  const LArFCAL_ID& fcalIdHelper = *cellIdHelper.fcal_idHelper();
 
   // find numerical ranges
   IdentifierHash firstIndex, lastIndex;
-  cellIdHelper->calo_cell_hash_range((int)CaloCell_ID::LARFCAL, firstIndex, lastIndex);
+  cellIdHelper.calo_cell_hash_range((int)CaloCell_ID::LARFCAL, firstIndex, lastIndex);
   m_indxOffset = (size_t)firstIndex;
   m_indxBound  = (size_t)lastIndex;
 
@@ -138,7 +131,7 @@ bool LArFCalTowerStore::buildLookUp(CaloTowerContainer* theTowers)
 	  //std::cout<<"cell:"<<anIndex<<std::endl;
       
 	  // get cell geometry
-      const CaloDetDescrElement* theElement = theManager->get_element(cellIndex);
+      const CaloDetDescrElement* theElement = theManager.get_element(cellIndex);
       if (!theElement) {
         msg << MSG::ERROR<< "Can't find element for index " << cellIndex
             << endmsg;
@@ -151,7 +144,7 @@ bool LArFCalTowerStore::buildLookUp(CaloTowerContainer* theTowers)
       double dyCell = theElement->dy();
 
       // get cell logical location
-      int thisModule = fcalIdHelper->module(theElement->identify());
+      int thisModule = fcalIdHelper.module(theElement->identify());
       // get cell splitting
       thisModule--;
       double theXBin   = dxCell / (double)m_ndxFCal[thisModule];
diff --git a/LArCalorimeter/LArRecUtils/src/LArFCalTowerStore.h b/LArCalorimeter/LArRecUtils/src/LArFCalTowerStore.h
index 089b24b54e92160a6ba5d960dc53736aa9fd7b1d..f54ab5ab29028b1511582ec7925e7893f6bea782 100644
--- a/LArCalorimeter/LArRecUtils/src/LArFCalTowerStore.h
+++ b/LArCalorimeter/LArRecUtils/src/LArFCalTowerStore.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef LARRECUTILS_LARFCALTOWERSTORE_H
@@ -32,6 +32,8 @@ PACKAGE:  offline/LArCalorimeter/LArClusterRec
 #include <map>
 #include <vector>
 
+class CaloDetDescrManager;
+
 class LArFCalTowerStore
 {
  public:
@@ -70,7 +72,9 @@ class LArFCalTowerStore
   unsigned int towerSize(tower_iterator t) const  {return t->size();}
   
   /// \brief setup trigger
-  bool buildLookUp(CaloTowerContainer* theTowers);
+  bool buildLookUp(const CaloCell_ID& cellIdHelper,
+                   const CaloDetDescrManager& theManager,
+                   CaloTowerContainer* theTowers);
 
   /// \brief size of internal data store
   size_t size() const { return m_TTCmatrix.size(); }
diff --git a/LArCalorimeter/LArRecUtils/src/LArHVCondAlg.cxx b/LArCalorimeter/LArRecUtils/src/LArHVCondAlg.cxx
index 56284850ad2ed0465d156d7ab188e647de8c7566..5c45c9d1954356224cdc7c28c18190748fa96e81 100755
--- a/LArCalorimeter/LArRecUtils/src/LArHVCondAlg.cxx
+++ b/LArCalorimeter/LArRecUtils/src/LArHVCondAlg.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "./LArHVCondAlg.h" 
@@ -12,7 +12,7 @@
 #include "CaloIdentifier/LArEM_ID.h"
 #include "CaloIdentifier/LArHEC_ID.h"
 #include "CaloIdentifier/LArFCAL_ID.h"
-#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 #include "CaloDetDescr/CaloDetDescrManager.h"
 #include "LArReadoutGeometry/EMBCell.h"
 #include "LArHV/LArHVManager.h"
@@ -62,6 +62,7 @@
 // constructor 
 LArHVCondAlg::LArHVCondAlg( const std::string& name, ISvcLocator* pSvcLocator )
   : AthReentrantAlgorithm(name,pSvcLocator),
+    m_calodetdescrmgr(nullptr),
     m_larem_id(nullptr),
     m_larhec_id(nullptr),
     m_larfcal_id(nullptr),
@@ -81,11 +82,12 @@ LArHVCondAlg::~LArHVCondAlg()
 
 //initialize
 StatusCode LArHVCondAlg::initialize(){
-  ATH_CHECK(detStore()->retrieve(m_caloIdMgr));
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
 
-  m_larem_id   = m_caloIdMgr->getEM_ID();
-  m_larhec_id   = m_caloIdMgr->getHEC_ID();
-  m_larfcal_id   = m_caloIdMgr->getFCAL_ID();
+  m_larem_id   = idHelper->em_idHelper();
+  m_larhec_id   = idHelper->hec_idHelper();
+  m_larfcal_id   = idHelper->fcal_idHelper();
 
   ATH_CHECK(detStore()->retrieve(m_calodetdescrmgr));
 
diff --git a/LArCalorimeter/LArRecUtils/src/LArHVCondAlg.h b/LArCalorimeter/LArRecUtils/src/LArHVCondAlg.h
index b69427da2f8386b3d278b4c1a96c1d3aaeb7eb0b..a05c11389962bdc8f4743af0538680cdc55a0615 100755
--- a/LArCalorimeter/LArRecUtils/src/LArHVCondAlg.h
+++ b/LArCalorimeter/LArRecUtils/src/LArHVCondAlg.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /**
@@ -36,7 +36,6 @@ class AthenaAttributeList;
 class LArEM_ID;
 class LArHEC_ID;
 class LArFCAL_ID;
-class CaloIdManager;
 class CaloDetDescrManager;
 class Identifier;
 class LArElectrodeID;
@@ -77,8 +76,7 @@ class LArHVCondAlg: public AthReentrantAlgorithm
 
   // other members:
   
-  const DataHandle<CaloIdManager> m_caloIdMgr;
-  const DataHandle<CaloDetDescrManager> m_calodetdescrmgr;
+  const CaloDetDescrManager* m_calodetdescrmgr;
   const LArEM_ID* m_larem_id;
   const LArHEC_ID* m_larhec_id;
   const LArFCAL_ID* m_larfcal_id;
diff --git a/LArCalorimeter/LArRecUtils/src/LArHVCorrTool.cxx b/LArCalorimeter/LArRecUtils/src/LArHVCorrTool.cxx
index c09f3e35d5393b0385bd885a7a66032c2c7adc5e..f16d01686a8a0c13f29d1d442606bdbc095cefa3 100644
--- a/LArCalorimeter/LArRecUtils/src/LArHVCorrTool.cxx
+++ b/LArCalorimeter/LArRecUtils/src/LArHVCorrTool.cxx
@@ -28,18 +28,19 @@ LArHVCorrTool::LArHVCorrTool(const std::string& type,
 			     const IInterface* parent) 
   : 
     AthAlgTool(type, name, parent),
-    m_lar_on_id(NULL), 	    
-    m_calocell_id(NULL),	
-    m_larem_id(NULL),
-    m_larhec_id(NULL),
-    m_larfcal_id(NULL),	
-    m_electrodeID(NULL),
+    m_lar_on_id(nullptr), 	    
+    m_calocell_id(nullptr),	
+    m_larem_id(nullptr),
+    m_larhec_id(nullptr),
+    m_larfcal_id(nullptr),	
+    m_electrodeID(nullptr),
+    m_calodetdescrmgr(nullptr),
     m_cablingService("LArCablingLegacyService"),
-    m_hvtool("LArHVToolMC")
+    m_hvtool("LArHVToolMC",this)
 {
   declareInterface<ILArHVCorrTool>(this);
 
-  m_Tdrift = NULL;
+  m_Tdrift = nullptr;
   m_ownScale = true;
   m_keyOutput = "LArHVScaleCorr";
   m_keyOutputTd = "LArTdrift";
@@ -73,64 +74,22 @@ LArHVCorrTool::~LArHVCorrTool() {
 StatusCode LArHVCorrTool::initialize() {
   ATH_MSG_DEBUG("LArHVCorrTool initialize() begin");
   
-  StatusCode sc = detStore()->retrieve(m_lar_on_id,"LArOnlineID");
-  if (sc.isFailure()) {
-    msg(MSG::ERROR) << "Unable to retrieve  LArOnlineID from DetectorStore" << endmsg;
-    return StatusCode::FAILURE;
-  }
-
-  sc=detStore()->retrieve(m_calocell_id,"CaloCell_ID");
-  if (sc.isFailure()) {
-    msg(MSG::ERROR) << "Unable to retrieve  CaloCellID from DetectorStore" << endmsg;
-    return StatusCode::FAILURE;
-  }
-// retrieve LArEM id helper
-
-  sc = detStore()->retrieve( m_caloIdMgr );
-  if (sc.isFailure()) {
-   msg(MSG::ERROR) << "Unable to retrieve CaloIdMgr " << endmsg;
-   return sc;
-  }
-
-  m_larem_id   = m_caloIdMgr->getEM_ID();
-  m_larhec_id   = m_caloIdMgr->getHEC_ID();
-  m_larfcal_id   = m_caloIdMgr->getFCAL_ID();
+  ATH_CHECK( detStore()->retrieve(m_lar_on_id,"LArOnlineID") );
+  ATH_CHECK( detStore()->retrieve(m_calocell_id,"CaloCell_ID") );
 
-  if(m_cablingService.retrieve().isFailure()){
-    msg(MSG::ERROR) << "Unable to get CablingService " << endmsg;
-    return StatusCode::FAILURE;
-  }
+  m_larem_id   = m_calocell_id->em_idHelper();
+  m_larhec_id   = m_calocell_id->hec_idHelper();
+  m_larfcal_id   = m_calocell_id->fcal_idHelper();
 
-  sc = detStore()->retrieve(m_calodetdescrmgr);                
-  if (sc.isFailure()) {
-    msg(MSG::ERROR) << "Unable to get CaloDetDescrManager" << endmsg;
-    return StatusCode::FAILURE;                              
-  } 
+  ATH_CHECK( m_cablingService.retrieve() );
+  ATH_CHECK( detStore()->retrieve(m_calodetdescrmgr) );
+  ATH_CHECK( detStore()->retrieve(m_electrodeID) );
+  ATH_CHECK( m_hvtool.retrieve() );
 
+  ATH_CHECK( detStore()->regFcn(&ILArHVTool::LoadCalibration,dynamic_cast<ILArHVTool*>(&(*m_hvtool)),
+                                &ILArHVCorrTool::LoadCalibration,dynamic_cast<ILArHVCorrTool*>(this)) );
 
-  sc=detStore()->retrieve(m_electrodeID);
-  if (sc.isFailure()) {
-    msg(MSG::ERROR) << "Unable to get LArElectrodeID helper" << endmsg;
-    return sc;
-  }
-
-  if (m_hvtool.retrieve().isFailure()) {
-    msg(MSG::ERROR) << "Unable to find tool for LArHVTool" << endmsg; 
-    return StatusCode::FAILURE;
-  }
-
-  sc = detStore()->regFcn(&ILArHVTool::LoadCalibration,dynamic_cast<ILArHVTool*>(&(*m_hvtool)),
-			  &ILArHVCorrTool::LoadCalibration,dynamic_cast<ILArHVCorrTool*>(this));
-  if (sc.isFailure()) {
-    msg(MSG::ERROR) << "canot register callback " << endmsg;
-    return sc;
-  }
-
-  sc = this->buildFixHVList();
-  if (sc.isFailure()) {
-    msg(MSG::ERROR) << " cannot build list to fix HV corrections " << endmsg; 
-    return StatusCode::FAILURE;
-  }
+  ATH_CHECK( this->buildFixHVList() );
 
   //Initialize hash-ranges
   //FIXME: Hardcoded numbers are not ideal
@@ -254,7 +213,7 @@ StatusCode LArHVCorrTool::finalize()
 // *** compute global ADC2MeV factor from subfactors *** 
 StatusCode LArHVCorrTool::getScale(const HASHRANGEVEC& hashranges) const {
   
-  if (m_doTdrift && m_Tdrift==NULL) {
+  if (m_doTdrift && m_Tdrift==nullptr) {
     m_Tdrift = new LArTdriftComplete();
     if( (m_Tdrift->setGroupingType("ExtendedSubDetector",msg())).isFailure()) {
       msg(MSG::ERROR) << " cannot setGroupingType " << endmsg;
diff --git a/LArCalorimeter/LArRecUtils/src/LArHVCorrTool.h b/LArCalorimeter/LArRecUtils/src/LArHVCorrTool.h
index bce0b2ae3ca17dd22ce1b9fed9d2e53977b50a06..608689b6a4acd806924f504abb1f16427e14dbe3 100644
--- a/LArCalorimeter/LArRecUtils/src/LArHVCorrTool.h
+++ b/LArCalorimeter/LArRecUtils/src/LArHVCorrTool.h
@@ -17,7 +17,6 @@
 #include "StoreGate/DataHandle.h"
 #include "LArCabling/LArCablingLegacyService.h"
 #include "LArIdentifier/LArOnlineID.h"
-#include "CaloIdentifier/CaloIdManager.h"
 #include "CaloIdentifier/LArID.h"
 #include "CaloDetDescr/CaloDetDescrManager.h"
 
@@ -70,8 +69,7 @@ class LArHVCorrTool: public AthAlgTool,
   const LArHEC_ID*      m_larhec_id;	
   const LArFCAL_ID*     m_larfcal_id;	
   const LArElectrodeID* m_electrodeID;  
-  const DataHandle<CaloIdManager> m_caloIdMgr;
-  const DataHandle<CaloDetDescrManager> m_calodetdescrmgr;
+  const CaloDetDescrManager* m_calodetdescrmgr;
 
   ToolHandle<LArCablingLegacyService>  m_cablingService;  
   ToolHandle<ILArHVTool> m_hvtool;
diff --git a/LArCalorimeter/LArRecUtils/src/LArHVPathologyDbCondAlg.cxx b/LArCalorimeter/LArRecUtils/src/LArHVPathologyDbCondAlg.cxx
index f04294614960bd9512edcede9ce5a6f9d8d4e533..d3eb7dedd5f033cfceef1f1899eece0d93c39e03 100755
--- a/LArCalorimeter/LArRecUtils/src/LArHVPathologyDbCondAlg.cxx
+++ b/LArCalorimeter/LArRecUtils/src/LArHVPathologyDbCondAlg.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "LArHVPathologyDbCondAlg.h" 
@@ -14,7 +14,7 @@
 #include "CoralBase/Blob.h"
 
 #include "CaloDetDescr/CaloDetDescrManager.h"
-#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 #include "CaloIdentifier/LArEM_ID.h"
 #include "CaloIdentifier/LArHEC_ID.h"
 #include "CaloIdentifier/LArFCAL_ID.h"
@@ -41,29 +41,15 @@ StatusCode LArHVPathologyDbCondAlg::initialize()
   ATH_CHECK(m_hvMappingKey.initialize());
   ATH_CHECK(m_hvPAthologyKey.initialize());
   
-  StatusCode sc = detStore()->retrieve( m_caloIdMgr );
-  if (sc.isFailure()) {
-   ATH_MSG_ERROR( "Unable to retrieve CaloIdMgr ");
-   return sc;
-  }
-
-  m_larem_id   = m_caloIdMgr->getEM_ID();
-  m_larhec_id   = m_caloIdMgr->getHEC_ID();
-  m_larfcal_id   = m_caloIdMgr->getFCAL_ID();
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
 
-//  retrieve CaloDetDescrMgr 
-  sc = detStore()->retrieve(m_calodetdescrmgr);
-  if (sc.isFailure()) {
-     ATH_MSG_ERROR("Unable to retrieve CaloDetDescrMgr ");
-     return sc;
-  }
-
-  sc = detStore()->retrieve(m_laronline_id,"LArOnlineID");
-  if (sc.isFailure()) {
-     ATH_MSG_ERROR("Unable to retrieve  LArOnlineID from DetectorStore");
-     return sc;
-  }
+  m_larem_id   = idHelper->em_idHelper();
+  m_larhec_id   = idHelper->hec_idHelper();
+  m_larfcal_id   = idHelper->fcal_idHelper();
 
+  ATH_CHECK( detStore()->retrieve (m_calodetdescrmgr, "CaloMgr") );
+  ATH_CHECK( detStore()->retrieve(m_laronline_id,"LArOnlineID") );
   ATH_CHECK(detStore()->retrieve(m_hvlineHelper,"LArHVLineID"));
 
   return StatusCode::SUCCESS;
diff --git a/LArCalorimeter/LArRecUtils/src/LArHVPathologyDbCondAlg.h b/LArCalorimeter/LArRecUtils/src/LArHVPathologyDbCondAlg.h
index 95c034f44fff15a33dc3e4113eeb82cbb67b4f40..c5bce4d3e10338275cb601db782c12cb028f265c 100755
--- a/LArCalorimeter/LArRecUtils/src/LArHVPathologyDbCondAlg.h
+++ b/LArCalorimeter/LArRecUtils/src/LArHVPathologyDbCondAlg.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef LARHVPATHOLOGYDBCONDALG
@@ -17,7 +17,6 @@ class LArEM_ID;
 class LArHEC_ID;
 class LArFCAL_ID;
 class LArOnlineID;
-class CaloIdManager;
 class CaloDetDescrManager;
 class LArHVLineID;
 class Identifier;
@@ -41,8 +40,7 @@ class LArHVPathologyDbCondAlg: public AthReentrantAlgorithm
   SG::ReadCondHandleKey<LArHVIdMapping> m_hvMappingKey {this, "HVMappingKey", "LArHVIdMap", "Key for mapping object" };
   SG::WriteCondHandleKey<LArHVPathology> m_hvPAthologyKey {this, "HVPAthologyKey", "LArHVPathology", "Key for HV pathologies in Cond. store"};
 
-  const DataHandle<CaloIdManager> m_caloIdMgr;
-  const DataHandle<CaloDetDescrManager> m_calodetdescrmgr;
+  const CaloDetDescrManager* m_calodetdescrmgr;
   const LArEM_ID*       m_larem_id;
   const LArHEC_ID*       m_larhec_id;
   const LArFCAL_ID*       m_larfcal_id;
diff --git a/LArCalorimeter/LArRecUtils/src/LArHVScaleCorrCondAlg.cxx b/LArCalorimeter/LArRecUtils/src/LArHVScaleCorrCondAlg.cxx
index 7c4b510f4224ea32988ccf6240251ae6caa05aef..825822bd62c862b13ae6c5b0bab7a6654143d7e7 100644
--- a/LArCalorimeter/LArRecUtils/src/LArHVScaleCorrCondAlg.cxx
+++ b/LArCalorimeter/LArRecUtils/src/LArHVScaleCorrCondAlg.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "LArHVScaleCorrCondAlg.h"
@@ -30,7 +30,8 @@ LArHVScaleCorrCondAlg::LArHVScaleCorrCondAlg(const std::string& name, ISvcLocato
     m_larem_id(nullptr),
     m_larhec_id(nullptr),
     m_larfcal_id(nullptr),	
-    m_electrodeID(nullptr)
+    m_electrodeID(nullptr),
+    m_calodetdescrmgr(nullptr)
 {
 
   m_deltatupdate = 0;
@@ -56,11 +57,10 @@ StatusCode LArHVScaleCorrCondAlg::initialize() {
   // retrieve id helpers
   ATH_CHECK(detStore()->retrieve(m_lar_on_id,"LArOnlineID"));
   ATH_CHECK(detStore()->retrieve(m_calocell_id,"CaloCell_ID"));
-  ATH_CHECK(detStore()->retrieve( m_caloIdMgr ));
 
-  m_larem_id   = m_caloIdMgr->getEM_ID();
-  m_larhec_id   = m_caloIdMgr->getHEC_ID();
-  m_larfcal_id   = m_caloIdMgr->getFCAL_ID();
+  m_larem_id   = m_calocell_id->em_idHelper();
+  m_larhec_id   = m_calocell_id->hec_idHelper();
+  m_larfcal_id   = m_calocell_id->fcal_idHelper();
 
   ATH_CHECK(detStore()->retrieve(m_calodetdescrmgr));
 
diff --git a/LArCalorimeter/LArRecUtils/src/LArHVScaleCorrCondAlg.h b/LArCalorimeter/LArRecUtils/src/LArHVScaleCorrCondAlg.h
index 0e31884e91051b2ebfb37a6f41023f166ded3092..da4f21cfba5cedccf1cab6c066b7e7e1584c575c 100644
--- a/LArCalorimeter/LArRecUtils/src/LArHVScaleCorrCondAlg.h
+++ b/LArCalorimeter/LArRecUtils/src/LArHVScaleCorrCondAlg.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 // Rewritten from LArHVScaleCorrTool
 
@@ -15,7 +15,6 @@
 #include "StoreGate/WriteCondHandleKey.h"
 
 #include "LArIdentifier/LArOnlineID.h"
-#include "CaloIdentifier/CaloIdManager.h"
 #include "CaloIdentifier/LArID.h"
 #include "CaloDetDescr/CaloDetDescrManager.h"
 #include "LArRecConditions/LArHVData.h"
@@ -53,8 +52,7 @@ class LArHVScaleCorrCondAlg: public AthAlgorithm
   const LArHEC_ID*      m_larhec_id;	
   const LArFCAL_ID*     m_larfcal_id;	
   const LArElectrodeID* m_electrodeID;  
-  const DataHandle<CaloIdManager> m_caloIdMgr;
-  const DataHandle<CaloDetDescrManager> m_calodetdescrmgr;
+  const CaloDetDescrManager* m_calodetdescrmgr;
 
   SG::ReadCondHandleKey<LArOnOffIdMapping>  m_cablingKey {this,"keyCabling", "LArOnOffIdMap", "Input key for Id mapping"} ;  
   SG::ReadCondHandleKey<LArHVData> m_hvKey {this, "keyHVdata", "LArHVData", "Input key for HV data from DCS"};
diff --git a/LArCalorimeter/LArRecUtils/src/LArOFCTool.cxx b/LArCalorimeter/LArRecUtils/src/LArOFCTool.cxx
index dd212ff648a45ab33a257c2ba94cc72c594fed19..f880811e76349f8a270feb72aa3c893a278f72f0 100644
--- a/LArCalorimeter/LArRecUtils/src/LArOFCTool.cxx
+++ b/LArCalorimeter/LArRecUtils/src/LArOFCTool.cxx
@@ -31,7 +31,6 @@ LArOFCTool::LArOFCTool(const std::string& type,
     m_lar_on_id(nullptr),
     m_cablingService(nullptr),
     m_larmcsym("LArMCSymTool"),
-    m_calo_id_man(nullptr),
     m_lar_em_id(nullptr),
     m_lar_hec_id(nullptr),
     m_lar_fcal_id(nullptr),
@@ -83,16 +82,18 @@ StatusCode LArOFCTool::initialize()
   }
 
   //retrieves helpers for LArCalorimeter
-  m_calo_id_man  = CaloIdManager::instance();
+  const CaloCell_Base_ID* idHelper = nullptr;
   if ( m_isSC ) {
-  m_lar_em_id   = m_calo_id_man->getEM_SuperCell_ID();
-  m_lar_hec_id  = m_calo_id_man->getHEC_SuperCell_ID();
-  m_lar_fcal_id = m_calo_id_man->getFCAL_SuperCell_ID();
-  }  else  {
-  m_lar_em_id   = m_calo_id_man->getEM_ID();
-  m_lar_hec_id  = m_calo_id_man->getHEC_ID();
-  m_lar_fcal_id = m_calo_id_man->getFCAL_ID();
+    ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_SuperCell_ID") );
   }
+  else {
+    ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  }
+
+  m_lar_em_id   = idHelper->em_idHelper();
+  m_lar_hec_id  = idHelper->hec_idHelper();
+  m_lar_fcal_id = idHelper->fcal_idHelper();
+
   IToolSvc* toolSvc = nullptr;
   ATH_CHECK(  service( "ToolSvc",toolSvc ) );
   if ( m_isSC ) {
diff --git a/LArCalorimeter/LArRecUtils/src/LArOFCTool.h b/LArCalorimeter/LArRecUtils/src/LArOFCTool.h
index 92f5e8f80733ade780962ecceb0d4f61adba539c..0698de4b3fe64d3f5f92d4b627543a08b5138f75 100644
--- a/LArCalorimeter/LArRecUtils/src/LArOFCTool.h
+++ b/LArCalorimeter/LArRecUtils/src/LArOFCTool.h
@@ -42,7 +42,6 @@
 #include "LArCabling/LArCablingBase.h"
 #include "LArElecCalib/ILArMCSymTool.h"
 #include "LArIdentifier/LArOnlineID_Base.h"
-#include "CaloIdentifier/CaloIdManager.h"
 #include "CaloIdentifier/LArID.h"
 
 class StoreGateSvc; 
@@ -101,7 +100,6 @@ class LArOFCTool: public AthAlgTool,
   LArCablingBase* m_cablingService;
   ToolHandle<ILArMCSymTool>    m_larmcsym;
   
-  const CaloIdManager* m_calo_id_man;
   const LArEM_Base_ID*    m_lar_em_id; 
   const LArHEC_Base_ID*   m_lar_hec_id;
   const LArFCAL_Base_ID*  m_lar_fcal_id;
diff --git a/LArCalorimeter/LArRecUtils/src/MakeLArCellFromRaw.cxx b/LArCalorimeter/LArRecUtils/src/MakeLArCellFromRaw.cxx
index ee6788a58d11ad72d57d1b15591581e508707bce..c20397cb439e890b3a1bd1461188f69379e2ac54 100644
--- a/LArCalorimeter/LArRecUtils/src/MakeLArCellFromRaw.cxx
+++ b/LArCalorimeter/LArRecUtils/src/MakeLArCellFromRaw.cxx
@@ -11,7 +11,6 @@
 #include "CaloDetDescr/CaloDetDescrManager.h"
 #include "CaloDetDescr/CaloDetDescrElement.h"
 #include "CaloIdentifier/CaloCell_ID.h"
-#include "CaloIdentifier/CaloIdManager.h"
 #include "CaloIdentifier/LArEM_ID.h"
 #include "CaloIdentifier/LArHEC_ID.h"
 #include "CaloIdentifier/LArFCAL_ID.h"
@@ -55,7 +54,7 @@ void MakeLArCellFromRaw::initialize( const LArRoI_Map* roiMap ,
   StatusCode sc = svcLoc->service("MessageSvc", m_msgSvc);
   if (sc.isFailure())
   {
-     std::cout << "MakeLArCellFromRaw ERROR cannot retrieve MessageSvc " << std::endl;
+    std::cout << "MakeLArCellFromRaw ERROR cannot retrieve MessageSvc " << std::endl;
     return;
   }
 
@@ -66,7 +65,19 @@ void MakeLArCellFromRaw::initialize( const LArRoI_Map* roiMap ,
   if(pCorr) log <<MSG::INFO <<" Number of Corrections "<< pCorr->size()<< endmsg ;
   
 
-  const CaloDetDescrManager* man = CaloDetDescrManager::instance();
+  StoreGateSvc* detStore = nullptr;
+  sc = svcLoc->service("DetectorStore", detStore);
+  if (sc.isFailure())
+  {
+    log << MSG::ERROR << "MakeLArCellFromRaw ERROR cannot retrieve DetectorStore " << endmsg;
+    return;
+  }
+
+  const CaloDetDescrManager* man = nullptr;
+  if ( detStore->retrieve (man, "CaloMgr").isFailure() ) {
+    log << MSG::ERROR << "MakeLArCellFromRaw ERROR cannot retrieve CaloMgr " << endmsg;
+    return;
+  }
 
   IToolSvc* p_toolSvc;
   StatusCode status = svcLoc->service( "ToolSvc",p_toolSvc );
@@ -98,25 +109,14 @@ void MakeLArCellFromRaw::initialize( const LArRoI_Map* roiMap ,
   }
 
 
-  const CaloIdManager* caloCIM = man->getCalo_Mgr();
-  const LArEM_ID& em_id = *( caloCIM->getEM_ID() );
-  const LArHEC_ID& hec_id = *( caloCIM->getHEC_ID() );
-  const LArFCAL_ID& fcal_id = *(caloCIM->getFCAL_ID() );
-
-// retrive onlineID helper from detStore
+  const CaloCell_ID* calo_id = man->getCaloCell_ID();
+  const LArEM_ID& em_id = *calo_id->em_idHelper();
+  const LArHEC_ID& hec_id = *calo_id->hec_idHelper();
+  const LArFCAL_ID& fcal_id = *calo_id->fcal_idHelper();
 
-   StoreGateSvc* detStore;
-   if (svcLoc->service("DetectorStore", detStore).isFailure()) {
-     log << MSG::ERROR   << "Unable to access DetectoreStoren MakeLArCellFromRaw" << endmsg ;
-     return;
-   }
-
-// retrieve OnlineID helper from detStore
-   sc = detStore->retrieve(m_onlineID, "LArOnlineID");
-   if (sc.isFailure()) {
-     log << MSG::ERROR <<  "MakeLArCellFromRaw: Could not get LArOnlineID helper !" << endmsg ;
-      return;
-   }
+  if (detStore->retrieve(m_onlineID, "LArOnlineID").isFailure()) {
+    log <<MSG::ERROR << "cannot find LArOnlineID in MakeLArCellFromRaw " << endmsg;
+  }
 
 
   int n_em   = 0 ; 
diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/CMakeLists.txt b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/CMakeLists.txt
index 8e9abc47c0ed1268921fb2b8faebc42e61aebd5b..99fb34c2e1a2d5f08c1242f38ea8d3baaac80ead 100644
--- a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/CMakeLists.txt
+++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/CMakeLists.txt
@@ -75,7 +75,7 @@ find_package( AthenaPoolUtilitiesTest )
 
 if( ATHENAPOOLUTILITIESTEST_FOUND )
   set( MUONEVENTATHENAPOOL_REFERENCE_TAG
-       MuonEventAthenaPoolReference-01-00-00 )
+       MuonEventAthenaPoolReference-02-00-00 )
   run_tpcnv_test( MuonEventTPCnv_17.0.0   ESD-17.0.0
                    REFERENCE_TAG ${MUONEVENTATHENAPOOL_REFERENCE_TAG} )
   run_tpcnv_test( MuonEventTPCnv_20.1.7.2 ESD-20.1.7.2
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/CMakeLists.txt b/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/CMakeLists.txt
index b79622617bc6301e31a2e05c16b3621c60185d5d..697abfeef1002ec7d1a0291d47ea13f9f7aea86c 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/CMakeLists.txt
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/CMakeLists.txt
@@ -37,7 +37,7 @@ find_package( AthenaPoolUtilitiesTest )
 
 if( ATHENAPOOLUTILITIESTEST_FOUND )
   set( MUONSIMEVENTATHENAPOOL_REFERENCE_TAG
-       MuonSimEventAthenaPoolReference-01-00-00 )
+       MuonSimEventAthenaPoolReference-02-00-00 )
   run_tpcnv_test( MuonSimEventTPCnv_HITS   HITS.04919495._000416
                    REFERENCE_TAG ${MUONSIMEVENTATHENAPOOL_REFERENCE_TAG} )
 else()
diff --git a/MuonSpectrometer/MuonConfig/python/MuonBytestreamDecodeConfig.py b/MuonSpectrometer/MuonConfig/python/MuonBytestreamDecodeConfig.py
index 6363d17ae0f6f7c5c23022df049533bef8384fb8..14e4ea9065fbc934b044ee52f53cdffa3e5673bb 100644
--- a/MuonSpectrometer/MuonConfig/python/MuonBytestreamDecodeConfig.py
+++ b/MuonSpectrometer/MuonConfig/python/MuonBytestreamDecodeConfig.py
@@ -24,7 +24,7 @@ def MuonCacheCfg():
                                     RpcCacheKey    = MuonCacheNames.RpcCache,
                                     TgcCacheKey    = MuonCacheNames.TgcCache)
     acc.addEventAlgo( cacheCreator )
-    return acc, cacheCreator
+    return acc
 
 
 ## This configuration function sets up everything for decoding RPC bytestream data into RDOs
@@ -130,9 +130,6 @@ def MdtBytestreamDecodeCfg(flags, forTrigger=False):
     MuonMdtRawDataProviderTool = Muon__MDT_RawDataProviderTool(name    = "MDT_RawDataProviderTool",
                                                                Decoder = MDTRodDecoder)
     if forTrigger:
-        # Trigger the creation of cache containers
-        cacheAcc,cacheAlg = MuonCacheCfg()
-        acc.merge( cacheAcc )
         # tell the raw data provider tool to use the cache
         MuonMdtRawDataProviderTool.CsmContainerCacheKey = MuonCacheNames.MdtCsmCache
 
@@ -170,9 +167,6 @@ def CscBytestreamDecodeCfg(flags, forTrigger=False):
     MuonCscRawDataProviderTool = Muon__CSC_RawDataProviderTool(name    = "CSC_RawDataProviderTool",
                                                                Decoder = CSCRodDecoder)
     if forTrigger:
-        # Trigger the creation of cache containers
-        cacheAcc,cacheAlg = MuonCacheCfg()
-        acc.merge( cacheAcc )
         # tell the raw data provider tool to use the cache
         MuonCscRawDataProviderTool.CscContainerCacheKey = MuonCacheNames.CscCache
 
diff --git a/MuonSpectrometer/MuonConfig/python/MuonRdoDecodeConfig.py b/MuonSpectrometer/MuonConfig/python/MuonRdoDecodeConfig.py
index f96f53de9347697ec427bbb5ba348a2b73532a80..1398b7bf5cafe9b2db943bbbb066e2b52685c87b 100644
--- a/MuonSpectrometer/MuonConfig/python/MuonRdoDecodeConfig.py
+++ b/MuonSpectrometer/MuonConfig/python/MuonRdoDecodeConfig.py
@@ -169,11 +169,17 @@ def muonRdoDecodeTestData( forTrigger = False ):
     log.info('About to setup Rpc Raw data decoding')
 
     cfg=ComponentAccumulator()
+
         
     # Seem to need this to read BS properly
     from ByteStreamCnvSvc.ByteStreamConfig import TrigBSReadCfg
     cfg.merge(TrigBSReadCfg(ConfigFlags ))
 
+    if forTrigger:
+        # cache creators loaded independently
+        from MuonConfig.MuonBytestreamDecodeConfig import MuonCacheCfg
+        cfg.merge( MuonCacheCfg() )
+
     # Schedule Rpc bytestream data decoding - once mergeAll is working can simplify these lines
     from MuonConfig.MuonBytestreamDecodeConfig import RpcBytestreamDecodeCfg
     rpcdecodingAcc, rpcdecodingAlg = RpcBytestreamDecodeCfg( ConfigFlags ) 
diff --git a/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest.ref b/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest.ref
index 80ddcf2e960bb8a03f747a1d2c5d53b0e31c4f45..9ad83eb8eb9f444bba4c86a9221666c6382c17b1 100644
--- a/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest.ref
+++ b/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest.ref
@@ -3,8 +3,10 @@ Flag categories that can be loaded dynamically
 Category        :                 Generator name : Defined in
 DQ              :                           __dq : AthenaConfiguration/AllConfigFlags.py
 Detector        :                     __detector : AthenaConfiguration/AllConfigFlags.py
+Egamma          :                       __egamma : AthenaConfiguration/AllConfigFlags.py
 LAr             :                          __lar : AthenaConfiguration/AllConfigFlags.py
 Muon            :                         __muon : AthenaConfiguration/AllConfigFlags.py
+Sim             :                   __simulation : AthenaConfiguration/AllConfigFlags.py
 Trigger         :                      __trigger : AthenaConfiguration/AllConfigFlags.py
 Py:Athena            INFO About to setup Rpc Raw data decoding
 Py:ComponentAccumulator   DEBUG Adding component EventSelectorByteStream/EventSelector to the job
@@ -39,8 +41,10 @@ Flag Name                                : Value
 Flag categories that can be loaded dynamically
 Category        :                 Generator name : Defined in
 DQ              :                           __dq : AthenaConfiguration/AllConfigFlags.py
+Egamma          :                       __egamma : AthenaConfiguration/AllConfigFlags.py
 LAr             :                          __lar : AthenaConfiguration/AllConfigFlags.py
 Muon            :                         __muon : AthenaConfiguration/AllConfigFlags.py
+Sim             :                   __simulation : AthenaConfiguration/AllConfigFlags.py
 Trigger         :                      __trigger : AthenaConfiguration/AllConfigFlags.py
 Py:ComponentAccumulator   DEBUG Adding component GeoModelSvc/GeoModelSvc to the job
 Py:ComponentAccumulator   DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job
@@ -275,7 +279,9 @@ Flag Name                                : Value
 Flag categories that can be loaded dynamically
 Category        :                 Generator name : Defined in
 DQ              :                           __dq : AthenaConfiguration/AllConfigFlags.py
+Egamma          :                       __egamma : AthenaConfiguration/AllConfigFlags.py
 LAr             :                          __lar : AthenaConfiguration/AllConfigFlags.py
+Sim             :                   __simulation : AthenaConfiguration/AllConfigFlags.py
 Trigger         :                      __trigger : AthenaConfiguration/AllConfigFlags.py
 Py:ComponentAccumulator   DEBUG Adding component CondInputLoader/CondInputLoader to the job
 Py:ComponentAccumulator   DEBUG Adding component IOVDbSvc/IOVDbSvc to the job
@@ -835,7 +841,6 @@ Py:Athena            INFO Print Config
 |-MonitorService                          = 'MonitorSvc'
 |-OutputLevel                             = 0
 |-RegisterForContextService               = False
-|-Sequential                              = False
 |-StopOverride                            = False
 |-TimeOut                                 = 0.0
 |=/***** Algorithm Muon::RpcRawDataProvider/RpcRawDataProvider ***************************************
@@ -1290,6 +1295,483 @@ Py:Athena            INFO Print Config
 | \----- (End of Algorithm CscThresholdClusterBuilder/CscThesholdClusterBuilder) ---------------------
 \----- (End of Algorithm AthSequencer/AthAlgSeq) ---------------------------------------------------
 Py:Athena            INFO Save Config
+/***** Algorithm AthSequencer/AthAlgSeq ************************************************************
+|-Atomic                                  = False
+|-AuditAlgorithms                         = False
+|-AuditBeginRun                           = False
+|-AuditEndRun                             = False
+|-AuditExecute                            = False
+|-AuditFinalize                           = False
+|-AuditInitialize                         = False
+|-AuditReinitialize                       = False
+|-AuditRestart                            = False
+|-AuditStart                              = False
+|-AuditStop                               = False
+|-ContinueEventloopOnFPE                  = False
+|-Enable                                  = True
+|-ErrorCounter                            = 0
+|-ErrorMax                                = 1
+|-FilterCircularDependencies              = True
+|-IgnoreFilterPassed                      = False
+|-IsIOBound                               = False
+|                                            (default: [])
+|-ModeOR                                  = False
+|-MonitorService                          = 'MonitorSvc'
+|-OutputLevel                             = 0
+|-RegisterForContextService               = False
+|-StopOverride                            = False
+|-TimeOut                                 = 0.0
+|=/***** Algorithm Muon::RpcRawDataProvider/RpcRawDataProvider ***************************************
+| |-AuditAlgorithms                         = False
+| |-AuditBeginRun                           = False
+| |-AuditEndRun                             = False
+| |-AuditExecute                            = False
+| |-AuditFinalize                           = False
+| |-AuditInitialize                         = False
+| |-AuditReinitialize                       = False
+| |-AuditRestart                            = False
+| |-AuditStart                              = False
+| |-AuditStop                               = False
+| |-DoSeededDecoding                        = False
+| |-Enable                                  = True
+| |-ErrorCounter                            = 0
+| |-ErrorMax                                = 1
+| |-FilterCircularDependencies              = True
+| |-IsIOBound                               = False
+| |-MonitorService                          = 'MonitorSvc'
+| |-OutputLevel                             = 0
+| |                                            (default: 'Muon::RPC_RawDataProviderTool/RpcRawDataProviderTool')
+| |-RegisterForContextService               = False
+| |-RoIs                                    = 'StoreGateSvc+OutputRoIs'
+| |=/***** Private AlgTool Muon::RPC_RawDataProviderTool/RpcRawDataProvider.RPC_RawDataProviderTool *****
+| | |-AuditFinalize                  = False
+| | |-AuditInitialize                = False
+| | |-AuditReinitialize              = False
+| | |-AuditRestart                   = False
+| | |-AuditStart                     = False
+| | |-AuditStop                      = False
+| | |-AuditTools                     = False
+| | |-MonitorService                 = 'MonitorSvc'
+| | |-OutputLevel                    = 0
+| | |-RPCSec                         = 'StoreGateSvc+RPC_SECTORLOGIC'
+| | |-RdoLocation                    = 'StoreGateSvc+RPCPAD'
+| | |=/***** Private AlgTool Muon::RpcROD_Decoder/RpcRawDataProvider.RPC_RawDataProviderTool.RpcROD_Decoder *****
+| | | |-AuditFinalize                    = False
+| | | |-AuditInitialize                  = False
+| | | |-AuditReinitialize                = False
+| | | |-AuditRestart                     = False
+| | | |-AuditStart                       = False
+| | | |-AuditStop                        = False
+| | | |-AuditTools                       = False
+| | | |-DataErrorPrintLimit              = 1000
+| | | |-MonitorService                   = 'MonitorSvc'
+| | | |-OutputLevel                      = 0
+| | | |-Sector13Data                     = False
+| | | |-SpecialROBNumber                 = -1
+| | | \----- (End of Private AlgTool Muon::RpcROD_Decoder/RpcRawDataProvider.RPC_RawDataProviderTool.RpcROD_Decoder) -----
+| | \----- (End of Private AlgTool Muon::RPC_RawDataProviderTool/RpcRawDataProvider.RPC_RawDataProviderTool) -----
+| \----- (End of Algorithm Muon::RpcRawDataProvider/RpcRawDataProvider) ------------------------------
+|=/***** Algorithm Muon::TgcRawDataProvider/TgcRawDataProvider ***************************************
+| |-AuditAlgorithms                         = False
+| |-AuditBeginRun                           = False
+| |-AuditEndRun                             = False
+| |-AuditExecute                            = False
+| |-AuditFinalize                           = False
+| |-AuditInitialize                         = False
+| |-AuditReinitialize                       = False
+| |-AuditRestart                            = False
+| |-AuditStart                              = False
+| |-AuditStop                               = False
+| |-Enable                                  = True
+| |-ErrorCounter                            = 0
+| |-ErrorMax                                = 1
+| |-FilterCircularDependencies              = True
+| |-IsIOBound                               = False
+| |-MonitorService                          = 'MonitorSvc'
+| |-OutputLevel                             = 0
+| |                                            (default: 'Muon::TGC_RawDataProviderTool/TgcRawDataProviderTool')
+| |-RegisterForContextService               = False
+| |=/***** Private AlgTool Muon::TGC_RawDataProviderTool/TgcRawDataProvider.TGC_RawDataProviderTool *****
+| | |-AuditFinalize                  = False
+| | |-AuditInitialize                = False
+| | |-AuditReinitialize              = False
+| | |-AuditRestart                   = False
+| | |-AuditStart                     = False
+| | |-AuditStop                      = False
+| | |-AuditTools                     = False
+| | |                                   (default: 'Muon::TGC_RodDecoderReadout/TGC_RodDecoderReadout')
+| | |-MonitorService                 = 'MonitorSvc'
+| | |-OutputLevel                    = 0
+| | |-RdoLocation                    = 'StoreGateSvc+TGCRDO'
+| | |=/***** Private AlgTool Muon::TGC_RodDecoderReadout/TgcRawDataProvider.TGC_RawDataProviderTool.TgcROD_Decoder *****
+| | | |-AuditFinalize                  = False
+| | | |-AuditInitialize                = False
+| | | |-AuditReinitialize              = False
+| | | |-AuditRestart                   = False
+| | | |-AuditStart                     = False
+| | | |-AuditStop                      = False
+| | | |-AuditTools                     = False
+| | | |-MonitorService                 = 'MonitorSvc'
+| | | |-OutputLevel                    = 0
+| | | |-ShowStatusWords                = False
+| | | |-SkipCoincidence                = False
+| | | \----- (End of Private AlgTool Muon::TGC_RodDecoderReadout/TgcRawDataProvider.TGC_RawDataProviderTool.TgcROD_Decoder) -----
+| | \----- (End of Private AlgTool Muon::TGC_RawDataProviderTool/TgcRawDataProvider.TGC_RawDataProviderTool) -----
+| \----- (End of Algorithm Muon::TgcRawDataProvider/TgcRawDataProvider) ------------------------------
+|=/***** Algorithm Muon::MdtRawDataProvider/MdtRawDataProvider ***************************************
+| |-AuditAlgorithms                         = False
+| |-AuditBeginRun                           = False
+| |-AuditEndRun                             = False
+| |-AuditExecute                            = False
+| |-AuditFinalize                           = False
+| |-AuditInitialize                         = False
+| |-AuditReinitialize                       = False
+| |-AuditRestart                            = False
+| |-AuditStart                              = False
+| |-AuditStop                               = False
+| |-Enable                                  = True
+| |-ErrorCounter                            = 0
+| |-ErrorMax                                = 1
+| |-FilterCircularDependencies              = True
+| |-IsIOBound                               = False
+| |-MonitorService                          = 'MonitorSvc'
+| |-OutputLevel                             = 0
+| |                                            (default: 'Muon::MDT_RawDataProviderTool/MdtRawDataProviderTool')
+| |-RegisterForContextService               = False
+| |=/***** Private AlgTool Muon::MDT_RawDataProviderTool/MdtRawDataProvider.MDT_RawDataProviderTool *****
+| | |-AuditFinalize                     = False
+| | |-AuditInitialize                   = False
+| | |-AuditReinitialize                 = False
+| | |-AuditRestart                      = False
+| | |-AuditStart                        = False
+| | |-AuditStop                         = False
+| | |-AuditTools                        = False
+| | |-CsmContainerCacheKey              = 'StoreGateSvc+'
+| | |-MonitorService                    = 'MonitorSvc'
+| | |-OutputLevel                       = 0
+| | |-RdoLocation                       = 'StoreGateSvc+MDTCSM'
+| | |-ReadKey                           = 'ConditionStore+MuonMDT_CablingMap'
+| | |=/***** Private AlgTool MdtROD_Decoder/MdtRawDataProvider.MDT_RawDataProviderTool.MdtROD_Decoder *****
+| | | |-AuditFinalize                  = False
+| | | |-AuditInitialize                = False
+| | | |-AuditReinitialize              = False
+| | | |-AuditRestart                   = False
+| | | |-AuditStart                     = False
+| | | |-AuditStop                      = False
+| | | |-AuditTools                     = False
+| | | |-MonitorService                 = 'MonitorSvc'
+| | | |-OutputLevel                    = 0
+| | | |-ReadKey                        = 'ConditionStore+MuonMDT_CablingMap'
+| | | |-SpecialROBNumber               = -1
+| | | \----- (End of Private AlgTool MdtROD_Decoder/MdtRawDataProvider.MDT_RawDataProviderTool.MdtROD_Decoder) -----
+| | \----- (End of Private AlgTool Muon::MDT_RawDataProviderTool/MdtRawDataProvider.MDT_RawDataProviderTool) -----
+| \----- (End of Algorithm Muon::MdtRawDataProvider/MdtRawDataProvider) ------------------------------
+|=/***** Algorithm Muon::CscRawDataProvider/CscRawDataProvider ***************************************
+| |-AuditAlgorithms                         = False
+| |-AuditBeginRun                           = False
+| |-AuditEndRun                             = False
+| |-AuditExecute                            = False
+| |-AuditFinalize                           = False
+| |-AuditInitialize                         = False
+| |-AuditReinitialize                       = False
+| |-AuditRestart                            = False
+| |-AuditStart                              = False
+| |-AuditStop                               = False
+| |-Enable                                  = True
+| |-ErrorCounter                            = 0
+| |-ErrorMax                                = 1
+| |-FilterCircularDependencies              = True
+| |-IsIOBound                               = False
+| |-MonitorService                          = 'MonitorSvc'
+| |-OutputLevel                             = 0
+| |                                            (default: 'Muon::CSC_RawDataProviderTool/CscRawDataProviderTool')
+| |-RegisterForContextService               = False
+| |=/***** Private AlgTool Muon::CSC_RawDataProviderTool/CscRawDataProvider.CSC_RawDataProviderTool *****
+| | |-AuditFinalize                     = False
+| | |-AuditInitialize                   = False
+| | |-AuditReinitialize                 = False
+| | |-AuditRestart                      = False
+| | |-AuditStart                        = False
+| | |-AuditStop                         = False
+| | |-AuditTools                        = False
+| | |-CscContainerCacheKey              = 'StoreGateSvc+'
+| | |-EventInfoKey                      = 'StoreGateSvc+EventInfo'
+| | |-MonitorService                    = 'MonitorSvc'
+| | |-OutputLevel                       = 0
+| | |-RdoLocation                       = 'StoreGateSvc+CSCRDO'
+| | |=/***** Private AlgTool Muon::CscROD_Decoder/CscRawDataProvider.CSC_RawDataProviderTool.CscROD_Decoder *****
+| | | |-AuditFinalize                  = False
+| | | |-AuditInitialize                = False
+| | | |-AuditReinitialize              = False
+| | | |-AuditRestart                   = False
+| | | |-AuditStart                     = False
+| | | |-AuditStop                      = False
+| | | |-AuditTools                     = False
+| | | |-IsCosmics                      = False
+| | | |-IsOldCosmics                   = False
+| | | |-MonitorService                 = 'MonitorSvc'
+| | | |-OutputLevel                    = 0
+| | | \----- (End of Private AlgTool Muon::CscROD_Decoder/CscRawDataProvider.CSC_RawDataProviderTool.CscROD_Decoder) -----
+| | \----- (End of Private AlgTool Muon::CSC_RawDataProviderTool/CscRawDataProvider.CSC_RawDataProviderTool) -----
+| \----- (End of Algorithm Muon::CscRawDataProvider/CscRawDataProvider) ------------------------------
+|=/***** Algorithm RpcRdoToRpcPrepData/RpcRdoToRpcPrepData *******************************************
+| |-AuditAlgorithms                         = False
+| |-AuditBeginRun                           = False
+| |-AuditEndRun                             = False
+| |-AuditExecute                            = False
+| |-AuditFinalize                           = False
+| |-AuditInitialize                         = False
+| |-AuditReinitialize                       = False
+| |-AuditRestart                            = False
+| |-AuditStart                              = False
+| |-AuditStop                               = False
+| |                                            (default: 'Muon::RpcRdoToPrepDataTool/RpcRdoToPrepDataTool')
+| |-DoSeededDecoding                        = False
+| |-Enable                                  = True
+| |-ErrorCounter                            = 0
+| |-ErrorMax                                = 1
+| |-FilterCircularDependencies              = True
+| |-IsIOBound                               = False
+| |-MonitorService                          = 'MonitorSvc'
+| |-OutputCollection                        = 'StoreGateSvc+RPC_Measurements'
+| |-OutputLevel                             = 0
+| |-PrintInputRdo                           = False
+| |-RegisterForContextService               = False
+| |-RoIs                                    = 'StoreGateSvc+OutputRoIs'
+| |=/***** Private AlgTool Muon::RpcRdoToPrepDataTool/RpcRdoToRpcPrepData.RpcRdoToRpcPrepDataTool ******
+| | |-AuditFinalize                                   = False
+| | |-AuditInitialize                                 = False
+| | |-AuditReinitialize                               = False
+| | |-AuditRestart                                    = False
+| | |-AuditStart                                      = False
+| | |-AuditStop                                       = False
+| | |-AuditTools                                      = False
+| | |-DecodeData                                      = True
+| | |-InputCollection                                 = 'StoreGateSvc+RPC_triggerHits'
+| | |-MonitorService                                  = 'MonitorSvc'
+| | |-OutputCollection                                = 'StoreGateSvc+RPCPAD'
+| | |-OutputLevel                                     = 0
+| | |-RPCInfoFromDb                                   = False
+| | |                                                    (default: 'Muon::RpcRDO_Decoder')
+| | |-TriggerOutputCollection                         = 'StoreGateSvc+RPC_Measurements'
+| | |-etaphi_coincidenceTime                          = 20.0
+| | |-overlap_timeTolerance                           = 10.0
+| | |-processingData                                  = False
+| | |-produceRpcCoinDatafromTriggerWords              = True
+| | |-reduceCablingOverlap                            = True
+| | |-solvePhiAmbiguities                             = True
+| | |-timeShift                                       = -12.5
+| | |=/***** Private AlgTool Muon::RpcRDO_Decoder/RpcRdoToRpcPrepData.RpcRdoToRpcPrepDataTool.Muon::RpcRDO_Decoder *****
+| | | |-AuditFinalize                  = False
+| | | |-AuditInitialize                = False
+| | | |-AuditReinitialize              = False
+| | | |-AuditRestart                   = False
+| | | |-AuditStart                     = False
+| | | |-AuditStop                      = False
+| | | |-AuditTools                     = False
+| | | |-MonitorService                 = 'MonitorSvc'
+| | | |-OutputLevel                    = 0
+| | | \----- (End of Private AlgTool Muon::RpcRDO_Decoder/RpcRdoToRpcPrepData.RpcRdoToRpcPrepDataTool.Muon::RpcRDO_Decoder) -----
+| | \----- (End of Private AlgTool Muon::RpcRdoToPrepDataTool/RpcRdoToRpcPrepData.RpcRdoToRpcPrepDataTool) -----
+| \----- (End of Algorithm RpcRdoToRpcPrepData/RpcRdoToRpcPrepData) ----------------------------------
+|=/***** Algorithm TgcRdoToTgcPrepData/TgcRdoToTgcPrepData *******************************************
+| |-AuditAlgorithms                         = False
+| |-AuditBeginRun                           = False
+| |-AuditEndRun                             = False
+| |-AuditExecute                            = False
+| |-AuditFinalize                           = False
+| |-AuditInitialize                         = False
+| |-AuditReinitialize                       = False
+| |-AuditRestart                            = False
+| |-AuditStart                              = False
+| |-AuditStop                               = False
+| |                                            (default: 'Muon::TgcRdoToPrepDataTool/TgcPrepDataProviderTool')
+| |-DoSeededDecoding                        = False
+| |-Enable                                  = True
+| |-ErrorCounter                            = 0
+| |-ErrorMax                                = 1
+| |-FilterCircularDependencies              = True
+| |-IsIOBound                               = False
+| |-MonitorService                          = 'MonitorSvc'
+| |-OutputCollection                        = 'StoreGateSvc+TGC_Measurements'
+| |-OutputLevel                             = 0
+| |-PrintInputRdo                           = False
+| |-RegisterForContextService               = False
+| |-RoIs                                    = 'StoreGateSvc+OutputRoIs'
+| |-Setting                                 = 0
+| |=/***** Private AlgTool Muon::TgcRdoToPrepDataTool/TgcRdoToTgcPrepData.TgcRdoToTgcPrepDataTool ******
+| | |-AuditFinalize                                        = False
+| | |-AuditInitialize                                      = False
+| | |-AuditReinitialize                                    = False
+| | |-AuditRestart                                         = False
+| | |-AuditStart                                           = False
+| | |-AuditStop                                            = False
+| | |-AuditTools                                           = False
+| | |-DecodeData                                           = True
+| | |-FillCoinData                                         = True
+| | |-MonitorService                                       = 'MonitorSvc'
+| | |-OutputCoinCollection                                 = 'TrigT1CoinDataCollection'
+| | |-OutputCollection                                     = 'TGC_Measurements'
+| | |-OutputLevel                                          = 0
+| | |-RDOContainer                                         = 'StoreGateSvc+TGCRDO'
+| | |-TGCHashIdOffset                                      = 26000
+| | |-dropPrdsWithZeroWidth                                = True
+| | |                                                         (default: ['StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy'])
+| | |                                                         (default: ['StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy'])
+| | |-show_warning_level_invalid_A09_SSW6_hit              = False
+| | \----- (End of Private AlgTool Muon::TgcRdoToPrepDataTool/TgcRdoToTgcPrepData.TgcRdoToTgcPrepDataTool) -----
+| \----- (End of Algorithm TgcRdoToTgcPrepData/TgcRdoToTgcPrepData) ----------------------------------
+|=/***** Algorithm MdtRdoToMdtPrepData/MdtRdoToMdtPrepData *******************************************
+| |-AuditAlgorithms                         = False
+| |-AuditBeginRun                           = False
+| |-AuditEndRun                             = False
+| |-AuditExecute                            = False
+| |-AuditFinalize                           = False
+| |-AuditInitialize                         = False
+| |-AuditReinitialize                       = False
+| |-AuditRestart                            = False
+| |-AuditStart                              = False
+| |-AuditStop                               = False
+| |                                            (default: 'Muon::MdtRdoToPrepDataTool/MdtPrepDataProviderTool')
+| |-DoSeededDecoding                        = False
+| |-Enable                                  = True
+| |-ErrorCounter                            = 0
+| |-ErrorMax                                = 1
+| |-FilterCircularDependencies              = True
+| |-IsIOBound                               = False
+| |-MonitorService                          = 'MonitorSvc'
+| |-OutputCollection                        = 'StoreGateSvc+MDT_DriftCircles'
+| |-OutputLevel                             = 0
+| |-PrintInputRdo                           = False
+| |-RegisterForContextService               = False
+| |-RoIs                                    = 'StoreGateSvc+OutputRoIs'
+| |=/***** Private AlgTool Muon::MdtRdoToPrepDataTool/MdtRdoToMdtPrepData.MdtRdoToMdtPrepDataTool ******
+| | |-AuditFinalize                        = False
+| | |-AuditInitialize                      = False
+| | |-AuditReinitialize                    = False
+| | |-AuditRestart                         = False
+| | |-AuditStart                           = False
+| | |-AuditStop                            = False
+| | |-AuditTools                           = False
+| | |-CalibratePrepData                    = True
+| | |-DecodeData                           = True
+| | |-DiscardSecondaryHitTwin              = False
+| | |-DoPropagationCorrection              = False
+| | |-DoTofCorrection                      = True
+| | |-MonitorService                       = 'MonitorSvc'
+| | |-OutputCollection                     = 'StoreGateSvc+MDT_DriftCircles'
+| | |-OutputLevel                          = 0
+| | |-RDOContainer                         = 'StoreGateSvc+MDTCSM'
+| | |-ReadKey                              = 'ConditionStore+MuonMDT_CablingMap'
+| | |-SortPrepData                         = False
+| | |-TimeWindowLowerBound                 = -1000000.0
+| | |-TimeWindowSetting                    = 2
+| | |-TimeWindowUpperBound                 = -1000000.0
+| | |-TwinCorrectSlewing                   = False
+| | |-Use1DPrepDataTwin                    = False
+| | |-UseAllBOLTwin                        = False
+| | |-UseTwin                              = True
+| | \----- (End of Private AlgTool Muon::MdtRdoToPrepDataTool/MdtRdoToMdtPrepData.MdtRdoToMdtPrepDataTool) -----
+| \----- (End of Algorithm MdtRdoToMdtPrepData/MdtRdoToMdtPrepData) ----------------------------------
+|=/***** Algorithm CscRdoToCscPrepData/CscRdoToCscPrepData *******************************************
+| |-AuditAlgorithms                         = False
+| |-AuditBeginRun                           = False
+| |-AuditEndRun                             = False
+| |-AuditExecute                            = False
+| |-AuditFinalize                           = False
+| |-AuditInitialize                         = False
+| |-AuditReinitialize                       = False
+| |-AuditRestart                            = False
+| |-AuditStart                              = False
+| |-AuditStop                               = False
+| |                                            (default: 'Muon::CscRdoToCscPrepDataTool/CscRdoToPrepDataTool')
+| |-DoSeededDecoding                        = False
+| |-Enable                                  = True
+| |-ErrorCounter                            = 0
+| |-ErrorMax                                = 1
+| |-FilterCircularDependencies              = True
+| |-IsIOBound                               = False
+| |-MonitorService                          = 'MonitorSvc'
+| |-OutputCollection                        = 'StoreGateSvc+CSC_Measurements'
+| |-OutputLevel                             = 0
+| |-PrintInputRdo                           = False
+| |-RegisterForContextService               = False
+| |-RoIs                                    = 'StoreGateSvc+OutputRoIs'
+| |=/***** Private AlgTool Muon::CscRdoToCscPrepDataTool/CscRdoToCscPrepData.CscRdoToCscPrepDataTool *****
+| | |-AuditFinalize                  = False
+| | |-AuditInitialize                = False
+| | |-AuditReinitialize              = False
+| | |-AuditRestart                   = False
+| | |-AuditStart                     = False
+| | |-AuditStop                      = False
+| | |-AuditTools                     = False
+| | |-CSCHashIdOffset                = 22000
+| | |-DecodeData                     = True
+| | |-MonitorService                 = 'MonitorSvc'
+| | |-OutputCollection               = 'StoreGateSvc+CSC_Measurements'
+| | |-OutputLevel                    = 0
+| | |-RDOContainer                   = 'StoreGateSvc+CSCRDO'
+| | |=/***** Private AlgTool CscCalibTool/CscRdoToCscPrepData.CscRdoToCscPrepDataTool.CscCalibTool *******
+| | | |-AuditFinalize                   = False
+| | | |-AuditInitialize                 = False
+| | | |-AuditReinitialize               = False
+| | | |-AuditRestart                    = False
+| | | |-AuditStart                      = False
+| | | |-AuditStop                       = False
+| | | |-AuditTools                      = False
+| | | |-IsOnline                        = True
+| | | |-Latency                         = 100.0
+| | | |-MonitorService                  = 'MonitorSvc'
+| | | |-NSamples                        = 4
+| | | |-Noise                           = 3.5
+| | | |-OutputLevel                     = 0
+| | | |-Pedestal                        = 2048.0
+| | | |-ReadFromDatabase                = True
+| | | |-Slope                           = 0.19
+| | | |-SlopeFromDatabase               = False
+| | | |-TimeOffsetRange                 = 1.0
+| | | |-Use2Samples                     = False
+| | | |-integrationNumber               = 12.0
+| | | |-integrationNumber2              = 11.66
+| | | |-samplingTime                    = 50.0
+| | | |-signalWidth                     = 14.4092
+| | | |-timeOffset                      = 46.825
+| | | \----- (End of Private AlgTool CscCalibTool/CscRdoToCscPrepData.CscRdoToCscPrepDataTool.CscCalibTool) -----
+| | |=/***** Private AlgTool Muon::CscRDO_Decoder/CscRdoToCscPrepData.CscRdoToCscPrepDataTool.CscRDO_Decoder *****
+| | | |-AuditFinalize                  = False
+| | | |-AuditInitialize                = False
+| | | |-AuditReinitialize              = False
+| | | |-AuditRestart                   = False
+| | | |-AuditStart                     = False
+| | | |-AuditStop                      = False
+| | | |-AuditTools                     = False
+| | | |-MonitorService                 = 'MonitorSvc'
+| | | |-OutputLevel                    = 0
+| | | \----- (End of Private AlgTool Muon::CscRDO_Decoder/CscRdoToCscPrepData.CscRdoToCscPrepDataTool.CscRDO_Decoder) -----
+| | \----- (End of Private AlgTool Muon::CscRdoToCscPrepDataTool/CscRdoToCscPrepData.CscRdoToCscPrepDataTool) -----
+| \----- (End of Algorithm CscRdoToCscPrepData/CscRdoToCscPrepData) ----------------------------------
+|=/***** Algorithm CscThresholdClusterBuilder/CscThesholdClusterBuilder ******************************
+| |-AuditAlgorithms                         = False
+| |-AuditBeginRun                           = False
+| |-AuditEndRun                             = False
+| |-AuditExecute                            = False
+| |-AuditFinalize                           = False
+| |-AuditInitialize                         = False
+| |-AuditReinitialize                       = False
+| |-AuditRestart                            = False
+| |-AuditStart                              = False
+| |-AuditStop                               = False
+| |-Enable                                  = True
+| |-ErrorCounter                            = 0
+| |-ErrorMax                                = 1
+| |-FilterCircularDependencies              = True
+| |-IsIOBound                               = False
+| |-MonitorService                          = 'MonitorSvc'
+| |-OutputLevel                             = 0
+| |-RegisterForContextService               = False
+| |                                            (default: 'CscThresholdClusterBuilderTool/CscThresholdClusterBuilderTool')
+| \----- (End of Algorithm CscThresholdClusterBuilder/CscThesholdClusterBuilder) ---------------------
+\----- (End of Algorithm AthSequencer/AthAlgSeq) ---------------------------------------------------
 
 JOs reading stage finished, launching Athena from pickle file
 
@@ -1829,7 +2311,6 @@ AthenaEventLoopMgr   INFO   ===>>>  start processing event #186568452, run #3272
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #186568452, run #327265 19 events processed so far  <<<===
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #186580451, run #327265 19 events processed so far  <<<===
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #186580451, run #327265 20 events processed so far  <<<===
-Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
 ApplicationMgr       INFO Application Manager Stopped successfully
 CondInputLoader      INFO Finalizing CondInputLoader...
 AtlasFieldSvc        INFO finalize() successful
diff --git a/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest_Cache.ref b/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest_Cache.ref
index 5c116b9ab32b1a8e8c1aa90b511e872fa1841750..bca879f265a777080aeb63bf51fd090d83231f5a 100644
--- a/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest_Cache.ref
+++ b/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest_Cache.ref
@@ -3,8 +3,10 @@ Flag categories that can be loaded dynamically
 Category        :                 Generator name : Defined in
 DQ              :                           __dq : AthenaConfiguration/AllConfigFlags.py
 Detector        :                     __detector : AthenaConfiguration/AllConfigFlags.py
+Egamma          :                       __egamma : AthenaConfiguration/AllConfigFlags.py
 LAr             :                          __lar : AthenaConfiguration/AllConfigFlags.py
 Muon            :                         __muon : AthenaConfiguration/AllConfigFlags.py
+Sim             :                   __simulation : AthenaConfiguration/AllConfigFlags.py
 Trigger         :                      __trigger : AthenaConfiguration/AllConfigFlags.py
 Py:Athena            INFO About to setup Rpc Raw data decoding
 Py:ComponentAccumulator   DEBUG Adding component EventSelectorByteStream/EventSelector to the job
@@ -34,13 +36,16 @@ Py:ComponentAccumulator   DEBUG Adding component ProxyProviderSvc/ProxyProviderS
 Py:ComponentAccumulator   DEBUG Adding component ByteStreamAttListMetadataSvc/ByteStreamAttListMetadataSvc to the job
 Py:ComponentAccumulator   DEBUG Adding component IOVDbMetaDataTool/IOVDbMetaDataTool to the job
 Py:ComponentAccumulator   DEBUG Adding component ByteStreamMetadataTool/ByteStreamMetadataTool to the job
+Py:ComponentAccumulator   DEBUG   Merging algorithm MuonCacheCreator to a sequence AthAlgSeq
 dynamically loading the flag Detector
 Flag Name                                : Value
 Flag categories that can be loaded dynamically
 Category        :                 Generator name : Defined in
 DQ              :                           __dq : AthenaConfiguration/AllConfigFlags.py
+Egamma          :                       __egamma : AthenaConfiguration/AllConfigFlags.py
 LAr             :                          __lar : AthenaConfiguration/AllConfigFlags.py
 Muon            :                         __muon : AthenaConfiguration/AllConfigFlags.py
+Sim             :                   __simulation : AthenaConfiguration/AllConfigFlags.py
 Trigger         :                      __trigger : AthenaConfiguration/AllConfigFlags.py
 Py:ComponentAccumulator   DEBUG Adding component GeoModelSvc/GeoModelSvc to the job
 Py:ComponentAccumulator   DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job
@@ -327,7 +332,9 @@ Flag Name                                : Value
 Flag categories that can be loaded dynamically
 Category        :                 Generator name : Defined in
 DQ              :                           __dq : AthenaConfiguration/AllConfigFlags.py
+Egamma          :                       __egamma : AthenaConfiguration/AllConfigFlags.py
 LAr             :                          __lar : AthenaConfiguration/AllConfigFlags.py
+Sim             :                   __simulation : AthenaConfiguration/AllConfigFlags.py
 Trigger         :                      __trigger : AthenaConfiguration/AllConfigFlags.py
 Py:ComponentAccumulator   DEBUG Adding component CondInputLoader/CondInputLoader to the job
 Py:ComponentAccumulator   DEBUG Adding component IOVDbSvc/IOVDbSvc to the job
@@ -414,9 +421,7 @@ Py:ComponentAccumulator   DEBUG Reconciled configuration of component TagInfoMgr
 Py:ComponentAccumulator   DEBUG Reconciled configuration of component ProxyProviderSvc
 Py:ComponentAccumulator   DEBUG Reconciled configuration of component ToolSvc.Muon::MuonIdHelperTool
 Py:ComponentAccumulator   DEBUG Adding component ROBDataProviderSvc/ROBDataProviderSvc to the job
-Py:ComponentAccumulator   DEBUG   Merging algorithm MuonCacheCreator to a sequence AthAlgSeq
 Py:ComponentAccumulator   DEBUG Adding component Muon::MDT_RawDataProviderTool/MDT_RawDataProviderTool to the job
-Py:ComponentAccumulator   DEBUG   Merging algorithm MuonCacheCreator to a sequence AthAlgSeq
 Py:ComponentAccumulator   DEBUG Reconciled configuration of component CondInputLoader
 Py:ComponentAccumulator   DEBUG Adding component MuonMDT_CablingAlg/MuonMDT_CablingAlg to the job
 Py:ComponentAccumulator   DEBUG Reconciled configuration of component GeoModelSvc
@@ -493,7 +498,6 @@ Py:ComponentAccumulator   DEBUG Reconciled configuration of component TagInfoMgr
 Py:ComponentAccumulator   DEBUG Reconciled configuration of component ProxyProviderSvc
 Py:ComponentAccumulator   DEBUG Reconciled configuration of component ToolSvc.Muon::MuonIdHelperTool
 Py:ComponentAccumulator   DEBUG Adding component ROBDataProviderSvc/ROBDataProviderSvc to the job
-Py:ComponentAccumulator   DEBUG   Merging algorithm MuonCacheCreator to a sequence AthAlgSeq
 Py:ComponentAccumulator   DEBUG Adding component Muon::CSC_RawDataProviderTool/CSC_RawDataProviderTool to the job
 Py:ComponentAccumulator   DEBUG Reconciled configuration of component GeoModelSvc
 Py:ComponentAccumulator   DEBUG Reconciled configuration of component DetDescrCnvSvc
@@ -1118,9 +1122,29 @@ Py:Athena            INFO Print Config
 |-MonitorService                          = 'MonitorSvc'
 |-OutputLevel                             = 0
 |-RegisterForContextService               = False
-|-Sequential                              = False
 |-StopOverride                            = False
 |-TimeOut                                 = 0.0
+|=/***** Algorithm MuonCacheCreator/MuonCacheCreator *************************************************
+| |-AuditAlgorithms                         = False
+| |-AuditBeginRun                           = False
+| |-AuditEndRun                             = False
+| |-AuditExecute                            = False
+| |-AuditFinalize                           = False
+| |-AuditInitialize                         = False
+| |-AuditReinitialize                       = False
+| |-AuditRestart                            = False
+| |-AuditStart                              = False
+| |-AuditStop                               = False
+| |-DisableViewWarning                      = False
+| |-Enable                                  = True
+| |-ErrorCounter                            = 0
+| |-ErrorMax                                = 1
+| |-FilterCircularDependencies              = True
+| |-IsIOBound                               = False
+| |-MonitorService                          = 'MonitorSvc'
+| |-OutputLevel                             = 0
+| |-RegisterForContextService               = False
+| \----- (End of Algorithm MuonCacheCreator/MuonCacheCreator) ----------------------------------------
 |=/***** Algorithm Muon::RpcRawDataProvider/RpcRawDataProvider ***************************************
 | |-AuditAlgorithms                         = False
 | |-AuditBeginRun                           = False
@@ -1218,6 +1242,383 @@ Py:Athena            INFO Print Config
 | | | \----- (End of Private AlgTool Muon::TGC_RodDecoderReadout/TgcRawDataProvider.TGC_RawDataProviderTool.TgcROD_Decoder) -----
 | | \----- (End of Private AlgTool Muon::TGC_RawDataProviderTool/TgcRawDataProvider.TGC_RawDataProviderTool) -----
 | \----- (End of Algorithm Muon::TgcRawDataProvider/TgcRawDataProvider) ------------------------------
+|=/***** Algorithm Muon::MdtRawDataProvider/MdtRawDataProvider ***************************************
+| |-AuditAlgorithms                         = False
+| |-AuditBeginRun                           = False
+| |-AuditEndRun                             = False
+| |-AuditExecute                            = False
+| |-AuditFinalize                           = False
+| |-AuditInitialize                         = False
+| |-AuditReinitialize                       = False
+| |-AuditRestart                            = False
+| |-AuditStart                              = False
+| |-AuditStop                               = False
+| |-Enable                                  = True
+| |-ErrorCounter                            = 0
+| |-ErrorMax                                = 1
+| |-FilterCircularDependencies              = True
+| |-IsIOBound                               = False
+| |-MonitorService                          = 'MonitorSvc'
+| |-OutputLevel                             = 0
+| |                                            (default: 'Muon::MDT_RawDataProviderTool/MdtRawDataProviderTool')
+| |-RegisterForContextService               = False
+| |=/***** Private AlgTool Muon::MDT_RawDataProviderTool/MdtRawDataProvider.MDT_RawDataProviderTool *****
+| | |-AuditFinalize                     = False
+| | |-AuditInitialize                   = False
+| | |-AuditReinitialize                 = False
+| | |-AuditRestart                      = False
+| | |-AuditStart                        = False
+| | |-AuditStop                         = False
+| | |-AuditTools                        = False
+| | |-MonitorService                    = 'MonitorSvc'
+| | |-RdoLocation                       = 'StoreGateSvc+MDTCSM'
+| | |-ReadKey                           = 'ConditionStore+MuonMDT_CablingMap'
+| | |=/***** Private AlgTool MdtROD_Decoder/MdtRawDataProvider.MDT_RawDataProviderTool.MdtROD_Decoder *****
+| | | |-AuditFinalize                  = False
+| | | |-AuditInitialize                = False
+| | | |-AuditReinitialize              = False
+| | | |-AuditRestart                   = False
+| | | |-AuditStart                     = False
+| | | |-AuditStop                      = False
+| | | |-AuditTools                     = False
+| | | |-MonitorService                 = 'MonitorSvc'
+| | | |-OutputLevel                    = 0
+| | | |-ReadKey                        = 'ConditionStore+MuonMDT_CablingMap'
+| | | |-SpecialROBNumber               = -1
+| | | \----- (End of Private AlgTool MdtROD_Decoder/MdtRawDataProvider.MDT_RawDataProviderTool.MdtROD_Decoder) -----
+| | \----- (End of Private AlgTool Muon::MDT_RawDataProviderTool/MdtRawDataProvider.MDT_RawDataProviderTool) -----
+| \----- (End of Algorithm Muon::MdtRawDataProvider/MdtRawDataProvider) ------------------------------
+|=/***** Algorithm Muon::CscRawDataProvider/CscRawDataProvider ***************************************
+| |-AuditAlgorithms                         = False
+| |-AuditBeginRun                           = False
+| |-AuditEndRun                             = False
+| |-AuditExecute                            = False
+| |-AuditFinalize                           = False
+| |-AuditInitialize                         = False
+| |-AuditReinitialize                       = False
+| |-AuditRestart                            = False
+| |-AuditStart                              = False
+| |-AuditStop                               = False
+| |-Enable                                  = True
+| |-ErrorCounter                            = 0
+| |-ErrorMax                                = 1
+| |-FilterCircularDependencies              = True
+| |-IsIOBound                               = False
+| |-MonitorService                          = 'MonitorSvc'
+| |-OutputLevel                             = 0
+| |                                            (default: 'Muon::CSC_RawDataProviderTool/CscRawDataProviderTool')
+| |-RegisterForContextService               = False
+| |=/***** Private AlgTool Muon::CSC_RawDataProviderTool/CscRawDataProvider.CSC_RawDataProviderTool *****
+| | |-AuditFinalize                     = False
+| | |-AuditInitialize                   = False
+| | |-AuditReinitialize                 = False
+| | |-AuditRestart                      = False
+| | |-AuditStart                        = False
+| | |-AuditStop                         = False
+| | |-AuditTools                        = False
+| | |-EventInfoKey                      = 'StoreGateSvc+EventInfo'
+| | |-MonitorService                    = 'MonitorSvc'
+| | |-RdoLocation                       = 'StoreGateSvc+CSCRDO'
+| | |=/***** Private AlgTool Muon::CscROD_Decoder/CscRawDataProvider.CSC_RawDataProviderTool.CscROD_Decoder *****
+| | | |-AuditFinalize                  = False
+| | | |-AuditInitialize                = False
+| | | |-AuditReinitialize              = False
+| | | |-AuditRestart                   = False
+| | | |-AuditStart                     = False
+| | | |-AuditStop                      = False
+| | | |-AuditTools                     = False
+| | | |-IsCosmics                      = False
+| | | |-IsOldCosmics                   = False
+| | | |-MonitorService                 = 'MonitorSvc'
+| | | |-OutputLevel                    = 0
+| | | \----- (End of Private AlgTool Muon::CscROD_Decoder/CscRawDataProvider.CSC_RawDataProviderTool.CscROD_Decoder) -----
+| | \----- (End of Private AlgTool Muon::CSC_RawDataProviderTool/CscRawDataProvider.CSC_RawDataProviderTool) -----
+| \----- (End of Algorithm Muon::CscRawDataProvider/CscRawDataProvider) ------------------------------
+|=/***** Algorithm RpcRdoToRpcPrepData/RpcRdoToRpcPrepData *******************************************
+| |-AuditAlgorithms                         = False
+| |-AuditBeginRun                           = False
+| |-AuditEndRun                             = False
+| |-AuditExecute                            = False
+| |-AuditFinalize                           = False
+| |-AuditInitialize                         = False
+| |-AuditReinitialize                       = False
+| |-AuditRestart                            = False
+| |-AuditStart                              = False
+| |-AuditStop                               = False
+| |                                            (default: 'Muon::RpcRdoToPrepDataTool/RpcRdoToPrepDataTool')
+| |-DoSeededDecoding                        = False
+| |-Enable                                  = True
+| |-ErrorCounter                            = 0
+| |-ErrorMax                                = 1
+| |-FilterCircularDependencies              = True
+| |-IsIOBound                               = False
+| |-MonitorService                          = 'MonitorSvc'
+| |-OutputCollection                        = 'StoreGateSvc+RPC_Measurements'
+| |-OutputLevel                             = 0
+| |-PrintInputRdo                           = False
+| |-RegisterForContextService               = False
+| |-RoIs                                    = 'StoreGateSvc+OutputRoIs'
+| |=/***** Private AlgTool Muon::RpcRdoToPrepDataTool/RpcRdoToRpcPrepData.RpcRdoToRpcPrepDataTool ******
+| | |-AuditFinalize                                   = False
+| | |-AuditInitialize                                 = False
+| | |-AuditReinitialize                               = False
+| | |-AuditRestart                                    = False
+| | |-AuditStart                                      = False
+| | |-AuditStop                                       = False
+| | |-AuditTools                                      = False
+| | |-DecodeData                                      = True
+| | |-InputCollection                                 = 'StoreGateSvc+RPC_triggerHits'
+| | |-MonitorService                                  = 'MonitorSvc'
+| | |-OutputCollection                                = 'StoreGateSvc+RPCPAD'
+| | |-OutputLevel                                     = 0
+| | |-RPCInfoFromDb                                   = False
+| | |                                                    (default: 'Muon::RpcRDO_Decoder')
+| | |-TriggerOutputCollection                         = 'StoreGateSvc+RPC_Measurements'
+| | |-etaphi_coincidenceTime                          = 20.0
+| | |-overlap_timeTolerance                           = 10.0
+| | |-processingData                                  = False
+| | |-produceRpcCoinDatafromTriggerWords              = True
+| | |-reduceCablingOverlap                            = True
+| | |-solvePhiAmbiguities                             = True
+| | |-timeShift                                       = -12.5
+| | |=/***** Private AlgTool Muon::RpcRDO_Decoder/RpcRdoToRpcPrepData.RpcRdoToRpcPrepDataTool.Muon::RpcRDO_Decoder *****
+| | | |-AuditFinalize                  = False
+| | | |-AuditInitialize                = False
+| | | |-AuditReinitialize              = False
+| | | |-AuditRestart                   = False
+| | | |-AuditStart                     = False
+| | | |-AuditStop                      = False
+| | | |-AuditTools                     = False
+| | | |-MonitorService                 = 'MonitorSvc'
+| | | |-OutputLevel                    = 0
+| | | \----- (End of Private AlgTool Muon::RpcRDO_Decoder/RpcRdoToRpcPrepData.RpcRdoToRpcPrepDataTool.Muon::RpcRDO_Decoder) -----
+| | \----- (End of Private AlgTool Muon::RpcRdoToPrepDataTool/RpcRdoToRpcPrepData.RpcRdoToRpcPrepDataTool) -----
+| \----- (End of Algorithm RpcRdoToRpcPrepData/RpcRdoToRpcPrepData) ----------------------------------
+|=/***** Algorithm TgcRdoToTgcPrepData/TgcRdoToTgcPrepData *******************************************
+| |-AuditAlgorithms                         = False
+| |-AuditBeginRun                           = False
+| |-AuditEndRun                             = False
+| |-AuditExecute                            = False
+| |-AuditFinalize                           = False
+| |-AuditInitialize                         = False
+| |-AuditReinitialize                       = False
+| |-AuditRestart                            = False
+| |-AuditStart                              = False
+| |-AuditStop                               = False
+| |                                            (default: 'Muon::TgcRdoToPrepDataTool/TgcPrepDataProviderTool')
+| |-DoSeededDecoding                        = False
+| |-Enable                                  = True
+| |-ErrorCounter                            = 0
+| |-ErrorMax                                = 1
+| |-FilterCircularDependencies              = True
+| |-IsIOBound                               = False
+| |-MonitorService                          = 'MonitorSvc'
+| |-OutputCollection                        = 'StoreGateSvc+TGC_Measurements'
+| |-OutputLevel                             = 0
+| |-PrintInputRdo                           = False
+| |-RegisterForContextService               = False
+| |-RoIs                                    = 'StoreGateSvc+OutputRoIs'
+| |-Setting                                 = 0
+| |=/***** Private AlgTool Muon::TgcRdoToPrepDataTool/TgcRdoToTgcPrepData.TgcRdoToTgcPrepDataTool ******
+| | |-AuditFinalize                                        = False
+| | |-AuditInitialize                                      = False
+| | |-AuditReinitialize                                    = False
+| | |-AuditRestart                                         = False
+| | |-AuditStart                                           = False
+| | |-AuditStop                                            = False
+| | |-AuditTools                                           = False
+| | |-DecodeData                                           = True
+| | |-FillCoinData                                         = True
+| | |-MonitorService                                       = 'MonitorSvc'
+| | |-OutputCoinCollection                                 = 'TrigT1CoinDataCollection'
+| | |-OutputCollection                                     = 'TGC_Measurements'
+| | |-OutputLevel                                          = 0
+| | |-RDOContainer                                         = 'StoreGateSvc+TGCRDO'
+| | |-TGCHashIdOffset                                      = 26000
+| | |-dropPrdsWithZeroWidth                                = True
+| | |                                                         (default: ['StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy'])
+| | |                                                         (default: ['StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy'])
+| | |-show_warning_level_invalid_A09_SSW6_hit              = False
+| | \----- (End of Private AlgTool Muon::TgcRdoToPrepDataTool/TgcRdoToTgcPrepData.TgcRdoToTgcPrepDataTool) -----
+| \----- (End of Algorithm TgcRdoToTgcPrepData/TgcRdoToTgcPrepData) ----------------------------------
+|=/***** Algorithm MdtRdoToMdtPrepData/MdtRdoToMdtPrepData *******************************************
+| |-AuditAlgorithms                         = False
+| |-AuditBeginRun                           = False
+| |-AuditEndRun                             = False
+| |-AuditExecute                            = False
+| |-AuditFinalize                           = False
+| |-AuditInitialize                         = False
+| |-AuditReinitialize                       = False
+| |-AuditRestart                            = False
+| |-AuditStart                              = False
+| |-AuditStop                               = False
+| |                                            (default: 'Muon::MdtRdoToPrepDataTool/MdtPrepDataProviderTool')
+| |-DoSeededDecoding                        = False
+| |-Enable                                  = True
+| |-ErrorCounter                            = 0
+| |-ErrorMax                                = 1
+| |-FilterCircularDependencies              = True
+| |-IsIOBound                               = False
+| |-MonitorService                          = 'MonitorSvc'
+| |-OutputCollection                        = 'StoreGateSvc+MDT_DriftCircles'
+| |-OutputLevel                             = 0
+| |-PrintInputRdo                           = False
+| |-RegisterForContextService               = False
+| |-RoIs                                    = 'StoreGateSvc+OutputRoIs'
+| |=/***** Private AlgTool Muon::MdtRdoToPrepDataTool/MdtRdoToMdtPrepData.MdtRdoToMdtPrepDataTool ******
+| | |-AuditFinalize                        = False
+| | |-AuditInitialize                      = False
+| | |-AuditReinitialize                    = False
+| | |-AuditRestart                         = False
+| | |-AuditStart                           = False
+| | |-AuditStop                            = False
+| | |-AuditTools                           = False
+| | |-CalibratePrepData                    = True
+| | |-DecodeData                           = True
+| | |-DiscardSecondaryHitTwin              = False
+| | |-DoPropagationCorrection              = False
+| | |-DoTofCorrection                      = True
+| | |-MonitorService                       = 'MonitorSvc'
+| | |-OutputCollection                     = 'StoreGateSvc+MDT_DriftCircles'
+| | |-OutputLevel                          = 0
+| | |-RDOContainer                         = 'StoreGateSvc+MDTCSM'
+| | |-ReadKey                              = 'ConditionStore+MuonMDT_CablingMap'
+| | |-SortPrepData                         = False
+| | |-TimeWindowLowerBound                 = -1000000.0
+| | |-TimeWindowSetting                    = 2
+| | |-TimeWindowUpperBound                 = -1000000.0
+| | |-TwinCorrectSlewing                   = False
+| | |-Use1DPrepDataTwin                    = False
+| | |-UseAllBOLTwin                        = False
+| | |-UseTwin                              = True
+| | \----- (End of Private AlgTool Muon::MdtRdoToPrepDataTool/MdtRdoToMdtPrepData.MdtRdoToMdtPrepDataTool) -----
+| \----- (End of Algorithm MdtRdoToMdtPrepData/MdtRdoToMdtPrepData) ----------------------------------
+|=/***** Algorithm CscRdoToCscPrepData/CscRdoToCscPrepData *******************************************
+| |-AuditAlgorithms                         = False
+| |-AuditBeginRun                           = False
+| |-AuditEndRun                             = False
+| |-AuditExecute                            = False
+| |-AuditFinalize                           = False
+| |-AuditInitialize                         = False
+| |-AuditReinitialize                       = False
+| |-AuditRestart                            = False
+| |-AuditStart                              = False
+| |-AuditStop                               = False
+| |                                            (default: 'Muon::CscRdoToCscPrepDataTool/CscRdoToPrepDataTool')
+| |-DoSeededDecoding                        = False
+| |-Enable                                  = True
+| |-ErrorCounter                            = 0
+| |-ErrorMax                                = 1
+| |-FilterCircularDependencies              = True
+| |-IsIOBound                               = False
+| |-MonitorService                          = 'MonitorSvc'
+| |-OutputCollection                        = 'StoreGateSvc+CSC_Measurements'
+| |-OutputLevel                             = 0
+| |-PrintInputRdo                           = False
+| |-RegisterForContextService               = False
+| |-RoIs                                    = 'StoreGateSvc+OutputRoIs'
+| |=/***** Private AlgTool Muon::CscRdoToCscPrepDataTool/CscRdoToCscPrepData.CscRdoToCscPrepDataTool *****
+| | |-AuditFinalize                  = False
+| | |-AuditInitialize                = False
+| | |-AuditReinitialize              = False
+| | |-AuditRestart                   = False
+| | |-AuditStart                     = False
+| | |-AuditStop                      = False
+| | |-AuditTools                     = False
+| | |-CSCHashIdOffset                = 22000
+| | |-DecodeData                     = True
+| | |-MonitorService                 = 'MonitorSvc'
+| | |-OutputCollection               = 'StoreGateSvc+CSC_Measurements'
+| | |-OutputLevel                    = 0
+| | |-RDOContainer                   = 'StoreGateSvc+CSCRDO'
+| | |=/***** Private AlgTool CscCalibTool/CscRdoToCscPrepData.CscRdoToCscPrepDataTool.CscCalibTool *******
+| | | |-AuditFinalize                   = False
+| | | |-AuditInitialize                 = False
+| | | |-AuditReinitialize               = False
+| | | |-AuditRestart                    = False
+| | | |-AuditStart                      = False
+| | | |-AuditStop                       = False
+| | | |-AuditTools                      = False
+| | | |-IsOnline                        = True
+| | | |-Latency                         = 100.0
+| | | |-MonitorService                  = 'MonitorSvc'
+| | | |-NSamples                        = 4
+| | | |-Noise                           = 3.5
+| | | |-OutputLevel                     = 0
+| | | |-Pedestal                        = 2048.0
+| | | |-ReadFromDatabase                = True
+| | | |-Slope                           = 0.19
+| | | |-SlopeFromDatabase               = False
+| | | |-TimeOffsetRange                 = 1.0
+| | | |-Use2Samples                     = False
+| | | |-integrationNumber               = 12.0
+| | | |-integrationNumber2              = 11.66
+| | | |-samplingTime                    = 50.0
+| | | |-signalWidth                     = 14.4092
+| | | |-timeOffset                      = 46.825
+| | | \----- (End of Private AlgTool CscCalibTool/CscRdoToCscPrepData.CscRdoToCscPrepDataTool.CscCalibTool) -----
+| | |=/***** Private AlgTool Muon::CscRDO_Decoder/CscRdoToCscPrepData.CscRdoToCscPrepDataTool.CscRDO_Decoder *****
+| | | |-AuditFinalize                  = False
+| | | |-AuditInitialize                = False
+| | | |-AuditReinitialize              = False
+| | | |-AuditRestart                   = False
+| | | |-AuditStart                     = False
+| | | |-AuditStop                      = False
+| | | |-AuditTools                     = False
+| | | |-MonitorService                 = 'MonitorSvc'
+| | | |-OutputLevel                    = 0
+| | | \----- (End of Private AlgTool Muon::CscRDO_Decoder/CscRdoToCscPrepData.CscRdoToCscPrepDataTool.CscRDO_Decoder) -----
+| | \----- (End of Private AlgTool Muon::CscRdoToCscPrepDataTool/CscRdoToCscPrepData.CscRdoToCscPrepDataTool) -----
+| \----- (End of Algorithm CscRdoToCscPrepData/CscRdoToCscPrepData) ----------------------------------
+|=/***** Algorithm CscThresholdClusterBuilder/CscThesholdClusterBuilder ******************************
+| |-AuditAlgorithms                         = False
+| |-AuditBeginRun                           = False
+| |-AuditEndRun                             = False
+| |-AuditExecute                            = False
+| |-AuditFinalize                           = False
+| |-AuditInitialize                         = False
+| |-AuditReinitialize                       = False
+| |-AuditRestart                            = False
+| |-AuditStart                              = False
+| |-AuditStop                               = False
+| |-Enable                                  = True
+| |-ErrorCounter                            = 0
+| |-ErrorMax                                = 1
+| |-FilterCircularDependencies              = True
+| |-IsIOBound                               = False
+| |-MonitorService                          = 'MonitorSvc'
+| |-OutputLevel                             = 0
+| |-RegisterForContextService               = False
+| |                                            (default: 'CscThresholdClusterBuilderTool/CscThresholdClusterBuilderTool')
+| \----- (End of Algorithm CscThresholdClusterBuilder/CscThesholdClusterBuilder) ---------------------
+\----- (End of Algorithm AthSequencer/AthAlgSeq) ---------------------------------------------------
+Py:Athena            INFO Save Config
+/***** Algorithm AthSequencer/AthAlgSeq ************************************************************
+|-Atomic                                  = False
+|-AuditAlgorithms                         = False
+|-AuditBeginRun                           = False
+|-AuditEndRun                             = False
+|-AuditExecute                            = False
+|-AuditFinalize                           = False
+|-AuditInitialize                         = False
+|-AuditReinitialize                       = False
+|-AuditRestart                            = False
+|-AuditStart                              = False
+|-AuditStop                               = False
+|-ContinueEventloopOnFPE                  = False
+|-Enable                                  = True
+|-ErrorCounter                            = 0
+|-ErrorMax                                = 1
+|-FilterCircularDependencies              = True
+|-IgnoreFilterPassed                      = False
+|-IsIOBound                               = False
+|                                            (default: [])
+|-ModeOR                                  = False
+|-MonitorService                          = 'MonitorSvc'
+|-OutputLevel                             = 0
+|-RegisterForContextService               = False
+|-StopOverride                            = False
+|-TimeOut                                 = 0.0
 |=/***** Algorithm MuonCacheCreator/MuonCacheCreator *************************************************
 | |-AuditAlgorithms                         = False
 | |-AuditBeginRun                           = False
@@ -1239,6 +1640,103 @@ Py:Athena            INFO Print Config
 | |-OutputLevel                             = 0
 | |-RegisterForContextService               = False
 | \----- (End of Algorithm MuonCacheCreator/MuonCacheCreator) ----------------------------------------
+|=/***** Algorithm Muon::RpcRawDataProvider/RpcRawDataProvider ***************************************
+| |-AuditAlgorithms                         = False
+| |-AuditBeginRun                           = False
+| |-AuditEndRun                             = False
+| |-AuditExecute                            = False
+| |-AuditFinalize                           = False
+| |-AuditInitialize                         = False
+| |-AuditReinitialize                       = False
+| |-AuditRestart                            = False
+| |-AuditStart                              = False
+| |-AuditStop                               = False
+| |-DoSeededDecoding                        = False
+| |-Enable                                  = True
+| |-ErrorCounter                            = 0
+| |-ErrorMax                                = 1
+| |-FilterCircularDependencies              = True
+| |-IsIOBound                               = False
+| |-MonitorService                          = 'MonitorSvc'
+| |-OutputLevel                             = 0
+| |                                            (default: 'Muon::RPC_RawDataProviderTool/RpcRawDataProviderTool')
+| |-RegisterForContextService               = False
+| |-RoIs                                    = 'StoreGateSvc+OutputRoIs'
+| |=/***** Private AlgTool Muon::RPC_RawDataProviderTool/RpcRawDataProvider.RPC_RawDataProviderTool *****
+| | |-AuditFinalize                  = False
+| | |-AuditInitialize                = False
+| | |-AuditReinitialize              = False
+| | |-AuditRestart                   = False
+| | |-AuditStart                     = False
+| | |-AuditStop                      = False
+| | |-AuditTools                     = False
+| | |-MonitorService                 = 'MonitorSvc'
+| | |-OutputLevel                    = 0
+| | |-RPCSec                         = 'StoreGateSvc+RPC_SECTORLOGIC'
+| | |-RdoLocation                    = 'StoreGateSvc+RPCPAD'
+| | |=/***** Private AlgTool Muon::RpcROD_Decoder/RpcRawDataProvider.RPC_RawDataProviderTool.RpcROD_Decoder *****
+| | | |-AuditFinalize                    = False
+| | | |-AuditInitialize                  = False
+| | | |-AuditReinitialize                = False
+| | | |-AuditRestart                     = False
+| | | |-AuditStart                       = False
+| | | |-AuditStop                        = False
+| | | |-AuditTools                       = False
+| | | |-DataErrorPrintLimit              = 1000
+| | | |-MonitorService                   = 'MonitorSvc'
+| | | |-OutputLevel                      = 0
+| | | |-Sector13Data                     = False
+| | | |-SpecialROBNumber                 = -1
+| | | \----- (End of Private AlgTool Muon::RpcROD_Decoder/RpcRawDataProvider.RPC_RawDataProviderTool.RpcROD_Decoder) -----
+| | \----- (End of Private AlgTool Muon::RPC_RawDataProviderTool/RpcRawDataProvider.RPC_RawDataProviderTool) -----
+| \----- (End of Algorithm Muon::RpcRawDataProvider/RpcRawDataProvider) ------------------------------
+|=/***** Algorithm Muon::TgcRawDataProvider/TgcRawDataProvider ***************************************
+| |-AuditAlgorithms                         = False
+| |-AuditBeginRun                           = False
+| |-AuditEndRun                             = False
+| |-AuditExecute                            = False
+| |-AuditFinalize                           = False
+| |-AuditInitialize                         = False
+| |-AuditReinitialize                       = False
+| |-AuditRestart                            = False
+| |-AuditStart                              = False
+| |-AuditStop                               = False
+| |-Enable                                  = True
+| |-ErrorCounter                            = 0
+| |-ErrorMax                                = 1
+| |-FilterCircularDependencies              = True
+| |-IsIOBound                               = False
+| |-MonitorService                          = 'MonitorSvc'
+| |-OutputLevel                             = 0
+| |                                            (default: 'Muon::TGC_RawDataProviderTool/TgcRawDataProviderTool')
+| |-RegisterForContextService               = False
+| |=/***** Private AlgTool Muon::TGC_RawDataProviderTool/TgcRawDataProvider.TGC_RawDataProviderTool *****
+| | |-AuditFinalize                  = False
+| | |-AuditInitialize                = False
+| | |-AuditReinitialize              = False
+| | |-AuditRestart                   = False
+| | |-AuditStart                     = False
+| | |-AuditStop                      = False
+| | |-AuditTools                     = False
+| | |                                   (default: 'Muon::TGC_RodDecoderReadout/TGC_RodDecoderReadout')
+| | |-MonitorService                 = 'MonitorSvc'
+| | |-OutputLevel                    = 0
+| | |-RdoLocation                    = 'StoreGateSvc+TGCRDO'
+| | |=/***** Private AlgTool Muon::TGC_RodDecoderReadout/TgcRawDataProvider.TGC_RawDataProviderTool.TgcROD_Decoder *****
+| | | |-AuditFinalize                  = False
+| | | |-AuditInitialize                = False
+| | | |-AuditReinitialize              = False
+| | | |-AuditRestart                   = False
+| | | |-AuditStart                     = False
+| | | |-AuditStop                      = False
+| | | |-AuditTools                     = False
+| | | |-MonitorService                 = 'MonitorSvc'
+| | | |-OutputLevel                    = 0
+| | | |-ShowStatusWords                = False
+| | | |-SkipCoincidence                = False
+| | | \----- (End of Private AlgTool Muon::TGC_RodDecoderReadout/TgcRawDataProvider.TGC_RawDataProviderTool.TgcROD_Decoder) -----
+| | \----- (End of Private AlgTool Muon::TGC_RawDataProviderTool/TgcRawDataProvider.TGC_RawDataProviderTool) -----
+| \----- (End of Algorithm Muon::TgcRawDataProvider/TgcRawDataProvider) ------------------------------
 |=/***** Algorithm Muon::MdtRawDataProvider/MdtRawDataProvider ***************************************
 | |-AuditAlgorithms                         = False
 | |-AuditBeginRun                           = False
@@ -1589,7 +2087,6 @@ Py:Athena            INFO Print Config
 | |                                            (default: 'CscThresholdClusterBuilderTool/CscThresholdClusterBuilderTool')
 | \----- (End of Algorithm CscThresholdClusterBuilder/CscThesholdClusterBuilder) ---------------------
 \----- (End of Algorithm AthSequencer/AthAlgSeq) ---------------------------------------------------
-Py:Athena            INFO Save Config
 
 JOs reading stage finished, launching Athena from pickle file
 
@@ -3130,7 +3627,6 @@ CscRawDataProvi...  DEBUG Before processing numColls=0
 CscRawDataProvi...  DEBUG vector of ROB ID to decode: size = 32
 CscRawDataProvi...  DEBUG After processing numColls=32
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #186580451, run #327265 20 events processed so far  <<<===
-Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
 ApplicationMgr       INFO Application Manager Stopped successfully
 CondInputLoader      INFO Finalizing CondInputLoader...
 AtlasFieldSvc        INFO finalize() successful
diff --git a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/RT_Relation_DB_DigiTool.h b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/RT_Relation_DB_DigiTool.h
index 19d4232d28a468b549f228a34007895129c8a03f..5021f574c833fa7a874ed6c6837e2322dbc4b0ad 100644
--- a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/RT_Relation_DB_DigiTool.h
+++ b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/RT_Relation_DB_DigiTool.h
@@ -42,7 +42,7 @@ class RT_Relation_DB_DigiTool : public AthAlgTool, virtual public IMDT_Digitizat
     RT_Relation_DB_DigiTool( const std::string& type, const std::string& name, const IInterface* parent );
     
     //Methods
-    StatusCode initialize();
+    virtual StatusCode initialize() override;
     virtual MdtDigiToolOutput digitize(const MdtDigiToolInput& input, CLHEP::HepRandomEngine *rndmEngine) override final;
     bool initializeTube();
   
diff --git a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/RT_Relation_DigiTool.h b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/RT_Relation_DigiTool.h
index 6cce27f63a527ba460d389b75896639963536b41..8c004f60c83ae7d799d05f5311203bc57498d832 100644
--- a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/RT_Relation_DigiTool.h
+++ b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/RT_Relation_DigiTool.h
@@ -36,7 +36,7 @@ class RT_Relation_DigiTool : public AthAlgTool,
 
   virtual MdtDigiToolOutput digitize(const MdtDigiToolInput& input,CLHEP::HepRandomEngine *rndmEngine) override final;
   
-  StatusCode initialize();
+  virtual StatusCode initialize() override;
 
   bool initializeTube();
 
diff --git a/MuonSpectrometer/MuonOverlay/CscOverlay/CscOverlay/CscOverlay.h b/MuonSpectrometer/MuonOverlay/CscOverlay/CscOverlay/CscOverlay.h
index 042c28904d766bd32e4d06041e8fec03154085e6..66d185126505cc42181bbff0a9b18efe3a1594ce 100644
--- a/MuonSpectrometer/MuonOverlay/CscOverlay/CscOverlay/CscOverlay.h
+++ b/MuonSpectrometer/MuonOverlay/CscOverlay/CscOverlay/CscOverlay.h
@@ -37,20 +37,25 @@ public:
 
   CscOverlay(const std::string &name,ISvcLocator *pSvcLocator);
 
-  /** Framework implemenrtation for the event loop */
   virtual StatusCode initialize() override final;
   virtual StatusCode execute() override final;
 
 private:
 
-  /** given 2 container of data - zero bias real data and the simulation,
-      do the merging */
-  StatusCode overlayContainer(const CscRawDataContainer* main, const CscRawDataContainer* overlay);
+  /// @brief Overlay signal on the background container and record to the output one
+  StatusCode overlayContainer(const CscRawDataContainer *bkgContainer,
+                              const CscRawDataContainer *signalContainer,
+                              CscRawDataContainer *outputContainer);
 
-  /** if the 2 container do overlay,
-      loop over the container and do the overlap collection by collection */
-  void mergeCollections(CscRawDataCollection *out_coll, const CscRawDataCollection *orig_coll,
-                        const CscRawDataCollection *ovl_coll, CLHEP::HepRandomEngine* rndmEngine);
+  /// @brief Copy CscRawDataCollection, optionally only copy properties
+  std::unique_ptr<CscRawDataCollection> copyCollection(const CscRawDataCollection *collection,
+                                                       bool propertiesOnly = false) const;
+
+  /// @brief In case of overlap merge signal and background collections
+  void mergeCollections(const CscRawDataCollection *bkgCollection,
+                        const CscRawDataCollection *signalCollection,
+                        CscRawDataCollection *outputCollection,
+                        CLHEP::HepRandomEngine *rndmEngine);
 
   /** get the data in one SPU of a chamber */
   void spuData( const CscRawDataCollection * coll, const uint16_t spuID, std::vector<const CscRawData*>& data);
@@ -77,9 +82,6 @@ private:
   //Whether the data needs to be fliped by 49-strip for bug#56002
   bool needtoflip(const int address) const;
 
-  // Copying CscRawDataCollection properties
-  void copyCscRawDataCollectionProperties(const CscRawDataCollection& sourceColl, CscRawDataCollection& outColl) const;
-
   // ----------------------------------------------------------------
 
   // jO controllable properties.
diff --git a/MuonSpectrometer/MuonOverlay/CscOverlay/src/CscOverlay.cxx b/MuonSpectrometer/MuonOverlay/CscOverlay/src/CscOverlay.cxx
index 7006962cdab05e2c1768c4900600dfb02cfa6c7e..97dde499aad284f73e63aea39da2aaed03314772 100644
--- a/MuonSpectrometer/MuonOverlay/CscOverlay/src/CscOverlay.cxx
+++ b/MuonSpectrometer/MuonOverlay/CscOverlay/src/CscOverlay.cxx
@@ -4,7 +4,6 @@
 
 #include "CscOverlay/CscOverlay.h"
 
-#include "StoreGate/StoreGateSvc.h"
 #include "StoreGate/ReadHandle.h"
 #include "StoreGate/WriteHandle.h"
 
@@ -14,10 +13,9 @@
 #include "CLHEP/Random/RandomEngine.h"
 #include "CLHEP/Random/RandGauss.h"
 
-#include <iostream>
-#include <typeinfo>
-
-constexpr uint16_t MAX_AMPL = 4095; // 12-bit ADC
+namespace {
+  constexpr uint16_t MAX_AMPL = 4095; // 12-bit ADC
+}
 
 //================================================================
 CscOverlay::CscOverlay(const std::string &name, ISvcLocator *pSvcLocator) :
@@ -52,201 +50,215 @@ StatusCode CscOverlay::initialize()
 
 //================================================================
 StatusCode CscOverlay::execute() {
-  ATH_MSG_DEBUG("CscOverlay::execute() begin");
-  //----------------------------------------------------------------
+  ATH_MSG_DEBUG("execute() begin");
+
+
   SG::ReadHandle<CscRawDataContainer> bkgContainer(m_bkgInputKey);
   if(!bkgContainer.isValid()) {
-    ATH_MSG_ERROR("Could not get signal CSC container " << bkgContainer.name() << " from store " << bkgContainer.store());
+    ATH_MSG_ERROR("Could not get background CscRawDataContainer called " << bkgContainer.name() << " from store " << bkgContainer.store());
     return StatusCode::FAILURE;
   }
   ATH_MSG_DEBUG("Found background CscRawDataContainer called " << bkgContainer.name() << " in store " << bkgContainer.store());
 
-  ATH_MSG_DEBUG("Retrieving signal input CSC container");
   SG::ReadHandle<CscRawDataContainer> signalContainer(m_signalInputKey);
   if(!signalContainer.isValid()) {
-    ATH_MSG_ERROR("Could not get signal CSC container " << signalContainer.name() << " from store " << signalContainer.store());
+    ATH_MSG_ERROR("Could not get signal CscRawOverlayContainer called " << signalContainer.name() << " from store " << signalContainer.store());
     return StatusCode::FAILURE;
   }
   ATH_MSG_DEBUG("Found signal CscRawOverlayContainer called " << signalContainer.name() << " in store " << signalContainer.store());
 
-  /* now do the overlay */
-  ATH_CHECK(this->overlayContainer(bkgContainer.cptr(), signalContainer.cptr()));
+  SG::WriteHandle<CscRawDataContainer> outputContainer(m_outputKey);
+  ATH_CHECK(outputContainer.record(std::make_unique<CscRawDataContainer>(bkgContainer->size())));
+  if (!outputContainer.isValid()) {
+    ATH_MSG_ERROR("Could not record output CscRawOverlayContainer called " << outputContainer.name() << " to store " << outputContainer.store());
+    return StatusCode::FAILURE;
+  }
+  ATH_MSG_DEBUG("Recorded output CscRawOverlayContainer called " << outputContainer.name() << " in store " << outputContainer.store());
+
+  // now do the overlay
+  ATH_CHECK(overlayContainer(bkgContainer.cptr(), signalContainer.cptr(), outputContainer.ptr()));
+
 
-  //----------------------------------------------------------------
-  ATH_MSG_DEBUG("CscOverlay::execute() end");
+  ATH_MSG_DEBUG("execute() end");
   return StatusCode::SUCCESS;
 }
 
 //================================================================
-StatusCode CscOverlay::overlayContainer(const CscRawDataContainer *main,
-                                  const CscRawDataContainer *overlay)
+StatusCode CscOverlay::overlayContainer(const CscRawDataContainer *bkgContainer,
+                                        const CscRawDataContainer *signalContainer,
+                                        CscRawDataContainer *outputContainer)
 {
-  ATH_MSG_DEBUG("overlayContainer<>() begin");
-
-  SG::WriteHandle<CscRawDataContainer> outputContainer(m_outputKey);
-  if (outputContainer.record(std::make_unique<CscRawDataContainer>()).isFailure()) {
-    ATH_MSG_ERROR("Could not record output CscRawDataContainer called " << outputContainer.name() << " to store " << outputContainer.store());
-    return StatusCode::FAILURE;
+  ATH_MSG_DEBUG("overlayContainer() begin");
+
+  // Get all the hashes for the signal and background containers
+  const std::vector<IdentifierHash> bkgHashes = bkgContainer->GetAllCurrentHashes();
+  const std::vector<IdentifierHash> signalHashes = signalContainer->GetAllCurrentHashes();
+
+  // The MC signal container should typically be smaller than bkgContainer,
+  // because the latter contains all the noise, minimum bias and pile up.
+  // Thus we firstly iterate over signal hashes and store them in a map.
+  std::map<IdentifierHash, bool> overlapMap;
+  for (const IdentifierHash &hashId : signalHashes) {
+    overlapMap.emplace(hashId, false);
   }
 
-  /** Add data from the main container to the output one */
-  CscRawDataContainer::const_iterator p_main = main->begin();
-  CscRawDataContainer::const_iterator p_main_end = main->end();
-  for(; p_main != p_main_end; ) {
-    const CscRawDataCollection& mainColl(**p_main);
-    //Deep-copy CscRawDataCollection
-    //FIXME Write a copy-constructor for CscRawDataCollection!!
-    auto p_newColl = std::make_unique<CscRawDataCollection>(mainColl.identify());
-    this->copyCscRawDataCollectionProperties(mainColl, *p_newColl);
-    for(auto rawData : **p_main) {
-      auto newData = std::make_unique<CscRawData>(*rawData); // TODO confirm implicit copy-constructor works as expected
-      p_newColl->push_back(newData.release());
-    }
-    if ( outputContainer->addCollection(p_newColl.release(), p_main.hashId()).isFailure() ) {
-      ATH_MSG_WARNING("addCollection failed for main");
-    }
-    else {
-      ATH_MSG_DEBUG("data overlayContainer() added overlaid RDO");
+  // Now loop through the background hashes and copy unique ones over
+  for (const IdentifierHash &hashId : bkgHashes) {
+    auto search = overlapMap.find(hashId);
+    if (search == overlapMap.end()) {
+      // Copy the background collection
+      std::unique_ptr<CscRawDataCollection> bkgCollection
+        = copyCollection(bkgContainer->indexFindPtr(hashId));
+
+      if (outputContainer->addCollection(bkgCollection.get(), hashId).isFailure()) {
+        ATH_MSG_ERROR("Adding background Collection with hashId " << hashId << " failed");
+        return StatusCode::FAILURE;
+      } else {
+        bkgCollection.release();
+      }
+    } else {
+      // Flip the overlap flag
+      search->second = true;
     }
-    ++p_main;
   }
 
+  // Setup random engine
   ATHRNG::RNGWrapper* rngWrapper = m_rndmSvc->getEngine(this);
   rngWrapper->setSeed( name(), Gaudi::Hive::currentContext() );
   CLHEP::HepRandomEngine *rndmEngine(*rngWrapper);
 
-  /** Add data from the ovl container to the output one */
-  CscRawDataContainer::const_iterator p_ovl = overlay->begin();
-  CscRawDataContainer::const_iterator p_ovl_end = overlay->end();
-
-  for(; p_ovl != p_ovl_end; ) {
+  // Finally loop through the map and process the signal and overlay if
+  // necessary
+  for (const auto &[hashId, overlap] : overlapMap) {
+    // Retrieve the signal collection
+    const CscRawDataCollection *signalCollection = signalContainer->indexFindPtr(hashId);
 
-    const CscRawDataCollection *coll_ovl = *p_ovl;
-    const uint16_t coll_id = (*p_ovl)->identify();
+    // Output collection
+    std::unique_ptr<CscRawDataCollection> outputCollection{};
 
-    /** The newly created stuff will go to the output EventStore SG */
-    auto out_coll = std::make_unique<CscRawDataCollection>( coll_id );
+    if (overlap) { // Do overlay
+      // Retrieve the background collection
+      const CscRawDataCollection *bkgCollection = bkgContainer->indexFindPtr(hashId);
 
-    /** Look for the same ID in the main StoreGate EventStore */
-    CscRawDataContainer::const_iterator q = outputContainer->indexFind(coll_id);
+      // Create the output collection with background collection as a base
+      // TODO: should it be signal collection?
+      outputCollection = copyCollection(bkgCollection, true);
 
-    if( q != outputContainer->end() ) {
-      /** Need to merge the collections
-          Retrieve q */
+      // Merge the collections
+      mergeCollections(bkgCollection, signalCollection, outputCollection.get(), rndmEngine);
+    } else {
+      // Create the output collection with signal collection as a base
+      outputCollection = copyCollection(signalCollection, true);
 
-      const CscRawDataCollection *coll_data = *q;
-      this->copyCscRawDataCollectionProperties(*coll_data, *out_coll);
-      this->mergeCollections(out_coll.get(), coll_data, coll_ovl, rndmEngine);
+      uint16_t numSamples = signalCollection->numSamples();
 
-      /** Here the new collection is created, but not yet registered.
-          Put it in IDC in place of the original collection.
-       */
-
-      outputContainer->removeCollection(p_ovl.hashId());
-      if(outputContainer->addCollection(out_coll.release(), p_ovl.hashId()).isFailure()) {
-        ATH_MSG_WARNING("addCollection failed ");
-      }
-      else {
-        ATH_MSG_DEBUG("overlayContainer() added overlaid RDO");
-      }
-    }
-    else {
-      /** Copy the complete collection from ovl to output,
-          hopefully preserving the "most derived" type of its raw data */
-      this->copyCscRawDataCollectionProperties(*coll_ovl, *out_coll);
-
-      /** Copy the complete collection from ovl to output,
-          hopefully preserving the "most derived" type of its raw data */
-      unsigned int numSamples = coll_ovl->numSamples();
-      for(CscRawDataCollection::const_iterator i=coll_ovl->begin(); i!=coll_ovl->end(); i++) {
-
-        /** Put Digit into Collection */
-        const CscRawData *data = ( *i );
-        if( !data ) {
+      for (const CscRawData *data : *signalCollection) {
+        if (!data) {
           ATH_MSG_WARNING("NULL pointer to Digit!");
           continue;
         }
-        else{
-          /** The new RDO goes to m_storeGateOutput - no need to mess with the pedestal, but add in noise */
-          uint16_t width = data->width();
-          uint32_t hashOffset = data->hashId();
-          std::vector<uint16_t> all_samples;
-          for (unsigned int j=0; j<width; ++j) {
-            uint32_t stripHash = hashOffset+j;
-            double noise    = m_cscCalibTool->stripNoise( stripHash, false );
-            //double pedestal = m_cscCalibTool->stripPedestal( stripHash, false );
-            std::vector<uint16_t> samples;
-            bool extractSamples = data->samples(j, numSamples, samples);
-            if (!extractSamples) {
-              ATH_MSG_WARNING("Unable to extract samples for strip " << j
-                              << " Online Cluster width = " << width
-                              << " for number of Samples = " << numSamples
-                              << " continuing ...");
-            }
-            else {
-              for (unsigned int k=0; k<samples.size(); ++k) {
-                double theNoise = CLHEP::RandGauss::shoot(rndmEngine, 0.0, noise);
-                float adcCount = samples[k] + theNoise;
-                if ( adcCount > MAX_AMPL ) {
-                  ATH_MSG_DEBUG("value out of range (copying over signal): " << adcCount << " "
-                                << " Setting it to max value = " << MAX_AMPL
-                                << " IdentifierHash is " << stripHash);
-                  adcCount = MAX_AMPL;
-                }
-                all_samples.push_back( (uint16_t) rint(adcCount) );
+
+        // Copy the digit and add noise
+        std::vector<uint16_t> samples;
+
+        uint16_t width = data->width();
+        uint32_t hashOffset = data->hashId();
+
+        // Loop over width
+        for (uint16_t j = 0; j < width; ++j) {
+          uint32_t stripHash = hashOffset + j;
+          double stripNoise = m_cscCalibTool->stripNoise(stripHash, false);
+          // Get the samples
+          std::vector<uint16_t> stripSamples;
+          bool extractSamplesStatus = data->samples(j, numSamples, stripSamples);
+          if (!extractSamplesStatus) {
+            ATH_MSG_WARNING("Unable to extract samples for strip " << j
+                            << " Online Cluster width = " << width
+                            << " for number of Samples = " << numSamples
+                            << " continuing ...");
+          } else {
+            for (uint16_t sample : stripSamples) {
+              double sampleNoise = CLHEP::RandGauss::shoot(rndmEngine, 0.0, stripNoise);
+              // TODO: rounding issue - some strange type conversion is going on
+              // uint16_t adcCount = sample + std::lrint(sampleNoise);
+              float adcCount = sample + sampleNoise;
+              if (adcCount > MAX_AMPL) {
+                ATH_MSG_DEBUG("value out of range (copying over signal): " << adcCount << " "
+                              << " Setting it to max value = " << MAX_AMPL
+                              << " IdentifierHash is " << stripHash);
+                adcCount = MAX_AMPL;
               }
+              // TODO: rounding issue
+              // samples.push_back(adcCount);
+              samples.push_back( (uint16_t) rint(adcCount) );
             }
           }
-          auto rdo = std::make_unique<CscRawData>( all_samples, data->address(), data->identify(), data->rpuID(), data->width() );
-          rdo->setHashID( data->hashId() );//ACH - was "width()" ???
-          rdo->setTime( data->time() );//ACH - was absent
+        }
 
-          //perform some checks
-          bool good=true;
-          for (unsigned int j=0; j<width; ++j) {
-            const Identifier channelId = m_cscRdoDecoderTool->channelIdentifier(rdo.get(), j);
-            if(!(m_cscHelper->valid(channelId))) {
-              ATH_MSG_WARNING("Invalid CSC Identifier! - skipping " << channelId);
-              good=false;
-            }
-          }
-          if (good){
-            out_coll->push_back( rdo.release() );
+        // Copy over the digit with the updated samples
+        auto rdo = std::make_unique<CscRawData>(samples, data->address(), data->identify(), data->time(), data->rpuID(), data->width(), data->hashId());
+
+        // Perform some checks
+        bool good = true;
+        for (uint16_t j = 0; j < width; ++j) {
+          const Identifier channelId = m_cscRdoDecoderTool->channelIdentifier(rdo.get(), j);
+          if (!m_cscHelper->valid(channelId)) {
+            ATH_MSG_WARNING("Invalid CSC Identifier! - skipping " << channelId);
+            good = false;
+            break;
           }
         }
-      }
-
-      /** The new collection goes to m_storeGateOutput */
-      if(outputContainer->addCollection(out_coll.get(), out_coll->identify()).isFailure()) {
-        ATH_MSG_ERROR("overlayContainer(): Problem in outputContainer->addCollection(Identifier)");
-        return StatusCode::FAILURE;
-      }
-      else {
-        ATH_MSG_DEBUG("overlayContainer() added new RDO");
-        out_coll.release(); // now owned by outputContainer
+        if (good) {
+          outputCollection->push_back(rdo.release());
+        }
       }
     }
 
-    ++p_ovl;
+    if (outputContainer->addCollection(outputCollection.get(), hashId).isFailure()) {
+      ATH_MSG_ERROR("Adding overlaid Collection with hashId " << hashId << " failed");
+      return StatusCode::FAILURE;
+    } else {
+      outputCollection.release();
+    }
   }
 
-  ATH_MSG_DEBUG("overlayContainer<>() end");
+  ATH_MSG_DEBUG("overlayContainer>() end");
   return StatusCode::SUCCESS;
 }
 
-// Copying CscRawDataCollection properties
- void CscOverlay::copyCscRawDataCollectionProperties(const CscRawDataCollection& sourceColl, CscRawDataCollection& outColl) const {
-   /** copy a few things to the new collection */
-   outColl.setIdentifyHash( sourceColl.identifyHash() );
-   outColl.set_eventType( sourceColl.eventType() );
-   outColl.setRodId ( sourceColl.rodId() );
-   outColl.setSubDetectorId ( sourceColl.subDetectorId() );
-   if (sourceColl.samplingPhase()) { outColl.set_samplingPhase(); }
-   if (sourceColl.triggerType()) { outColl.set_triggerType(); }
-   outColl.set_firstBitSummary( sourceColl.firstBitSummary() );
-   outColl.set_scaAddress( sourceColl.scaAddress() );
-   for (auto dataType : sourceColl.dataType()) { outColl.addDataType( dataType ); }
- }
+// Copy CscRawDataCollection
+std::unique_ptr<CscRawDataCollection>
+CscOverlay::copyCollection(const CscRawDataCollection *collection,
+                           bool propertiesOnly) const
+{
+  auto outputCollection = std::make_unique<CscRawDataCollection>(collection->identify());
+
+  // Copy property values to the new collection
+  outputCollection->setIdentifyHash(collection->identifyHash());
+  outputCollection->set_eventType(collection->eventType());
+  outputCollection->setRodId(collection->rodId());
+  outputCollection->setSubDetectorId(collection->subDetectorId());
+  outputCollection->set_samplingPhase(collection->samplingPhase());
+  outputCollection->set_triggerType(collection->triggerType());
+  outputCollection->set_firstBitSummary(collection->firstBitSummary());
+  outputCollection->set_scaAddress(collection->scaAddress());
+  for (uint8_t dataType : collection->dataType()) {
+    outputCollection->addDataType(dataType);
+  }
+
+  // Return if only properties requested
+  if (propertiesOnly) {
+    return outputCollection;
+  }
+
+  for (const CscRawData *existingDatum : *collection) {
+    // Owned by the collection
+    auto *datumCopy = new CscRawData(*existingDatum);
+    outputCollection->push_back(datumCopy);
+  }
+
+  return outputCollection;
+}
 
 void CscOverlay::spuData( const CscRawDataCollection * coll, const uint16_t spuID, std::vector<const CscRawData*>& data) {
   data.clear();  if ( !coll ) return;
@@ -267,36 +279,33 @@ bool CscOverlay::needtoflip(const int address) const {
          return false;
 }
 
-//
-//
-//
-//
+
 //================================================================
-void CscOverlay::mergeCollections(CscRawDataCollection *out_coll,
-                                  const CscRawDataCollection *data_coll,
-                                  const CscRawDataCollection *ovl_coll,
-                                  CLHEP::HepRandomEngine* rndmEngine)
+void CscOverlay::mergeCollections(const CscRawDataCollection *bkgCollection,
+                                  const CscRawDataCollection *signalCollection,
+                                  CscRawDataCollection *outputCollection,
+                                  CLHEP::HepRandomEngine *rndmEngine)
 {
-  ATH_MSG_DEBUG("mergeCollection<>() begin");
+  ATH_MSG_DEBUG("mergeCollection() begin");
 
   // number of ADC samples in  the both data stream
-  unsigned int nSigSamples  = data_coll->numSamples();
-  unsigned int nOvlSamples  = ovl_coll->numSamples();
+  unsigned int nSigSamples  = bkgCollection->numSamples();
+  unsigned int nOvlSamples  = signalCollection->numSamples();
 
   // sampling times in both data streams
-  unsigned int dataSamplingTime = data_coll->rate();
-  unsigned int ovlSamplingTime  = ovl_coll->rate();
+  unsigned int dataSamplingTime = bkgCollection->rate();
+  unsigned int ovlSamplingTime  = signalCollection->rate();
 
   if ( dataSamplingTime != ovlSamplingTime ) {
-    ATH_MSG_WARNING("Overlay of inconsistent data - sampling times not the same "
-                    << dataSamplingTime << " ns " << ovlSamplingTime << " ns");
-     return;
+    ATH_MSG_ERROR("Overlay of inconsistent data - sampling times not the same "
+                  << dataSamplingTime << " ns " << ovlSamplingTime << " ns");
+    throw std::runtime_error("mergeCollections(): sampling time mismatch");
   }
 
   if ( nSigSamples != nOvlSamples ) {
-    ATH_MSG_WARNING("Overlay of inconsistent data - number of samples not the same "
-                    << nSigSamples << " " << nOvlSamples);
-     return;
+    ATH_MSG_ERROR("Overlay of inconsistent data - number of samples not the same "
+                  << nSigSamples << " " << nOvlSamples);
+    throw std::runtime_error("mergeCollections(): number of samples mismatch");
   }
 
   /** loop over the SPU - collecting thr data by layer
@@ -306,10 +315,10 @@ void CscOverlay::mergeCollections(CscRawDataCollection *out_coll,
   for ( uint16_t spuID=0; spuID<10; ++spuID) {
 
     std::vector<const CscRawData*> sigData; // real data
-    this->spuData(data_coll, spuID, sigData);
+    this->spuData(bkgCollection, spuID, sigData);
 
     std::vector<const CscRawData*> ovlData; // simulation
-    this->spuData(ovl_coll, spuID, ovlData);
+    this->spuData(signalCollection, spuID, ovlData);
 
     /** for the non-precision strips, all the 4 layers in a chamber
         are in the same SPU, we need to recover the data by chamber layer */
@@ -360,7 +369,7 @@ void CscOverlay::mergeCollections(CscRawDataCollection *out_coll,
        for (std::map< int,std::vector<uint16_t> >::const_iterator s=sigSamples.begin(); s!=sigSamples.end(); ++s){readstrips.insert(s->first);}
        for (std::map< int,std::vector<uint16_t> >::const_iterator si=ovlSamples.begin(); si!=ovlSamples.end(); ++si){readstrips.insert(si->first);}
 
-       std::vector<CscRawData*> datums = this->overlay(sigSamples, ovlSamples,address, spuID, out_coll->identify(), hash, rndmEngine);
+       std::vector<CscRawData*> datums = this->overlay(sigSamples, ovlSamples,address, spuID, outputCollection->identify(), hash, rndmEngine);
        if ( datums.size()==0 ) {         ATH_MSG_WARNING("datums is size 0!");       }
        for (unsigned int di=0; di<datums.size(); ++di){
          CscRawData* datum=datums[di];
@@ -407,7 +416,7 @@ void CscOverlay::mergeCollections(CscRawDataCollection *out_coll,
             }
           else{ATH_MSG_DEBUG("Valid CSC Identifier in merge " << channelId);}
           }
-          if (good){        out_coll->push_back(datum);   }
+          if (good){        outputCollection->push_back(datum);   }
           else{     continue;     }
 
           //keep count
@@ -425,8 +434,8 @@ void CscOverlay::mergeCollections(CscRawDataCollection *out_coll,
 
     }
   }
-  for (unsigned int i=0; i<10; ++i) out_coll->set_spuCount(i,clusterCounts[i]);
-  for (unsigned int i=0; i<2; ++i)  { if (rpuCount[i] != 0) out_coll->addRPU(rpuCount[i]); }
+  for (unsigned int i=0; i<10; ++i) outputCollection->set_spuCount(i,clusterCounts[i]);
+  for (unsigned int i=0; i<2; ++i)  { if (rpuCount[i] != 0) outputCollection->addRPU(rpuCount[i]); }
   // FIXME --- need to be able to reset the dataType - should add a new method to CscRawDataCollection for this
   ATH_MSG_DEBUG("mergeCollection<>() end ");
 }
diff --git a/PhysicsAnalysis/AnalysisCommon/IsolationSelection/Root/IsolationSelectionTool.cxx b/PhysicsAnalysis/AnalysisCommon/IsolationSelection/Root/IsolationSelectionTool.cxx
index c04e13ce2179b7ae4d6c6594d13229da9605c5b5..f9e0fb8307d0716ed4c2a0c8d7c492912cd06dca 100644
--- a/PhysicsAnalysis/AnalysisCommon/IsolationSelection/Root/IsolationSelectionTool.cxx
+++ b/PhysicsAnalysis/AnalysisCommon/IsolationSelection/Root/IsolationSelectionTool.cxx
@@ -163,25 +163,25 @@ namespace CP {
             addCutToWP(wp, m_muWPKey, xAOD::Iso::ptvarcone30, "99");
         } else if (muWPname == "Loose") {
             addCutToWP(wp, m_muWPKey, xAOD::Iso::ptvarcone30, "99");
-            addCutToWP(wp, m_muWPKey, xAOD::Iso::topoetcone20, "99");
+            //addCutToWP(wp, m_muWPKey, xAOD::Iso::topoetcone20, "99");
         } else if (muWPname == "Tight") {
             ATH_MSG_WARNING("Obsolete muon WP " << muWPname << ". Check Twiki " << m_TwikiLoc);
             addCutToWP(wp, m_muWPKey, xAOD::Iso::ptvarcone30, "99");
-            addCutToWP(wp, m_muWPKey, xAOD::Iso::topoetcone20, "96");
+            //addCutToWP(wp, m_muWPKey, xAOD::Iso::topoetcone20, "96");
             // For gradient efficiency in pT
         } else if (muWPname == "Gradient") {
             addCutToWP(wp, m_muWPKey, xAOD::Iso::ptvarcone30, "0.1143*x+92.14");
-            addCutToWP(wp, m_muWPKey, xAOD::Iso::topoetcone20, "0.1143*x+92.14");
+            //addCutToWP(wp, m_muWPKey, xAOD::Iso::topoetcone20, "0.1143*x+92.14");
         } else if (muWPname == "GradientLoose") {
             addCutToWP(wp, m_muWPKey, xAOD::Iso::ptvarcone30, "0.057*x+95.57");
-            addCutToWP(wp, m_muWPKey, xAOD::Iso::topoetcone20, "0.057*x+95.57");
+            ///addCutToWP(wp, m_muWPKey, xAOD::Iso::topoetcone20, "0.057*x+95.57");
         } else if (muWPname == "GradientT1") {
             addCutToWP(wp, m_muWPKey, xAOD::Iso::ptvarcone30, "0.1713*x+88.71");
-            addCutToWP(wp, m_muWPKey, xAOD::Iso::topoetcone20, "0.1713*x+88.71");
+            //addCutToWP(wp, m_muWPKey, xAOD::Iso::topoetcone20, "0.1713*x+88.71");
             ATH_MSG_WARNING("Obsolete muon WP " << muWPname << ". Check Twiki " << m_TwikiLoc);
         } else if (muWPname == "GradientT2") {
             addCutToWP(wp, m_muWPKey, xAOD::Iso::ptvarcone30, "0.2283*x+85.28");
-            addCutToWP(wp, m_muWPKey, xAOD::Iso::topoetcone20, "0.2283*x+85.28");
+            //addCutToWP(wp, m_muWPKey, xAOD::Iso::topoetcone20, "0.2283*x+85.28");
             ATH_MSG_WARNING("Obsolete muon WP " << muWPname << ". Check Twiki " << m_TwikiLoc);
             // Using fixed cuts
         } else if (muWPname == "FixedCutTightTrackOnly") {
diff --git a/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/share/PhysValTrigEgamma_jobOptions.py b/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/share/PhysValTrigEgamma_jobOptions.py
index e7d5cfca43415bdd7a860eebe877dd7376957a4d..a9f349ee4e9efaaf042a48001eb998108b62de41 100644
--- a/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/share/PhysValTrigEgamma_jobOptions.py
+++ b/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/share/PhysValTrigEgamma_jobOptions.py
@@ -1,8 +1,9 @@
 from TrigEgammaMonitoring.TrigEgammaMonitoringConfig import TrigEgammaMonitoringTool
-for tool1 in TrigEgammaMonitoringTool():
+tools = TrigEgammaMonitoringTool()
+for tool1 in tools:
     tool1.EnableLumi = False
     tool1.OutputLevel = WARNING
     #tool1.DetailLevel = 10
     
     tool1.EnableLumi = False
-    monMan.AthenaMonTools += [tool1]
+    #monMan.AthenaMonTools += [tool1]
diff --git a/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetVertexFractionTool.h b/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetVertexFractionTool.h
index 68c9e910b6bf3360a5e419af166b291cd9e097b9..ac3f1931fd7854756e6d5707c7443aa9d1b64d32 100644
--- a/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetVertexFractionTool.h
+++ b/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetVertexFractionTool.h
@@ -119,6 +119,8 @@ private:  // methods
                         const std::vector<const xAOD::TrackParticle*>&,
                         const jet::TrackVertexAssociation*) const;
 
+protected:
+  bool m_isTrigger;  
 };
 
 
diff --git a/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetVertexTaggerTool.h b/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetVertexTaggerTool.h
index 68823c71171b86f9d1b415adfaecbf6141650083..2e4f378941523e14340527aee93cc9ce332c6a38 100644
--- a/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetVertexTaggerTool.h
+++ b/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetVertexTaggerTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 // JetVertexTaggerTool.h
@@ -55,7 +55,6 @@
 #include "xAODTracking/TrackParticle.h"
 #include "xAODTracking/TrackParticleContainer.h"
 
-#include "JetInterface/IJetTrackSelector.h"
 #include "JetRec/JetModifierBase.h"
 #include "JetEDM/TrackVertexAssociation.h"
 #include "JetInterface/IJetModifier.h"
@@ -105,15 +104,12 @@ public:
 private:  // data
 
   // Configurable parameters
-  std::string m_assocTracksName;
-  std::string m_tvaName;
-  std::string m_tracksName;
+  std::string m_verticesName;
   std::string m_jvfCorrName;
   std::string m_sumPtTrkName;
   std::string m_jvtlikelihoodHistName;
   std::string m_jvtfileName;
   std::string m_jvtName;
-  ToolHandle<IJetTrackSelector> m_htsel;
   TString m_fn;
   TFile * m_jvtfile;
   TH2F * m_jvthisto;
diff --git a/Reconstruction/Jet/JetMomentTools/Root/JetVertexFractionTool.cxx b/Reconstruction/Jet/JetMomentTools/Root/JetVertexFractionTool.cxx
index 06ce33713eb9a25f4dca955ce3366e1bfdfd1e2f..695f73a27b774bcb25e7af7e400e00bff3ac5397 100644
--- a/Reconstruction/Jet/JetMomentTools/Root/JetVertexFractionTool.cxx
+++ b/Reconstruction/Jet/JetMomentTools/Root/JetVertexFractionTool.cxx
@@ -22,6 +22,7 @@ JetVertexFractionTool::JetVertexFractionTool(const std::string& name)
   declareProperty("VertexContainer", m_vertexContainer_key);
   declareProperty("TrackVertexAssociation", m_tva_key);
   declareProperty("TrackParticleContainer",m_tracksCont_key);
+  declareProperty("IsTrigger",m_isTrigger =false);
 }
 
 //**********************************************************************
@@ -166,7 +167,7 @@ int JetVertexFractionTool::modify(xAOD::JetContainer& jetCont) const {
     std::vector<float> vsumpttrk = jet->getAttribute<std::vector<float> >(m_sumPtTrkName);
     float sumpttrk_all = tracksums.first;
     float sumpttrk_nonPV = tracksums.second;
-    float sumpttrk_PV = vsumpttrk[HSvertex->index()];
+    float sumpttrk_PV = vsumpttrk[HSvertex->index() - (*vertices)[0]->index()];
 
     // Get and set the JVF vector
     std::vector<float> jvf(vertices->size());
@@ -176,9 +177,10 @@ int JetVertexFractionTool::modify(xAOD::JetContainer& jetCont) const {
     jet->setAttribute(m_jvfname, jvf);
 
     // Get and set the highest JVF vertex
-    jet->setAttribute("Highest" + m_jvfname + "Vtx",getMaxJetVertexFraction(vertices,jvf));
-
-    // Calculate RpT and JVFCorr
+    if(!m_isTrigger) {
+      jet->setAttribute("Highest" + m_jvfname + "Vtx",getMaxJetVertexFraction(vertices,jvf));
+    }
+    // Calculate RpT and JVFCorr 
     // Default JVFcorr to -1 when no tracks are associated.
     float jvfcorr = -999.;
     if(sumpttrk_PV + sumpttrk_nonPV > 0) {
@@ -286,15 +288,19 @@ int JetVertexFractionTool::getPileupTrackCount(const xAOD::Vertex* vertex,
 
 const xAOD::Vertex* JetVertexFractionTool::findHSVertex(const xAOD::VertexContainer*& vertices) const
 {
-  for ( size_t iVertex = 0; iVertex < vertices->size(); ++iVertex ) {
-    if(vertices->at(iVertex)->vertexType() == xAOD::VxType::PriVtx) {
-
-      ATH_MSG_VERBOSE("JetVertexFractionTool " << name() << " Found HS vertex at index: "<< iVertex);
-      return vertices->at(iVertex);
-    }
+  const xAOD::Vertex* primvert = nullptr;
+  for (const xAOD::Vertex* pv : *vertices) {
+	if (pv->vertexType() == xAOD::VxType::PriVtx ) {
+		primvert = pv;
+      		ATH_MSG_VERBOSE("JetVertexFractionTool " << name() << " Found HS vertex.");
+		break;
+	}
+  }
+  if (primvert == nullptr ) {
+  	ATH_MSG_VERBOSE("There is no vertex of type PriVx. Taking default vertex.");
+	primvert = *(vertices->begin());
   }
-  ATH_MSG_VERBOSE("There is no vertex of type PriVx. Taking default vertex.");
-  return vertices->at(0);
+  return primvert;
 }
 
 //**********************************************************************
diff --git a/Reconstruction/Jet/JetMomentTools/Root/JetVertexTaggerTool.cxx b/Reconstruction/Jet/JetMomentTools/Root/JetVertexTaggerTool.cxx
index 09e0fd97d5c7dceea9714e01714da16d96ce58fe..6c4a709b2f737b9c7c1368232d4b78fd03dc432c 100644
--- a/Reconstruction/Jet/JetMomentTools/Root/JetVertexTaggerTool.cxx
+++ b/Reconstruction/Jet/JetMomentTools/Root/JetVertexTaggerTool.cxx
@@ -1,7 +1,7 @@
 ///////////////////////// -*- C++ -*- ////////////////////////////
 
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 // JetVertexTaggerTool.cxx
@@ -21,14 +21,12 @@ JetVertexTaggerTool::JetVertexTaggerTool(const std::string& name)
 : asg::AsgTool(name)
 , m_jvtlikelihoodHistName("")
 , m_jvtfileName("")
-, m_htsel("")
 {
     declareProperty("JVFCorrName", m_jvfCorrName="JVFCorr");
     declareProperty("SumPtTrkName", m_sumPtTrkName="SumPtTrkPt500");
 
     declareProperty("JVTFileName",m_jvtfileName = "JVTlikelihood_20140805.root");
     declareProperty("JVTLikelihoodHistName",m_jvtlikelihoodHistName = "JVTRootCore_kNN100trim_pt20to50_Likelihood");
-    declareProperty("TrackSelector", m_htsel);
     declareProperty("JVTName", m_jvtName ="Jvt");
 
     declareProperty("VertexContainer", m_vertexContainer_key="PrimaryVertices");
@@ -41,12 +39,6 @@ StatusCode JetVertexTaggerTool::initialize() {
   ATH_MSG_DEBUG("initializing version with data handles");
   ATH_MSG_INFO("Initializing JetVertexTaggerTool " << name());
 
-  if ( m_htsel.empty() ) {
-    ATH_MSG_INFO("  No track selector.");
-  } else {
-    ATH_MSG_INFO("  Track selector: " << m_htsel->name());
-  }
-
   // Use the Path Resolver to find the jvt file and retrieve the likelihood histogram
   m_fn =  PathResolverFindCalibFile(m_jvtfileName);
   ATH_MSG_INFO("  Reading JVT file from:\n    " << m_jvtfileName << "\n");
@@ -101,7 +93,7 @@ int JetVertexTaggerTool::modify(xAOD::JetContainer& jetCont) const {
       // Default JVFcorr to -1 when no tracks are associated.
       float jvfcorr = jet->getAttribute<float>(m_jvfCorrName);
       std::vector<float> sumpttrkpt500 = jet->getAttribute<std::vector<float> >(m_sumPtTrkName);
-      const float rpt = sumpttrkpt500[HSvertex->index()]/jet->pt();
+      const float rpt = sumpttrkpt500[HSvertex->index() - (*vertices)[0]->index()]/jet->pt();
       float jvt = evaluateJvt(rpt, jvfcorr);
 
       jet->setAttribute(m_jvtName+"Rpt",rpt);
diff --git a/Reconstruction/Jet/JetRec/Root/IParticleExtractor.cxx b/Reconstruction/Jet/JetRec/Root/IParticleExtractor.cxx
index 2e3ed355f62fa11faa8148dbedb62a4f5a58ddd7..f1fdd906fd70a2386e92d8d7d2eaab77b37fa1b7 100644
--- a/Reconstruction/Jet/JetRec/Root/IParticleExtractor.cxx
+++ b/Reconstruction/Jet/JetRec/Root/IParticleExtractor.cxx
@@ -55,7 +55,7 @@ void IParticleExtractor::addToJet(xAOD::Jet& jet,
                                    [](double sumPt, const xAOD::IParticle* p){
                                      return sumPt + p->pt();});
 
-    if (!m_isTrigger){jet.setAssociatedObjects(m_label, constituents);}
+    if ( (!m_isTrigger) || (m_label == "GhostTrack") ){jet.setAssociatedObjects(m_label, constituents);}
     jet.setAttribute<float>(m_label + "Pt", ptSum);
     jet.setAttribute<int>(m_label+"Count", constituents.size());
   } else {
diff --git a/Reconstruction/Jet/JetRecTools/JetRecTools/JetConstituentModSequence.h b/Reconstruction/Jet/JetRecTools/JetRecTools/JetConstituentModSequence.h
index 50ded5fd4265ce7eda3aa91cbff5fa26053994ac..f14d27742687e2ba58de93c443b940e2bbc7ebe0 100644
--- a/Reconstruction/Jet/JetRecTools/JetRecTools/JetConstituentModSequence.h
+++ b/Reconstruction/Jet/JetRecTools/JetRecTools/JetConstituentModSequence.h
@@ -75,6 +75,12 @@ protected:
   StatusCode
   copyModRecord(const SG::ReadHandleKey<T>&,
                 const SG::WriteHandleKey<T>&) const;
+
+  // temporary trigger helper needed until we can
+  // decommission TrigHLTJetRec classes
+  template<class T, class Taux, class Tsingle>
+  StatusCode
+  copyModForTrigger(const T&) const;
 };
 
 template<class T>
@@ -106,5 +112,28 @@ JetConstituentModSequence::copyModRecord(const SG::ReadHandleKey<T>& inKey,
   return StatusCode::SUCCESS;
 }
 
+template<class T, class Taux, class Tsingle>
+StatusCode
+JetConstituentModSequence::copyModForTrigger(const T& originals) const
+{
+    
+  // This is the trigger case, revert to a deep copy of the input container.
+  // Create the new container and its auxiliary store.
+  T* constitCopy = new T();
+  Taux* constitCopyAux = new Taux();
+  constitCopy->setStore( constitCopyAux ); //< Connect the two
+
+  for(const Tsingle* orig_constit : originals) {
+    Tsingle* theconstit = new Tsingle();
+    constitCopy->push_back( theconstit );
+    *theconstit= *orig_constit; // copies auxdata from one auxstore to the other
+  }
+  
+  for (auto t : m_modifiers) {ATH_CHECK(t->process(constitCopy));}
+
+  // Update the output container pointer
+  m_trigOutputConstits = constitCopy;
+  return StatusCode::SUCCESS;
+}
 
 #endif
diff --git a/Reconstruction/Jet/JetRecTools/Root/JetConstituentModSequence.cxx b/Reconstruction/Jet/JetRecTools/Root/JetConstituentModSequence.cxx
index 4a8b4b1b0fd3e7f84616d2f8c523a55970f7f09d..e2e17de28ffb820351aed16c8bf60521156e1391 100644
--- a/Reconstruction/Jet/JetRecTools/Root/JetConstituentModSequence.cxx
+++ b/Reconstruction/Jet/JetRecTools/Root/JetConstituentModSequence.cxx
@@ -7,6 +7,7 @@
 // Will later add the intermediate step
 
 #include "JetRecTools/JetConstituentModSequence.h"
+#include "xAODCaloEvent/CaloClusterAuxContainer.h"
 
 JetConstituentModSequence::JetConstituentModSequence(const std::string &name):
   asg::AsgTool(name),
@@ -19,7 +20,7 @@ JetConstituentModSequence::JetConstituentModSequence(const std::string &name):
   declareProperty("OutputContainer", m_outputContainer, "The output container for the sequence.");
   declareProperty("InputType", m_inputType, "The xAOD type name for the input container.");
   declareProperty("Modifiers", m_modifiers, "List of IJet tools.");
-	declareProperty("Trigger", m_trigger=false);
+  declareProperty("Trigger", m_trigger=false);
   declareProperty("SaveAsShallow", m_saveAsShallow=true, "Save as shallow copy");
 
 }
@@ -72,19 +73,29 @@ StatusCode JetConstituentModSequence::initialize() {
 }
   
 int JetConstituentModSequence::execute() const {
-  if (m_trigger){return 0;}
 
   // Create the shallow copy according to the input type
   switch(m_inputType){
 
   case xAOD::Type::CaloCluster: {
-    auto sc  = copyModRecord(m_inClusterKey, 
-                             m_outClusterKey);
-    if(!sc.isSuccess()){return 1;}
+    if (m_trigger){
+      auto clustersin = dynamic_cast<const xAOD::CaloClusterContainer*>(m_trigInputConstits);
+      if(clustersin==nullptr) {
+	ATH_MSG_ERROR("Failed to cast trigInputConstits to CaloCluster");
+	return(3);
+      }
+      auto sc  = copyModForTrigger<xAOD::CaloClusterContainer,xAOD::CaloClusterAuxContainer,xAOD::CaloCluster>(*clustersin);
+      if(!sc.isSuccess()){return 1;}
+    } else {
+      auto sc  = copyModRecord(m_inClusterKey, 
+			       m_outClusterKey);
+      if(!sc.isSuccess()){return 1;}
+    }
     break; 
   }
   
   case xAOD::Type::ParticleFlow: {
+    if (m_trigger){return 2;}
     auto sc = copyModRecordPFO();
     if(!sc.isSuccess()){return 1;}
     break;
diff --git a/Reconstruction/MVAUtils/CMakeLists.txt b/Reconstruction/MVAUtils/CMakeLists.txt
index 7774cf602d8dcfc71378f87acd9fff466491adb5..3b392df10ad2b57945adc42d884db32c433fdbd5 100644
--- a/Reconstruction/MVAUtils/CMakeLists.txt
+++ b/Reconstruction/MVAUtils/CMakeLists.txt
@@ -5,6 +5,10 @@
 # Declare the package name:
 atlas_subdir( MVAUtils )
 
+atlas_depends_on_subdirs(
+  PRIVATE
+  Control/CxxUtils )
+
 # External dependencies:
 find_package( ROOT COMPONENTS Tree TreePlayer TMVA XMLIO Core MathCore Hist RIO pthread )
 
diff --git a/Reconstruction/egamma/egammaRec/python/EMCommonRefitter.py b/Reconstruction/egamma/egammaRec/python/EMCommonRefitter.py
index c42ebc0cd12e249bcc95e5d23a0993a064d07a81..88c83ee17639ccf259a63f704406706caa8aa30f 100644
--- a/Reconstruction/egamma/egammaRec/python/EMCommonRefitter.py
+++ b/Reconstruction/egamma/egammaRec/python/EMCommonRefitter.py
@@ -28,7 +28,7 @@ def CreateEgammaRotCreator():
     # --- since a correction is needed to fix biases when running on new run 2 compatible calibation
 
     if not hasattr(ToolSvc, "PixelLorentzAngleTool"):
-      from SiLorentzAngleSvc.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup
+      from SiLorentzAngleTool.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup
       pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup()
 
     from SiClusterizationTool.SiClusterizationToolConf import InDet__NnClusterizationFactory    
@@ -61,7 +61,7 @@ def CreateEgammaRotCreator():
     # load Pixel ROT creator, we overwrite the defaults for the
     # tool to always make conservative pixel cluster errors
     if not hasattr(ToolSvc, "PixelLorentzAngleTool"):
-      from SiLorentzAngleSvc.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup
+      from SiLorentzAngleTool.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup
       pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup()
 
     from SiClusterOnTrackTool.SiClusterOnTrackToolConf import InDet__PixelClusterOnTrackTool
@@ -80,7 +80,7 @@ def CreateEgammaRotCreator():
 
   if DetFlags.haveRIO.SCT_on():
     # SiLorentzAngleTool
-    from SiLorentzAngleSvc.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
+    from SiLorentzAngleTool.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
     sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup()
     from SiClusterOnTrackTool.SiClusterOnTrackToolConf import InDet__SCT_ClusterOnTrackTool
     egSCT_ClusterOnTrackTool = InDet__SCT_ClusterOnTrackTool ("egSCT_ClusterOnTrackTool",
diff --git a/TileCalorimeter/TileRec/TileRec/TileAANtuple.h b/TileCalorimeter/TileRec/TileRec/TileAANtuple.h
index cac40af3ffe43c47bdf54628fd0c67e4c760e961..df20a467ffbd94c2b7e09f5538aaa6ec747a581b 100755
--- a/TileCalorimeter/TileRec/TileRec/TileAANtuple.h
+++ b/TileCalorimeter/TileRec/TileRec/TileAANtuple.h
@@ -247,8 +247,8 @@ class TileAANtuple : public AthAlgorithm {
 
       short m_rodBCID[N_ROS][N_MODULES] = {{0}};
       short m_fragSize[N_ROS][N_MODULES] = {{0}};
-      uint16_t m_dmuMask[N_ROS][N_MODULES][2] = {{0}};
-      uint16_t m_slinkCRC[N_ROS][N_MODULES][2] = {{0}};
+      uint16_t m_dmuMask[N_ROS][N_MODULES][2] = {{{0}}};
+      uint16_t m_slinkCRC[N_ROS][N_MODULES][2] = {{{0}}};
 
       uint32_t m_DMUheader[N_ROS2][N_MODULES][N_DMUS] = {{{0}}};
       short m_DMUbcid[N_ROS2][N_MODULES][N_DMUS] = {{{0}}};
@@ -295,8 +295,8 @@ class TileAANtuple : public AthAlgorithm {
       float m_pedDsp[N_ROS2][N_MODULES][N_CHANS] = {{{0}}};
       float m_chi2Dsp[N_ROS2][N_MODULES][N_CHANS] = {{{0}}};
 
-      float m_eMF[N_ROS2][N_MODULES][N_CHANS][N_SAMPLES] = {{{0}}};
-      float m_tMF[N_ROS2][N_MODULES][N_CHANS][N_SAMPLES] = {{{0}}};
+      float m_eMF[N_ROS2][N_MODULES][N_CHANS][N_SAMPLES] = {{{{0}}}};
+      float m_tMF[N_ROS2][N_MODULES][N_CHANS][N_SAMPLES] = {{{{0}}}};
       float m_chi2MF[N_ROS2][N_MODULES][N_CHANS] = {{{0}}};
       float m_pedMF[N_ROS2][N_MODULES][N_CHANS] = {{{0}}};
 
diff --git a/TileCalorimeter/TileSimAlgs/TileSimAlgs/TileDigitsFromPulse.h b/TileCalorimeter/TileSimAlgs/TileSimAlgs/TileDigitsFromPulse.h
index a9fa8ce47c34323b256b4a17d0fa682e77d72761..d2371cf227ca6e596bd154e442ccc810986ddd18 100644
--- a/TileCalorimeter/TileSimAlgs/TileSimAlgs/TileDigitsFromPulse.h
+++ b/TileCalorimeter/TileSimAlgs/TileSimAlgs/TileDigitsFromPulse.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 //****************************************************************************
@@ -74,7 +74,7 @@ class TilePulseShape;
 
 class TileHWID;
 class TileInfo;
-class IAtRndmGenSvc;
+class IAthRNGSvc;
 
 class TH1F;
 class TFile;
@@ -114,8 +114,7 @@ private:
     SG::WriteHandleKey<TileRawChannelContainer> m_rawChannelContainerKey{this,
         "TileRawChannelContainer", "TrueAmp", "Output Tile raw channel container key"};
     
-    CLHEP::HepRandomEngine * m_pHRengine; //!< Random number generator engine to use
-    ServiceHandle <IAtRndmGenSvc> m_rndmSvc;  //!< Random number service to use
+    ServiceHandle <IAthRNGSvc> m_rndmSvc{this, "RndmSvc", "AthRNGSvc", ""};  //!< Random number service to use
 
     
     //Parameters
diff --git a/TileCalorimeter/TileSimAlgs/TileSimAlgs/TileDigitsMaker.h b/TileCalorimeter/TileSimAlgs/TileSimAlgs/TileDigitsMaker.h
index 870dfbe8050b3c59c7425bb6c90e725b3758e843..fb7fb3ef82635d6e2cce986907499f0dc6348c35 100644
--- a/TileCalorimeter/TileSimAlgs/TileSimAlgs/TileDigitsMaker.h
+++ b/TileCalorimeter/TileSimAlgs/TileSimAlgs/TileDigitsMaker.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 //****************************************************************************
@@ -50,7 +50,7 @@
 #include "TileEvent/TileHitContainer.h"
 
 
-class IAtRndmGenSvc;
+class IAthRNGSvc;
 class PileUpMergeSvc;
 class TileID;
 class TileTBID;
@@ -153,9 +153,7 @@ class TileDigitsMaker: public AthAlgorithm {
     int m_binTime0Lo;                   //!< Index of time=0 bin for low gain pulse shape
     double m_timeStepLo;                //!< Time step in low gain pulse shape: 25.0 / nBinsPerXLo
 
-    CLHEP::HepRandomEngine * m_pHRengine;    //!< Random number generator engine to use
-
-    ServiceHandle<IAtRndmGenSvc> m_rndmSvc;  //!< Random number service to use
+    ServiceHandle<IAthRNGSvc> m_rndmSvc{this, "RndmSvc", "AthRNGSvc", ""};  //!< Random number service to use
 
     ToolHandle<TileCondToolNoiseSample> m_tileToolNoiseSample{this,
         "TileCondToolNoiseSample", "TileCondToolNoiseSample", "Tile sample noise tool"};
diff --git a/TileCalorimeter/TileSimAlgs/TileSimAlgs/TileHitToRawChannel.h b/TileCalorimeter/TileSimAlgs/TileSimAlgs/TileHitToRawChannel.h
index f8dda86c1804c6a8d106f8be4759952eb759cd09..a628d57fb737795014f805265f2f2c566dc0f0b8 100644
--- a/TileCalorimeter/TileSimAlgs/TileSimAlgs/TileHitToRawChannel.h
+++ b/TileCalorimeter/TileSimAlgs/TileSimAlgs/TileHitToRawChannel.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 //****************************************************************************
@@ -51,7 +51,7 @@
 #include <vector>
 
 
-class IAtRndmGenSvc;
+class IAthRNGSvc;
 class TileID;
 class TileTBID;
 class TileHWID;
@@ -111,8 +111,7 @@ class TileHitToRawChannel: public AthAlgorithm {
     double m_threshHi; //!< Value of the mimimal amplitude required to do the conversion to raw channel in high gain (not used for low gain)
     double m_ampMaxHi; //!< Value of the maximum amplitude to be stored as a high gain channel. For larger amplitudes, the channel is converted to low gain
 
-    IAtRndmGenSvc * m_atRndmGenSvc; //!< Random number generator engine to use
-    CLHEP::HepRandomEngine * m_pHRengine;  //!< Random number service to use
+    ServiceHandle<IAthRNGSvc> m_atRndmGenSvc{this, "RndmSvc", "AthRNGSvc", ""}; //!< Random number generator engine to use
 
     ToolHandle<TileCondToolEmscale> m_tileToolEmscale{this,
         "TileCondToolEmscale", "TileCondToolEmscale", "Tile EM scale calibration tool"};
diff --git a/TileCalorimeter/TileSimAlgs/TileSimAlgs/TileHitToTTL1.h b/TileCalorimeter/TileSimAlgs/TileSimAlgs/TileHitToTTL1.h
index d40163eb4a7a44e0eaa39b6c41afb770779c6354..faae77d0af7d8772c2247aafc70e5ec7b5b2ff64 100644
--- a/TileCalorimeter/TileSimAlgs/TileSimAlgs/TileHitToTTL1.h
+++ b/TileCalorimeter/TileSimAlgs/TileSimAlgs/TileHitToTTL1.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 //****************************************************************************
@@ -42,11 +42,9 @@
 #include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/ServiceHandle.h"
 
-#include "CLHEP/Random/RandomEngine.h"
-
 #include <string>
 
-class IAtRndmGenSvc;
+class IAthRNGSvc;
 class TileID;
 class TileTBID;
 class TileHWID;
@@ -118,9 +116,7 @@ class TileHitToTTL1: public AthAlgorithm {
     bool m_tileNoise;   //!< If true => generate noise for the TileTTL1 creation
     bool m_tileThresh;  //!< If true => apply threshold on the conversion to TileTTL1
 
-    CLHEP::HepRandomEngine* m_pHRengine; //!< Random number service to use
-
-    ServiceHandle<IAtRndmGenSvc> m_rndmSvc; //!< Random number generator engine to use
+    ServiceHandle<IAthRNGSvc> m_rndmSvc{this, "RndmSvc", "AthRNGSvc", ""}; //!< Random number generator engine to use
 
     ToolHandle<TileCondToolEmscale> m_tileToolEmscale{this,
         "TileCondToolEmscale", "TileCondToolEmscale", "Tile EM scale calibration tool"};
diff --git a/TileCalorimeter/TileSimAlgs/TileSimAlgs/TileHitVecToCntTool.h b/TileCalorimeter/TileSimAlgs/TileSimAlgs/TileHitVecToCntTool.h
index fa3f0d0525305535c99cdd1fb39d3f20b761d091..a8a7ed378dae47b0427f4d299aa044eb8d677fd6 100644
--- a/TileCalorimeter/TileSimAlgs/TileSimAlgs/TileHitVecToCntTool.h
+++ b/TileCalorimeter/TileSimAlgs/TileSimAlgs/TileHitVecToCntTool.h
@@ -37,7 +37,8 @@
 // Athena includes
 #include "PileUpTools/PileUpToolBase.h"
 #include "StoreGate/WriteHandleKey.h"
-#include "AthenaKernel/IAtRndmGenSvc.h"
+#include "AthenaKernel/IAthRNGSvc.h"
+
 #include "AthenaKernel/ITriggerTime.h"
 
 // Gaudi includes
@@ -94,8 +95,8 @@ class TileHitVecToCntTool: public PileUpToolBase {
     StatusCode createContainers();
     void processHitVectorForOverlay(const TileHitVector* inputHits, int& nHit, double& eHitTot);
     void processHitVectorForPileUp(const TileHitVector* inputHits, double SubEvtTimOffset, int& nHit, double& eHitTot, bool isSignal = false);
-    void processHitVectorWithoutPileUp(const TileHitVector* inputHits, int& nHit, double& eHitTot, TileHitNonConstContainer* &hitCont);
-    double applyPhotoStatistics(double energy, Identifier pmt_id);    //!< Method to apply photostatistics effect
+    void processHitVectorWithoutPileUp(const TileHitVector* inputHits, int& nHit, double& eHitTot, TileHitNonConstContainer* &hitCont, CLHEP::HepRandomEngine * engine);
+    double applyPhotoStatistics(double energy, Identifier pmt_id, CLHEP::HepRandomEngine * engine);    //!< Method to apply photostatistics effect
     void findAndMergeE1(TileHitCollection* coll, int frag_id, TileHitNonConstContainer* &hitCont);
     void findAndMergeMBTS(TileHitCollection* coll, int frag_id, TileHitNonConstContainer* &hitCont);
 
@@ -131,8 +132,7 @@ class TileHitVecToCntTool: public PileUpToolBase {
     const TileDetDescrManager* m_tileMgr;       //!< Pointer to TileDetDescrManager
     float m_nPhotoElectrons[7];                         //!< number of photo electrons per GeV in samplings
 
-    CLHEP::HepRandomEngine* m_pHRengine;       //!< Random number service to use
-    ServiceHandle<IAtRndmGenSvc> m_rndmSvc;     //!< Random number generator engine to use
+    ServiceHandle<IAthRNGSvc> m_rndmSvc{this, "RndmSvc", "AthRNGSvc", ""};     //!< Random number generator engine to use
 
     std::vector<TileHit*> m_allHits;           //!< vector for all TileHits
     std::vector<TileHit*> m_allHits_DigiHSTruth;           //!< vector for all TileHits
diff --git a/TileCalorimeter/TileSimAlgs/TileSimAlgs/TilePulseForTileMuonReceiver.h b/TileCalorimeter/TileSimAlgs/TileSimAlgs/TilePulseForTileMuonReceiver.h
index 9d0b66c21b1f513dde75cdc4708c88925fa4c419..ddfa17f2d891f8c1500bfaa2200cce06a27d8daf 100644
--- a/TileCalorimeter/TileSimAlgs/TileSimAlgs/TilePulseForTileMuonReceiver.h
+++ b/TileCalorimeter/TileSimAlgs/TileSimAlgs/TilePulseForTileMuonReceiver.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 //****************************************************************************
@@ -53,9 +53,7 @@
 #include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/ServiceHandle.h"
 
-#include "CLHEP/Random/RandomEngine.h"
-
-class IAtRndmGenSvc;
+class IAthRNGSvc;
 class PileUpMergeSvc;
 class HWIdentifier;
 
@@ -127,8 +125,7 @@ class TilePulseForTileMuonReceiver: public AthAlgorithm {
     //
     std::vector<double> m_shapeMuonReceiver;//!< Muon receiver pulse shape
 
-    CLHEP::HepRandomEngine* m_pHRengine;    //!< Random number generator engine to use
-    ServiceHandle<IAtRndmGenSvc> m_rndmSvc; //!< Random number service to use
+    ServiceHandle<IAthRNGSvc> m_rndmSvc{this, "RndmSvc", "AthRNGSvc", ""}; //!< Random number service to use
 
     ToolHandle<TileCondToolNoiseSample> m_tileToolNoiseSample{this,
         "TileCondToolNoiseSample", "TileCondToolNoiseSample", "Tile sample noise tool"};
diff --git a/TileCalorimeter/TileSimAlgs/python/TileDigitsGetter.py b/TileCalorimeter/TileSimAlgs/python/TileDigitsGetter.py
index 40dd0f6f39e2d9b9516adb95d01ef47fbfb9e44d..f83c2a867bed519d14ae099b961094e38d0987eb 100644
--- a/TileCalorimeter/TileSimAlgs/python/TileDigitsGetter.py
+++ b/TileCalorimeter/TileSimAlgs/python/TileDigitsGetter.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
 # Author: J. Poveda (Ximo.Poveda@cern.ch)
 # TileDigits creation from TileHit
@@ -65,10 +65,6 @@ class TileDigitsGetter ( Configured )  :
 
         theTileDigitsMaker.CalibrationRun=False
 
-        # Random number engine
-        theTileDigitsMaker.RndmSvc=digitizationFlags.rndmSvc()
-        digitizationFlags.rndmSeedList.addSeed("Tile_DigitsMaker", 4789899, 989240512)
-
         # Save integer numbers in digits vector if not pile-up premixing
         theTileDigitsMaker.IntegerDigits = not digitizationFlags.PileUpPremixing() 
 
diff --git a/TileCalorimeter/TileSimAlgs/python/TileRawChannelFromHitsGetter.py b/TileCalorimeter/TileSimAlgs/python/TileRawChannelFromHitsGetter.py
index 3994a819cf73848589dbb568104229aaf1fbde9c..64e2e6748cf1b227a375197fab71d86e4e702125 100644
--- a/TileCalorimeter/TileSimAlgs/python/TileRawChannelFromHitsGetter.py
+++ b/TileCalorimeter/TileSimAlgs/python/TileRawChannelFromHitsGetter.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
 # Author: J. Poveda (Ximo.Poveda@cern.ch)
 # TileRawChannel creation from TileHit
@@ -65,11 +65,6 @@ class TileRawChannelFromHitsGetter ( Configured )  :
 
         objKeyStore.addStreamESD(self.outputType(),self.outputKey())
 
-        # Random number engine
-        from Digitization.DigitizationFlags import digitizationFlags
-        digitizationFlags.rndmSeedList.addSeed("Tile_DigitsMaker", 4789899, 989240512)
-
-        
         # now add algorithm to topSequence
         # this should always come at the end
 
diff --git a/TileCalorimeter/TileSimAlgs/python/TileSimAlgsConfig.py b/TileCalorimeter/TileSimAlgs/python/TileSimAlgsConfig.py
index 8ffb0575f19fcaa98b137d7c0ba1de109ac9c536..6a5cf4fe333cb50e437618e1c6645133167173c2 100644
--- a/TileCalorimeter/TileSimAlgs/python/TileSimAlgsConfig.py
+++ b/TileCalorimeter/TileSimAlgs/python/TileSimAlgsConfig.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
 from Digitization.DigitizationFlags import digitizationFlags
 from AthenaCommon import CfgMgr
@@ -40,10 +40,6 @@ def TileHitVecToCntTool(name="TileHitVecToCntTool", **kwargs):
         kwargs.setdefault("HitTimeFlag", 2)
         kwargs.setdefault("UseTriggerTime", True)
 
-    # Random number engine
-    kwargs.setdefault("RndmSvc", digitizationFlags.rndmSvc())
-    digitizationFlags.rndmSeedList.addSeed("Tile_HitVecToCnt", 4789899, 989240512)
-
     if digitizationFlags.doXingByXingPileUp(): # PileUpTool approach
         kwargs.setdefault("FirstXing", Tile_FirstXing() ) 
         kwargs.setdefault("LastXing",  Tile_LastXing() ) 
diff --git a/TileCalorimeter/TileSimAlgs/share/TileFitDigitization_jobOptions.py b/TileCalorimeter/TileSimAlgs/share/TileFitDigitization_jobOptions.py
index e482a3694fcd210ab8e9f90b42d1ea2f117e649a..a022e6194614af6dd1f22a73f163a67997a4432a 100644
--- a/TileCalorimeter/TileSimAlgs/share/TileFitDigitization_jobOptions.py
+++ b/TileCalorimeter/TileSimAlgs/share/TileFitDigitization_jobOptions.py
@@ -80,11 +80,6 @@ if doTileHitToDigit:
     theTileDigitsMaker.UseCoolPulseShapes=False
     theTileDigitsMaker.MaskBadChannels=False
     theTileDigitsMaker.RndmEvtOverlay=False
-    
-    # Random number engine
-    from Digitization.DigitizationFlags import jobproperties
-    theTileDigitsMaker.RndmSvc=jobproperties.Digitization.rndmSvc()
-    jobproperties.Digitization.rndmSeedList.addSeed("Tile_DigitsMaker", 4789899, 989240512)
 
 
 if doTileDigitToRawChannel:
diff --git a/TileCalorimeter/TileSimAlgs/share/TileMuonReceiver_jobOptions.py b/TileCalorimeter/TileSimAlgs/share/TileMuonReceiver_jobOptions.py
index 01464381ac2d9c2e6bc233d2908c2b73657b4f2c..32f162bbe779ad08fa9b1413f849f8260dc96e70 100644
--- a/TileCalorimeter/TileSimAlgs/share/TileMuonReceiver_jobOptions.py
+++ b/TileCalorimeter/TileSimAlgs/share/TileMuonReceiver_jobOptions.py
@@ -48,12 +48,9 @@ topSequence += CfgMgr.TilePulseForTileMuonReceiver('TilePulseForTileMuonReceiver
                                                    , UseCoolPedestal = False
                                                    , UseCoolPulseShapes = True
                                                    , TileCondToolPulseShape = toolSvc.TileCondToolMuRcvPulseShape
-                                                   , TileRawChannelBuilderMF = toolSvc.TileMuRcvRawChannelBuilderMF
-                                                   , RndmSvc = jobproperties.Digitization.rndmSvc())
+                                                   , TileRawChannelBuilderMF = toolSvc.TileMuRcvRawChannelBuilderMF)
 
 
-jobproperties.Digitization.rndmSeedList.addSeed("Tile_PulseForTileMuonReceiver", 4789899, 989240512)
-
 topSequence += CfgMgr.TileMuonReceiverDecision('TileMuonReceiverDecision'
 #                                                , OutputLevel = VERBOSE 
 						, MuonReceiverEneThreshCellD6Low = 500
diff --git a/TileCalorimeter/TileSimAlgs/share/TileTTL1_jobOptions.py b/TileCalorimeter/TileSimAlgs/share/TileTTL1_jobOptions.py
index 4e40fd9f75e0b20f2e4e938a3994bccdae9cfbbc..41f01c71eac43e94b2a68108d678b2abe997270f 100644
--- a/TileCalorimeter/TileSimAlgs/share/TileTTL1_jobOptions.py
+++ b/TileCalorimeter/TileSimAlgs/share/TileTTL1_jobOptions.py
@@ -5,8 +5,6 @@ from TileSimAlgs.TileTTL1FromHitsGetter import TileTTL1FromHitsGetter
 theTileTTL1FromHitsGetter = TileTTL1FromHitsGetter()
 
 from Digitization.DigitizationFlags import jobproperties
-topSequence.TileHitToTTL1.RndmSvc = jobproperties.Digitization.rndmSvc()
-jobproperties.Digitization.rndmSeedList.addSeed("Tile_HitToTTL1", 4789899, 989240512)
 
 from AthenaCommon.BeamFlags import jobproperties
 if jobproperties.Beam.beamType == 'cosmics': 
@@ -17,7 +15,4 @@ if jobproperties.Beam.beamType == 'cosmics':
                                      TileTTL1Container = "TileTTL1CosmicsCnt",
 				     TileMBTSTTL1Container = "TileMBTSTTL1CosmicsContainer"
                                      )
-    theTileTTL1Cosmics.RndmSvc=jobproperties.Digitization.rndmSvc()
-    jobproperties.Digitization.rndmSeedList.addSeed("Tile_TTL1Cosmics", 4789899, 989240512)
-
     topSequence += theTileTTL1Cosmics
diff --git a/TileCalorimeter/TileSimAlgs/src/TileDigitsFromPulse.cxx b/TileCalorimeter/TileSimAlgs/src/TileDigitsFromPulse.cxx
index d26dac72a08c3c313a736ed9a639bdebe9c3472b..378bdee6eb5117eab0c39205f6009d58d581edfe 100644
--- a/TileCalorimeter/TileSimAlgs/src/TileDigitsFromPulse.cxx
+++ b/TileCalorimeter/TileSimAlgs/src/TileDigitsFromPulse.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 //*****************************************************************************
@@ -35,7 +35,8 @@
 #include "AthAllocators/DataPool.h"
 #include "PathResolver/PathResolver.h"
 //Random number service
-#include "AthenaKernel/IAtRndmGenSvc.h"
+#include "AthenaKernel/IAthRNGSvc.h"
+#include "AthenaKernel/RNGWrapper.h"
 
 #include <CLHEP/Random/Randomize.h>
 #include <CLHEP/Units/SystemOfUnits.h>
@@ -60,10 +61,7 @@ using CLHEP::RandFlat;
 TileDigitsFromPulse::TileDigitsFromPulse(std::string name, ISvcLocator* pSvcLocator) :
   AthAlgorithm(name, pSvcLocator),
   m_tileHWID(0),
-  m_tileInfo(0),
-  m_pHRengine(0),
-  m_rndmSvc("AtRndmGenSvc", name)
-
+  m_tileInfo(0)
 {
 	m_rChUnit = TileRawChannelUnit::ADCcounts;
 	m_rChType = TileFragHash::Default;
@@ -205,8 +203,6 @@ StatusCode TileDigitsFromPulse::initialize() {
 	if (!m_rndmSvc.retrieve().isSuccess()) {
 		ATH_MSG_FATAL("Could not initialize find Random Number Service.");
 		return StatusCode::FAILURE;
-	} else {
-		m_pHRengine = m_rndmSvc->GetEngine("Tile_DigitsMaker");
 	}
 	if (m_chanNoise)
 		m_gaussNoise = kFALSE; //Make sure channel noise overrides gaussian noise.
@@ -223,6 +219,10 @@ StatusCode TileDigitsFromPulse::execute() {
 
 	ATH_MSG_DEBUG("in execute()");
 
+	// Prepare RNG service
+	ATHRNG::RNGWrapper* rngWrapper = m_rndmSvc->getEngine(this);
+	rngWrapper->setSeed( name(), Gaudi::Hive::currentContext() );
+
 	// Create new container for digits
 	auto digitsContainer = std::make_unique<TileMutableDigitsContainer>(true,
                                                                             TileFragHash::Digitizer,
@@ -321,8 +321,8 @@ StatusCode TileDigitsFromPulse::execute() {
 							double Hfn1 = m_tileToolNoiseSample->getHfn1(drawerIdx, channel, gain);
 							double Hfn2 = m_tileToolNoiseSample->getHfn2(drawerIdx, channel, gain);
 							double Norm = m_tileToolNoiseSample->getHfnNorm(drawerIdx, channel, gain);
-							RandGaussQ::shootArray(m_pHRengine, samples.size(), Rndm, 0.0, 1.0);
-							RandFlat::shootArray(m_pHRengine, 1, Rndm_dG, 0.0, 1.0);
+							RandGaussQ::shootArray(*rngWrapper, samples.size(), Rndm, 0.0, 1.0);
+							RandFlat::shootArray(*rngWrapper, 1, Rndm_dG, 0.0, 1.0);
 							for (unsigned int js = 0; js < samples.size(); ++js) {
 								//using the same gaussian(sigma) for all samples in one channel in one event
 								if (Rndm_dG[0] < Norm)
diff --git a/TileCalorimeter/TileSimAlgs/src/TileDigitsMaker.cxx b/TileCalorimeter/TileSimAlgs/src/TileDigitsMaker.cxx
index 00da31feb79f25699188b479ddf424a81683845d..0f2e466ac388d999c9239231b1f6f3545bc679f0 100644
--- a/TileCalorimeter/TileSimAlgs/src/TileDigitsMaker.cxx
+++ b/TileCalorimeter/TileSimAlgs/src/TileDigitsMaker.cxx
@@ -34,7 +34,9 @@
 // Atlas include
 #include "AthenaKernel/errorcheck.h"
 // For the Athena-based random numbers.
-#include "AthenaKernel/IAtRndmGenSvc.h"
+#include "AthenaKernel/IAthRNGSvc.h"
+#include "AthenaKernel/RNGWrapper.h"
+
 #include "AthenaKernel/Units.h"
 #include "StoreGate/ReadHandle.h"
 #include "StoreGate/WriteHandle.h"
@@ -87,16 +89,13 @@ TileDigitsMaker::TileDigitsMaker(std::string name, ISvcLocator* pSvcLocator)
     m_nShapeLo(0),
     m_nBinsPerXLo(0),
     m_binTime0Lo(0),
-    m_timeStepLo(0.0),
-    m_pHRengine(0),
-    m_rndmSvc ("AtRndmGenSvc", name)
+    m_timeStepLo(0.0)
 {
   declareProperty("FilterThreshold",       m_filterThreshold = 100.0 * MeV, "Threshold on filtered digits (default - 100 MeV)");
   declareProperty("FilterThresholdMBTS",   m_filterThresholdMBTS = 0.0 * MeV, "Threshold on filtered digits of MBTS (default - 0 MeV)");
   declareProperty("TileInfoName",   m_infoName = "TileInfo");
   declareProperty("IntegerDigits",  m_integerDigits = true);
   declareProperty("CalibrationRun", m_calibRun = false);
-  declareProperty("RndmSvc", m_rndmSvc, "Random Number Service used in TileDigitsMaker");
   declareProperty("RndmEvtOverlay",m_rndmEvtOverlay = false,"Pileup and/or noise added by overlaying random events (default=false)");
   declareProperty("UseCoolPulseShapes",m_useCoolPulseShapes = true,"Pulse shapes from database (default=true)");
   declareProperty("MaskBadChannels",m_maskBadChannels = false,"Remove channels tagged bad (default=false)");
@@ -173,7 +172,6 @@ StatusCode TileDigitsMaker::initialize() {
 
   if (m_tileNoise || m_tileCoherNoise || m_rndmEvtOverlay) {
     ATH_CHECK( m_rndmSvc.retrieve());
-    m_pHRengine = m_rndmSvc->GetEngine("Tile_DigitsMaker");
   }
 
   ATH_MSG_DEBUG( "Event Overlay: " << ((m_rndmEvtOverlay)?"true":"false"));
@@ -361,6 +359,13 @@ StatusCode TileDigitsMaker::execute() {
 
   const EventContext& ctx = Gaudi::Hive::currentContext();
 
+  // Prepare RNG service
+  ATHRNG::RNGWrapper* rngWrapper = nullptr;
+  if (m_tileNoise || m_tileCoherNoise || m_rndmEvtOverlay) {
+    rngWrapper = m_rndmSvc->getEngine(this);
+    rngWrapper->setSeed( name(), ctx );
+  }
+
   static bool first = (msgLvl(MSG::VERBOSE) && !m_rndmEvtOverlay );
   if (first) {
     ATH_MSG_VERBOSE( "Dumping 2G noise parameters");
@@ -802,13 +807,13 @@ StatusCode TileDigitsMaker::execute() {
       //NOTE: ShootArray's inputs are : the engine, the size, the vector, the mean, the standard dev
       for (int k = 0; k < m_nSamples; ++k) {
         double * RndmVec = CorrRndmVec[k];
-        RandGaussQ::shootArray(m_pHRengine, nchMax, RndmVec, 0.0, 1.0);
+        RandGaussQ::shootArray(*rngWrapper, nchMax, RndmVec, 0.0, 1.0);
       }
 
       if (m_calibRun) {
         for (int k = 0; k < m_nSamples; ++k) {
           double * RndmVecLo = CorrRndmVecLo[k];
-          RandGaussQ::shootArray(m_pHRengine, nchMax, RndmVecLo, 0.0, 1.0);
+          RandGaussQ::shootArray(*rngWrapper, nchMax, RndmVecLo, 0.0, 1.0);
         }
       }
     }
@@ -891,11 +896,11 @@ StatusCode TileDigitsMaker::execute() {
 
       /* If tileNoise is requested, generate array of random numbers.   */
       if (tileNoiseLG) { // true if tileNoise is set or noise is needed for low gain in overlay
-        RandGaussQ::shootArray(m_pHRengine, m_nSamples, Rndm, 0.0, 1.0);
-        RandFlat::shootArray(m_pHRengine, 1, Rndm_dG, 0.0, 1.0);
+        RandGaussQ::shootArray(*rngWrapper, m_nSamples, Rndm, 0.0, 1.0);
+        RandFlat::shootArray(*rngWrapper, 1, Rndm_dG, 0.0, 1.0);
         if (m_calibRun) {
-          RandGaussQ::shootArray(m_pHRengine, m_nSamples, RndmLo, 0.0, 1.0);
-          RandFlat::shootArray(m_pHRengine, 1, RndmLo_dG, 0.0, 1.0);
+          RandGaussQ::shootArray(*rngWrapper, m_nSamples, RndmLo, 0.0, 1.0);
+          RandFlat::shootArray(*rngWrapper, 1, RndmLo_dG, 0.0, 1.0);
         }
       }
 
diff --git a/TileCalorimeter/TileSimAlgs/src/TileHitToRawChannel.cxx b/TileCalorimeter/TileSimAlgs/src/TileHitToRawChannel.cxx
index 8a2a56261508656b374e416529fef978b134a7a6..f42a18023d5222499c0642de261bc541ef471c76 100644
--- a/TileCalorimeter/TileSimAlgs/src/TileHitToRawChannel.cxx
+++ b/TileCalorimeter/TileSimAlgs/src/TileHitToRawChannel.cxx
@@ -34,7 +34,8 @@
 #include "StoreGate/WriteHandle.h"
 #include "AthenaKernel/errorcheck.h"
 // For the Athena-based random numbers.
-#include "AthenaKernel/IAtRndmGenSvc.h"
+#include "AthenaKernel/IAthRNGSvc.h"
+#include "AthenaKernel/RNGWrapper.h"
 
 //CLHEP includes
 #include <CLHEP/Random/Randomize.h>
@@ -59,8 +60,6 @@ TileHitToRawChannel::TileHitToRawChannel(std::string name, ISvcLocator* pSvcLoca
   , m_tileThresh(false)
   , m_threshHi(0.0)
   , m_ampMaxHi(0.0)
-  , m_atRndmGenSvc(0)
-  , m_pHRengine(0)
 {
   m_rChUnit = TileRawChannelUnit::ADCcounts;
   m_rChType = TileFragHash::Default;
@@ -103,9 +102,7 @@ StatusCode TileHitToRawChannel::initialize() {
   ATH_CHECK( m_tileToolNoiseSample.retrieve() );
 
   if (m_tileNoise) {
-    static const bool CREATEIFNOTTHERE_RNDM(true);
-    CHECK( service("AtRndmGenSvc", m_atRndmGenSvc, CREATEIFNOTTHERE_RNDM));
-    m_pHRengine = m_atRndmGenSvc->GetEngine("Tile_DigitsMaker");
+    ATH_CHECK(m_atRndmGenSvc.retrieve());
   }
 
   m_cabling = TileCablingService::getInstance();
@@ -169,6 +166,9 @@ StatusCode TileHitToRawChannel::execute() {
 
   ATH_MSG_DEBUG( "Executing TileHitToRawChannel" );
 
+  ATHRNG::RNGWrapper* rngWrapper = m_atRndmGenSvc->getEngine(this);
+  rngWrapper->setSeed( name(), Gaudi::Hive::currentContext() );
+
   // step1: read hits from TES
   SG::ReadHandle<TileHitContainer> hitContainer(m_hitContainerKey);
   ATH_CHECK( hitContainer.isValid() );
@@ -226,7 +226,7 @@ StatusCode TileHitToRawChannel::execute() {
     // If tileNoise is requested, generate random numbers to give noise
     if (m_tileNoise) {
 
-      RandGaussQ::shootArray(m_pHRengine, nChMax, random, 0.0, 1.0);
+      RandGaussQ::shootArray(*rngWrapper, nChMax, random, 0.0, 1.0);
 
       for (ch = 0; ch < nChMax; ++ch) {
         adc_gain[ch] = TileID::HIGHGAIN;
diff --git a/TileCalorimeter/TileSimAlgs/src/TileHitToTTL1.cxx b/TileCalorimeter/TileSimAlgs/src/TileHitToTTL1.cxx
index 6d4dd7210bd9871ec9876d6f6abfb28af17294de..a4946a1d371578e53410b4829af9b1ca92910575 100644
--- a/TileCalorimeter/TileSimAlgs/src/TileHitToTTL1.cxx
+++ b/TileCalorimeter/TileSimAlgs/src/TileHitToTTL1.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 //*****************************************************************************
@@ -40,7 +40,8 @@
 #include "StoreGate/WriteHandle.h"
 #include "AthenaKernel/errorcheck.h"
 // For the Athena-based random numbers.
-#include "AthenaKernel/IAtRndmGenSvc.h"
+#include "AthenaKernel/IAthRNGSvc.h"
+#include "AthenaKernel/RNGWrapper.h"
 
 // Gaudi includes
 #include "GaudiKernel/ISvcLocator.h"
@@ -74,15 +75,12 @@ TileHitToTTL1::TileHitToTTL1(std::string name, ISvcLocator* pSvcLocator)
   , m_lastTower(0)
   , m_tileNoise(false)
   , m_tileThresh(false)
-  , m_pHRengine(0)
-  , m_rndmSvc ("AtRndmGenSvc", name)
 {
   m_infoName = "TileInfo";
   m_TileTTL1Type = "Standard";
 
   declareProperty("TileInfoName", m_infoName);
   declareProperty("TileTTL1Type", m_TileTTL1Type);
-  declareProperty("RndmSvc", m_rndmSvc, "Random Number Service used in TileHitToTTL1");
   declareProperty("maskBadChannels", m_maskBadChannels = true);
 }
 
@@ -113,9 +111,8 @@ StatusCode TileHitToTTL1::initialize() {
   //=== get TileCondToolEmscale
   CHECK( m_tileToolEmscale.retrieve() );
 
-  CHECK( m_rndmSvc.retrieve() );
-  m_pHRengine = m_rndmSvc->GetEngine("Tile_HitToTTL1");
-
+  //=== Get rndm number service
+  ATH_CHECK( m_rndmSvc.retrieve() );
 
   m_cabling = TileCablingService::getInstance();
 
@@ -214,6 +211,10 @@ StatusCode TileHitToTTL1::execute() {
   // declare array for random number generation for noise in samples.
   double Rndm[16];      // Can't use variable size array
 
+  // Prepare RNG Service
+  ATHRNG::RNGWrapper* rngWrapper = m_rndmSvc->getEngine(this);
+  rngWrapper->setSeed( name(), Gaudi::Hive::currentContext() );
+
   /*........................................................................*/
   // Get hit container from TES and create TTL1 and MBTS container
   // Note that hit container has 256 collections (one for each drawer),
@@ -540,7 +541,7 @@ StatusCode TileHitToTTL1::execute() {
           double ttL1Max = m_tileInfo->MBTSL1Max(MBTS_id);
 
           if (m_tileNoise)
-            RandGaussQ::shootArray(m_pHRengine, m_MBTSnSamples, Rndm);
+            RandGaussQ::shootArray(*rngWrapper, m_MBTSnSamples, Rndm);
           for (int jsamp = 0; jsamp < m_MBTSnSamples; ++jsamp) {
             MBTSAmp[jsamp] *= ttL1Calib; // convert pCb to mV
             MBTSsamples[jsamp] = MBTSAmp[jsamp] + ttL1Ped;
@@ -596,7 +597,7 @@ StatusCode TileHitToTTL1::execute() {
           }  // end loop over samples
 
           if (m_tileNoise)
-            peakAmp += ttL1NoiseSigma * RandGaussQ::shoot(m_pHRengine);
+            peakAmp += ttL1NoiseSigma * RandGaussQ::shoot(*rngWrapper);
           ttL1samples[0] = peakAmp;
           if (m_tileThresh) {
             if (ttL1samples[0] - ttL1Ped < ttL1Thresh)
@@ -622,7 +623,7 @@ StatusCode TileHitToTTL1::execute() {
           double ttL1Max = m_tileInfo->TTL1Max(ttId[ieta]);
 
           if (m_tileNoise)
-            RandGaussQ::shootArray(m_pHRengine, m_nSamples, Rndm);
+            RandGaussQ::shootArray(*rngWrapper, m_nSamples, Rndm);
           for (int jsamp = 0; jsamp < m_nSamples; ++jsamp) {
             ttAmp[ieta][jsamp] *= ttL1Calib; // convert pCb to mV
             ttL1samples[jsamp] = ttAmp[ieta][jsamp] + ttL1Ped;
diff --git a/TileCalorimeter/TileSimAlgs/src/TileHitVecToCntTool.cxx b/TileCalorimeter/TileSimAlgs/src/TileHitVecToCntTool.cxx
index b78f6245c41b7240f4e81bef79c608625b977c36..3ec21273efb0abf08fa410f2ff2f1c003c199a29 100644
--- a/TileCalorimeter/TileSimAlgs/src/TileHitVecToCntTool.cxx
+++ b/TileCalorimeter/TileSimAlgs/src/TileHitVecToCntTool.cxx
@@ -31,7 +31,9 @@
 #include "AthenaKernel/ITriggerTime.h"
 #include "AthenaKernel/errorcheck.h"
 // For the Athena-based random numbers.
-#include "AthenaKernel/IAtRndmGenSvc.h"
+#include "AthenaKernel/IAthRNGSvc.h"
+#include "AthenaKernel/RNGWrapper.h"
+#include "CLHEP/Random/RandomEngine.h"
 
 // Gaudi includes
 #include "GaudiKernel/SystemOfUnits.h"
@@ -69,8 +71,6 @@ TileHitVecToCntTool::TileHitVecToCntTool(const std::string& type,
     , m_tileTBID(0)
     , m_tileInfo(0)
     , m_tileMgr(0)
-    , m_pHRengine(0)
-    , m_rndmSvc("AtRndmGenSvc",name)
     , m_hits(0)
     , m_hits_DigiHSTruth(0)
     , m_mbtsOffset(0)
@@ -91,7 +91,6 @@ TileHitVecToCntTool::TileHitVecToCntTool(const std::string& type,
     declareProperty("MaxHitTime", m_maxHitTime,           "All sub-hits with time above m_maxHitTime will be ignored");
     declareProperty("PhotostatWindow", m_photoStatisticsWindow, "Sum up energy in [-m_photoStatWindow,+m_photoStatWindow] and use it for photostatistics");
     declareProperty("PhotostatType", m_photoElectronStatistics,          "Method to apply photostatistics (default=2)");
-    declareProperty("RndmSvc", m_rndmSvc,                 "Random Number Service used in TileHitVecToCnt");
     declareProperty("SkipNoHit",m_skipNoHit,              "Skip events with no Tile hits (default=false)");
     declareProperty("RndmEvtOverlay",m_rndmEvtOverlay = false, "Pileup and/or noise added by overlaying random events (default=false)");
     declareProperty("DoHSTruthReconstruction",m_doDigiTruth = true, "DigiTruth reconstruction");
@@ -104,8 +103,7 @@ StatusCode TileHitVecToCntTool::initialize() {
 
   bool error = false;
 
-  CHECK(m_rndmSvc.retrieve());
-  m_pHRengine = m_rndmSvc->GetEngine("Tile_HitVecToCnt");
+  ATH_CHECK(m_rndmSvc.retrieve());
 
   // retrieve Tile detector manager, TileID helper and TileInfo from det store
 
@@ -377,6 +375,9 @@ StatusCode TileHitVecToCntTool::prepareEvent(unsigned int /*nInputEvents*/) {
 
   ATH_MSG_DEBUG("TileHitVecToCntTool prepareEvent finished");
 
+  ATHRNG::RNGWrapper* rngWrapper = m_rndmSvc->getEngine(this);
+  rngWrapper->setSeed( name(), Gaudi::Hive::currentContext() );
+
   return StatusCode::SUCCESS;
 }
 
@@ -556,7 +557,7 @@ void TileHitVecToCntTool::processHitVectorForPileUp(const TileHitVector* inputHi
   return;
 }
 
-void TileHitVecToCntTool::processHitVectorWithoutPileUp(const TileHitVector* inputHits, int& nHit, double& eHitTot, TileHitNonConstContainer* &hitCont) {
+void TileHitVecToCntTool::processHitVectorWithoutPileUp(const TileHitVector* inputHits, int& nHit, double& eHitTot, TileHitNonConstContainer* &hitCont, CLHEP::HepRandomEngine * engine) {
 
   TileHitVecConstIterator inpItr = inputHits->begin();
   TileHitVecConstIterator end = inputHits->end();
@@ -673,7 +674,7 @@ void TileHitVecToCntTool::processHitVectorWithoutPileUp(const TileHitVector* inp
             }
           }
           ATH_MSG_DEBUG("Minimal time in input event " << avtime);
-          double shift = RandFlat::shoot(m_pHRengine, m_triggerTime, 0.0);
+          double shift = RandFlat::shoot(engine, m_triggerTime, 0.0);
           ATH_MSG_DEBUG("Minimal time after random shift " << shift);
           avtime -= shift; // subtracting negative shift value here
 
@@ -760,6 +761,9 @@ StatusCode TileHitVecToCntTool::processBunchXing(int bunchXing
   ATH_MSG_DEBUG("Inside TileHitVecToCntTool processBunchXing" << bunchXing);
   //  setFilterPassed(true);
 
+  ATHRNG::RNGWrapper* rngWrapper = m_rndmSvc->getEngine(this);
+  CLHEP::HepRandomEngine * engine = *rngWrapper;
+
   SubEventIterator iEvt(bSubEvents);
   if (m_rndmEvtOverlay && bunchXing != 0) iEvt = eSubEvents; // in overlay skip all events except BC=0
 
@@ -789,7 +793,7 @@ StatusCode TileHitVecToCntTool::processBunchXing(int bunchXing
           } else {
             ATH_MSG_DEBUG(" New HitCont.  TimeOffset=" << SubEvtTimOffset << ", size =" << inputHits->size());
             this->processHitVectorForOverlay(inputHits, nHit, eHitTot);
-            //if( m_doDigiTruth && iEvt == bSubEvents) this->processHitVectorWithoutPileUp(inputHits, nHit, eHitTot, m_signalHits);
+            //if( m_doDigiTruth && iEvt == bSubEvents) this->processHitVectorWithoutPileUp(inputHits, nHit, eHitTot, m_signalHits, engine);
           }
         } else if (m_pileUp) { // pileup code
           bool isSignal = false;
@@ -805,8 +809,8 @@ StatusCode TileHitVecToCntTool::processBunchXing(int bunchXing
 	  ATH_MSG_ERROR(" Tile Hit container not found for event key " << hitVectorName);
 	}
 
-			  this->processHitVectorWithoutPileUp(inputHits, nHit, eHitTot, m_hits);
-        if(m_doDigiTruth) this->processHitVectorWithoutPileUp(inputHits, nHit, eHitTot, m_hits_DigiHSTruth);
+	this->processHitVectorWithoutPileUp(inputHits, nHit, eHitTot, m_hits, engine);
+        if(m_doDigiTruth) this->processHitVectorWithoutPileUp(inputHits, nHit, eHitTot, m_hits_DigiHSTruth, engine);
       } // to pile-up or not
 
     } // end of the loop over different input hitVectorNames (normal hits and MBTS hits)
@@ -831,6 +835,9 @@ StatusCode TileHitVecToCntTool::processAllSubEvents() {
   int nHit(0);
   double eHitTot(0.0);
 
+  ATHRNG::RNGWrapper* rngWrapper = m_rndmSvc->getEngine(this);
+  CLHEP::HepRandomEngine * engine = *rngWrapper;
+
   std::vector<std::string>::const_iterator hitVecNamesItr = m_hitVectorNames.begin();
   std::vector<std::string>::const_iterator hitVecNamesEnd = m_hitVectorNames.end();
   for (; hitVecNamesItr != hitVecNamesEnd; ++hitVecNamesItr) {
@@ -860,7 +867,7 @@ StatusCode TileHitVecToCntTool::processAllSubEvents() {
             const TileHitVector* inputHits = &(*(iCont->second));
             ATH_MSG_DEBUG(" New HitCont.  TimeOffset=" << SubEvtTimOffset << ", size =" << inputHits->size());
             this->processHitVectorForOverlay(inputHits, nHit, eHitTot);
-            if(m_doDigiTruth) this->processHitVectorWithoutPileUp(inputHits, nHit, eHitTot, m_hits_DigiHSTruth);
+            if(m_doDigiTruth) this->processHitVectorWithoutPileUp(inputHits, nHit, eHitTot, m_hits_DigiHSTruth, engine);
           }
         }
       } else if (m_pileUp) {  // pileup code
@@ -886,8 +893,8 @@ StatusCode TileHitVecToCntTool::processAllSubEvents() {
         ATH_MSG_WARNING("Hit Vector "<< hitVectorName << " not found in StoreGate");
         continue; // continue to the next hit vector
       }
-      this->processHitVectorWithoutPileUp(inputHits, nHit, eHitTot, m_hits);
-      if(m_doDigiTruth) this->processHitVectorWithoutPileUp(inputHits, nHit, eHitTot, m_hits_DigiHSTruth);
+      this->processHitVectorWithoutPileUp(inputHits, nHit, eHitTot, m_hits, engine);
+      if(m_doDigiTruth) this->processHitVectorWithoutPileUp(inputHits, nHit, eHitTot, m_hits_DigiHSTruth, engine);
     }
 
   } // end of the loop over different input hitVectorNames (normal hits and MBTS hits)
@@ -960,6 +967,9 @@ StatusCode TileHitVecToCntTool::mergeEvent() {
   //photoelectron statistics.
   //loop over all hits in TileHitContainer and take energy deposited in certain period of time
   //std::vector<std::string>::const_iterator hitVecNamesEnd = m_hitVectorNames.end();
+
+  ATHRNG::RNGWrapper* rngWrapper = m_rndmSvc->getEngine(this);
+  CLHEP::HepRandomEngine * engine = *rngWrapper;
   
   TileHitNonConstContainer::iterator collIt_DigiHSTruth; 
   TileHitNonConstContainer::iterator endColl_DigiHSTruth;
@@ -990,7 +1000,7 @@ StatusCode TileHitVecToCntTool::mergeEvent() {
         //channel_id = m_cabling->s2h_channel_id(pmt_id);
       }
 
-			double scaleFactor = applyPhotoStatistics(ehit, pmt_id);
+      double scaleFactor = applyPhotoStatistics(ehit, pmt_id, engine);
       pHit->scale(scaleFactor);
 
       if(m_doDigiTruth){
@@ -1071,7 +1081,7 @@ StatusCode TileHitVecToCntTool::finalize() {
 
 }
 
-double TileHitVecToCntTool::applyPhotoStatistics(double energy, Identifier pmt_id) {
+double TileHitVecToCntTool::applyPhotoStatistics(double energy, Identifier pmt_id, CLHEP::HepRandomEngine * engine) {
   // pmt_sample = 0-3 for normal cells 4 for inner MBTS, 5 for outer MBTS, 6 for E4'
   int pmt_sample =
       (m_tileTBID->is_tiletb(pmt_id)) ? TileID::SAMP_X + m_tileTBID->channel(pmt_id) : m_tileID->sample(pmt_id);
@@ -1081,19 +1091,19 @@ double TileHitVecToCntTool::applyPhotoStatistics(double energy, Identifier pmt_i
   switch (m_photoElectronStatistics) {
     case 2:
       if (pe > 20.0) {
-        RndmPois = std::max(0.0, RandGaussQ::shoot(m_pHRengine, pe, sqrt(pe))); // FIXME CLHEP::RandGaussZiggurat is faster and more accurate.
+        RndmPois = std::max(0.0, RandGaussQ::shoot(engine, pe, sqrt(pe))); // FIXME CLHEP::RandGaussZiggurat is faster and more accurate.
         pe_scale = RndmPois / pe;
       } else { // pe<=20
 
         if (pe > 0.) {
           double singleMEAN = 1.0;  //Parameterization of monoelectron spectra
           double singleSIGMA = 1.0;
-          RndmPois = RandPoissonT::shoot(m_pHRengine, pe);
+          RndmPois = RandPoissonT::shoot(engine, pe);
 
           if (RndmPois > 0) {
             pe_scale = 0;
             for (int i = 0; i < RndmPois; i++)
-              pe_scale += 1 / (1.08332) * std::max(0., RandGaussQ::shoot(m_pHRengine, singleMEAN, singleSIGMA)); // FIXME CLHEP::RandGaussZiggurat is faster and more accurate.
+              pe_scale += 1 / (1.08332) * std::max(0., RandGaussQ::shoot(engine, singleMEAN, singleSIGMA)); // FIXME CLHEP::RandGaussZiggurat is faster and more accurate.
 
             pe_scale /= RndmPois;
           } else
@@ -1104,7 +1114,7 @@ double TileHitVecToCntTool::applyPhotoStatistics(double energy, Identifier pmt_i
 
     case 0:
       if (pe > 0.0) {
-        RndmPois = RandPoissonT::shoot(m_pHRengine, pe);
+        RndmPois = RandPoissonT::shoot(engine, pe);
         pe_scale = RndmPois / pe;
       }
       break;
@@ -1112,7 +1122,7 @@ double TileHitVecToCntTool::applyPhotoStatistics(double energy, Identifier pmt_i
     case 1:
       if (pe > 0.0) {
         if (pe > 10.0) {
-          RndmPois = std::max(0.0, RandGaussQ::shoot(m_pHRengine, pe, sqrt(pe))); // FIXME CLHEP::RandGaussZiggurat is faster and more accurate.
+          RndmPois = std::max(0.0, RandGaussQ::shoot(engine, pe, sqrt(pe))); // FIXME CLHEP::RandGaussZiggurat is faster and more accurate.
         } else {
           int nn = std::max(10, (int) (pe * 10.0));
           double * ProbFunc = new double[nn];
@@ -1121,7 +1131,7 @@ double TileHitVecToCntTool::applyPhotoStatistics(double energy, Identifier pmt_i
             ProbFunc[i] = ProbFunc[i - 1] * pe / i;
           }
           RandGeneral* RandG = new RandGeneral(ProbFunc, nn, 0);
-          RndmPois = RandG->shoot(m_pHRengine) * nn;
+          RndmPois = RandG->shoot(engine) * nn;
           //here RndmPois is continuously distributed random value obtained from Poisson
           //distribution by approximation.
           delete RandG;
diff --git a/TileCalorimeter/TileSimAlgs/src/TileMuonReceiverDecision.cxx b/TileCalorimeter/TileSimAlgs/src/TileMuonReceiverDecision.cxx
index ac75cea888b94fa26a1450a9f037a79a4bb54b1b..8c9fcd54db9288b92175460beeddc56e013808b4 100644
--- a/TileCalorimeter/TileSimAlgs/src/TileMuonReceiverDecision.cxx
+++ b/TileCalorimeter/TileSimAlgs/src/TileMuonReceiverDecision.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 //****************************************************************************
@@ -36,8 +36,6 @@
 #include "StoreGate/ReadHandle.h"
 #include "StoreGate/WriteHandle.h"
 #include "AthenaKernel/errorcheck.h"
-#include "AthenaKernel/IAtRndmGenSvc.h"
-
 
 TileMuonReceiverDecision::TileMuonReceiverDecision(std::string name, ISvcLocator* pSvcLocator)
   : AthAlgorithm(name, pSvcLocator),
diff --git a/TileCalorimeter/TileSimAlgs/src/TilePulseForTileMuonReceiver.cxx b/TileCalorimeter/TileSimAlgs/src/TilePulseForTileMuonReceiver.cxx
index c7c9dfec82dbb39f168c53839e7914fda11a1f27..d532b76cb6b57e8073221d0c8fd804da192509f3 100644
--- a/TileCalorimeter/TileSimAlgs/src/TilePulseForTileMuonReceiver.cxx
+++ b/TileCalorimeter/TileSimAlgs/src/TilePulseForTileMuonReceiver.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 //***************************************************************************************
@@ -48,7 +48,9 @@
 #include "StoreGate/ReadHandle.h"
 #include "StoreGate/WriteHandle.h"
 #include "AthenaKernel/errorcheck.h"
-#include "AthenaKernel/IAtRndmGenSvc.h"
+#include "AthenaKernel/IAthRNGSvc.h"
+#include "AthenaKernel/RNGWrapper.h"
+
 
 // external
 #include <CLHEP/Random/Randomize.h>
@@ -76,8 +78,6 @@ TilePulseForTileMuonReceiver::TilePulseForTileMuonReceiver(std::string name, ISv
   , m_nBinsPerX(0)
   , m_binTime0(0)
   , m_timeStep(0.0)
-  , m_pHRengine(0)
-  , m_rndmSvc("AtRndmGenSvc", name)
   , m_MuRcvBuildTool("TileRawChannelBuilderMF")
   , m_run2(true)
 {
@@ -89,7 +89,6 @@ TilePulseForTileMuonReceiver::TilePulseForTileMuonReceiver(std::string name, ISv
   declareProperty("UseCoolPulseShapes"             , m_useCoolPulseShapes   = false, "Pulse shapes from database (default=false)");
   declareProperty("UseCoolNoise"                   , m_tileNoise            = false, "Noise from database (default=false)");
   declareProperty("UseCoolPedestal"                , m_tilePedestal         = false, "Pedestal from database (default=false)");
-  declareProperty("RndmSvc"                        , m_rndmSvc, "Random Number Service used in TilePulseForTileMuonReceiver");
   declareProperty("TileRawChannelBuilderMF"        , m_MuRcvBuildTool, "The tool by default is the Matched Filter");
 }
 
@@ -136,7 +135,7 @@ StatusCode TilePulseForTileMuonReceiver::initialize() {
                    << " ADC saturation value: "       << m_adcMax
                    << " TileCal Threshold LOW GAIN: " << m_tileThresh);
 
-  m_pHRengine = m_rndmSvc->GetEngine("Tile_PulseForTileMuonReceiver");
+  ATH_CHECK(m_rndmSvc.retrieve());
 
   m_nShape    = m_tileInfo->MuRcvNBins();
   m_nBinsPerX = m_tileInfo->MuRcvBinsPerX();
@@ -263,6 +262,10 @@ StatusCode TilePulseForTileMuonReceiver::execute() {
   //
   std::vector<float> digitsBuffer(m_nSamples);
 
+  // Prepare RNG service
+  ATHRNG::RNGWrapper* rngWrapper = m_rndmSvc->getEngine(this);
+  rngWrapper->setSeed( name(), Gaudi::Hive::currentContext() );
+
   /////////////////////////////////////////////////////////////////////////////////
   // (a.0) iterate over collections in the HIT container: access 'ros' and 'drawer'
   //
@@ -496,7 +499,7 @@ StatusCode TilePulseForTileMuonReceiver::execute() {
 
       // Generate an array to randomize the noise for each digit
       //
-      RandGaussQ::shootArray(m_pHRengine, m_nSamples, Rndm, 0.0, 1.0);
+      RandGaussQ::shootArray(*rngWrapper, m_nSamples, Rndm, 0.0, 1.0);
 
       ATH_MSG_VERBOSE( "(D.02)   Pulse digits [MeV]:"
                        << " " << pDigitSamples[0]
@@ -531,7 +534,7 @@ StatusCode TilePulseForTileMuonReceiver::execute() {
       // Collecting noise from the database
       //
       if (m_tileNoise) {
-        RandFlat::shootArray(m_pHRengine, 1, Rndm_dG, 0.0, 1.0);
+        RandFlat::shootArray(*rngWrapper, 1, Rndm_dG, 0.0, 1.0);
         sigma_Hfn1 = m_tileToolNoiseSample->getHfn1(idhash, TMDBchan, TileID::LOWGAIN);
         sigma_Hfn2 = m_tileToolNoiseSample->getHfn2(idhash, TMDBchan, TileID::LOWGAIN);
         if (sigma_Hfn1 > 0 || sigma_Hfn2) {
diff --git a/Tools/PROCTools/python/RunTier0TestsTools.py b/Tools/PROCTools/python/RunTier0TestsTools.py
index d795f8d7d0114306fcd2f31170e551316c5da0bc..467e7d7e23b2e6f6c06d869fef2a42d6c609be6a 100644
--- a/Tools/PROCTools/python/RunTier0TestsTools.py
+++ b/Tools/PROCTools/python/RunTier0TestsTools.py
@@ -24,5 +24,5 @@ ciRefFileMap = {
                 's3126-22.0'           : 'v3',
                 # OverlayTier0Test_required-test
                 'overlay-d1498-21.0'   : 'v1',
-                'overlay-d1498-22.0'   : 'v10',
+                'overlay-d1498-22.0'   : 'v11',
                }
diff --git a/Tools/Tier0ChainTests/test/test_q220.sh b/Tools/Tier0ChainTests/test/test_q220.sh
index bd2d1be252bbd6dcc2a31b129c264445e01a0f6d..29b7b66fa0dc7a09059958e864774149aca6a5e5 100755
--- a/Tools/Tier0ChainTests/test/test_q220.sh
+++ b/Tools/Tier0ChainTests/test/test_q220.sh
@@ -8,7 +8,8 @@
 # art-include: 21.3/Athena
 # art-include: 21.9/Athena
 
-Reco_tf.py --AMI=q220 --outputTAGFile=myTAG.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --outputHISTFile=myHIST.root --inputBSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data15_cos.00251363.physics_IDCosmic.merge.RAW._lb0057._SFO-ALL._0001.1 --imf False
+#This test currently has the muon isolation reconstruction switched off. It should be switched back on at a later date. 
+Reco_tf.py --AMI=q220 --outputTAGFile=myTAG.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --outputHISTFile=myHIST.root --imf False --preExec "r2e:from MuonRecExample.MuonRecFlags import muonRecFlags; muonRecFlags.doMuonIso.set_Value_and_Lock(False)"
 echo "art-result: $?"
 
 ArtPackage=$1
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/TrkVertexSeedFinderTools/IndexedCrossDistancesSeedFinder.h b/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/TrkVertexSeedFinderTools/IndexedCrossDistancesSeedFinder.h
index 774b897c6f68cf3a10489d5d3406ca6c5adb2af3..abb137247407d854c4dacff0d0d9c42ba1ac1282 100755
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/TrkVertexSeedFinderTools/IndexedCrossDistancesSeedFinder.h
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/TrkVertexSeedFinderTools/IndexedCrossDistancesSeedFinder.h
@@ -69,7 +69,6 @@ namespace Trk
   private:
 
     bool m_useweights;
-    int m_typeofweight;
     float m_trackdistcutoff;
     int m_trackdistexppower;
     float m_constraintcutoff;
diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/src/HLTCaloCellMaker.cxx b/Trigger/TrigAlgorithms/TrigCaloRec/src/HLTCaloCellMaker.cxx
index 1be6d9bca701b8f605a02cabb398b1128fc7c5b4..0b7ca1ab7f0b5cf3f1062b7775cd6b9bf4f1b7ad 100644
--- a/Trigger/TrigAlgorithms/TrigCaloRec/src/HLTCaloCellMaker.cxx
+++ b/Trigger/TrigAlgorithms/TrigCaloRec/src/HLTCaloCellMaker.cxx
@@ -70,9 +70,42 @@ StatusCode HLTCaloCellMaker::execute( const EventContext& context ) const {
 	cdv->updateCaloIterators();
 	
       } else {
+	// TT EM PART
+	for(int sampling=0;sampling<4;sampling++){
 	LArTT_Selector<LArCellCont> sel;
-	ATH_CHECK(m_dataAccessSvc->loadCollections( context, *roiDescriptor, TTEM, 2, sel ));
+	ATH_CHECK(m_dataAccessSvc->loadCollections( context, *roiDescriptor, TTEM, sampling, sel ));
 	for( const auto cell : sel ) {cdv->push_back( cell ); }
+	}
+	cdv->setHasCalo(CaloCell_ID::LAREM);
+	// TT HEC PART
+	for(int sampling=0;sampling<4;sampling++){
+	LArTT_Selector<LArCellCont> sel;
+	ATH_CHECK(m_dataAccessSvc->loadCollections( context, *roiDescriptor, TTHEC, sampling, sel ));
+	for( const auto cell : sel ) {cdv->push_back( cell ); }
+	}
+	cdv->setHasCalo(CaloCell_ID::LARHEC);
+	// TILE PART
+	for(int sampling=0;sampling<4;sampling++){
+	TileCellCollection sel;
+	ATH_CHECK(m_dataAccessSvc->loadCollections( context, *roiDescriptor, sel ));
+	for( const auto cell : sel ) {cdv->push_back( cell ); }
+	}
+	cdv->setHasCalo(CaloCell_ID::TILE);
+	// TT FCAL EM PART
+	{
+	LArTT_Selector<LArCellCont> sel;
+	ATH_CHECK(m_dataAccessSvc->loadCollections( context, *roiDescriptor, FCALEM, 0, sel ));
+	for( const auto cell : sel ) {cdv->push_back( cell ); }
+	}
+	cdv->setHasCalo(CaloCell_ID::LARFCAL);
+	// TT FCAL HAD PART
+	for(int sampling=0;sampling<2;sampling++){
+	LArTT_Selector<LArCellCont> sel;
+	ATH_CHECK(m_dataAccessSvc->loadCollections( context, *roiDescriptor, FCALHAD, sampling, sel ));
+	for( const auto cell : sel ) {cdv->push_back( cell ); }
+	}
+	cdv->setHasCalo(CaloCell_ID::LARFCAL);
+	cdv->updateCaloIterators();
       }
       ATH_MSG_INFO ("Producing "<<cdv->size()<<" cells");
       auto ss = cellContainer.record( std::move(cdv) );
@@ -92,11 +125,44 @@ StatusCode HLTCaloCellMaker::execute( const EventContext& context ) const {
 	cellContainerV->push_back( c.release()->asDataVector() );
 		
       } else {
-	LArTT_Selector<LArCellCont> sel;
-	ATH_CHECK(m_dataAccessSvc->loadCollections( context, *roiDescriptor, TTEM, 2, sel ));
 	auto c = std::make_unique<CaloConstCellContainer >(SG::VIEW_ELEMENTS);
-	int cc(0);
-	for( const auto cell : sel ) {c->push_back( cell ); cc++;}
+
+        // TT EM PART
+        for(int sampling=0;sampling<4;sampling++){
+        LArTT_Selector<LArCellCont> sel;
+        ATH_CHECK(m_dataAccessSvc->loadCollections( context, *roiDescriptor, TTEM, sampling, sel ));
+        for( const auto cell : sel ) {c->push_back( cell ); }
+        }
+        c->setHasCalo(CaloCell_ID::LAREM);
+        // TT HEC PART
+        for(int sampling=0;sampling<4;sampling++){
+        LArTT_Selector<LArCellCont> sel;
+        ATH_CHECK(m_dataAccessSvc->loadCollections( context, *roiDescriptor, TTHEC, sampling, sel ));
+        for( const auto cell : sel ) {c->push_back( cell ); }
+        }
+        c->setHasCalo(CaloCell_ID::LARHEC);
+        // TILE PART
+        for(int sampling=0;sampling<4;sampling++){
+        TileCellCollection sel;
+        ATH_CHECK(m_dataAccessSvc->loadCollections( context, *roiDescriptor, sel ));
+        for( const auto cell : sel ) {c->push_back( cell ); }
+        }
+        c->setHasCalo(CaloCell_ID::TILE);
+        // TT FCAL EM PART
+        {
+        LArTT_Selector<LArCellCont> sel;
+        ATH_CHECK(m_dataAccessSvc->loadCollections( context, *roiDescriptor, FCALEM, 0, sel ));
+        for( const auto cell : sel ) {c->push_back( cell ); }
+        }
+        c->setHasCalo(CaloCell_ID::LARFCAL);
+        // TT FCAL HAD PART
+        for(int sampling=0;sampling<2;sampling++){
+        LArTT_Selector<LArCellCont> sel;
+        ATH_CHECK(m_dataAccessSvc->loadCollections( context, *roiDescriptor, FCALHAD, sampling, sel ));
+        for( const auto cell : sel ) {c->push_back( cell ); }
+        }
+        c->setHasCalo(CaloCell_ID::LARFCAL);
+        c->updateCaloIterators();
 	cellContainerV->push_back( c.release()->asDataVector() );
       }
     }
diff --git a/Trigger/TrigAlgorithms/TrigEgammaRec/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigEgammaRec/CMakeLists.txt
index 27eefb6b34e88e81bf86392d18bd9477b40b47a5..13a3ced0d6e4dc30959224e2d00fb35bc8e9fd3a 100644
--- a/Trigger/TrigAlgorithms/TrigEgammaRec/CMakeLists.txt
+++ b/Trigger/TrigAlgorithms/TrigEgammaRec/CMakeLists.txt
@@ -20,12 +20,14 @@ atlas_depends_on_subdirs( PUBLIC
                           Trigger/TrigSteer/TrigInterfaces
                           PRIVATE
                           Calorimeter/CaloEvent
+                          Calorimeter/CaloUtils
                           Event/xAOD/xAODCaloEvent
                           Event/xAOD/xAODEgammaCnv
                           Event/xAOD/xAODEventShape
                           Event/xAOD/xAODTracking
 			  PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces	
                           Reconstruction/egamma/egammaEvent
+                          Reconstruction/egamma/egammaUtils
                           Trigger/TrigTools/TrigTimeAlgs )
 
 # External dependencies:
@@ -36,13 +38,13 @@ atlas_add_library( TrigEgammaRecLib
                    src/*.cxx
                    PUBLIC_HEADERS TrigEgammaRec
                    PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES xAODEgamma xAODPrimitives GaudiKernel RecoToolInterfaces egammaRecEvent TrigCaloEvent TrigParticle TrigSteeringEvent LumiBlockCompsLib TrigInterfacesLib EgammaAnalysisInterfacesLib TrigTimeAlgsLib
-                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} CaloEvent xAODCaloEvent xAODEventShape xAODTracking egammaEvent )
+                   LINK_LIBRARIES xAODEgamma xAODPrimitives GaudiKernel CaloUtilsLib RecoToolInterfaces egammaRecEvent TrigCaloEvent TrigParticle TrigSteeringEvent LumiBlockCompsLib TrigInterfacesLib EgammaAnalysisInterfacesLib TrigTimeAlgsLib
+                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} CaloEvent xAODCaloEvent xAODEventShape xAODTracking egammaEvent egammaUtils)
 
 atlas_add_component( TrigEgammaRec
                      src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} xAODEgamma xAODPrimitives GaudiKernel LumiBlockCompsLib RecoToolInterfaces egammaRecEvent TrigCaloEvent TrigParticle TrigSteeringEvent TrigInterfacesLib CaloEvent xAODCaloEvent xAODEventShape xAODTracking EgammaAnalysisInterfacesLib egammaEvent TrigTimeAlgsLib TrigEgammaRecLib )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} xAODEgamma xAODPrimitives GaudiKernel CaloUtilsLib LumiBlockCompsLib RecoToolInterfaces egammaRecEvent TrigCaloEvent TrigParticle TrigSteeringEvent TrigInterfacesLib CaloEvent xAODCaloEvent xAODEventShape xAODTracking EgammaAnalysisInterfacesLib egammaEvent egammaUtils TrigTimeAlgsLib TrigEgammaRecLib )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
diff --git a/Trigger/TrigAlgorithms/TrigEgammaRec/TrigEgammaRec/TrigEgammaRec.h b/Trigger/TrigAlgorithms/TrigEgammaRec/TrigEgammaRec/TrigEgammaRec.h
index 5e86e07598dd278d6be45ca9247fa04215c94d38..1a049aed5d7b1b4bdce74615a3246925d7259784 100755
--- a/Trigger/TrigAlgorithms/TrigEgammaRec/TrigEgammaRec/TrigEgammaRec.h
+++ b/Trigger/TrigAlgorithms/TrigEgammaRec/TrigEgammaRec/TrigEgammaRec.h
@@ -86,6 +86,8 @@ private:
 
   ToolHandle<IEMTrackMatchBuilder> m_trackMatchBuilder;
   ToolHandle<IEMConversionBuilder> m_conversionBuilder;
+
+
   ToolHandle<IEMShowerBuilder> m_showerBuilder;  // trigger specific
   ToolHandle<IEMFourMomBuilder> m_fourMomBuilder; // trigger specific
   ToolHandle<IEGammaAmbiguityTool> m_ambiguityTool;
@@ -112,12 +114,13 @@ private:
   ToolHandle<ILumiBlockMuTool>  m_lumiBlockMuTool; 
   // booleans to run specific parts of offline reconstruction
   bool m_doConversions;
+  bool m_doBremCollection;
   bool m_doTrackMatching;
   bool m_doTrackIsolation;
   bool m_doCaloCellIsolation;
   bool m_doTopoIsolation;
   bool m_useBremAssoc;
-  
+    
   // Allows delete
   EgammaRecContainer *m_eg_container; 
   // needed for monitoring to work
diff --git a/Trigger/TrigAlgorithms/TrigEgammaRec/python/TrigEgammaRecConfig.py b/Trigger/TrigAlgorithms/TrigEgammaRec/python/TrigEgammaRecConfig.py
index 40a003b5ac769727addd93030118bfd6afaaa42d..1721caa5a02a8f94876f727f7900c43b6005f5d8 100755
--- a/Trigger/TrigAlgorithms/TrigEgammaRec/python/TrigEgammaRecConfig.py
+++ b/Trigger/TrigAlgorithms/TrigEgammaRec/python/TrigEgammaRecConfig.py
@@ -56,7 +56,7 @@ TrigEgammaRec = Factory(TrigEgammaRecConf.TrigEgammaRec, name="TrigEgammaRec",do
     # Tools with non-default configuration
     TrackMatchBuilderTool = TrigEMTrackMatchBuilder,
     ShowerBuilderTool = TrigEMShowerBuilder,
-    
+                        
     # Set the isolation tools
     TrackIsolationTool = TrigTrackIsolationTool, 
     CaloCellIsolationTool = TrigCaloIsolationTool, 
@@ -75,7 +75,6 @@ TrigEgammaRec = Factory(TrigEgammaRecConf.TrigEgammaRec, name="TrigEgammaRec",do
     PhotonPIDBuilder = TrigPhotonPIDBuilder,
     
     # Tools with default configuration    
-#     VertexBuilderTool = EMVertexBuilder,
     ConversionBuilderTool = EMConversionBuilder.copyPublic("TrigEMConversionBuilder"),
     AmbiguityTool = EGammaAmbiguityTool.copyPublic("TrigEGammaAmbiguityTool"),
     FourMomBuilderTool = EMFourMomBuilder.copyPublic("TrigEMFourMomBuilder"),
@@ -88,3 +87,4 @@ TrigEgammaRec = Factory(TrigEgammaRecConf.TrigEgammaRec, name="TrigEgammaRec",do
     postInit = [configureTrigEgammaMonitoring],
 )
 
+
diff --git a/Trigger/TrigAlgorithms/TrigEgammaRec/python/TrigEgammaToolFactories.py b/Trigger/TrigAlgorithms/TrigEgammaRec/python/TrigEgammaToolFactories.py
index befd1e2ce4be958d9ec77d59a054e417441f498c..723459a24f27d63f24a66dace1fe31e23edd7bfc 100644
--- a/Trigger/TrigAlgorithms/TrigEgammaRec/python/TrigEgammaToolFactories.py
+++ b/Trigger/TrigAlgorithms/TrigEgammaRec/python/TrigEgammaToolFactories.py
@@ -2,7 +2,7 @@
 # -*- coding: utf-8 -*-
 # vim:fenc=utf-8
 #
-# Copyright @2016 Ryan Mackenzie White <ryan.white@cern.ch>
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 #
 
 """
@@ -36,9 +36,11 @@ PhotonPidTools()
 
 # Following tools have TrigEgamma factories
 from egammaTools.egammaToolsFactories import EMTrackMatchBuilder, EMFourMomBuilder, EMShowerBuilder
+from egammaTools import egammaToolsConf
 
 from egammaTools.egammaToolsConf import EMPIDBuilder
 from CaloClusterCorrection import CaloClusterCorrectionConf as Cccc
+from egammaTrackTools.egammaTrackToolsFactories import EMExtrapolationTools
 TrigCaloFillRectangularCluster = PublicToolFactory( Cccc.CaloFillRectangularCluster,
         name = "trigegamma_CaloFillRectangularCluster",
         eta_size = 5,
@@ -118,8 +120,14 @@ TrigEMExtrapolationTools=EMExtrapolationTools.copyPublic(name="TrigEMExtrapolati
                                                         useCaching=False)
 
 
+def appendtoTrigEMTrackMatchBuilder(tool):
+    "add track to calo tool "
+    if not hasattr(tool,"EMExtrapolationTools"):
+        tool += EMExtrapolationTools()
+
 TrigEMTrackMatchBuilder = EMTrackMatchBuilder.copyPublic(
     name = "TrigEMTrackMatchBuilder",
+    postInit=[appendtoTrigEMTrackMatchBuilder],
     broadDeltaEta      = 0.2, #For offline 0.1
     broadDeltaPhi      = 0.2, #For offline 0.15
     useScoring         = False, 
@@ -134,10 +142,13 @@ TrigEMShowerBuilder = EMShowerBuilder.copyPublic(
 )
 
 from TriggerMenu.egamma.EgammaSliceFlags import EgammaSliceFlags
+from egammaMVACalib.TrigEgammaMVACalibFactories import TrigElectronMVATool, TrigPhotonMVATool
+
 mlog.info("MVA version version %s"%EgammaSliceFlags.calibMVAVersion() )
 mlog.info("Cluster Correction version %s"%EgammaSliceFlags.clusterCorrectionVersion() )
 EgammaSliceFlags.calibMVAVersion.set_On()
 
+
 from TrigCaloRec.TrigCaloRecConf import TrigCaloClusterMaker
 
 def configureTrigCaloClusterMonitoring(tool):
@@ -163,7 +174,6 @@ def configureClusterBuilder(slwAlg):
             eta_Duplicate = 5,
             phi_Duplicate = 5
             )
-    #mlog.info("TrigCaloClusterMaker adding slw tool %s"%trigslw.getFullName())
     slwAlg += trigslw
     slwAlg.ClusterMakerTools=[ trigslw.getFullName() ]
 
@@ -178,7 +188,6 @@ def configureClusterCorrections(slwAlg):
         if hasattr(slwAlg,clName):
             continue
         for tool in make_CaloSwCorrections (cl,version=EgammaSliceFlags.clusterCorrectionVersion()):
-            #mlog.info("Correction tool %s"%tool.getFullName())
             slwAlg += tool
             slwAlg.ClusterCorrectionTools += [tool.getFullName()]
 
diff --git a/Trigger/TrigAlgorithms/TrigEgammaRec/python/TrigEgammaTrackTools.py b/Trigger/TrigAlgorithms/TrigEgammaRec/python/TrigEgammaTrackTools.py
new file mode 100644
index 0000000000000000000000000000000000000000..a5fe6863b36d92a8977f798b8746d99579ff985b
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigEgammaRec/python/TrigEgammaTrackTools.py
@@ -0,0 +1,112 @@
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+
+from AthenaCommon.AppMgr import ServiceMgr as svcMgr, ToolSvc
+
+from SiClusterOnTrackTool.SiClusterOnTrackToolConf import InDet__PixelClusterOnTrackTool
+egTrigPixelClusterOnTrackTool = InDet__PixelClusterOnTrackTool("egTrigPixelClusterOnTrackTool",
+                                                               DisableDistortions = False,
+                                                               applyNNcorrection = False)
+ToolSvc += egTrigPixelClusterOnTrackTool
+
+from SiClusterOnTrackTool.SiClusterOnTrackToolConf import InDet__SCT_ClusterOnTrackTool
+egTrigSCT_ClusterOnTrackTool = InDet__SCT_ClusterOnTrackTool ("egTrigSCT_ClusterOnTrackTool",
+                                                          CorrectionStrategy = 0,  # do correct position bias
+                                                          ErrorStrategy      = 2)  # do use phi dependent errors
+ToolSvc += egTrigSCT_ClusterOnTrackTool
+
+
+
+from TrkRIO_OnTrackCreator.TrkRIO_OnTrackCreatorConf import Trk__RIO_OnTrackCreator
+egTrigRotCreator = Trk__RIO_OnTrackCreator(name             = 'egTrigRotCreator',
+                                       ToolPixelCluster = egTrigPixelClusterOnTrackTool,
+                                       ToolSCT_Cluster  = egTrigSCT_ClusterOnTrackTool,
+                                       Mode             = 'indet')
+ToolSvc += egTrigRotCreator
+
+
+from TrkDetDescrSvc.AtlasTrackingGeometrySvc import AtlasTrackingGeometrySvc
+
+from TrkExRungeKuttaPropagator.TrkExRungeKuttaPropagatorConf import Trk__RungeKuttaPropagator as Propagator
+egTrigTrkPropagator = Propagator(name = 'egTrigTrkPropagator')
+egTrigTrkPropagator.AccuracyParameter = 0.0001
+ToolSvc += egTrigTrkPropagator
+
+from TrkExSTEP_Propagator.TrkExSTEP_PropagatorConf import Trk__STEP_Propagator as StepPropagator
+egTrigTrkStepPropagator = StepPropagator(name = 'egTrigTrkStepPropagator')
+ToolSvc += egTrigTrkStepPropagator
+
+from TrkExTools.TrkExToolsConf import Trk__Navigator
+egTrigTrkNavigator = Trk__Navigator(name = 'egTrigTrkNavigator')
+ToolSvc += egTrigTrkNavigator
+
+from TrkExTools.TrkExToolsConf import Trk__MaterialEffectsUpdator
+egTrigTrkMaterialUpdator = Trk__MaterialEffectsUpdator(name = "egTrigTrkMaterialEffectsUpdator")
+ToolSvc += egTrigTrkMaterialUpdator
+
+egTrigTrkSubPropagators = []
+egTrigTrkSubUpdators = []
+# -------------------- set it depending on the geometry ----------------------------------------------------
+# default for ID is (Rk,Mat)
+egTrigTrkSubPropagators += [ egTrigTrkPropagator.name() ]
+egTrigTrkSubUpdators    += [ egTrigTrkMaterialUpdator.name() ]
+# default for Calo is (Rk,MatLandau)
+egTrigTrkSubPropagators += [ egTrigTrkPropagator.name() ]
+egTrigTrkSubUpdators    += [ egTrigTrkMaterialUpdator.name() ]
+# default for MS is (STEP,Mat)
+egTrigTrkSubPropagators += [ egTrigTrkStepPropagator.name() ]
+egTrigTrkSubUpdators    += [ egTrigTrkMaterialUpdator.name() ]
+# ----------------------------------------------------------------------------------------------------------            
+
+from TrkExTools.TrkExToolsConf import Trk__Extrapolator
+egTrigTrkExtrapolator = Trk__Extrapolator(name                    = 'egTrigTrkExtrapolator',
+                                      Propagators             = [ egTrigTrkPropagator, egTrigTrkStepPropagator ],
+                                      MaterialEffectsUpdators = [ egTrigTrkMaterialUpdator ],
+                                      Navigator               = egTrigTrkNavigator,
+                                      SubPropagators          = egTrigTrkSubPropagators,
+                                      SubMEUpdators           = egTrigTrkSubUpdators)
+ToolSvc += egTrigTrkExtrapolator
+
+
+# Set up the GSF
+from TrkGaussianSumFilter.TrkGaussianSumFilterConf import Trk__GsfMaterialMixtureConvolution
+GSFTrigMaterialUpdator = Trk__GsfMaterialMixtureConvolution (name = 'GSFTrigMaterialUpdator')
+ToolSvc += GSFTrigMaterialUpdator
+# component Reduction
+from TrkGaussianSumFilter.TrkGaussianSumFilterConf import Trk__QuickCloseComponentsMultiStateMerger
+GSFTrigComponentReduction = Trk__QuickCloseComponentsMultiStateMerger (name                      = 'GSFTrigComponentReduction',
+                                                                       MaximumNumberOfComponents = 12)
+ToolSvc += GSFTrigComponentReduction
+
+from TrkMeasurementUpdator.TrkMeasurementUpdatorConf import Trk__KalmanUpdator as ConfiguredKalmanUpdator
+egTrigTrkUpdator = ConfiguredKalmanUpdator('egTrigTrkUpdator')
+ToolSvc += egTrigTrkUpdator
+
+from TrkGaussianSumFilter.TrkGaussianSumFilterConf import Trk__GsfMeasurementUpdator
+GSFTrigMeasurementUpdator = Trk__GsfMeasurementUpdator( name    = 'GSFTrigMeasurementUpdator',
+                                                    Updator = egTrigTrkUpdator )
+ToolSvc += GSFTrigMeasurementUpdator
+
+from TrkGaussianSumFilter.TrkGaussianSumFilterConf import Trk__GsfExtrapolator
+GSFTrigExtrapolator = Trk__GsfExtrapolator(name                          = 'GSFTrigExtrapolator',
+                                       Propagators                   = [ egTrigTrkPropagator ],
+                                       SearchLevelClosestParameters  = 10,
+                                       StickyConfiguration           = True,
+                                       Navigator                     = egTrigTrkNavigator,
+                                       GsfMaterialConvolution        = GSFTrigMaterialUpdator,
+                                       ComponentMerger               = GSFTrigComponentReduction,
+                                       SurfaceBasedMaterialEffects   = False )
+ToolSvc += GSFTrigExtrapolator
+
+
+from TrkGaussianSumFilter.TrkGaussianSumFilterConf import Trk__GaussianSumFitter
+GSFTrigTrackFitter = Trk__GaussianSumFitter(name                    = 'GSFTrigTrackFitter',
+                                        ToolForExtrapolation    = GSFTrigExtrapolator,
+                                        MeasurementUpdatorType  = GSFTrigMeasurementUpdator,
+                                        ReintegrateOutliers     = True,
+                                        MakePerigee             = True,
+                                        RefitOnMeasurementBase  = True,
+                                        DoHitSorting            = True,
+                                        ValidationMode          = False,
+                                        ToolForROTCreation      = egTrigRotCreator)
+# --- end of fitter loading
+ToolSvc += GSFTrigTrackFitter
diff --git a/Trigger/TrigAlgorithms/TrigEgammaRec/src/TrigEgammaRec.cxx b/Trigger/TrigAlgorithms/TrigEgammaRec/src/TrigEgammaRec.cxx
index 578aa0d87c3fe76507b6c895674f1528e8b1f85a..8b95163cef42217d4667e2e1e546c1264740c7e8 100755
--- a/Trigger/TrigAlgorithms/TrigEgammaRec/src/TrigEgammaRec.cxx
+++ b/Trigger/TrigAlgorithms/TrigEgammaRec/src/TrigEgammaRec.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /********************************************************************
@@ -146,6 +146,8 @@ TrigEgammaRec::TrigEgammaRec(const std::string& name,ISvcLocator* pSvcLocator):
     declareProperty("doTrackMatching",m_doTrackMatching = false, "run TrackMatchBuilder");
     // Set flag for conversions 
     declareProperty("doConversions",m_doConversions = false, "run ConversionBuilder");
+    /** @brief run GSF refit */
+    declareProperty("doBremCollection",                    m_doBremCollection          = false, "run BremCollection");
 
     // Monitoring
     typedef const DataVector<xAOD::Electron> xAODElectronDV_type;
@@ -469,59 +471,59 @@ HLT::ErrorCode TrigEgammaRec::hltInitialize() {
         if (runIsoType.find(flavName) == runIsoType.end()) runIsoType.insert(flavName);
     }
     
-    // /** @brief Retrieve IsolationTools based on IsoTypes configured */
-    // // BROKEN! WORTH FIXING, OR IS THIS FILE NOW OBSOLETE
-    // if(m_doTrackIsolation){
-    //     if (!m_trackIsolationTool.empty() && runIsoType.find("ptcone") != runIsoType.end()){ 
-    //         ATH_MSG_DEBUG("Retrieve TrackIsolationTool");
-
-    //         if(m_trackIsolationTool.retrieve().isFailure()){
-    //             ATH_MSG_ERROR("Unable to retrieve " << m_trackIsolationTool);
-    //             return HLT::BAD_JOB_SETUP;
-    //         }
-    //         else {
-    //             ATH_MSG_DEBUG("Retrieved Tool "<<m_trackIsolationTool);
-    //             if (timerSvc()) m_timerIsoTool1 = addTimer("TrackIsolationTool");
-    //         }
-    //     }
-    // } else {
-      m_trackIsolationTool.disable();
-    // }
-
-    // if(m_doCaloCellIsolation){
-    //     if (!m_caloCellIsolationTool.empty() && runIsoType.find("etcone") != runIsoType.end()) {
-    //         ATH_MSG_DEBUG("Retrieve CaloIsolationTool is empty");
-    //         if(m_caloCellIsolationTool.retrieve().isFailure()){
-    //             ATH_MSG_ERROR("Unable to retrieve " << m_caloCellIsolationTool);
-    //             return HLT::BAD_JOB_SETUP;
-    //         }
-    //         else {
-    //             ATH_MSG_DEBUG("Retrieved Tool "<<m_caloCellIsolationTool);
-    //             if (timerSvc()) m_timerIsoTool2 = addTimer("CaloCellIsolationTool");
-    //         }
-    //     } else {
-    //       m_caloCellIsolationTool.disable();
-    //     }
-    // } else {
-      m_caloCellIsolationTool.disable();
-    // }
-    // if(m_doTopoIsolation){
-    //     if (!m_topoIsolationTool.empty() && runIsoType.find("topoetcone") != runIsoType.end()) {
-    //         ATH_MSG_DEBUG("Retrieve TopoIsolationTool is empty");
-    //         if(m_topoIsolationTool.retrieve().isFailure()){
-    //             ATH_MSG_ERROR("Unable to retrieve " << m_topoIsolationTool);
-    //             return HLT::BAD_JOB_SETUP;
-    //         }
-    //         else {
-    //             ATH_MSG_DEBUG("Retrieved Tool "<<m_topoIsolationTool);
-    //             if (timerSvc()) m_timerIsoTool3 = addTimer("topoIsolationTool");
-    //         }
-    //     } else {
-    //       m_topoIsolationTool.disable();
-    //     }
-    // } else {
-      m_topoIsolationTool.disable();
-    // }
+     /** @brief Retrieve IsolationTools based on IsoTypes configured */
+     if(m_doTrackIsolation){
+         if (!m_trackIsolationTool.empty() && runIsoType.find("ptcone") != runIsoType.end()){ 
+             ATH_MSG_DEBUG("Retrieve TrackIsolationTool");
+
+             if(m_trackIsolationTool.retrieve().isFailure()){
+                 ATH_MSG_ERROR("Unable to retrieve " << m_trackIsolationTool);
+                 return HLT::BAD_JOB_SETUP;
+             }
+             else {
+                 ATH_MSG_DEBUG("Retrieved Tool "<<m_trackIsolationTool);
+                 if (timerSvc()) m_timerIsoTool1 = addTimer("TrackIsolationTool");
+             }
+         }
+     } else {
+    m_trackIsolationTool.disable();
+     }
+
+     if(m_doCaloCellIsolation){
+         if (!m_caloCellIsolationTool.empty() && runIsoType.find("etcone") != runIsoType.end()) {
+             ATH_MSG_DEBUG("Retrieve CaloIsolationTool is empty");
+             if(m_caloCellIsolationTool.retrieve().isFailure()){
+                 ATH_MSG_ERROR("Unable to retrieve " << m_caloCellIsolationTool);
+                 return HLT::BAD_JOB_SETUP;
+             }
+             else {
+                 ATH_MSG_DEBUG("Retrieved Tool "<<m_caloCellIsolationTool);
+                 if (timerSvc()) m_timerIsoTool2 = addTimer("CaloCellIsolationTool");
+             }
+         } else {
+           m_caloCellIsolationTool.disable();
+         }
+     } else {
+    m_caloCellIsolationTool.disable();
+     }
+     if(m_doTopoIsolation){
+         if (!m_topoIsolationTool.empty() && runIsoType.find("topoetcone") != runIsoType.end()) {
+             ATH_MSG_DEBUG("Retrieve TopoIsolationTool is empty");
+             if(m_topoIsolationTool.retrieve().isFailure()){
+                 ATH_MSG_ERROR("Unable to retrieve " << m_topoIsolationTool);
+                 return HLT::BAD_JOB_SETUP;
+             }
+             else {
+                 ATH_MSG_DEBUG("Retrieved Tool "<<m_topoIsolationTool);
+                 if (timerSvc()) m_timerIsoTool3 = addTimer("topoIsolationTool");
+             }
+         } else {
+           m_topoIsolationTool.disable();
+         }
+     } else {
+    m_topoIsolationTool.disable();
+     }
+    // <--
     //print summary info
     ATH_MSG_INFO("REGTEST: xAOD Reconstruction for Run2" );
     ATH_MSG_INFO("REGTEST: Initialization completed successfully, tools initialized:  " );
@@ -546,6 +548,7 @@ HLT::ErrorCode TrigEgammaRec::hltInitialize() {
     ATH_MSG_DEBUG("REGTEST: Do Track Isolation: "   << m_doTrackIsolation);
     ATH_MSG_DEBUG("REGTEST: Do CaloCell Isolation: "<< m_doCaloCellIsolation);
     ATH_MSG_DEBUG("REGTEST: Do TopoIsolation: "     << m_doTopoIsolation);
+    ATH_MSG_DEBUG("REGTEST: run bremBuilding: "     << m_doBremCollection);
     ATH_MSG_DEBUG("REGTEST: Use BremAssoc: "        << m_useBremAssoc);
 
     ATH_MSG_INFO("REGTEST: ElectronContainerName: " << m_electronContainerName );
@@ -635,28 +638,30 @@ HLT::ErrorCode TrigEgammaRec::hltExecute( const HLT::TriggerElement* inputTE,
     }
     
 
-    // bool topoClusTrue = false; 
-    // std::vector<const xAOD::CaloClusterContainer*> vectorClusterContainerTopo;
-    // if(m_doTopoIsolation){
-    //     stat = getFeatures(inputTE, vectorClusterContainerTopo,m_topoClusterContName);
+    bool topoClusTrue = false; 
+    std::vector<const xAOD::CaloClusterContainer*> vectorClusterContainerTopo;
+    if(m_doTopoIsolation){
+        stat = getFeatures(inputTE, vectorClusterContainerTopo,m_topoClusterContName);
     
-    //     if ( stat!= HLT::OK ) {
-    //         ATH_MSG_ERROR(" REGTEST: No CaloTopoClusterContainers retrieved for the trigger element");
-    //         //return HLT::OK; // If you did not get it, it is not a problem, continue!
-    //     }  
+    // -> From here is broken?
+        if ( stat!= HLT::OK ) {
+            ATH_MSG_ERROR(" REGTEST: No CaloTopoClusterContainers retrieved for the trigger element");
+            //return HLT::OK; // If you did not get it, it is not a problem, continue!
+        }  
              
-    //     //debug message
-    //     if ( msgLvl() <= MSG::VERBOSE){
-    //     msg() << MSG::VERBOSE << " REGTEST: Got " << vectorClusterContainerTopo.size()
-    //          << " CaloCTopoclusterContainers associated to the TE " << endmsg;
-    //     }
-    //     // Get the last ClusterContainer
-    //     if ( !vectorClusterContainerTopo.empty() ) {
-    //         const xAOD::CaloClusterContainer* clusContainerTopo = vectorClusterContainerTopo.back();
-    //         if (clusContainerTopo->size() > 0) topoClusTrue = true;
-    //         ATH_MSG_DEBUG("REGTEST: Number of topo containers : " << clusContainerTopo->size());
-    //     } // vector of Cluster Container empty?!
-    // }
+        //debug message
+        if ( msgLvl() <= MSG::VERBOSE){
+        msg() << MSG::VERBOSE << " REGTEST: Got " << vectorClusterContainerTopo.size()
+             << " CaloCTopoclusterContainers associated to the TE " << endmsg;
+        }
+        // Get the last ClusterContainer
+        if ( !vectorClusterContainerTopo.empty() ) {
+            const xAOD::CaloClusterContainer* clusContainerTopo = vectorClusterContainerTopo.back();
+            if (clusContainerTopo->size() > 0) topoClusTrue = true;
+            ATH_MSG_DEBUG("REGTEST: Number of topo containers : " << clusContainerTopo->size());
+        } // vector of Cluster Container empty?!
+    }
+    // <--  up to here
 
 
     if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG 
@@ -672,6 +677,7 @@ HLT::ErrorCode TrigEgammaRec::hltExecute( const HLT::TriggerElement* inputTE,
     std::string electronContSGKey="";
     std::string electronKey="";
     HLT::ErrorCode sc = getUniqueKey( m_electron_container, electronContSGKey, electronKey);
+    ATH_MSG_DEBUG("The electron container SG key created is: " << electronContSGKey);
     if (sc != HLT::OK) {
         msg() << MSG::DEBUG << "Could not retrieve the electron container key" << endmsg;
         return sc;
@@ -700,7 +706,7 @@ HLT::ErrorCode TrigEgammaRec::hltExecute( const HLT::TriggerElement* inputTE,
 
     // Shower Shape & CaloCellContainer
     const CaloCellContainer* pCaloCellContainer = 0;
-    //const xAOD::CaloClusterContainer* pTopoClusterContainer = 0;
+    const xAOD::CaloClusterContainer* pTopoClusterContainer = 0;
     
     // Get vector of pointers to all CaloCellContainers from TE
     std::string clusCollKey="";
@@ -748,7 +754,57 @@ HLT::ErrorCode TrigEgammaRec::hltExecute( const HLT::TriggerElement* inputTE,
                 if ( msgLvl() <= MSG::VERBOSE) msg() << MSG::VERBOSE << "Running m_showerBuilder: " << m_showerBuilder << endmsg;
             } //pCaloCellContainer
         }
-        //if(topoClusTrue) pTopoClusterContainer = vectorClusterContainerTopo.back();
+        if(topoClusTrue) pTopoClusterContainer = vectorClusterContainerTopo.back();
+    }
+
+
+    //********************************************************************************
+    xAOD::TrackParticleContainer *GSFTrigTrackParticles = new xAOD::TrackParticleContainer();
+    if (m_doBremCollection){ 
+
+      ATH_MSG_DEBUG("In m_doBremCollection");
+      ATH_MSG_DEBUG(" REGTEST: Got " << vectorClusterContainer.size() << " CaloClusterContainers associated to the TE ");
+      if (vectorClusterContainer.size() != 1){
+        ATH_MSG_ERROR("REGTEST: Size of vectorClusterContainer is not 1, it is: "<< vectorClusterContainer.size());
+        return HLT::NAV_ERROR;
+      }
+
+      // Get the last ClusterContainer
+      const xAOD::CaloClusterContainer* clusContainer = vectorClusterContainer.back();
+      if(!clusContainer){
+	return HLT::OK;
+      }
+      
+      ATH_MSG_DEBUG (clusContainer->size() << " calo clusters in container");
+      
+      
+      std::vector<const xAOD::TrackParticleContainer*> vectorTrackParticleContainer;
+      stat = getFeatures(inputTE, vectorTrackParticleContainer);
+      
+      if (stat != HLT::OK) {
+	ATH_MSG_DEBUG(" REGTEST: no TrackParticleContainer from TE, m_doBremCollection ");
+	return HLT::NAV_ERROR;
+      }
+      
+      const xAOD::TrackParticleContainer *tracks = vectorTrackParticleContainer.back();
+      if (!tracks || tracks->size()<1){
+       return HLT::OK;
+      }
+      for (const xAOD::TrackParticle *trk:*tracks) {
+            ATH_MSG_DEBUG("track pt is: " << trk->pt());
+      }
+            
+
+
+      for (const xAOD::TrackParticle *trk:*GSFTrigTrackParticles) {
+            ATH_MSG_DEBUG("GSFTrigTrackParticles pt is: " << trk->pt());
+      }
+      
+      if (HLT::OK != attachFeature( outputTE, GSFTrigTrackParticles, "GSFTrigTrackParticles") ){
+        ATH_MSG_ERROR("REGTEST: trigger xAOD::TrackParticleContainer for GSF attach to TE and record into StoreGate failed");
+        return HLT::NAV_ERROR;
+      }
+
     }
 
     //**********************************************************************
@@ -775,8 +831,11 @@ HLT::ErrorCode TrigEgammaRec::hltExecute( const HLT::TriggerElement* inputTE,
                     << " REGTEST: empty TrackParticleContainer from TE, m_trackMatchBuilder: " << m_trackMatchBuilder << endmsg;
 
             } else {
-                // Get the pointer to last TrackParticleContainer 
-                pTrackParticleContainer = vectorTrackParticleContainer.back();
+                // Get the pointer to last TrackParticleContainer
+                if(m_doBremCollection){
+                    pTrackParticleContainer = GSFTrigTrackParticles;
+                } 
+                else pTrackParticleContainer = vectorTrackParticleContainer.back();
                 m_doTrackMatching = true;
                 if(!pTrackParticleContainer){
                     m_doTrackMatching = false;
@@ -796,6 +855,7 @@ HLT::ErrorCode TrigEgammaRec::hltExecute( const HLT::TriggerElement* inputTE,
         float leadTrkpt=0.0;
         const xAOD::TrackParticle *leadTrk=NULL;
         for (const xAOD::TrackParticle *trk:*pTrackParticleContainer) {
+        ATH_MSG_DEBUG("In track matching, track pt: " << trk->pt());
             if(trk->pt() > leadTrkpt) {
                 leadTrkpt = trk->pt();
                 leadTrk=trk;
@@ -894,7 +954,10 @@ HLT::ErrorCode TrigEgammaRec::hltExecute( const HLT::TriggerElement* inputTE,
     }
                 
     ElementLinkVector<xAOD::TrackParticleContainer> trackLinks;
-    stat=getFeaturesLinks< xAOD::TrackParticleContainer, xAOD::TrackParticleContainer > (inputTE, trackLinks, "");
+    if(m_doBremCollection){
+        stat=getFeaturesLinks< xAOD::TrackParticleContainer, xAOD::TrackParticleContainer > (outputTE, trackLinks, "");
+    }
+    else stat=getFeaturesLinks< xAOD::TrackParticleContainer, xAOD::TrackParticleContainer > (inputTE, trackLinks, "");
     if ( stat != HLT::OK ) {
         ATH_MSG_ERROR("REGTEST: No TrackParticleLinks retrieved for the trigger element");
             //May need to add ERROR codes for online debugging
@@ -1082,53 +1145,61 @@ HLT::ErrorCode TrigEgammaRec::hltExecute( const HLT::TriggerElement* inputTE,
         // Isolation
         //
         // Calo Isolation types
-
-	// THIS IS NOW BROKEN. IS IT WORTH FIXING, OR WILL THIS BECOME OBSOLETE IN 22.0?
-        
-        // if(m_doCaloCellIsolation || m_doTopoIsolation){       
-        //     if (timerSvc()) m_timerIsoTool2->start(); //timer
-        //     std::map<std::string,CaloIsoHelp>::iterator itc = m_egCaloIso.begin(), itcE = m_egCaloIso.end();
-        //     for (; itc != itcE; itc++) {
-        //         CaloIsoHelp isoH = itc->second;
-        //         std::string flav = itc->first;
-        //         bool bsc = false;
-        //         if (flav == "etcone" && pCaloCellContainer)
-        //             bsc = m_caloCellIsolationTool->decorateParticle_caloCellIso(*eg, isoH.help.isoTypes, isoH.CorrList, pCaloCellContainer);
-        //         /*else if (flav == "topoetcone" )
-        //             // Add check for topoclusters (when available);
-        //             //bsc = m_topoIsolationTool->decorateParticle_topoClusterIso(*eg, isoH.help.isoTypes, isoH.CorrList, pTopoClusterContainer);*/
-        //         if (!bsc && flav=="etcone") 
-        //             ATH_MSG_WARNING("Call to CaloIsolationTool failed for flavour " << flav);
-        //     }
-        //     ATH_MSG_DEBUG(" REGTEST: etcone20   =  " << getIsolation_etcone20(eg));
-        //     ATH_MSG_DEBUG(" REGTEST: etcone30   =  " << getIsolation_etcone30(eg));
-        //     ATH_MSG_DEBUG(" REGTEST: etcone40   =  " << getIsolation_etcone40(eg));
-        //     if (timerSvc()) m_timerIsoTool2->stop(); //timer
-        // }
-        // if(m_doTrackIsolation){
-        //     ATH_MSG_DEBUG("Running TrackIsolationTool for Electrons");
-
-        //     if (timerSvc()) m_timerIsoTool1->start(); //timer
-        //     if(m_egTrackIso.size() != 0) {
-        //         // Track Isolation types
-        //         std::map<std::string,TrackIsoHelp>::iterator itt = m_egTrackIso.begin(), ittE = m_egTrackIso.end();
-        //         for (; itt != ittE; itt++) {
-        //             TrackIsoHelp isoH = itt->second;
-        //             std::string flav  = itt->first;
-        //             const std::set<const xAOD::TrackParticle*> tracksToExclude = xAOD::EgammaHelpers::getTrackParticles(eg, m_useBremAssoc); // For GSF this may need to be property
-        //             // Need the decorate methods from IsolationTool
-        //             bool bsc = m_trackIsolationTool->decorateParticle(*eg, isoH.help.isoTypes, isoH.CorrList, &leadTrkVtx, &tracksToExclude,pTrackParticleContainer);
-        //             if (!bsc) 
-        //                 ATH_MSG_WARNING("Call to TrackIsolationTool failed for flavour " << flav);
-        //         }
-        //         ATH_MSG_DEBUG(" REGTEST: ptcone20   =  " << getIsolation_ptcone20(eg));
-        //         ATH_MSG_DEBUG(" REGTEST: ptcone30   =  " << getIsolation_ptcone30(eg));
-        //         ATH_MSG_DEBUG(" REGTEST: ptcone40   =  " << getIsolation_ptcone40(eg));
-
-        //     }
-        //     if (timerSvc()) m_timerIsoTool1->stop(); //timer       
-        // }
         
+        if(m_doCaloCellIsolation || m_doTopoIsolation){       
+            if (timerSvc()) m_timerIsoTool2->start(); //timer
+            std::map<std::string,CaloIsoHelp>::iterator itc = m_egCaloIso.begin(), itcE = m_egCaloIso.end();
+            for (; itc != itcE; itc++) {
+                CaloIsoHelp isoH = itc->second;
+                std::string flav = itc->first;
+                bool bsc = false;
+                bool tbsc = false;
+		xAOD::CaloIsolation CaloIsoResult;
+		xAOD::CaloIsolation TopoIsoResult;
+                if (flav == "etcone" && pCaloCellContainer) {
+                    bsc = m_caloCellIsolationTool->caloCellIsolation(CaloIsoResult, *eg, isoH.help.isoTypes, isoH.CorrList, pCaloCellContainer);
+		} else if (flav == "topoetcone" && topoClusTrue) {
+                    // Add check for topoclusters (when available);
+                    tbsc = m_topoIsolationTool->caloTopoClusterIsolation(TopoIsoResult, *eg, isoH.help.isoTypes, isoH.CorrList, pTopoClusterContainer);
+		}
+                if (!bsc && m_doCaloCellIsolation && flav=="etcone") {
+                    ATH_MSG_WARNING("Call to CaloIsolationTool failed for flavour " << flav);
+		}
+                if (!tbsc && m_doTopoIsolation && flav =="topoetcone") {
+                    ATH_MSG_WARNING("Call to CaloTopoIsolationTool failed for flavour " << flav);
+		}
+
+		ATH_MSG_DEBUG(" REGTEST: etcone       " << flav <<  " =   " <<  CaloIsoResult.etcones[std::distance(m_egCaloIso.begin(), itc)]);
+		ATH_MSG_DEBUG(" REGTEST: topoetcone40 " << flav <<  " =   " <<  TopoIsoResult.etcones[std::distance(m_egCaloIso.begin(), itc)]);
+
+	    }
+            if (timerSvc()) m_timerIsoTool2->stop(); //timer
+        }
+        if(m_doTrackIsolation){
+            ATH_MSG_DEBUG("Running TrackIsolationTool for Electrons");
+
+            if (timerSvc()) m_timerIsoTool1->start(); //timer
+            if(m_egTrackIso.size() != 0) {
+                // Track Isolation types
+                std::map<std::string,TrackIsoHelp>::iterator itt = m_egTrackIso.begin(), ittE = m_egTrackIso.end();
+		xAOD::TrackIsolation isoresult;
+                for (; itt != ittE; itt++) {
+                    TrackIsoHelp isoH = itt->second;
+                    std::string flav  = itt->first;
+                    const std::set<const xAOD::TrackParticle*> tracksToExclude = xAOD::EgammaHelpers::getTrackParticles(eg, m_useBremAssoc); // For GSF this may need to be property
+                    // Need the decorate methods from IsolationTool
+                    bool bsc = m_trackIsolationTool->trackIsolation(isoresult, *eg, isoH.help.isoTypes, isoH.CorrList, &leadTrkVtx, &tracksToExclude,pTrackParticleContainer);
+                    if (!bsc) 
+                        ATH_MSG_WARNING("Call to TrackIsolationTool failed for flavour " << flav);
+                }
+                ATH_MSG_DEBUG(" REGTEST: ptcone20   =  " << isoresult.ptcones[0]);
+                ATH_MSG_DEBUG(" REGTEST: ptcone30   =  " << isoresult.ptcones[1]);
+                ATH_MSG_DEBUG(" REGTEST: ptcone40   =  " << isoresult.ptcones[2]);
+
+            if (timerSvc()) m_timerIsoTool1->stop(); //timer       
+	    }
+	}
+	//
         // PID
         ATH_MSG_DEBUG("about to run execute(eg) for PID");
         if (timerSvc()) m_timerPIDTool1->start(); //timer
@@ -1169,35 +1240,35 @@ HLT::ErrorCode TrigEgammaRec::hltExecute( const HLT::TriggerElement* inputTE,
         
         // Isolation
 
-	// BROKEN. WORTH FIXING, OR IS THIS FILE MOVING?
-        // if(m_doCaloCellIsolation || m_doTopoIsolation){       
-        //     if (timerSvc()) m_timerIsoTool2->start(); //timer
-        //     std::map<std::string,CaloIsoHelp>::iterator itc = m_egCaloIso.begin(), itcE = m_egCaloIso.end();
-        //     for (; itc != itcE; itc++) {
-        //         CaloIsoHelp isoH = itc->second;
-        //         std::string flav = itc->first;
-        //         bool bsc = false;
-        //         bool tbsc = false;
-        //         if (flav == "etcone" && pCaloCellContainer)
-        //             bsc = m_caloCellIsolationTool->decorateParticle_caloCellIso(*eg, isoH.help.isoTypes, isoH.CorrList, pCaloCellContainer);
-        //         else if (flav == "topoetcone" && topoClusTrue)
-        //             // Add check for topoclusters (when available);
-        //             tbsc = m_topoIsolationTool->decorateParticle_topoClusterIso(*eg, isoH.help.isoTypes, isoH.CorrList, pTopoClusterContainer);
-        //         if (!bsc && m_doCaloCellIsolation && flav=="etcone") 
-        //             ATH_MSG_WARNING("Call to CaloIsolationTool failed for flavour " << flav);
-        //         if (!tbsc && m_doTopoIsolation && flav =="topoetcone") 
-        //             ATH_MSG_WARNING("Call to CaloTopoIsolationTool failed for flavour " << flav);
-        //     }
-        //     ATH_MSG_DEBUG(" REGTEST: etcone20   =  " << getIsolation_etcone20(eg));
-        //     ATH_MSG_DEBUG(" REGTEST: etcone30   =  " << getIsolation_etcone30(eg));
-        //     ATH_MSG_DEBUG(" REGTEST: etcone40   =  " << getIsolation_etcone40(eg));
-        //     ATH_MSG_DEBUG(" REGTEST: topoetcone20   =  " << getIsolation_topoetcone20(eg));
-        //     ATH_MSG_DEBUG(" REGTEST: topoetcone30   =  " << getIsolation_topoetcone30(eg));
-        //     ATH_MSG_DEBUG(" REGTEST: topoetcone40   =  " << getIsolation_topoetcone40(eg));
-
-        //     if (timerSvc()) m_timerIsoTool2->stop(); //timer
-        // }
-    
+        if(m_doCaloCellIsolation || m_doTopoIsolation){       
+            if (timerSvc()) m_timerIsoTool2->start(); //timer
+            std::map<std::string,CaloIsoHelp>::iterator itc = m_egCaloIso.begin(), itcE = m_egCaloIso.end();
+            for (; itc != itcE; itc++) {
+                CaloIsoHelp isoH = itc->second;
+                std::string flav = itc->first;
+                bool bsc = false;
+                bool tbsc = false;
+		xAOD::CaloIsolation CaloIsoResult;
+		xAOD::CaloIsolation TopoIsoResult;
+                if (flav == "etcone" && pCaloCellContainer){
+                    bsc = m_caloCellIsolationTool->caloCellIsolation(CaloIsoResult, *eg, isoH.help.isoTypes, isoH.CorrList, pCaloCellContainer);
+		} else if (flav == "topoetcone" && topoClusTrue) {
+                    // Add check for topoclusters (when available);
+                    tbsc = m_topoIsolationTool->caloTopoClusterIsolation(TopoIsoResult, *eg, isoH.help.isoTypes, isoH.CorrList, pTopoClusterContainer);
+		}
+                if (!bsc && m_doCaloCellIsolation && flav=="etcone") {
+                    ATH_MSG_WARNING("Call to CaloIsolationTool failed for flavour " << flav);
+		}
+                if (!tbsc && m_doTopoIsolation && flav =="topoetcone") {
+                    ATH_MSG_WARNING("Call to CaloTopoIsolationTool failed for flavour " << flav);
+		}
+		ATH_MSG_DEBUG(" REGTEST: etcone       " << flav <<  " =   " <<  CaloIsoResult.etcones[std::distance(m_egCaloIso.begin(), itc)]);
+		ATH_MSG_DEBUG(" REGTEST: topoetcone40 " << flav <<  " =   " <<  TopoIsoResult.etcones[std::distance(m_egCaloIso.begin(), itc)]);
+	    }
+
+            if (timerSvc()) m_timerIsoTool2->stop(); //timer
+        }
+
         // Particle ID
         if (timerSvc()) m_timerPIDTool3->start(); //timer
         if( m_photonPIDBuilder->execute(ctx, eg)){
diff --git a/Trigger/TrigAlgorithms/TrigHLTJetRec/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigHLTJetRec/CMakeLists.txt
index 8e60a3038f7a97d9fa84988805446e3948591add..ec07e72ecc6437029c8ec9b59e02660fcae8b858 100644
--- a/Trigger/TrigAlgorithms/TrigHLTJetRec/CMakeLists.txt
+++ b/Trigger/TrigAlgorithms/TrigHLTJetRec/CMakeLists.txt
@@ -17,6 +17,7 @@ atlas_depends_on_subdirs( PUBLIC
                           Reconstruction/Jet/JetEDM
                           Reconstruction/Jet/JetInterface
                           Reconstruction/Jet/JetRec
+                          Reconstruction/Jet/JetRecTools
                           Trigger/TrigEvent/TrigCaloEvent
                           Trigger/TrigEvent/TrigNavStructure
                           Trigger/TrigEvent/TrigParticle
diff --git a/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/ITriggerJetBuildTool.h b/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/ITriggerJetBuildTool.h
index 8f7308f1c7dc74e5b4592bc516807c5fe21f3b18..4338415f25305006c97da1f7a29a7c2c375cd27c 100644
--- a/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/ITriggerJetBuildTool.h
+++ b/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/ITriggerJetBuildTool.h
@@ -34,6 +34,7 @@ public:
   // set inputs for jet finding. label is a type flag used 
   // for IParticle selection
   virtual void prime(const xAOD::IParticleContainer*) = 0;
+  virtual void primeGhost(const xAOD::IParticleContainer*, std::string ghostlabel) = 0;
   virtual int build(fastjet::ClusterSequence*&, xAOD::JetContainer*&) const = 0;
   
   // Allow owner Algorithm to reset the Pseudojets (no managed by the evt store)
diff --git a/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/NegativeEnergyRejectionTool.h b/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/NonPositiveEnergyRejectionTool.h
similarity index 72%
rename from Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/NegativeEnergyRejectionTool.h
rename to Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/NonPositiveEnergyRejectionTool.h
index e8a4f11838ed64d609fed0ddb7527cf3025a51b0..719ce2933ae7c9f31c2e7abf27ecb09307067325 100644
--- a/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/NegativeEnergyRejectionTool.h
+++ b/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/NonPositiveEnergyRejectionTool.h
@@ -9,21 +9,21 @@
 
 // P Sherwood March 2018
 
-/// \class NegativeEnergyRejectionTool
+/// \class NonPositiveEnergyRejectionTool
 ///
 /// Tool to select IParticles.
 
 #include "TrigHLTJetRec/IIParticleRejectionTool.h"
 #include "AsgTools/AsgTool.h"
 
-class NegativeEnergyRejectionTool : 
+class NonPositiveEnergyRejectionTool : 
   public asg::AsgTool, virtual public IIParticleRejectionTool{
-  ASG_TOOL_CLASS(NegativeEnergyRejectionTool, IIParticleRejectionTool)
+  ASG_TOOL_CLASS(NonPositiveEnergyRejectionTool, IIParticleRejectionTool)
   
   public:
   
-  NegativeEnergyRejectionTool(const std::string& name);
-  virtual ~NegativeEnergyRejectionTool() override {}
+  NonPositiveEnergyRejectionTool(const std::string& name);
+  virtual ~NonPositiveEnergyRejectionTool() override {}
   virtual StatusCode initialize() override;
   virtual StatusCode finalize() override;
 
@@ -33,7 +33,6 @@ class NegativeEnergyRejectionTool :
   virtual std::size_t rejected() const override;
 
 private:
-  bool  m_skipNegativeEnergy{true};
 
   std::size_t m_tested{0};
   std::size_t m_rejected{0};
diff --git a/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/PseudoJetCreatorFunctions.h b/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/PseudoJetCreatorFunctions.h
index ea2852bf60295ee36180f51b693399aece7d728c..3e35a299f11632d2a3094ccd9e275fa6c8d80ac0 100644
--- a/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/PseudoJetCreatorFunctions.h
+++ b/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/PseudoJetCreatorFunctions.h
@@ -34,6 +34,11 @@ namespace PseudoJetCreatorFunctions{
   createPseudoJets(const xAOD::IParticleContainer*, 
                    xAOD::JetInput::Type,
                    ToolHandle<IIParticleRejectionTool>&);
+
+  // ghost version
+  std::vector<PseudoJet> 
+  createGhostPseudoJets(const xAOD::IParticleContainer*, 
+                   ToolHandle<IIParticleRejectionTool>&);
 }
 
 
diff --git a/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/TrigHLTJetRecBase.h b/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/TrigHLTJetRecBase.h
index 266fbdeefd1557e6f27e88b70153767ce6f6b8a7..1deb1cf693d998f852e4139ab7c8eccfc33f7489 100644
--- a/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/TrigHLTJetRecBase.h
+++ b/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/TrigHLTJetRecBase.h
@@ -56,6 +56,7 @@ class TrigHLTJetRecBase: public HLT::FexAlgo {
   std::string getClusterCalib() const {return m_clusterCalib;}
   std::string getSecondaryLabel() const {return m_secondarylabel;}
   bool secondaryLabelisEmpty() const { return m_secondarylabel == ""; }
+  bool secondaryLabelisTracks() const { return m_secondarylabel.find("Track") != std::string::npos; }
 
   // functions and variables for secondary(associated) pseudojets
   /*
@@ -85,6 +86,10 @@ class TrigHLTJetRecBase: public HLT::FexAlgo {
   HLT::ErrorCode getInputContainer(const HLT::TriggerElement*,
                                    const InputContainer*&);
 
+  template<typename ghostInputContainer>
+  HLT::ErrorCode getGhostInputContainer(const HLT::TriggerElement*,
+                                  const ghostInputContainer*&);
+
  // IJetBuildTool - offline code to transform pseudojets to xAOD jets
  // ToolHandle<IJetBuildTool> m_jetbuildTool;
  // ToolHandle<JetRecTool> m_jetbuildTool;
diff --git a/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/TrigHLTJetRecBase_tpl.h b/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/TrigHLTJetRecBase_tpl.h
index ac0c3e5483c634b633d1534f5647cf906d37ace4..1c100a4baa0a103ace940580241e792cb47aa7b2 100644
--- a/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/TrigHLTJetRecBase_tpl.h
+++ b/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/TrigHLTJetRecBase_tpl.h
@@ -141,7 +141,6 @@ TrigHLTJetRecBase<InputContainer>::hltExecute(const HLT::TriggerElement*
     return status;
   }
 
-
   //convert selected inputs to pseudojets
   // LabelIndex* indexMap = new LabelIndex("PseudoJetLabelMapTrigger");
   //PS 3/4/18 jet::LabelIndex* indexMap = new jet::LabelIndex(m_pseudoJetLabelIndexArg);
@@ -197,6 +196,26 @@ TrigHLTJetRecBase<InputContainer>::hltExecute(const HLT::TriggerElement*
   ATH_MSG_DEBUG("Primed  jet build Tool");
 
 
+  if ( !secondaryLabelisEmpty() && secondaryLabelisTracks()) {
+  	// adding secondary ghost TRACK pseudojet container.
+  	const xAOD::TrackParticleContainer* ghostTrackInContainer = nullptr;
+  	//const ghostInputContainer* ghostInContainer = nullptr;
+	ATH_MSG_DEBUG("Retrieving secondary input container.");
+	status = this -> getGhostInputContainer(outputTE, ghostTrackInContainer);	
+ 	if (status == HLT::OK) {
+ 	   ATH_MSG_DEBUG("Obtained ghost inputs " 
+ 	                 << ghostTrackInContainer->size());
+ 	} else {
+ 	   ATH_MSG_ERROR("Failed to obtain ghost track constituents");
+ 	   return status;
+ 	}
+  	m_jetBuildTool->primeGhost(ghostTrackInContainer, m_secondarylabel);
+	ATH_MSG_DEBUG("Created ghost track pseudojet container with constituent label '"<<m_secondarylabel<<"'.");
+  }
+
+
+
+
   // add in tracks if appropriate and configured. Implemented in subclasses
   // addTracks(inputTE);
 
@@ -218,6 +237,7 @@ TrigHLTJetRecBase<InputContainer>::hltExecute(const HLT::TriggerElement*
   unsigned int j_count{0};
   for(auto j: *j_container)
     {
+
       /*
       ATH_MSG_VERBOSE("EMScale E " 
                       << (j->getAttribute<xAOD::JetFourMom_t>("JetEMScaleMomentum")).E());
@@ -225,7 +245,7 @@ TrigHLTJetRecBase<InputContainer>::hltExecute(const HLT::TriggerElement*
                       << j->getAttribute<xAOD::JetFourMom_t>("JetConstitScaleMomentum").E());
       */
       ++j_count;
-  
+ 
       ATH_MSG_DEBUG("jet "  
                       << j_count 
                       << " E " 
@@ -323,6 +343,36 @@ TrigHLTJetRecBase<InputContainer>::getInputContainer(const HLT::TriggerElement*
   return HLT::OK;
 }
 
+template<typename InputContainer>
+template<typename ghostInputContainer>
+HLT::ErrorCode
+TrigHLTJetRecBase<InputContainer>::getGhostInputContainer(const HLT::TriggerElement*
+                                                     outputTE,
+                                                     const ghostInputContainer*&
+                                                     inContainer){
+
+  // Get the input Container from input trigger element
+
+  // etablish the contianer type to retrieve from the trigger element
+  auto hltStatus = getFeature(outputTE, inContainer);  
+
+  if (hltStatus == HLT::OK) {
+    ATH_MSG_DEBUG("Retrieved the input container at address " << inContainer);
+  } else {
+    ATH_MSG_ERROR("Failed to retrieve the input container");
+    return HLT::ERROR;
+  }
+
+  if (inContainer == nullptr){
+    ATH_MSG_ERROR("The input container address = nullptr, giving up");
+    return HLT::ERROR;
+  }
+
+  ATH_MSG_DEBUG("Number of incoming objects : " << inContainer->size());
+
+  return HLT::OK;
+}
+
 
 //PS 3/4/18template<typename InputContainer>
 //PS 3/4/18HLT::ErrorCode
diff --git a/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/TrigHLTSoftKiller.h b/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/TrigHLTSoftKiller.h
index 31528c321137a192e4f2ff7d658c8112a41bdea1..473e371a60b81f82ef5019606c2b2723dcf82030 100644
--- a/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/TrigHLTSoftKiller.h
+++ b/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/TrigHLTSoftKiller.h
@@ -8,6 +8,7 @@
 #include "GaudiKernel/ToolHandle.h"
 #include "TrigInterfaces/FexAlgo.h"
 
+#include "JetRecTools/JetConstituentModSequence.h"
 
 class TrigHLTSoftKiller : public HLT::FexAlgo
 {
@@ -22,9 +23,11 @@ class TrigHLTSoftKiller : public HLT::FexAlgo
         HLT::ErrorCode hltFinalize();
 
     private:
-        // TODO Add SoftKiller ToolHandle and related here
 
-        std::string m_outputCollectionLabel;
+       ToolHandle<IJetConstituentModifier> m_skWeightTool;
+       ToolHandle<IJetExecuteTool> m_skclustModSeqTool; 
+       std::string m_outputCollectionLabel;
+       std::string m_clusterCalib;
         
 };
 
diff --git a/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/TriggerJetBuildTool.h b/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/TriggerJetBuildTool.h
index 335f8f797d16a1b6b7635ce5764ffdc9a912d438..31e7b477a082c00f3f1738ade0e8d2eeb7d5df3c 100644
--- a/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/TriggerJetBuildTool.h
+++ b/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/TriggerJetBuildTool.h
@@ -42,6 +42,7 @@ class TriggerJetBuildTool :
 
   // Set EDM inputs for jet finding
   virtual void prime(const xAOD::IParticleContainer*) override;
+  virtual void primeGhost(const xAOD::IParticleContainer*, std::string ghostlabel) override;
 
   virtual int build(fastjet::ClusterSequence*&, xAOD::JetContainer*&) const override;
   
diff --git a/Trigger/TrigAlgorithms/TrigHLTJetRec/python/TrigHLTJetRecConfig.py b/Trigger/TrigAlgorithms/TrigHLTJetRec/python/TrigHLTJetRecConfig.py
index c7c6a1623160b68cc722c7be7d0b016d7e75e3c0..46246ad5243050656bc997f9cd6659ec3f186c59 100644
--- a/Trigger/TrigAlgorithms/TrigHLTJetRec/python/TrigHLTJetRecConfig.py
+++ b/Trigger/TrigAlgorithms/TrigHLTJetRec/python/TrigHLTJetRecConfig.py
@@ -12,7 +12,8 @@ from GaudiKernel.Constants import (VERBOSE,
 
 import TrigHLTJetRecConf
 from TrigHLTJetRec.TrigHLTJetRecConf import (IParticleNullRejectionTool,
-                                             IParticlePtEtaRejectionTool,)
+                                             IParticlePtEtaRejectionTool,
+                                             NonPositiveEnergyRejectionTool)
 
 # from JetRec.JetRecConf import JetRecTool
 # from JetRec.JetRecConf import (JetFromPseudojetMT,)
@@ -192,6 +193,51 @@ def _getIsData():
     from AthenaCommon.GlobalFlags import globalflags
     return globalflags.DataSource() == 'data'
 
+def addJVFTool(toolname,
+                  tvSGkey,
+                  vcSGkey,
+                  tpcSGkey, ):
+
+    global jtm
+
+    try:
+        jvfTool  = getattr(jtm, toolname)
+    except AttributeError:       
+        from JetMomentTools.JetMomentToolsConf import JetVertexFractionTool
+ 
+        # Build the tool :
+        jvfTool = JetVertexFractionTool(toolname,
+                                        VertexContainer = vcSGkey, 
+                                        AssociatedTracks = "GhostTrack",
+                                        TrackVertexAssociation = tvSGkey,
+                                        TrackParticleContainer = tpcSGkey, 
+                                        TrackSelector = jtm.trackselloose,
+                                        JVFName = "JVF",
+                                        IsTrigger=True,)
+        
+        jtm += jvfTool
+        print 'TrigHLTJetRecConfig.addJVFTool '\
+            'Added jvf tool "%s" to jtm' % toolname
+
+
+def addJVTTool(toolname,
+                  vcSGkey, ):
+
+    global jtm
+
+    try:
+        jvfTool  = getattr(jtm, toolname)
+    except AttributeError:       
+        from JetMomentTools.JetMomentToolsConf import JetVertexTaggerTool
+ 
+        # Build the tool :
+        jvtTool = JetVertexTaggerTool(toolname,
+                                      VertexContainer = vcSGkey)
+        
+        jtm += jvtTool
+        print 'TrigHLTJetRecConfig.addJVFTool '\
+            'Added jvt tool "%s" to jtm' % toolname
+
 
 # *** FTK track moment tool helpers set up ***
 def configTVassocTool(name,
@@ -207,6 +253,7 @@ def configTVassocTool(name,
         TrackParticleContainer = tpcSGkey,
         TrackVertexAssociation = tvSGkey,
         VertexContainer = vcSGkey,
+        TrackVertexAssoTool = jtm.jetLooseTVAtool,
     )
 
     # Build the tool :
@@ -451,6 +498,7 @@ def _getJetBuildTool2(merge_param,
                       iParticleRejectionTool,
                       name='',
                       secondary_label='',
+		      trkopt = '',
                       outputLabel='',
                       OutputLevel=INFO,
                       fromJet=False
@@ -476,7 +524,7 @@ def _getJetBuildTool2(merge_param,
     # in situ calibration step is only for data, not MC
     # this string here allows the following code to be data/MC unaware
     inSitu = 'i' if _getIsData() else ''
-
+   
     # tell the offline code which calibration is requested
     calib_str = {'jes': 'calib:j:triggerNoPileup:HLTKt4',
                  'subjes': 'calib:aj:trigger:HLTKt4',
@@ -490,14 +538,27 @@ def _getJetBuildTool2(merge_param,
     if outputLabel!='triggerTowerjets': #towers don't have cluster moments
         mymods.append(jtm.clsmoms)
     if secondary_label == 'GhostTrack': # ghost track association expected, will want track moments.
-        if not hasattr(jtm, 'trkmoms_GhostTracks'):
+        if not hasattr(jtm, 'trkmoms_'+trkopt):
             print "In TrigHLTJetRecConfig._getJetBuildTool: Something went wrong. GhostTrack label set but no track moment tools configured. Continuing without trkmodifers."
         else:        
-            trkmoms_ghosttrack = getattr(jtm, 'trkmoms_GhostTracks')
+            trkmoms_ghosttrack = getattr(jtm, 'trkmoms_'+trkopt)
             trkmoms_ghosttrack.unlock()
             trkmoms_ghosttrack.AssociatedTracks = secondary_label
             trkmoms_ghosttrack.lock()
             mymods.append(trkmoms_ghosttrack)
+        if not hasattr(jtm, 'jvf_'+trkopt):
+            print "In TrigHLTJetRecConfig._getJetBuildTool: Something went wrong. GhostTrack label set but no JVF tool configured. Continuing without jvf calculations."
+        else:        
+            jvf_ghosttrack = getattr(jtm, 'jvf_'+trkopt)
+            jvf_ghosttrack.unlock()
+            jvf_ghosttrack.AssociatedTracks = secondary_label
+            jvf_ghosttrack.lock()
+            mymods.append(jvf_ghosttrack)
+        if not hasattr(jtm, 'jvt_'+trkopt):
+            print "In TrigHLTJetRecConfig._getJetBuildTool: Something went wrong. GhostTrack label set but no JVT tool configured. Continuing without jvt calculations."
+        else:        
+            jvt_ghosttrack = getattr(jtm, 'jvt_'+trkopt)
+            mymods.append(jvt_ghosttrack)
 
     if not do_minimalist_setup:
         # add in extra modofiers. This allows monitoring the ability
@@ -567,6 +628,7 @@ def _getJetBuildTool2(merge_param,
 
     try:
         # jetBuildTool = jtm.addJetFinderTrigger(
+        #OutputLevel=VERBOSE
         jetBuildTool = jtm.addTriggerJetBuildTool(
             name=name,
             alg="AntiKt",
@@ -1042,6 +1104,31 @@ def _getIParticleNullRejectionTool(toolname, **kwds):
 
     return rejecter
 
+def _getNonPositiveEnergyRejectionTool(toolname, **kwds):
+
+    # set up a tool to select all pseudo jets
+    # declare jtm as global as this function body may modify it
+    # with the += operator
+    global jtm
+    
+    # Build a new list of jet inputs. original: mygetters = [jtm.lcget]
+    try:
+        rejecter = getattr(jtm, toolname)
+    except AttributeError:
+        # Add the PseudoJetSelectorAll to the JetTool Manager,
+        # which pushes it to the ToolSvc in __iadd__
+        # This is done in the same as PseudoJetGetter is added in
+        # JetRecStandardTools.py.
+        # The 'Label' must be one of the values found in JetContainerInfo.h
+        rejecter = NonPositiveEnergyRejectionTool(
+            name=toolname, **kwds)
+        jtm += rejecter
+        rejecter = getattr(jtm, toolname)
+        print 'TrigHLTJetRecConfig._getNonPositiveEnergyRectionTool '\
+            'Added rejecter "%s" to jtm' % toolname
+
+    return rejecter
+
 
 def _getIParticlePtEtaRejectionTool(toolname, **kwds):
 
@@ -1103,8 +1190,8 @@ class TrigHLTJetRecFromCluster(TrigHLTJetRecConf.TrigHLTJetRecFromCluster):
         # self.iIParticleSelector = _getIParticleSelectorAll(
         #    'iIParticleSelectorAll') 
 
-        iIParticleRejecter = _getIParticleNullRejectionTool(
-            'iIParticleNullRejectionTool', OutputLevel=OutputLevel)
+        iIParticleRejecter = _getNonPositiveEnergyRejectionTool(
+            'nonPositiveEnergyRejectionTool', OutputLevel=OutputLevel)
         
         secondary_label = ''
         # FTK specific: do we want FTK? Set label to GhostTrack. 
@@ -1137,8 +1224,9 @@ class TrigHLTJetRecFromCluster(TrigHLTJetRecConf.TrigHLTJetRecFromCluster):
             do_substructure=do_substructure,
             iParticleRejectionTool=iIParticleRejecter,
             name=name,
-            secondary_label=secondary_label, # track related modifiers
             OutputLevel=OutputLevel,
+            trkopt = trkopt,
+            secondary_label=secondary_label, # needed for retrieving the track psjgetter and configuring and adding of track modifiers.
             )
         print 'after jetbuild'
         
@@ -1169,7 +1257,7 @@ class TrigHLTJetRecGroomer(TrigHLTJetRecConf.TrigHLTJetRecGroomer):
                  OutputLevel=INFO,
                  ):
 
-        # OutputLevel = VERBOSE
+        #OutputLevel = VERBOSE
         
         TrigHLTJetRecConf.TrigHLTJetRecGroomer.__init__(self, name = name)
 
@@ -1183,8 +1271,8 @@ class TrigHLTJetRecGroomer(TrigHLTJetRecConf.TrigHLTJetRecGroomer):
         # 3/18 IParticle selection moved to TriggerJetBuildTool
         # self.iIParticleSelector = _getIParticleSelectorAll(
         #    'iParticleSelectorAll')
-        iIParticleRejecter = _getIParticleNullRejectionTool(
-            'iIParticleNullRejectionTool', OutputLevel=OutputLevel)
+        iIParticleRejecter = _getNonPositiveEnergyRejectionTool(
+            'nonPositiveEnergyRejectionTool', OutputLevel=OutputLevel)
         
 
         # Groomer builds jets from clusters and then grooms them
@@ -1201,7 +1289,7 @@ class TrigHLTJetRecGroomer(TrigHLTJetRecConf.TrigHLTJetRecGroomer):
             do_minimalist_setup=do_minimalist_setup,
             iParticleRejectionTool=iIParticleRejecter,
             name=name+'notrim',
-            do_substructure=do_substructure,
+            do_substructure=False, #do_substructure,
             OutputLevel=OutputLevel,
         )
         
@@ -1248,15 +1336,14 @@ class TrigHLTJetRecFromJet(TrigHLTJetRecConf.TrigHLTJetRecFromJet):
         TrigHLTJetRecConf.TrigHLTJetRecFromJet.__init__(self, name=name)
         self.OutputLevel = OutputLevel
         
-        self.OutputLevel = OutputLevel
         self.cluster_calib = cluster_calib
         # self.pseudoJetGetter = _getTriggerPseudoJetGetter(cluster_calib)
 
         name = 'iIParticleEtaPtRejecter_%d_%d' % (int(10 * etaMaxCut),
                                                   int(ptMinCut))
         
-        iIParticleRejecter = _getIParticleNullRejectionTool(
-            'iIParticleNullRejectionTool', OutputLevel=OutputLevel)
+        iIParticleRejecter = _getNonPositiveEnergyRejectionTool(
+            'nonPositiveEnergyRejectionTool', OutputLevel=OutputLevel)
 
         concrete_type = 'Jet'
 
@@ -1313,8 +1400,8 @@ class TrigHLTJetRecFromTriggerTower(
         #                                       int(ptMinCut)),
         #    **{'etaMax': etaMaxCut, 'ptMin': ptMinCut})
 
-        iIParticleRejecter = _getIParticleNullRejectionTool(
-            'iIParticleNullRejectionTool', OutputLevel=OutputLevel)
+        iIParticleRejecter = _getNonPositiveEnergyRejectionTool(
+            'nonPositiveEnergyRejectionTool', OutputLevel=OutputLevel)
         
 
 
@@ -1472,6 +1559,8 @@ class TrigHLTEnergyDensity(TrigHLTJetRecConf.TrigHLTEnergyDensity):
 
         self.energyDensity = 0
 
+from JetRecTools.JetRecToolsConf import  (JetConstituentModSequence, SoftKillerWeightTool, ClusterAtEMScaleTool, VoronoiWeightTool)
+
 class TrigHLTSoftKiller(TrigHLTJetRecConf.TrigHLTSoftKiller):
     """Supply a specific grid configuration for SoftKiller"""
 
@@ -1487,12 +1576,43 @@ class TrigHLTSoftKiller(TrigHLTJetRecConf.TrigHLTSoftKiller):
         TrigHLTJetRecConf.TrigHLTSoftKiller.__init__(self,name=name)
 
         self.OutputLevel = OutputLevel
-        self.output_collection_label = output_collection_label
+        self.output_collection_label = output_collection_label+ '_' + name + '_'+cluster_calib
 
-        # TODO create and configure offline SoftKiller tool here, pass it to our tool
         # Use cluster_calib, sk_grid_param_eta, and sk_grid_param_phi to configure the offline tool
         print "SK: %s, %f, %f"%(cluster_calib,sk_grid_param_eta,sk_grid_param_phi)
 
+        # Temp hardcode enum value as this is code that will be dropped
+        xaodtype_calocluster = 1
+
+        modifiers = []
+        # We only want an EM tool if we are working with EM clusters
+        # The tool should be used before calling SoftKiller (prepend to list)
+        if cluster_calib == "EM":
+            emTool = ClusterAtEMScaleTool('emTool_'+name+'_'+cluster_calib, InputType=xaodtype_calocluster)
+            jtm.add(emTool)
+            self.emTool = emTool
+            modifiers.append(self.emTool)
+        
+        global jtm
+        skTool =  SoftKillerWeightTool( name+cluster_calib, SKGridSize=0.6, isCaloSplit=False, SKRapMin=0, SKRapMax=2.5, InputType=xaodtype_calocluster)
+        jtm.add(skTool)
+        self.skWeightTool = skTool
+
+        voronoiTool = VoronoiWeightTool('voronoiTool'+name+'_'+cluster_calib, doSpread =  False, nSigma = 0, InputType=xaodtype_calocluster)
+        jtm.add(voronoiTool)
+        self.voronoiTool = voronoiTool
+        modifiers += [self.voronoiTool, self.skWeightTool]
+        
+        skclustModSeq = JetConstituentModSequence('ClustModifSequence_'+name+'_'+cluster_calib,
+                                                 InputContainer = "CaloCalTopoClusters",
+                                                 OutputContainer = self.output_collection_label,
+                                                 InputType=xaodtype_calocluster,
+                                                 Trigger = True,
+                                                 Modifiers = modifiers
+                                                 )
+        jtm.add(skclustModSeq)
+        self.skclustModSeqTool = skclustModSeq
+        
         print "SK clusters from clusters"
 
 # Track Moment helper class                                                     
@@ -1502,6 +1622,7 @@ class TrigHLTTrackMomentHelpers(TrigHLTJetRecConf.TrigHLTTrackMomentHelpers):
 
     def __init__(self,
                  name,
+                 trkopt,
                  tvassocSGkey,
                  trackSGkey,
                  primVtxSGkey,
@@ -1512,7 +1633,7 @@ class TrigHLTTrackMomentHelpers(TrigHLTJetRecConf.TrigHLTTrackMomentHelpers):
         self.primVtxSGkey = primVtxSGkey
 
         #retrieve and configure the TVA tool 
-        tvatoolname = 'tvassoc_GhostTracks'
+        tvatoolname = 'tvassoc_'+trkopt
 
         tvaoptions = dict(tvSGkey=tvassocSGkey,
                        tpcSGkey=trackSGkey,
@@ -1522,12 +1643,27 @@ class TrigHLTTrackMomentHelpers(TrigHLTJetRecConf.TrigHLTTrackMomentHelpers):
         self.tvassocTool = _getTVassocTool(tvatoolname, **tvaoptions)
     
         # add  a specially configured trkmoms tool to jtm 
-        trkmomstoolname = 'trkmoms_GhostTracks'
+        trkmomstoolname = 'trkmoms_'+trkopt
         
         trkmomsoptions = dict(tvSGkey=tvassocSGkey,
                        vcSGkey=primVtxSGkey,
                        )
         addTrkMomsTool(trkmomstoolname, **trkmomsoptions)
+        
+        # add  a specially configured jvf tool to jtm 
+        jvftoolname = 'jvf_'+trkopt
+        
+        jvfoptions = dict(tvSGkey=tvassocSGkey,
+                       tpcSGkey=trackSGkey,
+                       vcSGkey=primVtxSGkey,
+                       )
+        addJVFTool(jvftoolname, **jvfoptions)
+
+        # add  a specially configured jvt tool to jtm 
+        jvttoolname = 'jvt_'+trkopt
+        
+        jvtoptions = dict(vcSGkey=primVtxSGkey)
+        addJVTTool(jvttoolname, **jvtoptions)
 
 # Data scouting algorithm
 class TrigHLTJetDSSelector(TrigHLTJetRecConf.TrigHLTJetDSSelector):
diff --git a/Trigger/TrigAlgorithms/TrigHLTJetRec/src/NegativeEnergyRejectionTool.cxx b/Trigger/TrigAlgorithms/TrigHLTJetRec/src/NegativeEnergyRejectionTool.cxx
deleted file mode 100644
index 40d1c344acb0ffa8b382ecca2ea13669c962a075..0000000000000000000000000000000000000000
--- a/Trigger/TrigAlgorithms/TrigHLTJetRec/src/NegativeEnergyRejectionTool.cxx
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-#include "TrigHLTJetRec/NegativeEnergyRejectionTool.h"
-
-
-NegativeEnergyRejectionTool::NegativeEnergyRejectionTool(const std::string& name):
-  AsgTool(name) {
-}
-
-StatusCode NegativeEnergyRejectionTool::initialize() {
-  ATH_MSG_INFO("Initializing " << name() << ".");
-  return StatusCode::SUCCESS; 
-}
-
-
-bool  NegativeEnergyRejectionTool::operator()(const xAOD::IParticle* ip) {
-  ATH_MSG_DEBUG("Entering operator()()...");
-
-  ++m_tested;
-  
-  bool null = (ip == 0);
-  bool negativeE = m_skipNegativeEnergy && ip->e() <= 0.0;
-  if  (null || negativeE){
-    ++m_rejected;
-    return true;
-  }
-  return false;
-}
-
-
-StatusCode NegativeEnergyRejectionTool::finalize() {
-  ATH_MSG_INFO("Finalizing " << name() << ".");
-  return StatusCode::SUCCESS; 
-}
-
-
-std::size_t NegativeEnergyRejectionTool::tested() const {return m_tested;}
-std::size_t NegativeEnergyRejectionTool::rejected() const {return m_rejected;}
diff --git a/Trigger/TrigAlgorithms/TrigHLTJetRec/src/NonPositiveEnergyRejectionTool.cxx b/Trigger/TrigAlgorithms/TrigHLTJetRec/src/NonPositiveEnergyRejectionTool.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..c48cda14d0ca1092185327cf595737923374842e
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigHLTJetRec/src/NonPositiveEnergyRejectionTool.cxx
@@ -0,0 +1,39 @@
+/*
+  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+*/
+#include "TrigHLTJetRec/NonPositiveEnergyRejectionTool.h"
+
+
+NonPositiveEnergyRejectionTool::NonPositiveEnergyRejectionTool(const std::string& name):
+  AsgTool(name) {
+}
+
+StatusCode NonPositiveEnergyRejectionTool::initialize() {
+  ATH_MSG_INFO("Initializing " << name() << ".");
+  return StatusCode::SUCCESS; 
+}
+
+
+bool  NonPositiveEnergyRejectionTool::operator()(const xAOD::IParticle* ip) {
+  ATH_MSG_DEBUG("Entering operator()()...");
+
+  ++m_tested;
+  
+  bool null = (ip == 0);
+  bool positiveE = ip->e() > FLT_MIN;
+  if  (null || !positiveE){
+    ++m_rejected;
+    return true;
+  }
+  return false;
+}
+
+
+StatusCode NonPositiveEnergyRejectionTool::finalize() {
+  ATH_MSG_INFO("Finalizing " << name() << ".");
+  return StatusCode::SUCCESS; 
+}
+
+
+std::size_t NonPositiveEnergyRejectionTool::tested() const {return m_tested;}
+std::size_t NonPositiveEnergyRejectionTool::rejected() const {return m_rejected;}
diff --git a/Trigger/TrigAlgorithms/TrigHLTJetRec/src/PseudoJetCreatorFunctions.cxx b/Trigger/TrigAlgorithms/TrigHLTJetRec/src/PseudoJetCreatorFunctions.cxx
index 070d35ac21b4c815aec040aacb44d5245b4fa70c..6632ec4280dc7751138b2d8ec26a9201d2792bcc 100644
--- a/Trigger/TrigAlgorithms/TrigHLTJetRec/src/PseudoJetCreatorFunctions.cxx
+++ b/Trigger/TrigAlgorithms/TrigHLTJetRec/src/PseudoJetCreatorFunctions.cxx
@@ -153,6 +153,14 @@ namespace PseudoJetCreatorFunctions{
     }
   };
 
+  ////////////Ghost version////////////////////
+  class GhostParticleMomentumGetter: public IMomentumGetter {
+    virtual xAOD::IParticle::FourMom_t  
+    operator()(const xAOD::IParticle* ip) const override {
+      return ip->p4()*1e-40; // momentum scaled to near zero.
+    }
+  };
+
   ////////////////////////////////
   // MomentumGetter Factory
 
@@ -165,6 +173,13 @@ namespace PseudoJetCreatorFunctions{
 
     return std::make_unique<IParticleMomentumGetter>();
   }
+
+  ////////////Ghost version////////////////////
+  std::unique_ptr<IMomentumGetter> 
+  make_ghostmomentumGetter(){
+
+    return std::make_unique<GhostParticleMomentumGetter>();
+  }
   
   ////////////////////////////////
   // IParticle to PseudoJet converter
@@ -253,5 +268,18 @@ namespace PseudoJetCreatorFunctions{
                                   rejecter,
                                   std::move(momentumGetter));
   }
+
+  ////////////////Ghost version////////////////////////////
+  std::vector<PseudoJet> 
+  createGhostPseudoJets(const xAOD::IParticleContainer* ips,
+                   ToolHandle<IIParticleRejectionTool>& rejecter){
+
+    
+    auto momentumGetter = make_ghostmomentumGetter();
+
+    return IParticlesToPseudoJets(ips, 
+                                  rejecter,
+                                  std::move(momentumGetter));
+  }
   
 }
diff --git a/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TrigHLTJetRecGroomer.cxx b/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TrigHLTJetRecGroomer.cxx
index 99c57591b6baeb6b47b96bf5acb553cc4757fc1e..6b8018cbe53fd52256e851de9995232ea283ec6e 100644
--- a/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TrigHLTJetRecGroomer.cxx
+++ b/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TrigHLTJetRecGroomer.cxx
@@ -90,7 +90,7 @@ TrigHLTJetRecGroomer::build(fastjet::ClusterSequence*& cs,
         
         ATH_MSG_DEBUG("Ungroomed/groomed jet number " << iJet << " has constituents of " << ungroomedJets->at(iJet)->numConstituents() << "/" << trimmedJets->at(iJet)->numConstituents() << ", pT ratio is " << orig_pt << "/" << trim_pt << " = " << ratio << " , constscale ratio is " << orig_const_pt << "/" << trim_const_pt << " = " << ratio_const << " , emscale ratio is " << orig_em_pt << "/" << trim_em_pt << " = " << ratio_em);
         }
-  */
+    */
 
   // Get rid of the intermediate (ungroomed) jets
   auto ungroomedStore = ungroomedJets->getStore();
diff --git a/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TrigHLTSoftKiller.cxx b/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TrigHLTSoftKiller.cxx
index 76bfb4d56c46ef2107ca4b3253150c8333597e97..afa60b0044d74a9efdbbe7cc25be9a54f77f3071 100644
--- a/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TrigHLTSoftKiller.cxx
+++ b/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TrigHLTSoftKiller.cxx
@@ -8,11 +8,13 @@
 
 #include "TrigHLTJetRec/TrigHLTSoftKiller.h"
 #include "xAODCaloEvent/CaloClusterContainer.h"
+#include "xAODBase/IParticleContainer.h"
 
 TrigHLTSoftKiller::TrigHLTSoftKiller(const std::string& name, ISvcLocator* pSvcLocator)
     : HLT::FexAlgo(name, pSvcLocator)
 {
     declareProperty( "output_collection_label", m_outputCollectionLabel);
+    declareProperty("skclustModSeqTool",m_skclustModSeqTool);
 }
 
 TrigHLTSoftKiller::~TrigHLTSoftKiller()
@@ -23,7 +25,15 @@ HLT::ErrorCode TrigHLTSoftKiller::hltInitialize()
     
     ATH_MSG_INFO("Initializing " << name() << "...");
     
-    // TODO Retrieve any needed ToolHandles here, like the SoftKiller tool
+   StatusCode sc = m_skclustModSeqTool.retrieve();
+
+   if (sc.isSuccess())
+       ATH_MSG_INFO("Retrieved skclustModSeqTool: " << m_skclustModSeqTool->name());
+    else
+    {
+     	ATH_MSG_ERROR("Failed to retrieve the skclustModSeqTool: " << m_skclustModSeqTool->name());
+        return HLT::ERROR;
+    }
 
     ATH_MSG_INFO("Initialization successful");
 
@@ -47,12 +57,12 @@ HLT::ErrorCode TrigHLTSoftKiller::hltExecute(const HLT::TriggerElement* inputTE,
     ATH_MSG_DEBUG("inputTE->getId(): " << inputTE->getId());
 
     // Get the input container
-    const xAOD::CaloClusterContainer* clusters = nullptr;
-    HLT::ErrorCode status = getFeature(inputTE,clusters);
+    const xAOD::CaloClusterContainer* inputclusters = nullptr;
+    HLT::ErrorCode status = getFeature(inputTE,inputclusters);
     if (status == HLT::OK)
     {
-        if (clusters != nullptr)
-            ATH_MSG_DEBUG("Retrieved input cluster container of size " << clusters->size());
+        if (inputclusters != nullptr)
+            ATH_MSG_DEBUG("Retrieved input cluster container of size " << inputclusters->size());
         else
         {
             ATH_MSG_ERROR("Retrieved NULL input cluster container");
@@ -65,19 +75,47 @@ HLT::ErrorCode TrigHLTSoftKiller::hltExecute(const HLT::TriggerElement* inputTE,
         return HLT::ERROR;
     }
 
+    JetConstituentModSequence *skclustModSeqTool = const_cast<JetConstituentModSequence*>(dynamic_cast<const JetConstituentModSequence*>(&*m_skclustModSeqTool));
+    const xAOD::IParticleContainer* IP_inputclusters = dynamic_cast<const xAOD::IParticleContainer*> (inputclusters);
+    skclustModSeqTool->setInputClusterCollection(IP_inputclusters);
+    //skclustModSeqTool->setInputClusterCollection(inputclusters);
+    int process_status = skclustModSeqTool->execute();
+    const xAOD::CaloClusterContainer* outputclusters = dynamic_cast<const xAOD::CaloClusterContainer*>(skclustModSeqTool->getOutputClusterCollection()); 
+    
+    if (process_status == 0)
+    {
+        if (outputclusters != nullptr)
+            ATH_MSG_DEBUG("Processed cluster container of size " << outputclusters->size());
+        else
+        {
+            ATH_MSG_ERROR("SoftKillerWeightTool returned NULL input cluster container");
+            return HLT::ERROR;
+        }
+    }
+    else
+    {
+        ATH_MSG_ERROR("Failed to retrieve processed cluster container");
+        return HLT::ERROR;
+    }
+    
+    ////////// FOR DEBUGGING PURPOSES
+    //SG::AuxElement::ConstAccessor<float> weightAcc("PUWeight"); // Handle for PU weighting here
+    //for (size_t icl = 0; icl < outputclusters->size(); ++icl)
+    //    if (weightAcc(*(outputclusters->at(icl))) < 1.e-6)
+    //        ATH_MSG_INFO("Cluster SK weight: " << weightAcc(*(outputclusters->at(icl))) << ", pT = " << outputclusters->at(icl)->pt());
 
-
-    // Apply SoftKiller and store the output in clustersSK
-    const xAOD::CaloClusterContainer* clustersSK = clusters; // TODO change this to the SK cluster output
-    // TODO add SK here
-
+    ATH_MSG_DEBUG("writing results");
 
 
     // Write the resulting container
+    auto auxStore = outputclusters->getStore();
     std::string key = "";
-    status = recordAndAttachFeature(outputTE,clustersSK,key,m_outputCollectionLabel);
+    status = recordAndAttachFeature(outputTE,outputclusters,key,m_outputCollectionLabel);
     if (status == HLT::OK)
+    {
         ATH_MSG_DEBUG("Attached SK cluster container to output TE");
+        delete auxStore;
+    }
     else
         ATH_MSG_ERROR("Failed to attach SK cluster container to output TE, status " << status);
     return status;
diff --git a/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TriggerJetBuildTool.cxx b/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TriggerJetBuildTool.cxx
index 8a3b5e367c03464b252f9f952f2e690302f5de57..94d04a79b290a42ab93c209ea4d6015ddce24f48 100644
--- a/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TriggerJetBuildTool.cxx
+++ b/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TriggerJetBuildTool.cxx
@@ -178,6 +178,57 @@ void TriggerJetBuildTool::prime(const xAOD::IParticleContainer* inputs){
                 
                 
 
+  PseudoJetContainer pjc(extractor, vpj);
+  m_inContainer.append(&pjc);
+}
+
+void TriggerJetBuildTool::primeGhost(const xAOD::IParticleContainer* inputs, std::string ghostlabel){
+
+  
+  // use the input IParticles to make a PseudoJEtContainer.
+  // This method may be called more than once per event
+  // m_label is a string which gives type information. It is used
+  // to determine the function used to select the incoming IParticles.
+  ATH_MSG_DEBUG("Entering primeGhost(), call " << ++m_nprime);
+
+  constexpr bool isGhost = true;
+  IParticleExtractor* extractor = new IParticleExtractor(inputs,
+                                                         ghostlabel,
+                                                         isGhost,
+                                                         m_isTrigger);
+
+  
+  ATH_MSG_DEBUG("No of ghost IParticle inputs: " << inputs->size());
+
+  for(const auto& ip : *inputs){
+    ATH_MSG_VERBOSE("primeGhost() PseudoJetInputDump" 
+                    << ip->e() 
+                    << " "
+                    << "ghost constituent label"
+                    << " "
+                    << ghostlabel);
+  }
+  
+  std::vector<PseudoJet> vpj = 
+    PseudoJetCreatorFunctions::createGhostPseudoJets(inputs, 
+                                                m_iParticleRejecter
+                                                );
+  
+  ATH_MSG_DEBUG("No of pseudojets: " << vpj.size());
+  for(const auto& pj : vpj){
+    ATH_MSG_VERBOSE("prime() PseudoJetDump. index" << " " << pj.user_index()
+                    << " E " << pj.E() 
+                    << " "
+		    << " label "
+                    << ghostlabel);
+  }
+
+  ATH_MSG_DEBUG("So far this job IParticles"
+                << " tested " << m_iParticleRejecter->tested()
+                << " rejected " << m_iParticleRejecter->rejected());
+                
+                
+
   PseudoJetContainer pjc(extractor, vpj);
   m_inContainer.append(&pjc);
 }
diff --git a/Trigger/TrigAlgorithms/TrigHLTJetRec/src/components/TrigHLTJetRec_entries.cxx b/Trigger/TrigAlgorithms/TrigHLTJetRec/src/components/TrigHLTJetRec_entries.cxx
index 547893ebbfa1952701514f0796bb6d8749ace510..b07dae3b28f8f95757f120b4df5a0c7aa7e8330b 100644
--- a/Trigger/TrigAlgorithms/TrigHLTJetRec/src/components/TrigHLTJetRec_entries.cxx
+++ b/Trigger/TrigAlgorithms/TrigHLTJetRec/src/components/TrigHLTJetRec_entries.cxx
@@ -23,18 +23,17 @@
 #include "TrigHLTJetRec/TriggerJetBuildTool.h"
 #include "TrigHLTJetRec/TriggerJetGroomerTool.h"
 
-
 #include "TrigHLTJetRec/IParticleNullRejectionTool.h"
 #include "TrigHLTJetRec/IParticlePtEtaRejectionTool.h"
 #include "TrigHLTJetRec/EMTopoRejectionTool.h"
 #include "TrigHLTJetRec/PFlowRejectionTool.h"
-#include "TrigHLTJetRec/NegativeEnergyRejectionTool.h"
+#include "TrigHLTJetRec/NonPositiveEnergyRejectionTool.h"
 
 DECLARE_COMPONENT(IParticleNullRejectionTool)
 DECLARE_COMPONENT(IParticlePtEtaRejectionTool)
 DECLARE_COMPONENT(EMTopoRejectionTool)
 DECLARE_COMPONENT(PFlowRejectionTool)
-DECLARE_COMPONENT(NegativeEnergyRejectionTool)
+DECLARE_COMPONENT(NonPositiveEnergyRejectionTool)
 
 DECLARE_COMPONENT( TrigHLTJetRecFromCluster )
 DECLARE_COMPONENT( TrigHLTJetRecFromJet )
diff --git a/Trigger/TrigAlgorithms/TrigPartialEventBuilding/src/PEBInfoWriterAlg.cxx b/Trigger/TrigAlgorithms/TrigPartialEventBuilding/src/PEBInfoWriterAlg.cxx
index 42ea4e63556ab3fadf64fb2b6bc80b8ef8f4326f..9b288cf02da0b22b5372f19fbe02e2d015213201 100644
--- a/Trigger/TrigAlgorithms/TrigPartialEventBuilding/src/PEBInfoWriterAlg.cxx
+++ b/Trigger/TrigAlgorithms/TrigPartialEventBuilding/src/PEBInfoWriterAlg.cxx
@@ -92,7 +92,7 @@ StatusCode PEBInfoWriterAlg::execute(const EventContext& eventContext) const {
     // Link to new decision
     newd->setObjectLink("roi", roiEL);
     newd->setObjectLink("view", viewEL);
-    linkToPrevious(newd, decisionInput().key(), counter);
+    linkToPrevious(newd, previousDecision);
     
     ATH_MSG_DEBUG("REGTEST:  View = " << (*viewEL));
     ATH_MSG_DEBUG("REGTEST:  RoI  = eta/phi = " << (*roiEL)->eta() << "/" << (*roiEL)->phi());
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TrigCaloDataAccessSvc.cxx b/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TrigCaloDataAccessSvc.cxx
index dc37eb0868f9b5bd1b3586857003e2b620d72615..689fda41a0a3de1c7036c0beaf318c8158f049e4 100644
--- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TrigCaloDataAccessSvc.cxx
+++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TrigCaloDataAccessSvc.cxx
@@ -548,7 +548,7 @@ unsigned int TrigCaloDataAccessSvc::prepareLArCollections( const EventContext& c
     m_robDataProvider->addROBData( requestROBs );
     m_robDataProvider->getROBData( context, requestROBs, robFrags );
   }
-  if ( robFrags.empty() ) {
+  if ( robFrags.empty() && (!requestROBs.empty()) ) {
     return 0x1; // dummy code
   }
 
diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/python/TrigEgammaProbelist.py b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/python/TrigEgammaProbelist.py
index 7a86304b75c82b4998fed73fa60e20203ec8152d..c0e9cfe8cca733442ba604187a026c2f51a0bdcf 100644
--- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/python/TrigEgammaProbelist.py
+++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/python/TrigEgammaProbelist.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
 # this file contains the useful lists of triggers for quick configuration
 # and a default monitoring configuration
@@ -514,3 +514,38 @@ monitoringTP_electron_extra =[
 ]
 
 
+### Make supproting trigger list for the emulation e/g tool
+supportingTriggerList = probeListLowMidPtSupportingTriggers+probeListHighPtSupportingTriggers
+# Update the supporting list with very loose chains. This will be used in data collisin matches
+for trig in probeListLowMidPtPhysicsTriggers+probeListHighPtPhysicsTriggers:
+  if 'vloose' in trig:  supportingTriggerList.append(trig)
+
+supportingTriggerList.extend( [
+  'HLT_e24_lhvloose_nod0_L1EM20VH',
+  'HLT_e26_lhvloose_nod0_L1EM20VH',
+  'HLT_e28_lhvloose_nod0_L1EM20VH',
+  'HLT_e140_lhvloose_nod0',
+  'HLT_e10_lhvloose_nod0_L1EM7',
+  'HLT_e10_lhvloose_nod0_L1EM7',
+  'HLT_e15_lhvloose_nod0_L1EM7',
+  'HLT_e20_lhvloose_nod0_L1EM12',
+  'HLT_e25_lhvloose_nod0_L1EM15',
+  'HLT_e30_lhvloose_nod0_L1EM15',
+  'HLT_e40_lhvloose_nod0_L1EM15',
+  'HLT_e50_lhvloose_nod0_L1EM15',
+  'HLT_e70_lhvloose_nod0',
+  'HLT_e80_lhvloose_nod0',
+  'HLT_e100_lhvloose_nod0',
+  'HLT_e120_lhvloose_nod0',
+  'HLT_e5_lhvloose_nod0',
+  'HLT_e12_lhvloose_nod0_L1EM10VH',
+  'HLT_e17_lhvloose_nod0',
+  'HLT_e20_lhvloose_nod0',
+  'HLT_e40_lhvloose_nod0',
+  'HLT_e60_lhvloose_nod0',
+] )
+
+
+
+
+
diff --git a/Trigger/TrigConfiguration/TrigConfData/CMakeLists.txt b/Trigger/TrigConfiguration/TrigConfData/CMakeLists.txt
index 083e0420bd214b9e37a42c77435cb047f5e675d4..c3c71b0df561f13849977389cc0519c09f136074 100644
--- a/Trigger/TrigConfiguration/TrigConfData/CMakeLists.txt
+++ b/Trigger/TrigConfiguration/TrigConfData/CMakeLists.txt
@@ -6,7 +6,7 @@
 atlas_subdir( TrigConfData )
 
 # Declare the package's dependencies:
-atlas_depends_on_subdirs( )
+atlas_depends_on_subdirs( CxxUtils )
 
 # External dependencies:
 find_package( Boost REQUIRED )
@@ -16,3 +16,8 @@ atlas_add_library ( TrigConfData TrigConfData/*.h src/*.cxx
                     PUBLIC_HEADERS TrigConfData
                     INCLUDE_DIRS ${Boost_INCLUDE_DIRS}
                     LINK_LIBRARIES ${Boost_LIBRARIES} )
+
+atlas_add_test( ConstIter SOURCES test/itertest.cxx
+                INCLUDE_DIRS ${Boost_INCLUDE_DIRS}
+                LINK_LIBRARIES ${Boost_LIBRARIES} TrigConfData
+                POST_EXEC_SCRIPT nopost.sh )
diff --git a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..b6f30c083c08bb1f1a2c77907f453831c0e82e27
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigConfiguration/TrigConfData
diff --git a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/ConstIter.h b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/ConstIter.h
index a0938698d930476255f18f3eb8ce3ff1ba0e3fbc..9d5cbbee6f3086000b9eea13138ce01abfaa5bd8 100644
--- a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/ConstIter.h
+++ b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/ConstIter.h
@@ -12,6 +12,8 @@
  * @brief Forward iterator to traverse the main components of the trigger configuration
  */
 
+#include "CxxUtils/checker_macros.h"
+
 #include <functional>
 
 namespace TrigConf {
@@ -55,6 +57,7 @@ namespace TrigConf {
          m_buf(buf),
          m_offset(offset),
          m_data(),
+         m_valid(false),
          m_f(f),
          m_bufIt(buf.begin())
       {}
@@ -77,21 +80,26 @@ namespace TrigConf {
       ConstIter & operator++() {
          ++m_offset;
          ++m_bufIt;
+         m_valid = false;
          return *this;
       }
 
       /** Dereference operator
        * Creates object of type @c T from the current object in the container on the fly using the creation function @c m_f
        */
-      const T & operator*() const { 
-         m_data = m_f(*m_bufIt);
+      const T & operator*() const {
+         if( ! m_valid ) {
+            m_data = m_f(*m_bufIt);
+            m_valid = true;
+         }
          return m_data;
       }
 
    private:
       const V & m_buf; //!< Const reference to the underlying data container
       std::size_t m_offset; //!< Current position of the iterator 
-      mutable T m_data; //!< Holder of the transformed data
+      mutable T m_data ATLAS_THREAD_SAFE; //!< Holder of the transformed data
+      mutable bool m_valid ATLAS_THREAD_SAFE; //!< indicates if data got transformed for current position
       std::function<T(const typename V::value_type &)> m_f; //!< Function to turn a single datum from the container into the output type 
       typename V::const_iterator m_bufIt; //!< Iterator over the container
 
diff --git a/Trigger/TrigConfiguration/TrigConfData/test/itertest.cxx b/Trigger/TrigConfiguration/TrigConfData/test/itertest.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..42124d91293ce6f43a45a8ea2e708cbdabd9cd46
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfData/test/itertest.cxx
@@ -0,0 +1,128 @@
+#include "TrigConfData/ConstIter.h"
+
+#include <vector>
+#include <iostream>
+
+using namespace std;
+
+class TestCollection {
+public:
+
+  TestCollection(const vector<vector<int>> & vi) :
+    m_data(vi)
+  {}
+  ~TestCollection() {}
+
+  using const_iterator = TrigConf::ConstIter< vector<vector<int>>, vector<int> >;
+
+  const_iterator begin() const {
+    return {m_data, 0};
+  }
+  const_iterator end() const {
+    return {m_data, m_data.size()};
+   }
+
+ private:
+   vector<vector<int>> m_data;
+
+ };
+
+
+bool inner_loop ( int, const std::vector<int> & v,
+		  const std::vector<int> & refV
+		  )
+{
+  bool allGood = true;
+  unsigned int refIdx(0);
+  for(int ii :  v) {
+    bool match = (ii == refV[refIdx++]);
+    allGood &= match;
+    cout << "      inner_loop " << ii << " -> " << (match ? "ok" : "mismatch  ======> FAIL") << endl;
+  }
+  return allGood;
+}
+
+bool test1 ( const TrigConf::ConstIter< vector<vector<int>>, std::vector<int>>& it,
+	     const std::vector<int> & refV )
+{
+   bool allGood = true;
+   cout << "In test1 with reference : ";
+   for( int i: refV ) cout << i << " ";
+   cout << endl;
+
+   unsigned int refIdx(0);
+   for ( int i : *it) {
+     bool match = i == refV[refIdx++];
+      cout << "   outer loop " << i << " -> " << (match ? "ok" : "mismatch  =========> FAIL") << endl;
+      allGood &= match;
+      allGood &= inner_loop (i, *it, refV);
+   }
+   return allGood;
+}
+
+bool test2 ( const TrigConf::ConstIter< vector<vector<int>>, std::vector<int>>& it,
+	     const std::vector<int> & refV )
+{
+   bool allGood = true;
+   cout << "In test2 with reference : ";
+   for( int i: refV ) cout << i << " ";
+   cout << endl;
+
+   unsigned int size = refV.size();
+
+   unsigned int refIdx(0);
+   auto end = (*it).end(); // create end first, so at least begin is pointing to a valid iterator in the following loop
+   for ( vector<int>::const_iterator ii = (*it).begin(); ii != end; ++ii) {
+
+      int v = *ii;
+      if ( refIdx>=size ) {
+         cout << "Not stopping correctly, begin() and end() pointing to different collections.  ===> FAIL" << endl;
+         allGood = false;
+         break;
+      }
+      bool match = (v == refV[refIdx++]); 
+      cout << "   loop " << v << " -> " << (match ? "ok" : "mismatch  =========> FAIL") << endl;
+      allGood &= match;
+   }
+   return allGood;
+}
+
+
+int main() {
+
+   bool successTest1 ( true );
+   bool successTest2 ( true );
+   bool successTest3 ( true );
+   bool success ( true );
+
+   vector<vector<int>> v = { {1, 2, 3, 4}, 
+			     {5, 6}, 
+			     {7, 8, 9, 10, 11}};
+
+   // test 1
+   auto iter1 = TrigConf::ConstIter< vector<vector<int>>, vector<int> > { v, 0 };
+   successTest1 &= test1(  iter1, { 1, 2, 3, 4});
+   successTest1 &= test1(++iter1, { 5, 6});
+   successTest1 &= test1(++iter1, { 7, 8, 9, 10, 11});
+
+   // test 2
+   auto iter2 = TrigConf::ConstIter< vector<vector<int>>, vector<int> > { v, 0 };
+   successTest2 = test2( iter2, v[0] );
+
+   // test 3
+   cout << "In test3" << endl;
+   const TestCollection c(v);
+   unsigned int idx(0);
+   for( auto x : c ) {
+      successTest3 &= inner_loop (0, x, v[idx++]);
+   }
+
+   cout << "Test iterator validity duration different loops          ... " << ( successTest1 ? "passed" : "failed" ) << endl;
+   cout << "Test iterator validity duration same loop                ... " << ( successTest2 ? "passed" : "failed" ) << endl;
+   cout << "Test iterator validity in range-based loop               ... " << ( successTest3 ? "passed" : "failed" ) << endl;
+
+   success &= successTest1;
+   success &= successTest2;
+   success &= successTest3;
+   return success ? 0 : 1;
+}
diff --git a/Trigger/TrigDataAccess/TrigDataAccessMonitoring/TrigDataAccessMonitoring/MonROBDataProviderSvc.h b/Trigger/TrigDataAccess/TrigDataAccessMonitoring/TrigDataAccessMonitoring/MonROBDataProviderSvc.h
index 1a0794746da280fb9f4080e728ef95761f0c4f13..355f9299c8dd8999db3eb7d45d3ef443b8bc661e 100644
--- a/Trigger/TrigDataAccess/TrigDataAccessMonitoring/TrigDataAccessMonitoring/MonROBDataProviderSvc.h
+++ b/Trigger/TrigDataAccess/TrigDataAccessMonitoring/TrigDataAccessMonitoring/MonROBDataProviderSvc.h
@@ -57,7 +57,7 @@ public:
     /// Add ROBFragments to cache for given ROB ids, ROB fragments may be retrieved with DataCollector 
     using ROBDataProviderSvc::addROBData;
     virtual void addROBData(const std::vector<uint32_t>& robIds,
-			    const std::string callerName="UNKNOWN") override;
+			    const std::string_view callerName="UNKNOWN") override;
 
     /// Add a given LVL1/LVL2 ROBFragment to cache 
     using ROBDataProviderSvc::setNextEvent;
@@ -70,7 +70,7 @@ public:
     using ROBDataProviderSvc::getROBData;
     virtual void getROBData(const std::vector<uint32_t>& robIds, 
 			    std::vector<const ROBF*>& robFragments,
-                            const std::string callerName="UNKNOWN") override;
+                            const std::string_view callerName="UNKNOWN") override;
  
     /// Retrieve the whole event.
     using ROBDataProviderSvc::getEvent;
diff --git a/Trigger/TrigDataAccess/TrigDataAccessMonitoring/src/MonROBDataProviderSvc.cxx b/Trigger/TrigDataAccess/TrigDataAccessMonitoring/src/MonROBDataProviderSvc.cxx
index a4edba585d3ad913c3e420566fe77bdb92cc7962..898bec780b57d0efb99198bc3fcfe2f87edae90f 100644
--- a/Trigger/TrigDataAccess/TrigDataAccessMonitoring/src/MonROBDataProviderSvc.cxx
+++ b/Trigger/TrigDataAccess/TrigDataAccessMonitoring/src/MonROBDataProviderSvc.cxx
@@ -174,7 +174,7 @@ StatusCode MonROBDataProviderSvc::queryInterface(const InterfaceID& riid, void**
 }
 
 /// addROBData (no effect in offline, all ROBS were already read in from full event)
-void MonROBDataProviderSvc::addROBData(const std::vector<uint32_t>& robIds, const std::string callerName) 
+void MonROBDataProviderSvc::addROBData(const std::vector<uint32_t>& robIds, const std::string_view callerName) 
 { 
   // for offline running all requested ROBs should be found in cache
   ROBDataProviderSvc::addROBData(robIds,callerName);
@@ -208,7 +208,7 @@ void MonROBDataProviderSvc::addROBData(const std::vector<uint32_t>& robIds, cons
   if ( p_robMonCollection ) {
     // caller name
     std::string caller_name("UNKNOWN");
-    if (callerName != "UNKNOWN") {
+    if (callerName != caller_name) {
       caller_name = callerName;
     } else {
       IAlgorithm* alg(0);
@@ -363,7 +363,7 @@ void MonROBDataProviderSvc::setNextEvent(const RawEvent* re)
 
 /** return ROBData for ROBID
  */ 
-void MonROBDataProviderSvc::getROBData(const std::vector<uint32_t>& robIds, std::vector<const ROBF*>& robFragments, std::string callerName) 
+void MonROBDataProviderSvc::getROBData(const std::vector<uint32_t>& robIds, std::vector<const ROBF*>& robFragments, std::string_view callerName) 
 {
   ROBDataProviderSvc::getROBData(robIds,robFragments, callerName);
   return ; 
diff --git a/Trigger/TrigDataAccess/TrigROBDataProviderSvc/TrigROBDataProviderSvc/ITrigROBDataProviderSvc.h b/Trigger/TrigDataAccess/TrigROBDataProviderSvc/TrigROBDataProviderSvc/ITrigROBDataProviderSvc.h
index 4d4cd640ef4ad4c1bf07de9b34061f5d6d420bce..a961547179ef1d4917ca3780d3ac68b2f0684049 100755
--- a/Trigger/TrigDataAccess/TrigROBDataProviderSvc/TrigROBDataProviderSvc/ITrigROBDataProviderSvc.h
+++ b/Trigger/TrigDataAccess/TrigROBDataProviderSvc/TrigROBDataProviderSvc/ITrigROBDataProviderSvc.h
@@ -10,6 +10,7 @@
 #include <vector>
 #include <map>
 #include <string>
+#include <string_view>
 
 // Declaration of the interface ID ( interface id, major version, minor version)
 static const InterfaceID IID_ITrigROBDataProviderSvc("ITrigROBDataProviderSvc", 2 , 0);
@@ -52,14 +53,14 @@ public:
   /// Collect all data for an event from the ROS and put them into the cache
   /// Return value: number of ROBs which were retrieved to complete the event
   /// Optinonally the name of the caller of this method can be specified for cost monitoring
-  virtual int collectCompleteEventData(const std::string callerName="UNKNOWN") = 0;
+  virtual int collectCompleteEventData(const std::string_view callerName="UNKNOWN") = 0;
 
   //-------------------------------------
   // Methods useful for (cost) monitoring
   //-------------------------------------
 
   /// set the name of the program which uses the ROBDataProviderSvc
-  virtual void setCallerName(const std::string) = 0;
+  virtual void setCallerName(const std::string_view) = 0;
 
   /// get the name of the program which is presently registered in the ROBDataProviderSvc
   virtual std::string getCallerName() = 0;
diff --git a/Trigger/TrigDataAccess/TrigROBDataProviderSvc/src/TrigROBDataProviderSvc.cxx b/Trigger/TrigDataAccess/TrigROBDataProviderSvc/src/TrigROBDataProviderSvc.cxx
index 5ccb3971b321a56bc26064c343dbb21a3ee88703..222554bcfb899b3b7dd8e9074ecc45be1d14aab8 100755
--- a/Trigger/TrigDataAccess/TrigROBDataProviderSvc/src/TrigROBDataProviderSvc.cxx
+++ b/Trigger/TrigDataAccess/TrigROBDataProviderSvc/src/TrigROBDataProviderSvc.cxx
@@ -427,7 +427,7 @@ StatusCode TrigROBDataProviderSvc::queryInterface(const InterfaceID& riid, void*
     - in offline only check that given ROB ids are in the map, issue an
       error if not
 */
-void TrigROBDataProviderSvc::addROBData(const std::vector<uint32_t>& robIds, const std::string callerName) 
+void TrigROBDataProviderSvc::addROBData(const std::vector<uint32_t>& robIds, const std::string_view callerName) 
 { 
   //-------------------
   // remove empty calls
@@ -844,7 +844,7 @@ void TrigROBDataProviderSvc::setNextEvent(const RawEvent* re)
 
 /** return ROBData for ROBID
  */ 
-void TrigROBDataProviderSvc::getROBData(const std::vector<uint32_t>& robIds, std::vector<const ROBF*>& robFragments, std::string callerName) 
+void TrigROBDataProviderSvc::getROBData(const std::vector<uint32_t>& robIds, std::vector<const ROBF*>& robFragments, std::string_view callerName) 
 {
 
   //--------------------
@@ -1096,7 +1096,7 @@ std::string TrigROBDataProviderSvc::dumpROBcache() const {
 
 /// Collect all data for an event from the ROS and put them into the cache
 /// Return value: number of ROBs which were retrieved to complete event
-int TrigROBDataProviderSvc::collectCompleteEventData(const std::string callerName) {
+int TrigROBDataProviderSvc::collectCompleteEventData(const std::string_view callerName) {
 
   // return if call was already issued
   if (m_isEventComplete) return 0;
@@ -1216,17 +1216,17 @@ int TrigROBDataProviderSvc::collectCompleteEventData(const std::string callerNam
 } // end int collectCompleteEventData(...)
 
 int TrigROBDataProviderSvc::collectCompleteEventData(const EventContext&, 
-                                                     const std::string callerName)
+                                                     const std::string_view callerName)
 {
   return collectCompleteEventData (callerName);
 }
 
 /// set the name of the program which uses the ROBDataProviderSvc
-void TrigROBDataProviderSvc::setCallerName(std::string callerName)
+void TrigROBDataProviderSvc::setCallerName(std::string_view callerName)
 {
  // caller name of this method
   std::string caller_name("UNKNOWN");
-  if (callerName != "UNKNOWN") { 
+  if (callerName != caller_name) { 
     caller_name = callerName;
   }else{
     IAlgorithm* alg(0);
diff --git a/Trigger/TrigDataAccess/TrigROBDataProviderSvc/src/TrigROBDataProviderSvc.h b/Trigger/TrigDataAccess/TrigROBDataProviderSvc/src/TrigROBDataProviderSvc.h
index 675b042d79cb2158dd44cc4078b15d782661e21e..8eccb1f80408d4873b89976e762af540ce2676f5 100755
--- a/Trigger/TrigDataAccess/TrigROBDataProviderSvc/src/TrigROBDataProviderSvc.h
+++ b/Trigger/TrigDataAccess/TrigROBDataProviderSvc/src/TrigROBDataProviderSvc.h
@@ -80,7 +80,7 @@ public:
     /// Add ROBFragments to cache for given ROB ids, ROB fragments may be retrieved with DataCollector 
     using ROBDataProviderSvc::addROBData;
     virtual void addROBData(const std::vector<uint32_t>& robIds,
-			    const std::string callerName="UNKNOWN") override;
+			    const std::string_view callerName="UNKNOWN") override;
 
     /// Add a given LVL1 ROBFragment to cache 
     using ROBDataProviderSvc::setNextEvent;
@@ -94,7 +94,7 @@ public:
     using ROBDataProviderSvc::getROBData;
     virtual void getROBData(const std::vector<uint32_t>& robIds, 
 			    std::vector<const ROBF*>& robFragments,
-			    const std::string callerName="UNKNOWN") override;
+			    const std::string_view callerName="UNKNOWN") override;
  
     /// Retrieve the whole event.
     using ROBDataProviderSvc::getEvent;
@@ -123,11 +123,11 @@ public:
 
     /// Collect all data for an event from the ROS and put them into the cache
     /// Return value: number of ROBs which were retrieved to complete the event
-    virtual int collectCompleteEventData(const std::string callerName="UNKNOWN") override;
-    virtual int collectCompleteEventData(const EventContext&, const std::string callerName="UNKNOWN") override;
+    virtual int collectCompleteEventData(const std::string_view callerName="UNKNOWN") override;
+    virtual int collectCompleteEventData(const EventContext&, const std::string_view callerName="UNKNOWN") override;
 
     /// set the name of the program which uses the ROBDataProviderSvc
-    virtual void setCallerName(const std::string) override;
+    virtual void setCallerName(const std::string_view) override;
 
     /// get the name of the program which is presently registered in the ROBDataProviderSvc
     virtual std::string getCallerName() override { return m_callerName; };
diff --git a/Trigger/TrigDataAccess/TrigROBDataProviderSvc/src/TrigROBDataProviderSvc_RTT.cxx b/Trigger/TrigDataAccess/TrigROBDataProviderSvc/src/TrigROBDataProviderSvc_RTT.cxx
index 07523ce449b62696e97b8d7341bddde3c7ff6210..5762978e5f9daef931ed7530080cb2d878a0eba9 100644
--- a/Trigger/TrigDataAccess/TrigROBDataProviderSvc/src/TrigROBDataProviderSvc_RTT.cxx
+++ b/Trigger/TrigDataAccess/TrigROBDataProviderSvc/src/TrigROBDataProviderSvc_RTT.cxx
@@ -178,14 +178,14 @@ void TrigROBDataProviderSvc_RTT::FillEvent(){
   }
 }
 
-void TrigROBDataProviderSvc_RTT::setCallerName(std::string callerName)
+void TrigROBDataProviderSvc_RTT::setCallerName(std::string_view callerName)
 {
   return TrigROBDataProviderSvc::setCallerName(callerName);
 }
 
 
 
-void TrigROBDataProviderSvc_RTT::addROBData(const std::vector<uint32_t>& robIds, std::string callerName)
+void TrigROBDataProviderSvc_RTT::addROBData(const std::vector<uint32_t>& robIds, std::string_view callerName)
 {
   //call the base class method
   TrigROBDataProviderSvc:: addROBData(robIds, callerName);
@@ -234,7 +234,7 @@ void TrigROBDataProviderSvc_RTT::addROBData(const std::vector<uint32_t>& robIds,
 
 
 void TrigROBDataProviderSvc_RTT::getROBData(const std::vector<uint32_t>& robIds, std::vector<const ROBF*>& robFragments,
-					    const std::string callerName)
+					    const std::string_view callerName)
 
 {
   //call the base class method
diff --git a/Trigger/TrigDataAccess/TrigROBDataProviderSvc/src/TrigROBDataProviderSvc_RTT.h b/Trigger/TrigDataAccess/TrigROBDataProviderSvc/src/TrigROBDataProviderSvc_RTT.h
index d197e49b15e35ed9cc9609642cad5e3ba885310c..912731206e739c4f358797cea4e93e88d40d04a0 100644
--- a/Trigger/TrigDataAccess/TrigROBDataProviderSvc/src/TrigROBDataProviderSvc_RTT.h
+++ b/Trigger/TrigDataAccess/TrigROBDataProviderSvc/src/TrigROBDataProviderSvc_RTT.h
@@ -64,18 +64,18 @@ class TrigROBDataProviderSvc_RTT : public TrigROBDataProviderSvc,
   void FillEvent();
 
   /// set the name of the program which uses the ROBDataProviderSvc
-  virtual void setCallerName(const std::string) override;
+  virtual void setCallerName(const std::string_view) override;
 
   //declare ROBdata // inherited from base class
   using ROBDataProviderSvc::addROBData;
   virtual void addROBData(const std::vector<uint32_t>& robIds,
-                          const std::string callerName="UNKNOWN") override;
+                          const std::string_view callerName="UNKNOWN") override;
 
   /// Retrieve ROBFragments for given ROB ids from cache 
   using ROBDataProviderSvc::getROBData;
   virtual void getROBData(const std::vector<uint32_t>& robIds, 
                           std::vector<const ROBF*>& robFragments,
-                          const std::string callerName="UNKNOWN") override;
+                          const std::string_view callerName="UNKNOWN") override;
  
   /// Add a given LVL1 ROBFragment to cache 
   using ROBDataProviderSvc::setNextEvent;
@@ -96,9 +96,9 @@ class TrigROBDataProviderSvc_RTT : public TrigROBDataProviderSvc,
   /// Collect all data for an event from the ROS and put them into the cache
   /// Return value: number of ROBs which were retrieved to complete the event
   /// Optinonally the name of the caller of this method can be specified for cost monitoring
-  virtual int collectCompleteEventData(const std::string callerName="UNKNOWN") override
+  virtual int collectCompleteEventData(const std::string_view callerName="UNKNOWN") override
   { return TrigROBDataProviderSvc::collectCompleteEventData (callerName); }
-  virtual int collectCompleteEventData(const EventContext& ctx, const std::string callerName="UNKNOWN") override
+  virtual int collectCompleteEventData(const EventContext& ctx, const std::string_view callerName="UNKNOWN") override
   { return TrigROBDataProviderSvc::collectCompleteEventData (ctx, callerName); }
 
   virtual bool isMissingPrefetching() override     { return 0;};// m_missingPrefetchingPerEvent; };
diff --git a/Trigger/TrigFTK/FastTrackSimWrap/share/FastTrackSimRegionalWrap_64TowersIBL_InDetClusters_jobOptions.py b/Trigger/TrigFTK/FastTrackSimWrap/share/FastTrackSimRegionalWrap_64TowersIBL_InDetClusters_jobOptions.py
index 4ea54f381f908a8103ce759447a19be6bad35b42..0016477cf6ff15d7674ea10a0c2e81ab7da9bd9f 100644
--- a/Trigger/TrigFTK/FastTrackSimWrap/share/FastTrackSimRegionalWrap_64TowersIBL_InDetClusters_jobOptions.py
+++ b/Trigger/TrigFTK/FastTrackSimWrap/share/FastTrackSimRegionalWrap_64TowersIBL_InDetClusters_jobOptions.py
@@ -32,7 +32,7 @@ FTKSGInput.ReadTruthTracks = True
 ToolSvc += FTKSGInput
 
 # SiLorentzAngleTool for SCT
-from SiLorentzAngleSvc.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
+from SiLorentzAngleTool.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
 sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup()
 
 from TrigFTKTrackConverter.TrigFTKTrackConverterConf import  TrigFTKClusterConverterTool
diff --git a/Trigger/TrigFTK/TrigFTK_RawDataAlgs/share/FTKMonitor_topOptions.py b/Trigger/TrigFTK/TrigFTK_RawDataAlgs/share/FTKMonitor_topOptions.py
index 76dd63324cc7e1c638ed7ede233bdc01976cc7b2..b853f7f2523d7367ebba71f3b6fccab3a3fbbd1e 100644
--- a/Trigger/TrigFTK/TrigFTK_RawDataAlgs/share/FTKMonitor_topOptions.py
+++ b/Trigger/TrigFTK/TrigFTK_RawDataAlgs/share/FTKMonitor_topOptions.py
@@ -33,7 +33,7 @@ FTK_RDO_Monitor.offlineTracksName="Tracks"
 FTK_RDO_Monitor.FTK_DataProvider=theFTK_DataProviderSvc
 
 from AthenaCommon.AppMgr import ToolSvc
-from SiLorentzAngleSvc.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
+from SiLorentzAngleTool.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
 sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup()
 FTK_RDO_Monitor.PixelLorentzAngleTool = ToolSvc.InDetTrigPixelLorentzAngleTool
 FTK_RDO_Monitor.SCTLorentzAngleTool = sctLorentzAngleToolSetup.SCTLorentzAngleTool
diff --git a/Trigger/TrigFTK/TrigFTK_RecExample/python/TrigFTKLoadTools.py b/Trigger/TrigFTK/TrigFTK_RecExample/python/TrigFTKLoadTools.py
index d40a71e2140c9dc0ad9ad42a8ce0312b36841463..16f50abaaf92b119a4c7f5dc76bf8711357b774c 100644
--- a/Trigger/TrigFTK/TrigFTK_RecExample/python/TrigFTKLoadTools.py
+++ b/Trigger/TrigFTK/TrigFTK_RecExample/python/TrigFTKLoadTools.py
@@ -7,7 +7,7 @@ jiri.masik@manchester.ac.uk
 from AthenaCommon.AppMgr import ServiceMgr as svcMgr
 
 # SiLorentzAngleTool for SCT
-from SiLorentzAngleSvc.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
+from SiLorentzAngleTool.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
 sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup()
 
 from TrigFTK_RecExample.TrigFTK_DataProviderSvc_Config import TrigFTK_DataProviderSvc
diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypoAlgMT.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypoAlgMT.cxx
index b5d7bcf9eb119224617abc759c0c677095712bd5..bb07fa0e5b2299df1ac8044d0b1a7e3f34f6e70a 100644
--- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypoAlgMT.cxx
+++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypoAlgMT.cxx
@@ -55,7 +55,7 @@ StatusCode TrigL2CaloHypoAlgMT::execute( const EventContext& context ) const {
 
   // loop over previous decisions
   size_t counter=0;
-  for ( auto previousDecision: *previousDecisionsHandle ) {
+  for ( const auto previousDecision: *previousDecisionsHandle ) {
     //get RoI  
     auto roiELInfo = TrigCompositeUtils::findLink<TrigRoiDescriptorCollection>( previousDecision, "initialRoI" );
     
@@ -82,7 +82,7 @@ StatusCode TrigL2CaloHypoAlgMT::execute( const EventContext& context ) const {
     }
     d->setObjectLink( "roi", roiELInfo.link );
     
-    TrigCompositeUtils::linkToPrevious( d, decisionInput().key(), counter );
+    TrigCompositeUtils::linkToPrevious( d, previousDecision );
     ATH_MSG_DEBUG( "Added view, roi, cluster, previous decision to new decision " << counter << " for view " << (*viewELInfo.link)->name()  );
     counter++;
 
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/components/TrigHLTJetHypo_entries.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/components/TrigHLTJetHypo_entries.cxx
index 09251a1c4e1e77a7b1b72992f27afb1aa209d1fa..d24e32ccc4fa63f083996bf6f3fa816abeb7c547 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/components/TrigHLTJetHypo_entries.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/components/TrigHLTJetHypo_entries.cxx
@@ -33,6 +33,7 @@ DECLARE_COMPONENT( TrigJetOrToolMT)
 DECLARE_COMPONENT( TrigHLTJetHypo_SMC )
 DECLARE_COMPONENT( TrigHLTJetHypo_HT )
 DECLARE_COMPONENT( TrigHLTJetHypo_TLA )
+DECLARE_COMPONENT( TrigHLTJetHypo_EtaEt )
 
 DECLARE_COMPONENT( TrigJetHypoAlgMT )
 DECLARE_COMPONENT( TrigJetHypoToolMT )
diff --git a/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigMufastHypoAlg.cxx b/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigMufastHypoAlg.cxx
index df1a85c30c1c68339e76f4b2dc28a9d605f828fb..981fb5a24e11e4f127aebe4da913acb67b3d6ca3 100755
--- a/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigMufastHypoAlg.cxx
+++ b/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigMufastHypoAlg.cxx
@@ -74,7 +74,7 @@ StatusCode TrigMufastHypoAlg::execute( const EventContext& context ) const
   std::vector<TrigMufastHypoTool::MuonClusterInfo> toolInput;
   // loop over previous decisions
   size_t counter=0;
-  for ( auto previousDecision: *previousDecisionsHandle ) {
+  for ( const auto previousDecision: *previousDecisionsHandle ) {
     //get RoI
     auto roiInfo = TrigCompositeUtils::findLink<TrigRoiDescriptorCollection>( previousDecision, "initialRoI"  );
     auto roiEL = roiInfo.link;
@@ -104,7 +104,7 @@ StatusCode TrigMufastHypoAlg::execute( const EventContext& context ) const
     newd->setObjectLink( "feature", muonEL );  
     newd->setObjectLink( "roi",     roiEL );
     newd->setObjectLink( "view",    viewEL );
-    TrigCompositeUtils::linkToPrevious( newd, decisionInput().key(), counter );
+    TrigCompositeUtils::linkToPrevious( newd, previousDecision );
     
     ATH_MSG_DEBUG("REGTEST: " << m_muFastKey.key() << " pT = " << (*muonEL)->pt() << " GeV");
     ATH_MSG_DEBUG("REGTEST: " << m_muFastKey.key() << " eta/phi = " << (*muonEL)->eta() << "/" << (*muonEL)->phi());
diff --git a/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigMuisoHypoAlg.cxx b/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigMuisoHypoAlg.cxx
index 166b8cc483c8ab247a085e858032d80f0a35d3eb..f5bed116b9ab0bea0f912e6282747cdc8f6b2b4b 100644
--- a/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigMuisoHypoAlg.cxx
+++ b/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigMuisoHypoAlg.cxx
@@ -68,7 +68,7 @@ StatusCode TrigMuisoHypoAlg::execute( const EventContext& context) const
  
   std::vector<TrigMuisoHypoTool::MuisoInfo> toolInput; 
   size_t counter = 0; // view counter
-  for ( auto previousDecision: *previousDecisionsHandle ) {
+  for ( const auto previousDecision: *previousDecisionsHandle ) {
     // get View
     auto viewEL = previousDecision->objectLink< ViewContainer >( "view" );
     ATH_CHECK( viewEL.isValid() );
@@ -90,7 +90,7 @@ StatusCode TrigMuisoHypoAlg::execute( const EventContext& context) const
     
     newd->setObjectLink( "feature", muonEL );  
     newd->setObjectLink( "view",    viewEL );
-    TrigCompositeUtils::linkToPrevious( newd, decisionInput().key(), counter );
+    TrigCompositeUtils::linkToPrevious( newd, previousDecision );
     
     ATH_MSG_DEBUG("REGTEST: " << m_muIsoKey.key() << " pT = " << (*muonEL)->pt() << " GeV");
     ATH_MSG_DEBUG("REGTEST: " << m_muIsoKey.key() << " eta/phi = " << (*muonEL)->eta() << "/" << (*muonEL)->phi());
diff --git a/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigMuonEFCombinerHypoAlg.cxx b/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigMuonEFCombinerHypoAlg.cxx
index 2de33a5573a324d8f670f4bdea892072ebab46ea..be33078a44f834b44c49da8b4f49d8f23c8a9dac 100755
--- a/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigMuonEFCombinerHypoAlg.cxx
+++ b/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigMuonEFCombinerHypoAlg.cxx
@@ -75,7 +75,7 @@ StatusCode TrigMuonEFCombinerHypoAlg::execute( const EventContext& context ) con
   size_t counter = 0;  // view counter
 
   // loop over previous decisions
-  for ( auto previousDecision: *previousDecisionsHandle ) {
+  for ( const auto previousDecision: *previousDecisionsHandle ) {
      // get RoIs
     auto roiInfo = TrigCompositeUtils::findLink<TrigRoiDescriptorCollection>( previousDecision, "initialRoI"  );
     auto roiEL = roiInfo.link;
@@ -110,7 +110,7 @@ StatusCode TrigMuonEFCombinerHypoAlg::execute( const EventContext& context ) con
     newd -> setObjectLink( "feature", muonEL );
     newd -> setObjectLink( "roi",     roiEL  );
     newd -> setObjectLink( "view",    viewEL );
-    TrigCompositeUtils::linkToPrevious( newd, decisionInput().key(), counter );
+    TrigCompositeUtils::linkToPrevious( newd, previousDecision );
 
     ATH_MSG_DEBUG("REGTEST: " << m_muonKey.key() << " pT = " << (*muonEL)->pt() << " GeV");
     ATH_MSG_DEBUG("REGTEST: " << m_muonKey.key() << " eta/phi = " << (*muonEL)->eta() << "/" << (*muonEL)->phi());
diff --git a/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigMuonEFMSonlyHypoAlg.cxx b/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigMuonEFMSonlyHypoAlg.cxx
index 40bed09b2bdb1d0eb84992dc87921cdb034e2981..e91f559945aa6c79683b76631d26dfcff65ee58d 100755
--- a/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigMuonEFMSonlyHypoAlg.cxx
+++ b/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigMuonEFMSonlyHypoAlg.cxx
@@ -75,7 +75,7 @@ StatusCode TrigMuonEFMSonlyHypoAlg::execute( const EventContext& context ) const
   size_t counter = 0;  // view counter
 
   // loop over previous decisions
-  for ( auto previousDecision: *previousDecisionsHandle ) {
+  for (const auto previousDecision: *previousDecisionsHandle ) {
      // get RoIs
     auto roiInfo = TrigCompositeUtils::findLink<TrigRoiDescriptorCollection>( previousDecision, "initialRoI"  );
     auto roiEL = roiInfo.link;
@@ -110,7 +110,7 @@ StatusCode TrigMuonEFMSonlyHypoAlg::execute( const EventContext& context ) const
     newd -> setObjectLink( "feature", muonEL );
     newd -> setObjectLink( "roi",     roiEL  );
     newd -> setObjectLink( "view",    viewEL );
-    TrigCompositeUtils::linkToPrevious( newd, decisionInput().key(), counter );
+    TrigCompositeUtils::linkToPrevious( newd, previousDecision );
 
     ATH_MSG_DEBUG("REGTEST: " << m_muonKey.key() << " pT = " << (*muonEL)->pt() << " GeV");
     ATH_MSG_DEBUG("REGTEST: " << m_muonKey.key() << " eta/phi = " << (*muonEL)->eta() << "/" << (*muonEL)->phi());
diff --git a/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigMuonEFTrackIsolationHypoAlg.cxx b/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigMuonEFTrackIsolationHypoAlg.cxx
index f1a59c2d650f44df95cce2e388063571332486e2..8c991854a1f48c3a2075db21876a3cad6e0308a6 100755
--- a/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigMuonEFTrackIsolationHypoAlg.cxx
+++ b/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigMuonEFTrackIsolationHypoAlg.cxx
@@ -71,7 +71,7 @@ StatusCode TrigMuonEFTrackIsolationHypoAlg::execute( const EventContext& context
 
   std::vector<TrigMuonEFTrackIsolationHypoTool::EFIsolationMuonInfo> toolInput;
   size_t counter = 0;
-  for ( auto previousDecision: *previousDecisionsHandle ) {
+  for ( const auto previousDecision: *previousDecisionsHandle ) {
     // get RoIs
     auto roiInfo = TrigCompositeUtils::findLink<TrigRoiDescriptorCollection>( previousDecision, "initialRoI"  );
     auto roiEL = roiInfo.link;
@@ -105,7 +105,7 @@ StatusCode TrigMuonEFTrackIsolationHypoAlg::execute( const EventContext& context
     newd -> setObjectLink( "roi", roiEL );
     newd -> setObjectLink( "view", viewEL );
 
-    TrigCompositeUtils::linkToPrevious( newd, decisionInput().key(), counter );
+    TrigCompositeUtils::linkToPrevious( newd, previousDecision );
 
 
     ATH_MSG_DEBUG("REGTEST: " << m_muonKey.key() << " pT = " << (*muonEL)->pt() << " GeV");
diff --git a/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigmuCombHypoAlg.cxx b/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigmuCombHypoAlg.cxx
index ea94c0bc76ea8c65a4da78deed9d86e2719b15eb..95ecf0836b6f7269388bf510baebeeaf6523f1f4 100644
--- a/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigmuCombHypoAlg.cxx
+++ b/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigmuCombHypoAlg.cxx
@@ -75,7 +75,7 @@ StatusCode TrigmuCombHypoAlg::execute(const EventContext& context) const
   // loop over previous decisions
   size_t counter = 0; 
 
-  for ( auto previousDecision: *previousDecisionsHandle )  {
+  for ( const auto previousDecision: *previousDecisionsHandle )  {
     // get L2MuonSA Feature
     TrigCompositeUtils::LinkInfo<xAOD::L2StandAloneMuonContainer> linkInfo = 
        TrigCompositeUtils::findLink<xAOD::L2StandAloneMuonContainer>(previousDecision, "feature");
@@ -104,7 +104,7 @@ StatusCode TrigmuCombHypoAlg::execute(const EventContext& context) const
 
     // set objectLink
     newd->setObjectLink( "feature", muCombEL );
-    TrigCompositeUtils::linkToPrevious( newd, decisionInput().key(), counter);
+    TrigCompositeUtils::linkToPrevious( newd, previousDecision);
 
     // DEBUG
     auto muFastInfo = (*muCombEL)->muSATrack(); 
diff --git a/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTauCaloHypoAlgMT.cxx b/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTauCaloHypoAlgMT.cxx
index e03f9bac680661df8d8eea2d74fe26b943e1beae..f709144b2293813c1308ea1657607e9af3e2fe12 100644
--- a/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTauCaloHypoAlgMT.cxx
+++ b/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTauCaloHypoAlgMT.cxx
@@ -52,7 +52,7 @@ StatusCode TrigTauCaloHypoAlgMT::execute( const EventContext& context ) const {
 
   // loop over previous decisions
   size_t counter=0;
-  for ( auto previousDecision: *previousDecisionsHandle ) {
+  for ( const auto previousDecision: *previousDecisionsHandle ) {
     //get RoI
     auto roiELInfo = TrigCompositeUtils::findLink<TrigRoiDescriptorCollection>( previousDecision, "initialRoI" );
     ATH_CHECK( roiELInfo.isValid() );
@@ -70,15 +70,15 @@ StatusCode TrigTauCaloHypoAlgMT::execute( const EventContext& context ) const {
 
     toolInput.emplace_back( d, roi, clusterHandle.cptr(), previousDecision );
 
-     {
-       auto el = ViewHelper::makeLink( *(viewELInfo.link), clusterHandle, 0 );
+    {
+      auto el = ViewHelper::makeLink( *(viewELInfo.link), clusterHandle, 0 );
       ATH_CHECK( el.isValid() );
       d->setObjectLink( "feature",  el );
     }
-     d->setObjectLink( "roi", roiELInfo.link );
-     TrigCompositeUtils::linkToPrevious( d, decisionInput().key(), counter );
-     ATH_MSG_DEBUG( "Added view, roi, cluster, previous decision to new decision " << counter << " for view " << (*viewELInfo.link)->name()  );
-     counter++;
+    d->setObjectLink( "roi", roiELInfo.link );
+    TrigCompositeUtils::linkToPrevious( d, previousDecision );
+    ATH_MSG_DEBUG( "Added view, roi, cluster, previous decision to new decision " << counter << " for view " << (*viewELInfo.link)->name()  );
+    counter++;
 
   }
 
diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitoringConfig.py b/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitoringConfig.py
index 4942cdbfce410062988b772024a4164c025d75c3..b103620c89b5c23c72f7bd3cf3f14036f4410016 100644
--- a/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitoringConfig.py
+++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitoringConfig.py
@@ -149,6 +149,10 @@ class TrigEgammaMonToolBuilder:
         self.mam=monitoring_mam
 
     def configureElectronMonTool(self,plotTool,toolList):
+        from AthenaCommon.AppMgr import ToolSvc
+        ToolSvc += plotTool()
+        for t in toolList:
+            ToolSvc += t()
         ElectronAnalysis = TrigEgammaNavAnalysisTool(name='HLTEgammaElectronAnalysis',
                 Analysis='Electrons',
                 PlotTool=plotTool,
@@ -265,23 +269,22 @@ class TrigEgammaMonToolBuilder:
                         histoPathBase=self.basePath,
                         IgnoreTruncationCheck=True,
                         Tools=["TrigEgammaNavTPAnalysisTool/HLTEgammaTPAnalysis"])
-                ToolSvc += tool        
             else:
-                ToolSvc += self.configureDefaultMonTool()
+                tool = self.configureDefaultMonTool()
         elif self.HI_mode == True or self.pPb_mode == True:
             tool = TrigEgammaMonTool( name = "HLTEgammaMon", 
                     histoPathBase=self.basePath,
                     IgnoreTruncationCheck=True,
                     Tools=["TrigEgammaNavAnalysisTool/HLTEgammaPhotonAnalysis",
                             "TrigEgammaNavAnalysisTool/HLTEgammaElectronAnalysis"])
-            ToolSvc += tool        
         elif self.cosmic_mode == True:
             tool = TrigEgammaMonTool( name = "HLTEgammaMon", 
                     histoPathBase=self.basePath,
                     IgnoreTruncationCheck=True,
                     Tools=["TrigEgammaNavAnalysisTool/HLTEgammaPhotonAnalysis",
                             "TrigEgammaNavAnalysisTool/HLTEgammaElectronAnalysis"])
-            ToolSvc += tool
         else:
-            ToolSvc += self.configureDefaultMonTool()
-        return toolList    
+            tool = self.configureDefaultMonTool()
+        ToolSvc += tool
+        #return toolList    
+        return [tool]
diff --git a/Trigger/TrigMonitoring/TrigJetMonitoring/TrigJetMonitoring/HLTJetMonTool.h b/Trigger/TrigMonitoring/TrigJetMonitoring/TrigJetMonitoring/HLTJetMonTool.h
index ffd4f3df1339ab80385c0ed16fbec5cfc6cf0c75..fcbcd0cb5d534e9f1923c283f1e66c0269ca3f8d 100755
--- a/Trigger/TrigMonitoring/TrigJetMonitoring/TrigJetMonitoring/HLTJetMonTool.h
+++ b/Trigger/TrigMonitoring/TrigJetMonitoring/TrigJetMonitoring/HLTJetMonTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 
@@ -89,10 +89,10 @@ class HLTJetMonTool : public IHLTMonTool {
     // data members
 
     // binning for basic histograms
-    std::vector<int>   m_njnbins,  m_jEtnbins,  m_jetanbins,  m_jphinbins,  m_jemfracnbins,  m_jhecfracnbins, m_jDEtnbins,  m_jDepnbins;
-    std::vector<float> m_njperbin, m_jEtperbin, m_jetaperbin, m_jphiperbin, m_jemfracperbin, m_jhecfracperbin, m_jDEtperbin, m_jDepperbin;
-    std::vector<float> m_njbinlo,  m_jEtbinlo,  m_jetabinlo,  m_jphibinlo,  m_jemfracbinlo,  m_jhecfracbinlo, m_jDEtbinlo,  m_jDepbinlo;
-    std::vector<float> m_njbinhi,  m_jEtbinhi,  m_jetabinhi,  m_jphibinhi,  m_jemfracbinhi,  m_jhecfracbinhi, m_jDEtbinhi,  m_jDepbinhi;
+    std::vector<int>   m_njnbins,  m_jEtnbins,  m_jetanbins,  m_jphinbins,  m_jemfracnbins,  m_jhecfracnbins,  m_jDEtnbins,  m_jDepnbins,  m_jJVTnbins,  m_jSumPtTrk500nbins;
+    std::vector<float> m_njperbin, m_jEtperbin, m_jetaperbin, m_jphiperbin, m_jemfracperbin, m_jhecfracperbin, m_jDEtperbin, m_jDepperbin, m_jJVTperbin, m_jSumPtTrk500perbin;
+    std::vector<float> m_njbinlo,  m_jEtbinlo,  m_jetabinlo,  m_jphibinlo,  m_jemfracbinlo,  m_jhecfracbinlo,  m_jDEtbinlo,  m_jDepbinlo,  m_jJVTbinlo,  m_jSumPtTrk500binlo;
+    std::vector<float> m_njbinhi,  m_jEtbinhi,  m_jetabinhi,  m_jphibinhi,  m_jemfracbinhi,  m_jhecfracbinhi,  m_jDEtbinhi,  m_jDepbinhi,  m_jJVTbinhi,  m_jSumPtTrk500binhi;
 
     // binning for trigger efficiency 
     std::vector<float> m_l1binloEt, m_l1binhiEt, m_l1nperbinEt,       // for L1 trigger eff vs. Et
diff --git a/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitoringConfig.py b/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitoringConfig.py
index bcfd5c07a516adb2ae951580f4d00532e5e7dd4d..78b3633c0722a67eca6f7d7eadcb2dec5bbc8b8b 100644
--- a/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitoringConfig.py
+++ b/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitoringConfig.py
@@ -49,6 +49,16 @@ hlt_jetemfracbins = [ 52]
 hlt_jetemfracbinlo = [ -0.02]
 hlt_jetemfracbinhi = [ 1.02 ]
 
+# Binning for JVT
+hlt_jetJVTbins = [ 62]
+hlt_jetJVTbinlo = [ -0.12]
+hlt_jetJVTbinhi = [ 1.02 ]
+
+# Binning for SumPtTrk500
+hlt_jetSumPtTrk500bins = [ 100 ]
+hlt_jetSumPtTrk500binlo = [ 0. ]
+hlt_jetSumPtTrk500binhi = [ 500 ]
+
 # Binning for DEt
 hlt_jetDEtbins = [ 42 ]
 hlt_jetDEtbinlo = [ -70. ]
@@ -126,7 +136,12 @@ if (pp) or (mc):
                   "a4tcemjesPS"     : "HLT_xAOD__JetContainer_a4tcemjesPS",
                   "a4tcemsubjesISFS"  : "HLT_xAOD__JetContainer_a4tcemsubjesISFS",
                   "a4tclcwjesFS"    : "HLT_xAOD__JetContainer_a4tclcwjesFS",
-                  "a4TTemnojcalibFS": "HLT_xAOD__JetContainer_a4TTemnojcalibFS"
+                  "a4GSC" : "HLT_xAOD__JetContainer_GSCJet",
+                  #"a10rtcemsubjesFS"   : "HLT_xAOD__JetContainer_a10r_tcemsubjesFS",
+                  "a10tclcwsubjesFS"   : "HLT_xAOD__JetContainer_a10tclcwsubjesFS",
+                  "a10ttclcwjesFS"   : "HLT_xAOD__JetContainer_a10ttclcwjesFS",
+                  "a4tcemsubjesISFSftk"  : "HLT_xAOD__JetContainer_a4tcemsubjesISFSftk",
+                  "a4tcemsubjesISFSftkrefit"  : "HLT_xAOD__JetContainer_a4tcemsubjesISFSftkrefit",
                   }
   
   hlt_offlineJetKeys = {"AntiKt4EMTopoJets":"AntiKt4EMTopoJets",   
@@ -163,10 +178,25 @@ if (pp) or (mc):
   
   
 # HLT items
-  hlt_hltEtThresholds            = { 'j25':20.,
-                                     'j25_320eta490':20.,
-                                     'j60':50., 
-                                     'j60_L1RD0_FILLED':50.,
+  hlt_hltEtThresholds            = { 'j0_perf_L1RD0FILLED': 0.,
+                                     'j0_perf_ftk_L1RD0FILLED': 0.,
+                                     'j0_perf_ftkrefit_L1RD0FILLED': 0.,
+                                     'j0_gsc0_boffperf_split_L1RD0FILLED': 0.,
+                                     'j0_gsc0_boffperf_split_ftk_L1RD0FILLED': 0.,
+                                     'j0_gsc0_boffperf_split_ftkrefit_L1RD0FILLED': 0.,
+                                     'j35':20.,
+                                     'j35_jes':20.,
+                                     'j35_lcw':20.,
+                                     'j35_sub':20.,
+                                     'j35_subjes':20.,
+                                     'j35_nojcalib':20.,
+                                     'j35_320eta490':20.,
+                                     'j35_320eta490_lcw':20.,
+                                     'j35_320eta490_jes':20.,
+                                     'j35_320eta490_sub':20.,
+                                     'j35_320eta490_subjes':20.,
+                                     'j35_320eta490_nojcalib':20.,
+                                     'j60':50.,
                                      'j60_280eta320':50.,
                                      'j60_320eta490':50.,
                                      'j200_jes_PS':100.,
@@ -176,24 +206,28 @@ if (pp) or (mc):
                                      'j460_a10_lcw_sub_L1J100':350.,
                                      'j80_xe80':50.,
                                      '4j45':20.,
-                                     '6j60':20.,
-                                     '5j60':30.,
-                                     '10j40_L14J20':0.,
-                                     'j0_perf_ds1_L1J75':0.,
-                                     'j0_perf_ds1_L1J100':0.,
-                                     'ht850_L1J100':50.,
-                                     'j60_TT':20,
-                                     'j85_cleanLLP':30,
-                                     'j85_cleanL':30,
-                                     'j85_cleanT':30,
-                                     'j0_1i2c300m500TLA':0.,
-                                     'j0_0i1c500m900TLA':0.
-                                     }
-  
-  hlt_hltEtaHighThresholds       = { 'j25':3.2,                          #Chose eta range for efficiency calculation
-                                     'j25_320eta490':4.9,
-                                     'j60':3.2 , 
-                                     'j60_L1RD0_FILLED':3.2,
+                                     '6j45':20.,
+                                     '6j45_0eta240':20.,
+                                     '10j40_L14J20':0.}
+    
+  hlt_hltEtaHighThresholds       = { 'j0_perf_L1RD0FILLED': 2.5,
+                                     'j0_perf_ftk_L1RD0FILLED': 2.5,
+                                     'j0_perf_ftkrefit_L1RD0FILLED': 2.5,
+                                     'j0_gsc0_boffperf_split_L1RD0FILLED': 2.5,
+                                     'j0_gsc0_boffperf_split_ftk_L1RD0FILLED': 2.5,
+                                     'j0_gsc0_boffperf_split_ftkrefit_L1RD0FILLED': 2.5,
+                                     'j35':3.2,
+                                     'j35_jes':3.2,
+                                     'j35_lcw':3.2,
+                                     'j35_sub':3.2,
+                                     'j35_subjes':3.2,
+                                     'j35_nojcalib':3.2,
+                                     'j35_320eta490':4.9,
+                                     'j35_320eta490_lcw':4.9,
+                                     'j35_320eta490_jes':4.9,
+                                     'j35_320eta490_sub':4.9,
+                                     'j35_320eta490_subjes':4.9,
+                                     'j60':3.2,
                                      'j60_280eta320':3.2,
                                      'j60_320eta490':4.9,
                                      'j200_jes_PS':3.2,
@@ -203,50 +237,63 @@ if (pp) or (mc):
                                      'j460_a10_lcw_sub_L1J100':3.2,
                                      'j80_xe80':3.2,
                                      '4j45':3.2,
-                                     '6j60':3.2,
-                                     '5j60':3.2,
-                                     '10j40_L14J20':3.2,
-                                     'j0_perf_ds1_L1J75':3.2,
-                                     'j0_perf_ds1_L1J100':3.2,
-                                     'ht850_L1J100':3.2,
-                                     'j60_TT':3.2,
-                                     'j85_cleanLLP':3.2,
-                                     'j85_cleanL':3.2,
-                                     'j85_cleanT':3.2,
-                                     'j0_1i2c300m500TLA':3.2,
-                                     'j0_0i1c500m900TLA':3.2}
-  
-  hlt_hltEtaLowThresholds        = { 'j25':0.,
-                                     'j25_320eta490':3.2, 
-                                     'j60':0.,   
-                                     'j60_L1RD0_FILLED':0., 
+                                     '6j45':3.2,
+                                     '6j45_0eta240':2.4,
+                                     '10j40_L14J20':3.2}
+  
+  hlt_hltEtaLowThresholds        = { 'j0_perf_L1RD0FILLED': 0.,
+                                     'j0_perf_ftk_L1RD0FILLED': 0.,
+                                     'j0_perf_ftkrefit_L1RD0FILLED': 0.,
+                                     'j0_gsc0_boffperf_split_L1RD0FILLED': 0.,
+                                     'j0_gsc0_boffperf_split_ftk_L1RD0FILLED': 0.,
+                                     'j0_gsc0_boffperf_split_ftkrefit_L1RD0FILLED': 0.,
+                                     'j35':0.0,
+                                     'j35_jes':0.0,
+                                     'j35_lcw':0.0,
+                                     'j35_sub':0.0,
+                                     'j35_subjes':0.0,
+                                     'j35_nojcalib':0.0,
+                                     'j35_320eta490':3.2,
+                                     'j35_320eta490_lcw':3.2,
+                                     'j35_320eta490_jes':3.2,
+                                     'j35_320eta490_sub':3.2,
+                                     'j35_320eta490_subjes':3.2,
+                                     'j60':0.0,
                                      'j60_280eta320':2.8,
                                      'j60_320eta490':3.2,
-                                     'j200_jes_PS':0.,
-                                     'j260':0.,   
-                                     'j360':0.,  
-                                     'j460':0.,  
-                                     'j460_a10_lcw_sub_L1J100':0.,
-                                     'j80_xe80':0.,
-                                     '4j45':0.,
-                                     '6j60':0.,
-                                     '5j60':0.,
-                                     '10j40_L14J20':0.,
-                                     'j0_perf_ds1_L1J75':0.,
-                                     'j0_perf_ds1_L1J100':0.,
-                                     'ht850_L1J100':0.,
-                                     'j60_TT':0.,
-                                     'j85_cleanLLP':0.,
-                                     'j85_cleanL':0.,
-                                     'j85_cleanT':0.,
-                                     'j0_1i2c300m500TLA':0.,
-                                     'j0_0i1c500m900TLA':0.}
-  
-  
-  hlt_hltJetn                    = { 'j25':1,                           #Select the nth jet for efficiency calcultaion of single/multijet HLT chains
-                                     'j25_320eta490':1, 
-                                     'j60':1,   
-                                     'j60_L1RD0_FILLED':1, 
+                                     'j60_L1RD0_FILLED':0.0,
+                                     'j260':0.0,
+                                     'j360':0.0,
+                                     'j420':0.0,
+                                     'j225_gsc420_boffperf_split':0.0,
+                                     'j460_a10_lcw_subjes_L1SC111':0.0,
+                                     'j460_a10t_lcw_jes_L1SC111':0.0,
+                                     '2j330_a10t_lcw_jes_35smcINF_SC111':0.0,
+                                     'j80_xe80':0.0,
+                                     '4j45':0.0,
+                                     '6j45':0.0,
+                                     '6j45_0eta240':0.0,
+                                     '10j40_L14J20':0.0}
+  
+  
+  hlt_hltJetn                    = { 'j0_perf_L1RD0FILLED': 1,
+                                     'j0_perf_ftk_L1RD0FILLED': 1,
+                                     'j0_perf_ftkrefit_L1RD0FILLED': 1,
+                                     'j0_gsc0_boffperf_split_L1RD0FILLED': 1,
+                                     'j0_gsc0_boffperf_split_ftk_L1RD0FILLED': 1,
+                                     'j0_gsc0_boffperf_split_ftkrefit_L1RD0FILLED': 1,
+                                     'j35':1,
+                                     'j35_jes':1,
+                                     'j35_lcw':1,
+                                     'j35_sub':1,
+                                     'j35_subjes':1,
+                                     'j35_nojcalib':1,
+                                     'j35_320eta490':1,
+                                     'j35_320eta490_lcw':1,
+                                     'j35_320eta490_jes':1,
+                                     'j35_320eta490_sub':1,
+                                     'j35_320eta490_subjes':1,
+                                     'j60':1,
                                      'j60_280eta320':1,
                                      'j60_320eta490':1,
                                      'j200_jes_PS':1,
@@ -256,53 +303,67 @@ if (pp) or (mc):
                                      'j460_a10_lcw_sub_L1J100':1,
                                      'j80_xe80':1,
                                      '4j45':4,
-                                     '6j60':6,
-                                     '5j60':5,
-                                     '10j40_L14J20':10,
-                                     'j0_perf_ds1_L1J75':1,
-                                     'j0_perf_ds1_L1J100':1,
-                                     'ht850_L1J100':1,
-                                     'j60_TT':1,
-                                     'j85_cleanLLP':1,
-                                     'j85_cleanL':1,
-                                     'j85_cleanT':1,
-                                     'j0_1i2c300m500TLA':1,
-                                     'j0_0i1c500m900TLA':1}
-  
-  
-  hlt_hltContainers              = {'j25':'a4tcemsubjesISFS',                  #Chose container to retrieve the features of a given chain
-                                    'j25_320eta490':'a4tcemsubjesISFS',
-                                    'j60':'a4tcemsubjesISFS',
-                                    'j60_L1RD0_FILLED':'a4tcemsubjesISFS',
-                                    'j60_280eta320':'a4tcemsubjesISFS',
-                                    'j60_320eta490':'a4tcemsubjesISFS',
-                                    'j200_jes_PS':'a4tcemjesPS',
-                                    'j260':'a4tcemsubjesISFS',
-                                    'j360':'a4tcemsubjesISFS',
-                                    'j460':'a4tcemsubjesISFS',
-                                    'j460_a10_lcw_sub_L1J100':'a10tclcwsubFS',
-                                    'j80_xe80':'a4tcemsubjesISFS',
-                                    '4j45':'a4tcemsubjesISFS',
-                                    '6j60':'a4tcemsubjesISFS',
-                                    '5j60':'a4tcemsubjesISFS',
-                                    '10j40_L14J20':'a4tcemsubjesISFS',
-                                    'j0_perf_ds1_L1J75':'a4tcemsubjesISFS',
-                                    'j0_perf_ds1_L1J100':'a4tcemsubjesISFS',
-                                    'ht850_L1J100':'a4tcemsubjesISFS',
-                                    'j60_TT':'a4TTemnojcalibFS',
-                                    'j85_cleanLLP':'a4tcemsubjesISFS',
-                                    'j85_cleanL':'a4tcemsubjesISFS',
-                                    'j85_cleanT':'a4tcemsubjesISFS',
-                                    'j0_1i2c300m500TLA':'a4tcemsubjesISFS',
-                                    'j0_0i1c500m900TLA':'a4tcemsubjesISFS'}
-                
+                                     '6j45':6,
+                                     '6j45_0eta240':6,
+                                     '10j40_L14J20':10}
+  
+  
+  hlt_hltContainers              = { 'j0_perf_L1RD0FILLED':'a4tcemsubjesISFS',
+                                     'j0_perf_ftk_L1RD0FILLED':'a4tcemsubjesISFSftk',
+                                     'j0_perf_ftkrefit_L1RD0FILLED':'a4tcemsubjesISFSftkrefit',
+                                     'j0_gsc0_boffperf_split_L1RD0FILLED':'a4tcemsubjesISFS',
+                                     'j0_gsc0_boffperf_split_ftk_L1RD0FILLED':'a4tcemsubjesISFSftk',
+                                     'j0_gsc0_boffperf_split_ftkrefit_L1RD0FILLED':'a4tcemsubjesISFSftkrefit',
+                                     'j35':'a4tcemsubjesISFS',
+                                     'j35_sub':'a4tcemsubFS',
+                                     'j35_jes':'a4tcemjesFS',
+                                     'j35_subjes':'a4tcemsubjesFS',
+                                     'j35_nojcalib':'a4tcemnojcalibFS',
+                                     'j35_lcw':'a4tclcwsubjesISFS',
+                                     'j35_320eta490':'a4tcemsubjesISFS',
+                                     'j35_320eta490_sub':'a4tcemsubFS',
+                                     'j35_320eta490_jes':'a4tcemjesFS',
+                                     'j35_320eta490_subjes':'a4tcemsubjesFS',
+                                     'j35_320eta490_nojcalib':'a4tcemnojcalibFS',
+                                     'j35_320eta490_lcw':'a4tclcwsubjesISFS',
+                                     'j60':'a4tcemsubjesISFS',
+                                     'j60_280eta320':'a4tcemsubjesISFS',
+                                     'j60_320eta490':'a4tcemsubjesISFS',
+                                     'j60_L1RD0_FILLED':'a4tcemsubjesISFS',
+                                     'j260':'a4tcemsubjesISFS',
+                                     'j360':'a4tcemsubjesISFS',
+                                     'j420':'a4tcemsubjesISFS',
+                                     'j225_gsc420_boffperf_split':'a4GSC',
+                                     'j460_a10_lcw_subjes_L1SC111':'a10tclcwsubjesFS',
+                                     'j460_a10t_lcw_jes_L1SC111':'a10ttclcwjesFS',
+                                     '2j330_a10t_lcw_jes_35smcINF_SC111':'a10ttclcwjesFS',
+                                     'j80_xe80':'a4tcemsubjesISFS',
+                                     '4j45':'a4tcemsubjesISFS',
+                                     '6j45':'a4tcemsubjesISFS',
+                                     '6j45_0eta240':'a4tcemsubjesISFS',
+                                     '10j40_L14J20':'a4tcemsubjesISFS'
+                                     }
                 
 # Offline 
-  hlt_offlineEtThresholds        = { 'L1_J15':10., 
-                                     'j25':20.,
-                                     'j25_320eta490':20., 
-                                     'j60':50.  , 
-                                     'j60_L1RD0_FILLED':50.,
+  hlt_offlineEtThresholds        = { 'j0_perf_L1RD0FILLED': 0.,
+                                     'j0_perf_ftk_L1RD0FILLED': 0.,
+                                     'j0_perf_ftkrefit_L1RD0FILLED': 0.,
+                                     'j0_gsc0_boffperf_split_L1RD0FILLED': 0.,
+                                     'j0_gsc0_boffperf_split_ftk_L1RD0FILLED': 0.,
+                                     'j0_gsc0_boffperf_split_ftkrefit_L1RD0FILLED': 0.,
+                                     'L1_J15':0., 
+                                     'j35_jes':20.,
+                                     'j35_lcw':20.,
+                                     'j35_sub':20.,
+                                     'j35_subjes':20.,
+                                     'j35_nojcalib':20.,
+                                     'j35_320eta490':20.,
+                                     'j35_320eta490_lcw':20.,
+                                     'j35_320eta490_jes':20.,
+                                     'j35_320eta490_sub':20.,
+                                     'j35_320eta490_subjes':20.,
+                                     'j35_320eta490_nojcalib':20.,
+                                     'j60':50.,
                                      'j60_280eta320':50.,
                                      'j60_320eta490':50.,
                                      'j200_jes_PS':100.,
@@ -716,6 +777,16 @@ def TrigJetMonitoringTool():
             JetemfracBinLo            = hlt_jetemfracbinlo,
             JetemfracBinHi            = hlt_jetemfracbinhi,
 
+            # Binning for emfrac
+            JetJVTNBins               = hlt_jetJVTbins,
+            JetJVTBinLo               = hlt_jetJVTbinlo,
+            JetJVTBinHi               = hlt_jetJVTbinhi,
+
+            # Binning for emfrac
+            JetSumPtTrk500NBins       = hlt_jetSumPtTrk500bins,
+            JetSumPtTrk500BinLo       = hlt_jetSumPtTrk500binlo,
+            JetSumPtTrk500BinHi       = hlt_jetSumPtTrk500binhi,
+
             # Binning for DEt
             JetDEtNBins               = hlt_jetDEtbins,
             JetDEtBinLo               = hlt_jetDEtbinlo,
@@ -823,9 +894,6 @@ def TrigJetMonitoringTool():
  # from TrigHLTMonitoring.HLTMonFlags import HLTMonFlags
  # HLTMonFlags.doEgamma.set_Value_and_Lock(False)
 
-  
-  #ToolSvc += HLTJetMon;
-
   # Set up the trigger configuration tool:
   #ToolSvc += CfgMgr.TrigConf__xAODConfigTool( "xAODConfigTool",
                                             #OutputLevel = 2 )
diff --git a/Trigger/TrigMonitoring/TrigJetMonitoring/src/HLTJetMonTool.cxx b/Trigger/TrigMonitoring/TrigJetMonitoring/src/HLTJetMonTool.cxx
index 4429f2a220e59e822e89fefbfdeaf4bed8f782b4..4cdba05848029e75bee0fbc9b6edd0922781ec99 100755
--- a/Trigger/TrigMonitoring/TrigJetMonitoring/src/HLTJetMonTool.cxx
+++ b/Trigger/TrigMonitoring/TrigJetMonitoring/src/HLTJetMonTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 
@@ -145,6 +145,16 @@ HLTJetMonTool::HLTJetMonTool(
   declareProperty("HLTEffBinLoEtGeV",   m_hltbinloEt );
   declareProperty("HLTEffBinHiEtGeV",   m_hltbinhiEt );
 
+  // Jet JVT bins
+  declareProperty("JetJVTNBins",       m_jJVTnbins );
+  declareProperty("JetJVTBinLo",       m_jJVTbinlo );
+  declareProperty("JetJVTBinHi",       m_jJVTbinhi );
+
+  // Jet SumPtTrk bins
+  declareProperty("JetSumPtTrk500NBins", m_jSumPtTrk500nbins );
+  declareProperty("JetSumPtTrk500BinLo", m_jSumPtTrk500binlo );
+  declareProperty("JetSumPtTrk500BinHi", m_jSumPtTrk500binhi );
+
   //declareProperty("JetChainsRegex",     m_chainsByRegexp);
 
   declareProperty("EMFractionCut",      m_emfracCut = 0.9);
@@ -551,6 +561,14 @@ StatusCode HLTJetMonTool::book( ) {
     float thebinSize = m_jhecfracnbins[k] > 0 ? fabs(m_jhecfracbinhi[k]-m_jhecfracbinlo[k]) / m_jhecfracnbins[k] : -1.;
     m_jhecfracperbin.push_back(thebinSize);
   }
+  for(unsigned int k = 0; k < m_jJVTnbins.size(); k++) {
+    float thebinSize = m_jJVTnbins[k] > 0 ? fabs(m_jJVTbinhi[k]-m_jJVTbinlo[k]) / m_jJVTnbins[k] : -1.;
+    m_jJVTperbin.push_back(thebinSize);
+  }
+  for(unsigned int k = 0; k < m_jSumPtTrk500nbins.size(); k++) {
+    float thebinSize = m_jSumPtTrk500nbins[k] > 0 ? fabs(m_jSumPtTrk500binhi[k]-m_jSumPtTrk500binlo[k]) / m_jSumPtTrk500nbins[k] : -1.;
+    m_jSumPtTrk500perbin.push_back(thebinSize);
+  }
   for(unsigned int k = 0; k < m_jDEtnbins.size(); k++) {
     float thebinSize = m_jDEtnbins[k] > 0 ? fabs(m_jDEtbinhi[k]-m_jDEtbinlo[k]) / m_jDEtnbins[k] : -1.;
     m_jDEtperbin.push_back(thebinSize);
@@ -624,7 +642,7 @@ void HLTJetMonTool::bookJetHists() {
   unsigned int k = 0; 
   for(JetSigIter hj= m_HLTJetKeys.begin(); hj != m_HLTJetKeys.end(); ++hj, k++) {
     // book histograms for each HLT jet container 
-    varlist = "n;et;high_et;eta;phi;emfrac;hecfrac;phi_vs_eta;e_vs_eta;e_vs_phi;phi_vs_eta_lar;sigma_vs_lb;";
+    varlist = "n;et;high_et;eta;phi;emfrac;hecfrac;jvt;sumpttrk500;phi_vs_eta;e_vs_eta;e_vs_phi;phi_vs_eta_lar;sigma_vs_lb;";
     nvar = basicKineVar(varlist,bookvars);
     if(nvar==0) ATH_MSG_INFO("Error in bookKineVars - variable list not tokenized!");
 
@@ -683,7 +701,7 @@ void HLTJetMonTool::bookJetHists() {
 
   // HLT Chains
   // HLT basic histograms
-  varlist="et;leading_et;high_et;eta;phi;phi_vs_eta;emfrac;hecfrac;e_vs_eta;e_vs_phi;sigma_vs_lb;n;";
+  varlist="et;leading_et;high_et;eta;phi;emfrac;hecfrac;jvt;sumpttrk500;phi_vs_eta;e_vs_eta;e_vs_phi;sigma_vs_lb;n;";
   nvar = basicKineVar(varlist,bookvars);
   levels.clear(); levels.push_back("HLT"); /*levels.push_back("L1");*/
   for(JetSigIter k= m_basicHLTTrig.begin(); k != m_basicHLTTrig.end(); ++k ) {
@@ -725,7 +743,7 @@ void HLTJetMonTool::bookJetHists() {
     k = 0; // FIXME
     for(JetSigIter ofj= m_OFJetKeys.begin(); ofj != m_OFJetKeys.end(); ++ofj, k++) {
       // book histograms for each offline jet container 
-      varlist = "n;et;eta;phi;emfrac;hecfrac;phi_vs_eta;e_vs_eta;e_vs_phi;phi_vs_eta_lar;sigma_vs_lb;";
+      varlist = "n;et;eta;phi;emfrac;hecfrac;jvt;sumpttrk500;phi_vs_eta;e_vs_eta;e_vs_phi;phi_vs_eta_lar;sigma_vs_lb;";
       nvar = basicKineVar(varlist,bookvars);
       if(nvar==0) ATH_MSG_INFO("Error in bookKineVars - variable list not tokenized!");
 
@@ -874,7 +892,7 @@ void HLTJetMonTool::bookDijetHistos(const std::string& trigjet, const std::strin
     TString htitle = Form("%s E_{T} w.r.t %s E_{T}; Leading E_{T}^{jet} [GeV]; Subleading E_{T}^{jet} [GeV]",trigjet.c_str(), ofjet.c_str());
     TString hname = Form("%s_leadEt_vs_%s_subleadEt",trigjet.c_str(), ofjet.c_str());
     addHistogram(new TH2F(hname, htitle,nbinsEt,binloEt,binhiEt,nbinsEt,binloEt,binhiEt));
-    ATH_MSG_DEBUG("Booked " << hname << "(" << nbinsEt << "," << binloEt << "," << binhiEt << ")" );
+    ATH_MSG_VERBOSE("Booked " << hname << "(" << nbinsEt << "," << binloEt << "," << binhiEt << ")" );
     
   }else{
     
@@ -882,25 +900,25 @@ void HLTJetMonTool::bookDijetHistos(const std::string& trigjet, const std::strin
     TString htitle = Form("%s E_{T} w.r.t %s E_{T}; Leading Trigger E_{T}^{jet} [GeV]; Leading OF  E_{T}^{jet} [GeV]",trigjet.c_str(), ofjet.c_str());
     TString hname = Form("%s_leadEt_vs_%s_leadEt",trigjet.c_str(), ofjet.c_str());
     addHistogram(new TH2F(hname, htitle,nbinsEt,binloEt,binhiEt,nbinsEtOF,binloEtOF,binhiEtOF));
-    ATH_MSG_DEBUG("Booked " << hname << "(" << nbinsEt << "," << binloEt << "," << binhiEt << ")" );
+    ATH_MSG_VERBOSE("Booked " << hname << "(" << nbinsEt << "," << binloEt << "," << binhiEt << ")" );
     
     //L1/HLT lead Et vs. OF sublead Et
     htitle = Form("%s E_{T} w.r.t %s E_{T}; Leading Trigger E_{T}^{jet} [GeV]; Subleading OF  E_{T}^{jet} [GeV]",trigjet.c_str(), ofjet.c_str());
     hname = Form("%s_leadEt_vs_%s_subleadEt",trigjet.c_str(), ofjet.c_str());
     addHistogram(new TH2F(hname, htitle,nbinsEt,binloEt,binhiEt,nbinsEtOF,binloEtOF,binhiEtOF));
-    ATH_MSG_DEBUG("Booked " << hname << "(" << nbinsEt << "," << binloEt << "," << binhiEt << ")" );
+    ATH_MSG_VERBOSE("Booked " << hname << "(" << nbinsEt << "," << binloEt << "," << binhiEt << ")" );
     
     //L1/HLT sublead Et vs. OF lead Et
     htitle = Form("%s E_{T} w.r.t %s E_{T}; Subleading Trigger E_{T}^{jet} [GeV]; Leading OF  E_{T}^{jet} [GeV]",trigjet.c_str(), ofjet.c_str());
     hname = Form("%s_subleadEt_vs_%s_leadEt",trigjet.c_str(), ofjet.c_str());
     addHistogram(new TH2F(hname, htitle,nbinsEt,binloEt,binhiEt,nbinsEtOF,binloEtOF,binhiEtOF));
-    ATH_MSG_DEBUG("Booked " << hname << "(" << nbinsEt << "," << binloEt << "," << binhiEt << ")" );
+    ATH_MSG_VERBOSE("Booked " << hname << "(" << nbinsEt << "," << binloEt << "," << binhiEt << ")" );
     
     //L1/HLT sublead Et vs. OF sublead Et
     htitle = Form("%s E_{T} w.r.t %s E_{T}; Subleading Trigger  E_{T}^{jet} [GeV]; Subleading OF  E_{T}^{jet} [GeV]",trigjet.c_str(), ofjet.c_str());
     hname = Form("%s_subleadEt_vs_%s_subleadEt",trigjet.c_str(), ofjet.c_str());
     addHistogram(new TH2F(hname, htitle,nbinsEt,binloEt,binhiEt,nbinsEtOF,binloEtOF,binhiEtOF));
-    ATH_MSG_DEBUG("Booked " << hname << "(" << nbinsEt << "," << binloEt << "," << binhiEt << ")" );
+    ATH_MSG_VERBOSE("Booked " << hname << "(" << nbinsEt << "," << binloEt << "," << binhiEt << ")" );
   }
 }//EoF
 
@@ -952,7 +970,7 @@ void HLTJetMonTool::bookOfflineHists(JetSigtype& item, const std::string& ofjet)
     TString hname = Form("%s_Eff_vs_pt_num",trigName.Data());
 
     addHistogram(new TH1F(hname, htitle,nbinsEt,binloEt,binhiEt));
-    ATH_MSG_DEBUG("Booked " << hname << "(" << nbinsEt << "," << binloEt << "," << binhiEt << ")" );
+    ATH_MSG_VERBOSE("Booked " << hname << "(" << nbinsEt << "," << binloEt << "," << binhiEt << ")" );
 
     hname = Form("%s_Eff_vs_pt_den",trigName.Data());
     addHistogram(new TH1F(hname, htitle,nbinsEt,binloEt,binhiEt));
@@ -1011,7 +1029,7 @@ void HLTJetMonTool::bookOfflineHists(JetSigtype& item, const std::string& ofjet)
     hname = Form("%s_unmatched_pt",trigName.Data());
 
     addHistogram(new TH1F(hname, htitle,nbinsEt,binloEt,binhiEt));
-    ATH_MSG_DEBUG("Booked " << hname << "(" << nbinsEt << "," << binloEt << "," << binhiEt << ")" );
+    ATH_MSG_VERBOSE("Booked " << hname << "(" << nbinsEt << "," << binloEt << "," << binhiEt << ")" );
 
 
     //Resolution
@@ -1032,7 +1050,7 @@ void HLTJetMonTool::bookOfflineHists(JetSigtype& item, const std::string& ofjet)
     hname = Form("%s_Eff_vs_pt_vs_eta_num",trigName.Data());
 
     addHistogram(new TH2F(hname, htitle,nbinsEt,binloEt,binhiEt,m_jetanbins[0],m_jetabinlo[0],m_jetabinhi[0]));
-    ATH_MSG_DEBUG("Booked " << hname << "(" << nbinsEt << "," << binloEt << "," << binhiEt << ")" );
+    ATH_MSG_VERBOSE("Booked " << hname << "(" << nbinsEt << "," << binloEt << "," << binhiEt << ")" );
 
     hname = Form("%s_Eff_vs_pt_vs_eta_den",trigName.Data());
     addHistogram(new TH2F(hname, htitle,nbinsEt,binloEt,binhiEt,m_jetanbins[0],m_jetabinlo[0],m_jetabinhi[0]));
@@ -1042,7 +1060,7 @@ void HLTJetMonTool::bookOfflineHists(JetSigtype& item, const std::string& ofjet)
     hname = Form("%s_Eff_vs_pt_vs_phi_num",trigName.Data());
 
     addHistogram(new TH2F(hname, htitle,nbinsEt,binloEt,binhiEt,m_jphinbins[0],m_jphibinlo[0],m_jphibinhi[0]));
-    ATH_MSG_DEBUG("Booked " << hname << "(" << nbinsEt << "," << binloEt << "," << binhiEt << ")" );
+    ATH_MSG_VERBOSE("Booked " << hname << "(" << nbinsEt << "," << binloEt << "," << binhiEt << ")" );
 
     hname = Form("%s_Eff_vs_pt_vs_phi_den",trigName.Data());
     addHistogram(new TH2F(hname, htitle,nbinsEt,binloEt,binhiEt,m_jphinbins[0],m_jphibinlo[0],m_jphibinhi[0]));
@@ -1053,7 +1071,7 @@ void HLTJetMonTool::bookOfflineHists(JetSigtype& item, const std::string& ofjet)
     hname = Form("%s_pt_vs_OF_pt",trigName.Data());
 
     addHistogram(new TH2F(hname, htitle,nbinsEt,binloEt,binhiEt,nbinsEt,binloEt,binhiEt));
-    ATH_MSG_DEBUG("Booked " << hname << "(" << nbinsEt << "," << binloEt << "," << binhiEt << ")" );
+    ATH_MSG_VERBOSE("Booked " << hname << "(" << nbinsEt << "," << binloEt << "," << binhiEt << ")" );
 
 
     //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@@ -1170,6 +1188,20 @@ void HLTJetMonTool::bookBasicHists(std::vector<std::string>& level, std::vector<
         addHistogram(new TH1F(hname, htitle,m_jhecfracnbins[0],m_jhecfracbinlo[0],m_jhecfracbinhi[0]));
       }
       
+      // jet jvt
+      if(*var == "jvt") {
+        htitle = Form("%s jvt; a.u.; entries/%3.1f",title.Data(),m_jJVTperbin[0]);
+        hname = Form("%sJet_JVT",lvl.Data());
+        addHistogram(new TH1F(hname, htitle,m_jJVTnbins[0],m_jJVTbinlo[0],m_jJVTbinhi[0]));
+      }
+
+      // jet sumpttrk500
+      if(*var == "sumpttrk500") {
+        htitle = Form("%s_sumpttrk50;0 a.u.; entries/%3.1f",title.Data(),m_jSumPtTrk500perbin[0]);
+        hname = Form("%sJet_SumPtTrk500",lvl.Data());
+        addHistogram(new TH1F(hname, htitle,m_jSumPtTrk500nbins[0],m_jSumPtTrk500binlo[0],m_jSumPtTrk500binhi[0]));
+      }
+
       // roi descriptor eta
       if(*var == "roidesc_eta") {
         htitle = Form("%s pseudorapidity of center of RoI at origin; #eta; entries/%3.1f",title.Data(),m_jetaperbin[0]);
@@ -1260,7 +1292,6 @@ void HLTJetMonTool::bookBasicHists(std::vector<std::string>& level, std::vector<
 
 void HLTJetMonTool::setHistProperties(TH1* h) {
 
-  ATH_MSG_DEBUG( "in HLTJetMonTool::setHistProperties() " );
   if(!h) return;
   h->SetFillColor(42);
   h->SetTitleSize(0.037,"X");
@@ -1274,7 +1305,6 @@ void HLTJetMonTool::setHistProperties(TH1* h) {
 
 void HLTJetMonTool::set2DHistProperties(TH2* h) {
 
-  ATH_MSG_DEBUG( "in HLTJetMonTool::setHistProperties() " );
   if(!h) return;
   h->SetOption("CONT0");
 
@@ -1327,7 +1357,9 @@ StatusCode HLTJetMonTool::retrieveContainers() {
     m_OFJetC.push_back(jetcoll);
   } // end for
 
-  return sc;
+  // Override SC failure on retrieve, because we may want to run on files
+  // without every single chain activated!?
+  return StatusCode::SUCCESS;
 
 } // end retrieveContainers
 
@@ -1414,7 +1446,7 @@ StatusCode HLTJetMonTool::fillJetHists() {
       return StatusCode::SUCCESS;
     }
     ATH_MSG_DEBUG ( "HLTJetMonTool::fillDiJetHists() returned success" );    
-  
+
   return StatusCode::SUCCESS;
 
 } // end fillJetHists
@@ -1511,23 +1543,21 @@ StatusCode HLTJetMonTool::fillBasicHists() {
 	
       	if(/*m_debuglevel*/1) {
 	  //checks jet variables
-	  ATH_MSG_DEBUG( "REGTEST Looking at jet " << n_HLTJet);
-	  ATH_MSG_DEBUG( "REGTEST    pt: " << thisjet->pt() );
-	  ATH_MSG_DEBUG( "REGTEST    eta: " << thisjet->eta() );
-	  ATH_MSG_DEBUG( "REGTEST    phi: " << thisjet->phi() );
-	  ATH_MSG_DEBUG( "REGTEST    m: " << thisjet->m() );
-	  ATH_MSG_DEBUG( "REGTEST    e: " << thisjet->e() );
-	  // ATH_MSG_DEBUG( "REGTEST    emfrac: " << thisjet->getAttribute<float>(xAOD::JetAttribute::EMFrac) ); 
-	  // ATH_MSG_DEBUG( "REGTEST    hecfrac: " << thisjet->getAttribute<float>(xAOD::JetAttribute::HECFrac)); 
-	  ATH_MSG_DEBUG( "REGTEST    px: " << thisjet->px() );
-	  ATH_MSG_DEBUG( "REGTEST    py: " << thisjet->py() );
-	  ATH_MSG_DEBUG( "REGTEST    pz: " << thisjet->pz() );
-	  ATH_MSG_DEBUG( "REGTEST    type: " << thisjet->type() );
-	  ATH_MSG_DEBUG( "REGTEST    algorithm (kt: 0, cam: 1, antikt: 2, ...): " << thisjet->getAlgorithmType() );
-	  ATH_MSG_DEBUG( "REGTEST    size parameter: " << thisjet->getSizeParameter() );
-	  ATH_MSG_DEBUG( "REGTEST    input (LCTopo: 0, EMTopo: 1, ...): " << thisjet->getInputType() );
-	  ATH_MSG_DEBUG( "REGTEST    constituents signal state (uncalibrated: 0, calibrated: 1): " << thisjet->getConstituentsSignalState() );
-	  ATH_MSG_DEBUG( "REGTEST    number of constituents: " << thisjet->numConstituents() );      
+	  ATH_MSG_VERBOSE( "REGTEST Looking at jet " << n_HLTJet);
+	  ATH_MSG_VERBOSE( "REGTEST    pt: " << thisjet->pt() );
+	  ATH_MSG_VERBOSE( "REGTEST    eta: " << thisjet->eta() );
+	  ATH_MSG_VERBOSE( "REGTEST    phi: " << thisjet->phi() );
+	  ATH_MSG_VERBOSE( "REGTEST    m: " << thisjet->m() );
+	  ATH_MSG_VERBOSE( "REGTEST    e: " << thisjet->e() );
+	  ATH_MSG_VERBOSE( "REGTEST    px: " << thisjet->px() );
+	  ATH_MSG_VERBOSE( "REGTEST    py: " << thisjet->py() );
+	  ATH_MSG_VERBOSE( "REGTEST    pz: " << thisjet->pz() );
+	  ATH_MSG_VERBOSE( "REGTEST    type: " << thisjet->type() );
+	  ATH_MSG_VERBOSE( "REGTEST    algorithm (kt: 0, cam: 1, antikt: 2, ...): " << thisjet->getAlgorithmType() );
+	  ATH_MSG_VERBOSE( "REGTEST    size parameter: " << thisjet->getSizeParameter() );
+	  ATH_MSG_VERBOSE( "REGTEST    input (LCTopo: 0, EMTopo: 1, ...): " << thisjet->getInputType() );
+	  ATH_MSG_VERBOSE( "REGTEST    constituents signal state (uncalibrated: 0, calibrated: 1): " << thisjet->getConstituentsSignalState() );
+	  ATH_MSG_VERBOSE( "REGTEST    number of constituents: " << thisjet->numConstituents() );      
 	}
 	
         // for basic hists, don't cut eta/pt
@@ -1545,16 +1575,29 @@ StatusCode HLTJetMonTool::fillBasicHists() {
 	if (m_isPP || m_isCosmic || m_isMC){
 	  emfrac  = thisjet->getAttribute<float>(xAOD::JetAttribute::EMFrac); 
 	  hecfrac = thisjet->getAttribute<float>(xAOD::JetAttribute::HECFrac); 
+	  ATH_MSG_VERBOSE( "REGTEST    emfrac: " << emfrac ); 
+	  ATH_MSG_VERBOSE( "REGTEST    hecfrac: " << hecfrac ); 
 	}
 
-        ATH_MSG_DEBUG( lvl << " et =  " << et <<  "\teta = " << eta << "\temfrac = " << emfrac <<"\thecfrac");
-	
+	double  jvt  = -0.1;
+	double  sumpttrk500 = 0;
+	if (thisjet->isAvailable<float>("Jvt")){
+	  jvt = thisjet->getAttribute<float>("Jvt"); 
+ 	  sumpttrk500 = thisjet->getAttribute<std::vector<float> >("SumPtTrkPt500")[0]/Gaudi::Units::GeV;
+	  ATH_MSG_VERBOSE( "REGTEST    JVT: " << jvt ); 
+	  ATH_MSG_VERBOSE( "REGTEST    SumPtTrk500: " << sumpttrk500 ); 
+	}
+
+        if(msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG( lvl << " et =  " << et <<  "\teta = " << eta << "\temfrac = " << emfrac <<"\thecfrac");
+
         if((h  = hist(Form("%sJet_Et",lvl.c_str()))))           h->Fill(et,m_lumi_weight);
 	if((h  = hist(Form("%sJet_HighEt",lvl.c_str()))))       h->Fill(et,m_lumi_weight);
         if((h  = hist(Form("%sJet_eta",lvl.c_str()))))          h->Fill(eta,m_lumi_weight);
         if((h  = hist(Form("%sJet_phi",lvl.c_str()))))          h->Fill(phi,m_lumi_weight);
         if((h  = hist(Form("%sJet_emfrac",lvl.c_str()))))       h->Fill(emfrac,m_lumi_weight);
 	if((h  = hist(Form("%sJet_hecfrac",lvl.c_str()))))      h->Fill(hecfrac,m_lumi_weight);
+        if((h  = hist(Form("%sJet_JVT",lvl.c_str()))))          h->Fill(jvt,m_lumi_weight);
+	if((h  = hist(Form("%sJet_SumPtTrk500",lvl.c_str()))))  h->Fill(sumpttrk500,m_lumi_weight);
         if((h2 = hist2(Form("%sJet_phi_vs_eta",lvl.c_str()))))  h2->Fill(eta,phi,m_lumi_weight);
         if((h2 = hist2(Form("%sJet_E_vs_eta",lvl.c_str()))))    h2->Fill(eta,e,m_lumi_weight);
         if((h2 = hist2(Form("%sJet_E_vs_phi",lvl.c_str()))))    h2->Fill(phi,e,m_lumi_weight);
@@ -1638,7 +1681,14 @@ StatusCode HLTJetMonTool::fillBasicHists() {
 	      hecfrac = thisjet->getAttribute<float>(xAOD::JetAttribute::HECFrac); 
 	    }
 
-            ATH_MSG_DEBUG( lvl << " et =  " << et <<  "\teta = " << eta << "\temfrac = " << emfrac <<"\thecfrac");
+	    double  jvt  = -0.1;
+	    double  sumpttrk500 = 0;
+	    if (thisjet->isAvailable<float>("Jvt")){
+	      jvt = thisjet->getAttribute<float>("Jvt"); 
+	      sumpttrk500 = thisjet->getAttribute<std::vector<float> >("SumPtTrkPt500")[0]/Gaudi::Units::GeV;
+	    }
+
+            if(msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG( lvl << " et =  " << et <<  "\teta = " << eta << "\temfrac = " << emfrac <<"\thecfrac");
 
 
 	    v_thisjet.SetPtEtaPhiE(thisjet->pt()/Gaudi::Units::GeV,eta,phi,e);
@@ -1650,6 +1700,8 @@ StatusCode HLTJetMonTool::fillBasicHists() {
             if((h  = hist(Form("%sJet_phi",lvl.c_str()))))          h->Fill(phi,m_lumi_weight);
             if((h  = hist(Form("%sJet_emfrac",lvl.c_str()))))       h->Fill(emfrac,m_lumi_weight);
 	    if((h  = hist(Form("%sJet_hecfrac",lvl.c_str()))))      h->Fill(hecfrac,m_lumi_weight);
+	    if((h  = hist(Form("%sJet_JVT",lvl.c_str()))))          h->Fill(jvt,m_lumi_weight);
+	    if((h  = hist(Form("%sJet_SumPtTrk500",lvl.c_str()))))  h->Fill(sumpttrk500,m_lumi_weight);
             if((h2 = hist2(Form("%sJet_phi_vs_eta",lvl.c_str()))))  h2->Fill(eta,phi,m_lumi_weight);
             if((h2 = hist2(Form("%sJet_E_vs_eta",lvl.c_str()))))    h2->Fill(eta,e,m_lumi_weight);
             if((h2 = hist2(Form("%sJet_E_vs_phi",lvl.c_str()))))    h2->Fill(phi,e,m_lumi_weight);
diff --git a/Trigger/TrigSteer/DecisionHandling/DecisionHandling/TrigCompositeUtils.h b/Trigger/TrigSteer/DecisionHandling/DecisionHandling/TrigCompositeUtils.h
index f72f8f21b16729e9981b021606b7afc0a7101ac9..1bbd5cdcd5b27a4eefb764e885e34a61c1702660 100644
--- a/Trigger/TrigSteer/DecisionHandling/DecisionHandling/TrigCompositeUtils.h
+++ b/Trigger/TrigSteer/DecisionHandling/DecisionHandling/TrigCompositeUtils.h
@@ -55,7 +55,6 @@ namespace TrigCompositeUtils {
   /**
    * @brief Creates and right away records the DecisionContainer using the provided WriteHandle.
    **/
-
   void createAndStore( SG::WriteHandle<DecisionContainer>& handle );
 
   /**
@@ -94,6 +93,12 @@ Decision* newDecisionIn( DecisionContainer* dc, const Decision* dOld, const std:
    **/
   void insertDecisionIDs( const Decision* src, Decision* dest );
 
+ /**
+   * @brief Appends the decision IDs of src to the dest decision object
+   * @warning Performing merging of IDs and solving the duples (via set)
+   **/
+  void insertDecisionIDs( const DecisionIDContainer& src, Decision* dest );
+
  /**
    * @brief Make unique list of decision IDs of dest Decision object
    * @warning Use vector->set->vector
@@ -109,14 +114,17 @@ Decision* newDecisionIn( DecisionContainer* dc, const Decision* dOld, const std:
 
   /**
    * @brief Another variant of the above method to access DecisionIDs stored in
- the Decision object, returns const accessor
+   * the Decision object, returns const accessor
+   * @warning Operates on the underlying xAOD vector form rather than the DecisionContainer set form
    **/
-  const std::vector<int>& decisionIDs( const Decision* d ); 
+  const std::vector<DecisionID>& decisionIDs( const Decision* d ); 
 
   /**
-   * @brief Another variant of the above method to access DecisionIDs stored in the Decision object, returns read/write accessor
+   * @brief Another variant of the above method to access DecisionIDs stored in 
+   * the Decision object, returns read/write accessor
+   * @warning Operates on the underlying xAOD vector form rather than the DecisionContainer set form
    **/ 
-  std::vector<int>& decisionIDs( Decision* d );
+  std::vector<DecisionID>& decisionIDs( Decision* d );
 
   
   /**
@@ -135,19 +143,24 @@ Decision* newDecisionIn( DecisionContainer* dc, const Decision* dOld, const std:
   bool passed( DecisionID id, const DecisionIDContainer& );
   
   /**
-   * @brief Links to the previous object
+   * @brief Links to the previous object, location of previous 'seed' decision supplied by hand
    **/
   void linkToPrevious(Decision* d, const std::string& previousCollectionKey, size_t previousIndex);
 
   /**
-   * @brief checks if there is a link to previous object
+   * @brief Links to the previous object, 'seed' decision provided explicitly.
+   **/
+  void linkToPrevious(Decision* d, const Decision* dOld);
+
+  /**
+   * @brief checks if there is at least one 'seed' link to previous object
    **/
   bool hasLinkToPrevious(const Decision* d);
 
   /**
-   * @brief returns link to previous decision object
+   * @brief returns links to previous decision object 'seed'
    **/
-  ElementLinkVector<DecisionContainer> getLinkToPrevious(const Decision*);
+  const ElementLinkVector<DecisionContainer> getLinkToPrevious(const Decision*);
 
   /**
    * @brief copy all links from src to dest TC objects
@@ -180,6 +193,24 @@ Decision* newDecisionIn( DecisionContainer* dc, const Decision* dOld, const std:
     std::string m_name;
   };
 
+  /**
+   * @brief Prerequisite object usable with @see filter allowing to find TC having a link to an object collection of name
+   **/
+  class HasObjectCollection {
+  public:
+    /**
+     * @brief constructor specifying the link name
+     **/
+    HasObjectCollection(const std::string& name): m_name(name) {}
+    /**
+     * @brief checks if the arg TC has link collection of name specified at construction 
+     * @warning method for internal consumption within @see find function 
+     **/
+    bool operator()(const xAOD::TrigComposite* ) const;
+  private:
+    std::string m_name;
+  };
+
   
   /**
    * @brief collects all TC linked back to the start TC
@@ -196,7 +227,7 @@ Decision* newDecisionIn( DecisionContainer* dc, const Decision* dOld, const std:
       : source{0} {}
     LinkInfo(const xAOD::TrigComposite *s, const ElementLink<T>& l)
       : source{s}, link{l} {}
-	
+
     bool isValid() const {
       return source && link.isValid(); }
     /**
@@ -204,7 +235,7 @@ Decision* newDecisionIn( DecisionContainer* dc, const Decision* dOld, const std:
      */
     operator StatusCode () {
       return (isValid() ? StatusCode::SUCCESS : StatusCode::FAILURE); }
-	
+
     const xAOD::TrigComposite *source;
     ElementLink<T> link;
   };
@@ -217,25 +248,7 @@ Decision* newDecisionIn( DecisionContainer* dc, const Decision* dOld, const std:
    */
   template<typename T>
   LinkInfo<T>
-  findLink(const xAOD::TrigComposite* start, const std::string& linkName) {
-    auto source = find(start, HasObject(linkName) );
-    //
-    if ( not source ){
-      auto seeds = getLinkToPrevious(start);
-      // std::cout<<"Looking for seeds: found " <<seeds.size()<<std::endl;
-      for (auto seed: seeds){
-	const xAOD::TrigComposite* dec = *seed;//deference
-	LinkInfo<T> link= findLink<T>( dec, linkName );
-	// return the first found
-	if (link.isValid()) return link;
-      }
-      return LinkInfo<T>(); // invalid link
-    }
-
-    //std::cout<<"Found source for "<<linkName<<std::endl;
-
-    return LinkInfo<T>( source, source->objectLink<T>( linkName ) );
-  }
+  findLink(const xAOD::TrigComposite* start, const std::string& linkName);
 
   /**
    * Prints the TC including the linked seeds
diff --git a/Trigger/TrigSteer/DecisionHandling/DecisionHandling/TrigCompositeUtils.icc b/Trigger/TrigSteer/DecisionHandling/DecisionHandling/TrigCompositeUtils.icc
index 4f47a25430580aa651fe7c37ec81ea204ddb3015..198d9a223faeee541fedc427b7ad896877fe4efd 100644
--- a/Trigger/TrigSteer/DecisionHandling/DecisionHandling/TrigCompositeUtils.icc
+++ b/Trigger/TrigSteer/DecisionHandling/DecisionHandling/TrigCompositeUtils.icc
@@ -36,5 +36,23 @@ namespace TrigCompositeUtils {
     return handle;
   }
 
+  template<typename T>
+  LinkInfo<T>
+  findLink(const xAOD::TrigComposite* start, const std::string& linkName) {
+    auto source = find(start, HasObject(linkName) );
+    //
+    if ( not source ){
+      auto seeds = getLinkToPrevious(start);
+      for (auto seed: seeds){
+        const xAOD::TrigComposite* dec = *seed;//deference
+        LinkInfo<T> link= findLink<T>( dec, linkName );
+        // return the first found
+        if (link.isValid()) return link;
+      }
+      return LinkInfo<T>(); // invalid link
+    }
+
+    return LinkInfo<T>( source, source->objectLink<T>( linkName ) );
+  }
 
 }
diff --git a/Trigger/TrigSteer/DecisionHandling/share/TrigCompositeUtils_test.ref b/Trigger/TrigSteer/DecisionHandling/share/TrigCompositeUtils_test.ref
index 4336ef8e73c8cd36b427b307f184f51fe89d7639..0efaa06a2d0d91f617cc1585a5565f79113cb83c 100644
--- a/Trigger/TrigSteer/DecisionHandling/share/TrigCompositeUtils_test.ref
+++ b/Trigger/TrigSteer/DecisionHandling/share/TrigCompositeUtils_test.ref
@@ -1,7 +1,7 @@
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v27r1p99)
-                                          running on karma on Thu Dec 27 22:27:34 2018
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v30r5)
+                                          running on pc-tbed-pub-24.cern.ch on Wed Feb 20 14:16:00 2019
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 EventLoopMgr      WARNING Unable to locate service "EventSelector" 
@@ -9,18 +9,18 @@ EventLoopMgr      WARNING No events will be processed from external input.
 HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
-ClassIDSvc           INFO  getRegistryEntries: read 10811 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 7561 CLIDRegistry entries for module ALL
 Context: s: 0  e: 0
 Current context: s: 0  e: 0
 ClassIDSvc           INFO  getRegistryEntries: read 372 CLIDRegistry entries for module ALL
 initialize SG::WriteHandleKey<DecisionContainer> whkT
 call createAndStore( whkT ) with default context, twice
 StoreGateSvc_Impl WARNING  setupProxy:: error setting up proxy for key arbitrary and clid 1333228823
- Pre-existing valid DataProxy @0x1a48360 found in Store for key arbitrary with clid 1333228823
-StoreGateSvc_Impl WARNING record_impl: Problem setting up the proxy for object @0x1a458a0
- recorded with key arbitrary of type xAOD::TrigCompositeContainer (CLID 1333228823) in DataObject @0x1a42ea0
-VarHandle(Store...  ERROR Control/StoreGate/src/VarHandleBase.cxx:733 (FUNC): code 0: recordObject failed
-                    FATAL Control/StoreGate/StoreGate/WriteHandle.icc:887 (FUNC): code 0: this->record(std::move(data))
+ Pre-existing valid DataProxy @0xf666d0 found in Store for key arbitrary with clid 1333228823
+StoreGateSvc_Impl WARNING record_impl: Problem setting up the proxy for object @0xf64f10
+ recorded with key arbitrary of type xAOD::TrigCompositeContainer (CLID 1333228823) in DataObject @0xf66810
+VarHandle(Store...  ERROR /build1/atnight/localbuilds/nightlies/master/athena/Control/StoreGate/src/VarHandleBase.cxx:733 (FUNC): code 0: recordObject failed
+                    FATAL /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-02-11T2351/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/src/Control/StoreGate/StoreGate/WriteHandle.icc:887 (FUNC): code 0: this->record(std::move(data))
 handle name "arbitrary" isPresent 1 isValid 1
 handle name "arbitrary" isPresent 1 isValid 0
 
@@ -44,32 +44,33 @@ Call setObjectLink with a bad ElementLink that has no corresponding collection.
 xAOD::TrigComposite_v1::setObjectLink ERROR link is not valid
 
 New decision d3b with name & context 
-d3b: TrigComposite_v1 'd3b' link: name, key, index, CLID
-self, 1042135810, 3, 1333228823
-testlink, 1042135810, 1, 1333228823
-
+d3b: TrigComposite_v1 name:'d3b'
+  N Lnks:2
+    Link Name:self, Key:1042135810, Index:3, CLID:1333228823
+    Link Name:testlink, Key:1042135810, Index:1, CLID:1333228823
 el2 1042135810 1
-d3: TrigComposite_v1 '' link: name, key, index, CLID
-self, 1042135810, 2, 1333228823
-seed, 1042135810, 1, 1333228823
-
-d4: TrigComposite_v1 '' link: name, key, index, CLID
-self, 1042135810, 4, 1333228823
-seed, 1042135810, 1, 1333228823
-
+d3: TrigComposite_v1 name:''
+  N Lnks:2
+    Link Name:self, Key:1042135810, Index:2, CLID:1333228823
+    Link Name:seed__COLL, Key:1042135810, Index:1, CLID:1333228823
+  N Decisions: '2
+    95, 99, 
+d4: TrigComposite_v1 name:''
+  N Lnks:2
+    Link Name:self, Key:1042135810, Index:4, CLID:1333228823
+    Link Name:seed__COLL, Key:1042135810, Index:1, CLID:1333228823
 el: key 1042135810 index 1
 create d5 
 set link 
-d5: TrigComposite_v1 'd5' link: name, key, index, CLID
-self, 1042135810, 5, 1333228823
-feature, 1042135810, 1, 1333228823
-
+d5: TrigComposite_v1 name:'d5'
+  N Lnks:2
+    Link Name:self, Key:1042135810, Index:5, CLID:1333228823
+    Link Name:feature, Key:1042135810, Index:1, CLID:1333228823
 create d6 
-d6: TrigComposite_v1 'd6' link: name, key, index, CLID
-self, 1042135810, 6, 1333228823
-feature, 1042135810, 1, 1333228823
-seed, 1042135810, 5, 1333228823
-
+d6: TrigComposite_v1 name:'d6'
+  N Lnks:2
+    Link Name:self, Key:1042135810, Index:6, CLID:1333228823
+    Link Name:seed__COLL, Key:1042135810, Index:5, CLID:1333228823
 get d5 feature link 
 get d6 feature link 
 compare feature links 
diff --git a/Trigger/TrigSteer/DecisionHandling/src/ComboHypo.cxx b/Trigger/TrigSteer/DecisionHandling/src/ComboHypo.cxx
index 02488db94d84359d669f5d1ac3bc075fe5ea2606..a99a873cd1228fab6297cdee6687c8d40cb1488e 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/ComboHypo.cxx
+++ b/Trigger/TrigSteer/DecisionHandling/src/ComboHypo.cxx
@@ -10,7 +10,7 @@
 
 using namespace TrigCompositeUtils;
 ComboHypo::ComboHypo(const std::string& name, ISvcLocator* pSvcLocator) 
-  : ::AthReentrantAlgorithm(name, pSvcLocator)
+: ::AthReentrantAlgorithm(name, pSvcLocator)
 {}
 
 ComboHypo::~ComboHypo()
@@ -34,8 +34,8 @@ StatusCode ComboHypo::initialize() {
 
   // find max inputs size
   auto maxMultEl = std::max_element( m_multiplicitiesReqMap.begin(), m_multiplicitiesReqMap.end(),  
-  				   []( MultiplicityReqMap::value_type a, MultiplicityReqMap::value_type b ){  
-  				     return a.second.size() < b.second.size(); } ); 
+   []( MultiplicityReqMap::value_type a, MultiplicityReqMap::value_type b ){  
+     return a.second.size() < b.second.size(); } ); 
   
   const size_t maxMult = maxMultEl->second.size();
 
@@ -64,7 +64,7 @@ StatusCode ComboHypo::finalize() {
 
 
 StatusCode ComboHypo::copyDecisions( const DecisionIDContainer& passing, const EventContext& context ) const {
-    
+
   ATH_MSG_DEBUG( "Copying "<<passing.size()<<" positive decisions to outputs");
   for ( size_t input_counter = 0; input_counter < m_inputs.size(); ++input_counter ) {
 
@@ -74,51 +74,47 @@ StatusCode ComboHypo::copyDecisions( const DecisionIDContainer& passing, const E
 
     auto inputHandle = SG::makeHandle( m_inputs[input_counter], context );
     if ( inputHandle.isValid() ) {
-      const DecisionContainer* inputs = inputHandle.cptr();
-      const size_t sz = inputs->size();
       
-      for ( size_t i = 0; i < sz; ++i  ) {
-	const Decision *inputDecision = inputs->at(i);
-	DecisionIDContainer inputDecisionIDs;
-	decisionIDs( inputDecision, inputDecisionIDs );
-	
-	// from all poitive decision in the input only the ones that survived counting are passed over
-	DecisionIDContainer common;      
-	std::set_intersection( inputDecisionIDs.begin(), inputDecisionIDs.end(), passing.begin(), passing.end(),
-			       std::inserter( common, common.end() ) );
-	
-
-	Decision*  newDec = newDecisionIn( outDecisions );
-	linkToPrevious( newDec, inputHandle.key(), i );
-	ATH_MSG_DEBUG("New decision has "<< (TrigCompositeUtils::findLink<TrigRoiDescriptorCollection>( newDec, "initialRoI")).isValid()
-		      <<" valid initialRoI and "<< TrigCompositeUtils::getLinkToPrevious(newDec).size() <<" previous decisions");   
-
-	for ( auto id: common ) {
-	  addDecisionID( id, newDec );
-	}
-	
-	// add View?
-	if ( inputDecision->hasObjectLink( "view" ) ) {
-	   auto viewEL = inputDecision->objectLink< ViewContainer >( "view" );
-	   CHECK( viewEL.isValid() );
-	   newDec->setObjectLink( "view",    viewEL );
-	}
+      for (const Decision* inputDecision: *inputHandle) {
+
+        DecisionIDContainer inputDecisionIDs;
+        decisionIDs( inputDecision, inputDecisionIDs );
+
+        // from all poitive decision in the input only the ones that survived counting are passed over
+        DecisionIDContainer common;      
+        std::set_intersection( inputDecisionIDs.begin(), inputDecisionIDs.end(), passing.begin(), passing.end(),
+          std::inserter( common, common.end() ) );
+
+        Decision*  newDec = newDecisionIn( outDecisions );
+        linkToPrevious( newDec, inputDecision );
+        ATH_MSG_DEBUG("New decision has "<< (TrigCompositeUtils::findLink<TrigRoiDescriptorCollection>( newDec, "initialRoI")).isValid()
+          << " valid initialRoI and "<< TrigCompositeUtils::getLinkToPrevious(newDec).size() <<" previous decisions");   
+
+        insertDecisionIDs( common, newDec );
+
+        // add View?
+        if ( inputDecision->hasObjectLink( "view" ) ) {
+          auto viewEL = inputDecision->objectLink< ViewContainer >( "view" );
+          CHECK( viewEL.isValid() );
+          newDec->setObjectLink( "view",    viewEL );
+        }
       }
     }
 
     // debug printout:
-    if ( msgLvl(MSG::DEBUG)) {
+    if ( msgLvl(MSG::DEBUG) ) {
       ATH_MSG_DEBUG(outputHandle.key() <<" with "<< outputHandle->size() <<" decisions:");
       for (auto outdecision:  *outputHandle){
-	TrigCompositeUtils::DecisionIDContainer objDecisions;      
-	TrigCompositeUtils::decisionIDs( outdecision, objDecisions );    
-	ATH_MSG_DEBUG("Number of positive decisions for this output: " << objDecisions.size() );
-	for ( TrigCompositeUtils::DecisionID id : objDecisions ) {
-	  ATH_MSG_DEBUG( " ---  decision " << HLT::Identifier( id ) );
-	}
+        TrigCompositeUtils::DecisionIDContainer objDecisions;      
+        TrigCompositeUtils::decisionIDs( outdecision, objDecisions );    
+        ATH_MSG_DEBUG("Number of positive decisions for this output: " << objDecisions.size() );
+        for ( TrigCompositeUtils::DecisionID id : objDecisions ) {
+          ATH_MSG_DEBUG( " ---  decision " << HLT::Identifier( id ) );
+        }
       }
     }
   }
+
   return StatusCode::SUCCESS;
 }
 
@@ -129,11 +125,11 @@ void ComboHypo::fillDecisionsMap( std::vector< MultiplicityMap >&  dmap, const E
       ATH_MSG_DEBUG( "Found implicit RH from " << inputHandle.key() <<" with "<< inputHandle->size() << " elements:"  );
       MultiplicityMap thisInputDmap;
       for ( const Decision* decision : *inputHandle.cptr() ) {
-	ATH_MSG_DEBUG( "Decision with "<< decisionIDs( decision ).size() << " chains passed:" );
-	for ( DecisionID id: decisionIDs( decision ) ) {
-	  ATH_MSG_DEBUG( " +++ " << HLT::Identifier( id ) );
-	  thisInputDmap[id] ++;
-	}	    
+        ATH_MSG_DEBUG( "Decision with "<< decisionIDs( decision ).size() << " chains passed:" );
+        for ( DecisionID id: decisionIDs( decision ) ) {
+          ATH_MSG_DEBUG( " +++ " << HLT::Identifier( id ) );
+          thisInputDmap[id] ++;
+        }     
       }
       dmap[i]= thisInputDmap; 
     }
@@ -143,7 +139,6 @@ void ComboHypo::fillDecisionsMap( std::vector< MultiplicityMap >&  dmap, const E
     }
   }
 
-
   //debug
   ATH_MSG_DEBUG( "Decision map filled :" );
   int i=0;
@@ -158,7 +153,7 @@ void ComboHypo::fillDecisionsMap( std::vector< MultiplicityMap >&  dmap, const E
 
 StatusCode ComboHypo::execute(const EventContext& context ) const {
   ATH_MSG_DEBUG( "Executing " << name() << "..." );
- 
+
   
   DecisionIDContainer passing;
   // this map is filled with the count of positive decisions from each input
@@ -175,8 +170,8 @@ StatusCode ComboHypo::execute(const EventContext& context ) const {
       const int observedMultiplicity = dmap[ inputContainerIndex ][ requiredDecisionID ];
       ATH_MSG_DEBUG( "Required multiplicity " << requiredMultiplicity  << " for chain " << m.first<< ": observed multiplicity " << observedMultiplicity << " in container " << inputContainerIndex  );
       if ( observedMultiplicity < requiredMultiplicity ) {
-	overallDecision = false;
-	break;
+        overallDecision = false;
+        break;
       }
     }
     ATH_MSG_DEBUG( "Chain " << m.first <<  ( overallDecision ? " is accepted" : " is rejected") );
@@ -186,7 +181,6 @@ StatusCode ComboHypo::execute(const EventContext& context ) const {
   }
   
   ATH_CHECK( copyDecisions( passing, context ) );
-
   
   return StatusCode::SUCCESS;
 }
diff --git a/Trigger/TrigSteer/DecisionHandling/src/InputMakerBase.cxx b/Trigger/TrigSteer/DecisionHandling/src/InputMakerBase.cxx
index 6406db2a9d765067c5e7028e807cfa471418ff70..ae9f403eb8cf864fc9e352e4a2e7c6edc3a34be1 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/InputMakerBase.cxx
+++ b/Trigger/TrigSteer/DecisionHandling/src/InputMakerBase.cxx
@@ -10,7 +10,7 @@ using namespace TrigCompositeUtils;
 
 
 InputMakerBase::InputMakerBase( const std::string& name, ISvcLocator* pSvcLocator )
-  : ::AthReentrantAlgorithm( name, pSvcLocator ) {}
+: ::AthReentrantAlgorithm( name, pSvcLocator ) {}
 
 InputMakerBase::~InputMakerBase() {}
 
@@ -65,55 +65,66 @@ StatusCode InputMakerBase::decisionInputToOutput(const EventContext& context, st
     }
     ATH_MSG_DEBUG( "Running on input "<< inputKey.key()<<" with " << inputHandle->size() << " elements" );
     
-    // create the output container
+    // We have an input container with >= 1 Decision objects. Create an output container with the same index. 
     TrigCompositeUtils::createAndStore(outputHandles[outputIndex]);
 
 
     auto outDecisions = outputHandles[outputIndex].ptr();
 
-    //map all RoIs that are stored in this input container
-    std::vector <ElementLink<TrigRoiDescriptorCollection> > RoIsFromDecision;
-       
+    // If using m_mergeOutputs, then collate all RoIs that are stored in this input container
+    ElementLinkVector<TrigRoiDescriptorCollection> RoIsFromDecision;
+
     // loop over decisions retrieved from this input
     size_t input_counter =0;
     size_t output_counter =0;
-   
-    for ( auto decision : *inputHandle){
-      ATH_MSG_DEBUG( "Input Decision "<<input_counter <<" has " <<TrigCompositeUtils::getLinkToPrevious(decision).size()<<" previous links");
-      TrigCompositeUtils::Decision*  newDec;
-      bool addDecision=false;
-      int roi_counter=0;
+    for (const TrigCompositeUtils::Decision* inputDecision : *inputHandle){
+      ATH_MSG_DEBUG( "Input Decision "<<input_counter <<" has " <<TrigCompositeUtils::getLinkToPrevious(inputDecision).size()<<" previous links");
+      TrigCompositeUtils::Decision* newDec = nullptr;
+      bool addDecision = false;
+      ElementLink<TrigRoiDescriptorCollection> roiEL = ElementLink<TrigRoiDescriptorCollection>();
+      
       if (m_mergeOutputs){
-	auto roiELInfo = TrigCompositeUtils::findLink<TrigRoiDescriptorCollection>( decision,  m_roisLink.value());
-	CHECK( roiELInfo.isValid() );      
-	auto roiEL = roiELInfo.link;
-	auto roiIt=find(RoIsFromDecision.begin(), RoIsFromDecision.end(), roiEL);
-	addDecision = (roiIt == RoIsFromDecision.end());
-	if (addDecision) {
-	  RoIsFromDecision.push_back(roiEL); // just to keep track of which we have used
-	  const TrigRoiDescriptor* roi = *roiEL;
-	  ATH_MSG_DEBUG( "Found RoI:" <<*roi<<" FS="<<roi->isFullscan());
-	  roi_counter = roiIt-RoIsFromDecision.begin();
-	}
-      } else
-	addDecision=true;
+        // Get RoI from this input decision 
+        const auto roiELInfo = TrigCompositeUtils::findLink<TrigRoiDescriptorCollection>( inputDecision,  m_roisLink.value());
+        CHECK( roiELInfo.isValid() );      
+        roiEL = roiELInfo.link;
+        const auto roiIt = std::find(RoIsFromDecision.begin(), RoIsFromDecision.end(), roiEL);
+        addDecision = (roiIt == RoIsFromDecision.end());
+        // addDecision is positive here if we have *not* before encountered this RoI within this input collection.
+        if (addDecision) {
+          RoIsFromDecision.push_back(roiEL); // To keep track of which we have used
+          ATH_MSG_DEBUG( "Found RoI:" << **roiEL <<" FS="<< (*roiEL)->isFullscan());
+        }
+      } else { // Not merging, keep a 1-to-1 mapping of Decisions in Input & Output containers
+        addDecision=true;
+      }
 
       if ( addDecision ){
-	newDec = TrigCompositeUtils::newDecisionIn( outDecisions );
-	output_counter++;
-      }
-      else{
-	newDec = outDecisions[outputIndex][roi_counter];
+        // Create a new Decision in the Output container to mirror one in the Input container
+        newDec = TrigCompositeUtils::newDecisionIn( outDecisions );
+        output_counter++;
+      } else{
+        // addDecision can only be false if m_mergeOutputs was true and roiEL was found within RoIsFromDecision
+        // Re-use a Decision already added to the Output container 
+        const auto roiIt = std::find(RoIsFromDecision.begin(), RoIsFromDecision.end(), roiEL);
+        if (roiIt == RoIsFromDecision.end()) {
+          ATH_MSG_ERROR("Logic error in decisionInputToOutput. Cannot find existing RoI.");
+          return StatusCode::FAILURE;
+        }
+        const size_t roiCounter = std::distance( RoIsFromDecision.begin(), roiIt );
+        newDec = outDecisions[outputIndex][roiCounter];
       }
-      
-      TrigCompositeUtils::linkToPrevious( newDec, inputKey.key(), input_counter );
-      TrigCompositeUtils::insertDecisionIDs( decision, newDec );     	
+
+      TrigCompositeUtils::linkToPrevious( newDec, inputDecision ); // Link inputDecision object as the 'seed' of newDec
+      TrigCompositeUtils::insertDecisionIDs( inputDecision, newDec ); // Copy decision IDs from inputDecision into newDec
       ATH_MSG_DEBUG("New decision has "<< (TrigCompositeUtils::findLink<TrigRoiDescriptorCollection>( newDec,  m_roisLink.value())).isValid() <<" valid "<<m_roisLink.value() <<" and "<< TrigCompositeUtils::getLinkToPrevious(newDec).size() <<" previous decisions");     
-      input_counter++;	
+      input_counter++;  
     } // loop over input decisions
 
     ATH_MSG_DEBUG( "Filled output key " <<  decisionOutputs()[ outputIndex ].key() <<" of size "<<outDecisions->size()  <<" at index "<< outputIndex);
-    outputIndex++;	       
+    for (auto i : *outDecisions) msg() << i << " ";
+    msg() << endmsg;
+    outputIndex++;         
   } // end of first loop over input keys
 
   return StatusCode::SUCCESS;
@@ -176,4 +187,4 @@ size_t InputMakerBase::countInputHandles( const EventContext& context ) const {
 
 
 
-  
+
diff --git a/Trigger/TrigSteer/DecisionHandling/src/InputMakerForRoI.cxx b/Trigger/TrigSteer/DecisionHandling/src/InputMakerForRoI.cxx
index a527412adc03f363ff443842de31fcee677b423f..e396a41734d7d451beda37ea95c45a0bbca81b4f 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/InputMakerForRoI.cxx
+++ b/Trigger/TrigSteer/DecisionHandling/src/InputMakerForRoI.cxx
@@ -12,10 +12,11 @@ using TrigCompositeUtils::DecisionContainer;
 using TrigCompositeUtils::Decision;
 using TrigCompositeUtils::linkToPrevious;
 using TrigCompositeUtils::getLinkToPrevious;
+using TrigCompositeUtils::findLink;
 
 InputMakerForRoI:: InputMakerForRoI( const std::string& name, 
-				     ISvcLocator* pSvcLocator )    
-  : InputMakerBase( name, pSvcLocator ) {}
+ ISvcLocator* pSvcLocator )    
+: InputMakerBase( name, pSvcLocator ) {}
 
 
 InputMakerForRoI::~ InputMakerForRoI() {}
@@ -38,12 +39,12 @@ StatusCode  InputMakerForRoI::execute( const EventContext& context ) const {
   ATH_MSG_DEBUG( "Executing " << name() << "..." );
   
   // call base class helper method to read input decisions, loop over them create outputs and connect them, returns with outputHandles filled
-  std::vector< SG::WriteHandle<TrigCompositeUtils::DecisionContainer> > outputHandles;
+  std::vector< SG::WriteHandle<DecisionContainer> > outputHandles;
   ATH_CHECK (decisionInputToOutput(context, outputHandles));
   
   // Prepare Outputs
   std::unique_ptr< TrigRoiDescriptorCollection > oneRoIColl( new TrigRoiDescriptorCollection() );
- 
+
   // use also this:    ElementLinkVector<xAOD::MuonRoIContainer> getMuonRoILinks = obj->objectCollectionLinks<xAOD::MuonRoIContainer>("ManyMuonRoIs");
   std::vector <ElementLink<TrigRoiDescriptorCollection> > RoIsFromDecision;  // used to check for duplicate features linked to different inputHandles
 
@@ -61,24 +62,23 @@ StatusCode  InputMakerForRoI::execute( const EventContext& context ) const {
     ATH_MSG_DEBUG( "Got output "<< outputHandle.key()<<" with " << outputHandle->size() << " elements" );
     // loop over output decisions in container of outputHandle, follow link to inputDecision
     for ( auto outputDecision : *outputHandle){ 
-      ElementLinkVector<DecisionContainer> inputLinks = TrigCompositeUtils::getLinkToPrevious(outputDecision);
+      ElementLinkVector<DecisionContainer> inputLinks = getLinkToPrevious(outputDecision);
       for (auto input: inputLinks){
-	const Decision* inputDecision = *input;
-	auto roiELInfo = TrigCompositeUtils::findLink<TrigRoiDescriptorCollection>( inputDecision, m_roisLink.value() );
-	auto roiEL = roiELInfo.link;
-	ATH_CHECK( roiEL.isValid() );
-      
-	// avoid adding the same feature multiple times: check if not in container, if not add it
-	if ( find(RoIsFromDecision.begin(), RoIsFromDecision.end(), roiEL)
-	     == RoIsFromDecision.end() ){
-	  RoIsFromDecision.push_back(roiEL); // just to keep track of which we have used 
-	  const TrigRoiDescriptor* roi = *roiEL;
-	  ATH_MSG_DEBUG("Found RoI:" <<*roi<<" FS="<<roi->isFullscan());
-	  //make a new one:
-	  TrigRoiDescriptor* newroi= new TrigRoiDescriptor(*roi); //use copy constructor
-	  oneRoIColl->push_back(newroi);
-	  ATH_MSG_DEBUG("Added RoI:" <<*newroi<<" FS="<<newroi->isFullscan());
-	}
+        const Decision* inputDecision = *input;
+        auto roiELInfo = findLink<TrigRoiDescriptorCollection>( inputDecision, m_roisLink.value() );
+        auto roiEL = roiELInfo.link;
+        ATH_CHECK( roiEL.isValid() );
+
+        // avoid adding the same feature multiple times: check if not in container, if not add it
+        if ( find(RoIsFromDecision.begin(), RoIsFromDecision.end(), roiEL) == RoIsFromDecision.end() ) {
+          RoIsFromDecision.push_back(roiEL); // just to keep track of which we have used 
+          const TrigRoiDescriptor* roi = *roiEL;
+          ATH_MSG_DEBUG("Found RoI:" <<*roi<<" FS="<<roi->isFullscan());
+          //make a new one:
+          TrigRoiDescriptor* newroi= new TrigRoiDescriptor(*roi); //use copy constructor
+          oneRoIColl->push_back(newroi);
+          ATH_MSG_DEBUG("Added RoI:" <<*newroi<<" FS="<<newroi->isFullscan());
+        }
       } // loop over previous input links           
     } // loop over decisions      
   } // loop over output keys
diff --git a/Trigger/TrigSteer/DecisionHandling/src/RoRSeqFilter.cxx b/Trigger/TrigSteer/DecisionHandling/src/RoRSeqFilter.cxx
index dc97402c08734eb7ba704aa50bc48b3c313c4c35..33aa17f46550e97d04f34761a9bbe26ad9b24eda 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/RoRSeqFilter.cxx
+++ b/Trigger/TrigSteer/DecisionHandling/src/RoRSeqFilter.cxx
@@ -7,6 +7,15 @@
 
 #include "GaudiKernel/Property.h"
 
+using TrigCompositeUtils::DecisionContainer;
+using TrigCompositeUtils::Decision;
+using TrigCompositeUtils::DecisionIDContainer;
+using TrigCompositeUtils::DecisionID;
+using TrigCompositeUtils::decisionIDs;
+using TrigCompositeUtils::insertDecisionIDs;
+using TrigCompositeUtils::createAndStore;
+using TrigCompositeUtils::newDecisionIn;
+
 RoRSeqFilter::RoRSeqFilter( const std::string& name, 
   ISvcLocator* pSvcLocator ) :
   ::AthAlgorithm( name, pSvcLocator )
@@ -87,34 +96,35 @@ StatusCode RoRSeqFilter::execute() {
   if ( m_mergeInputs ) {
 
     ATH_MSG_DEBUG( "Recording " <<  m_outputKeys[ 0 ].key() ); 
-    TrigCompositeUtils::createAndStore(outputHandles[0]);
-    TrigCompositeUtils::DecisionContainer* output = outputHandles[0].ptr();
+    createAndStore(outputHandles[0]);
+    DecisionContainer* output = outputHandles[0].ptr();
     for ( auto inputKey: m_inputKeys ) {
       auto inputHandle = SG::makeHandle( inputKey );
       if( inputHandle.isValid() )
-        passCounter += copyPassing( *inputHandle, inputKey.key(),  *output );
+        passCounter += copyPassing( *inputHandle,  *output );
     }
     outputIndex++;
 
-  } else {
+  } else { // Not merging inputs
 
     for ( auto inputKey: m_inputKeys ) {
       // already made handles, so this code could be simplified to a loop over inputHandles.
       auto inputHandle = SG::makeHandle( inputKey );
 
       if( not inputHandle.isValid() ) {
-	ATH_MSG_DEBUG( "InputHandle "<< inputKey.key() <<" not present" );
+        ATH_MSG_DEBUG( "InputHandle "<< inputKey.key() <<" not present" );
       } else if ( inputHandle->empty() ) {
-	ATH_MSG_DEBUG( "InputHandle "<< inputKey.key() <<" contains all rejected decisions, skipping" );
+        ATH_MSG_DEBUG( "InputHandle "<< inputKey.key() <<" contains all rejected decisions, skipping" );
       } else {
-	ATH_MSG_DEBUG( "Checking inputHandle "<< inputKey.key() <<" with " << inputHandle->size() <<" elements");
-	TrigCompositeUtils::createAndStore(outputHandles[outputIndex]);
-	TrigCompositeUtils::DecisionContainer* output = outputHandles[outputIndex].ptr();
-	passCounter += copyPassing( *inputHandle, inputKey.key(), *output );	
-	ATH_MSG_DEBUG( "Recorded output key " <<  m_outputKeys[ outputIndex ].key() <<" of size "<<output->size()  <<" at index "<< outputIndex);
+        ATH_MSG_DEBUG( "Checking inputHandle "<< inputKey.key() <<" with " << inputHandle->size() <<" elements");
+        createAndStore(outputHandles[outputIndex]);
+        DecisionContainer* output = outputHandles[outputIndex].ptr();
+        passCounter += copyPassing( *inputHandle, *output );  
+        ATH_MSG_DEBUG( "Recorded output key " <<  m_outputKeys[ outputIndex ].key() <<" of size "<<output->size()  <<" at index "<< outputIndex);
       }
       outputIndex++; // Keep the mapping of inputKey<->outputKey correct
     }
+
   }
 
   setFilterPassed( passCounter != 0 );
@@ -127,33 +137,36 @@ StatusCode RoRSeqFilter::execute() {
   return StatusCode::SUCCESS;
 }
   
-size_t RoRSeqFilter::copyPassing( const TrigCompositeUtils::DecisionContainer& input, 
-                                  const std::string& inputKey,
-                                  TrigCompositeUtils::DecisionContainer& output ) const {
+size_t RoRSeqFilter::copyPassing( const DecisionContainer& input, 
+                                  DecisionContainer& output ) const {
   size_t passCounter = 0;
   ATH_MSG_DEBUG( "Input size " << input.size() );
   for (size_t i = 0; i < input.size(); ++i) {
-    const TrigCompositeUtils::Decision* inputDecision = input.at(i);
+    const Decision* inputDecision = input.at(i);
 
-    TrigCompositeUtils::DecisionIDContainer objDecisions;      
-    TrigCompositeUtils::decisionIDs( inputDecision, objDecisions );
+    DecisionIDContainer objDecisions;      
+    decisionIDs( inputDecision, objDecisions );
 
     ATH_MSG_DEBUG("Number of positive decisions for this input: " << objDecisions.size() );
 
-    for ( TrigCompositeUtils::DecisionID id : objDecisions ) {
+    for ( DecisionID id : objDecisions ) {
       ATH_MSG_DEBUG( " -- Positive decision " << HLT::Identifier( id ) );
     }
 
-    std::vector<TrigCompositeUtils::DecisionID> intersection;
+    DecisionIDContainer intersection;
     std::set_intersection( m_chains.begin(), m_chains.end(),
          objDecisions.begin(), objDecisions.end(),
-         std::back_inserter( intersection ) );
+         std::inserter(intersection, intersection.end()) );
 
     if ( not intersection.empty() ) {      
-      TrigCompositeUtils::Decision* decisionCopy = TrigCompositeUtils::newDecisionIn( &output, name() );
-      *decisionCopy = *inputDecision; // copies auxdata from one auxstore to the other
-      // future improvement: could use newDecisionIn(&output,input,name which internally does the linkToPrevious, then no longer need to pass the key
-      TrigCompositeUtils::linkToPrevious(decisionCopy, inputKey, i); // Update seed
+      // This sets up the 'self' link & the 'seed' link (seeds from inputDecision)
+      Decision* decisionCopy = newDecisionIn( &output, inputDecision, name() );
+
+      // Copy accross only the DecisionIDs which have passed through this Filter for this Decision object. 
+      // WARNING: Still need to 100% confirm if the correct set to propagate forward is objDecisions or intersection.
+      // Tim M changing this from objDecisions (all IDs) -> intersection (only passed IDs) Feb 19
+      insertDecisionIDs(intersection, decisionCopy);
+
       passCounter ++;
       ATH_MSG_DEBUG("Input satisfied at least one active chain");
     } else {
diff --git a/Trigger/TrigSteer/DecisionHandling/src/RoRSeqFilter.h b/Trigger/TrigSteer/DecisionHandling/src/RoRSeqFilter.h
index ee6a6dd2f9fbf02a472f854ee4c31b9c938eee8f..6e572e48d7fc85a9a70ca09f87976dc0c11f973f 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/RoRSeqFilter.h
+++ b/Trigger/TrigSteer/DecisionHandling/src/RoRSeqFilter.h
@@ -79,17 +79,15 @@ class RoRSeqFilter
 /**
  * @brief Applies generic filter to input container, keeping only the decision objects with at least 
  * one affirmative decision from the previous Stage. Considering only decisions from chains utilising this filter.
- * @param input Reference to input container of decision objects.
  * @param inputKey Storegate key of input, needed to link newly created decision objects to their parents.
  * @param output Writeable output container to store copies of decision objects which pass the filter.
  * @return The number of decision objects which passed the filter.
  *
- * Produced a deep-copy of all Decision objects in the input container which possess a positive decision from
+ * Produced a selective copy of all Decision objects in the input container which possess a positive decision from
  * at least one of the chains which this filter algorithm is configured for. This new object is linked to its 
  * parent and stored in the output collection. It will form the starting point for the next Step. 
  **/
   size_t copyPassing( const TrigCompositeUtils::DecisionContainer& input, 
-                      const std::string& inputKey,
                       TrigCompositeUtils::DecisionContainer& output) const;
 
 }; 
diff --git a/Trigger/TrigSteer/DecisionHandling/src/TrigCompositeUtils.cxx b/Trigger/TrigSteer/DecisionHandling/src/TrigCompositeUtils.cxx
index 581958e813a97f4db2c9337ecf1aaa93d00b65d3..8a8e92a003e73c29d862c742b47937dc4ac9ae57 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/TrigCompositeUtils.cxx
+++ b/Trigger/TrigSteer/DecisionHandling/src/TrigCompositeUtils.cxx
@@ -10,10 +10,8 @@
 #include "StoreGate/WriteHandle.h"
 #include "DecisionHandling/TrigCompositeUtils.h"
 
-
-
-static const SG::AuxElement::Accessor< std::vector< int > >   readWriteAccessor( "decisions" );
-static const SG::AuxElement::ConstAccessor< std::vector<int> > readOnlyAccessor( "decisions" );
+static const SG::AuxElement::Accessor< std::vector<TrigCompositeUtils::DecisionID> > readWriteAccessor("decisions");
+static const SG::AuxElement::ConstAccessor< std::vector<TrigCompositeUtils::DecisionID> > readOnlyAccessor("decisions");
 
 namespace TrigCompositeUtils {  
 
@@ -36,7 +34,6 @@ namespace TrigCompositeUtils {
   Decision* newDecisionIn ( DecisionContainer* dc, const std::string& name, const EventContext& ctx ) {
     Decision * x = new Decision;
     dc->push_back( x );
-    readWriteAccessor( *x ).size(); // fake operation just to make the decisions decoration
     size_t index = dc->size() - 1;
     // make self link, useful to copy for seed link in a successor, but requires that DecisionContainer is already recorded in SG.
     ElementLink<DecisionContainer> el(*dc, index, ctx);
@@ -51,68 +48,63 @@ namespace TrigCompositeUtils {
   }
 
   Decision* newDecisionIn ( DecisionContainer* dc, const Decision* dOld, const std::string& name, const EventContext& ctx ) {
-    Decision* dNew =  newDecisionIn( dc, name, ctx);
-   if ( dOld->hasObjectLink("roi" ) ){
-     dNew->copyLinkFrom(dOld,"roi");
-   }
-   else if ( dOld->hasObjectLink("initialRoI") ){
-     dNew->copyLinkFrom(dOld,"initialRoI","roi");
-   }
-   if ( dOld->hasObjectLink("view" ) ){
-     dNew->copyLinkFrom(dOld,"view");
-   }
-   if ( dOld->hasObjectLink("feature" ) ){
-     dNew->copyLinkFrom(dOld,"feature");
-   }
-   if ( dOld->hasObjectLink("self" ) ){
-     dNew->copyLinkFrom(dOld,"self","seed"); // make use of self-link 
-   }
-   return dNew;
+    Decision* dNew =  newDecisionIn( dc, name, ctx); // Sets up 'self' link of dNew
+    linkToPrevious(dNew, dOld); // Sets up link to 'seed' collection, points to 'self' link of dOld
+    return dNew;
   }
 
   void addDecisionID( DecisionID id,  Decision* d ) {   
-    std::vector<int>& decisions = readWriteAccessor( *d );
-    if ( decisions.size() == 0 or decisions.back() != static_cast<int>(id) ) 
+    std::vector<DecisionID>& decisions = readWriteAccessor( *d );
+    if ( decisions.size() == 0 or decisions.back() != id) 
       decisions.push_back( id );
   }
   
   void decisionIDs( const Decision* d, DecisionIDContainer& destination ) {    
-    const std::vector<int>& decisions = readOnlyAccessor( *d );    
+    const std::vector<DecisionID>& decisions = readOnlyAccessor( *d );    
     destination.insert( decisions.begin(), decisions.end() );
   }
 
-  const std::vector<int>& decisionIDs( const Decision* d ) {    
+  const std::vector<DecisionID>& decisionIDs( const Decision* d ) {    
     return readOnlyAccessor( *d );    
   }
 
-  std::vector<int>& decisionIDs( Decision* d ) {
+  std::vector<DecisionID>& decisionIDs( Decision* d ) {
     return readWriteAccessor( *d );
   }
 
-  void insertDecisionIDs( const Decision* src, Decision* dest ){
-    DecisionIDContainer ids;
-    decisionIDs( src, ids );
-    decisionIDs( dest, ids );
-    decisionIDs( dest ).clear(); 
-    decisionIDs( dest ).insert( decisionIDs(dest).end(), ids.begin(), ids.end() );
+  void insertDecisionIDs(const Decision* src, Decision* dest ){
+    DecisionIDContainer srcIds;
+    decisionIDs( src, srcIds ); // Now stored in a set
+    insertDecisionIDs( srcIds, dest);
+  }
+
+  void insertDecisionIDs( const DecisionIDContainer& src, Decision* dest ) {
+    DecisionIDContainer collateIDs;
+    // Decision are xAOD objects backed by a std::vector
+    // Here we use a std::set to de-duplicate IDs from src and dest before setting dest
+    decisionIDs( dest, collateIDs ); // Set operation 1. Get from dest
+    collateIDs.insert( src.begin(), src.end() ); // Set operation 2. Get from src
+    decisionIDs( dest ).clear(); // Clear target
+    // Copy from set to (ordered) vector
+    decisionIDs( dest ).insert( decisionIDs(dest).end(), src.begin(), src.end() );
   }
 
-  void uniqueDecisionIDs( Decision* dest){
-    DecisionIDContainer ids;
-    decisionIDs( dest, ids );
-    decisionIDs( dest ).clear(); 
-    decisionIDs( dest ).insert( decisionIDs(dest).end(), ids.begin(), ids.end() );
+  void uniqueDecisionIDs(Decision* dest) {
+    // Re-use above insertDecisionIDs method.
+    // This implicitly performs de-duplication
+    return insertDecisionIDs(dest, dest);
   }
 
   bool allFailed( const Decision* d ) {
-    const std::vector<int>& decisions = readOnlyAccessor( *d );    
+    const std::vector<DecisionID>& decisions = readOnlyAccessor( *d );    
     return decisions.empty();
   }
 
   bool isAnyIDPassing( const Decision* d,  const DecisionIDContainer& required ) {
-    for ( auto id : readOnlyAccessor( *d ) ) {
-      if ( required.count( id ) > 0 )
-	return true;
+    for ( DecisionID id : readOnlyAccessor( *d ) ) {
+      if ( required.count( id ) > 0 ) {
+        return true;
+      }
     }
     return false;
   }    
@@ -122,29 +114,29 @@ namespace TrigCompositeUtils {
   }
 
   void linkToPrevious( Decision* d, const std::string& previousCollectionKey, size_t previousIndex ) {
-    ElementLinkVector<DecisionContainer> seeds;
-    ElementLink<DecisionContainer> new_seed= ElementLink<DecisionContainer>( previousCollectionKey, previousIndex );
-    // do we need this link to self link?
-    if ( (*new_seed)->hasObjectLink("self" ) )
-      seeds.push_back( (*new_seed)->objectLink<DecisionContainer>("self")); // make use of self-link 
-    else
-      seeds.push_back(ElementLink<DecisionContainer>( previousCollectionKey, previousIndex ));
-    
-    if (hasLinkToPrevious(d) ){
-      ElementLinkVector<DecisionContainer> oldseeds = d->objectCollectionLinks<DecisionContainer>( "seed" );
-      seeds.reserve( seeds.size() + oldseeds.size() );
-      std::move( oldseeds.begin(), oldseeds.end(), std::back_inserter( seeds ) );
+    ElementLink<DecisionContainer> seed = ElementLink<DecisionContainer>( previousCollectionKey, previousIndex );
+    if (!seed.isValid()) {
+      throw GaudiException("Invalid Decision Link key or index provided", "TrigCompositeUtils::linkToPrevious", StatusCode::FAILURE);
+    } else {
+      d->addObjectCollectionLink("seed", seed);
     }
+  }
 
-    d->addObjectCollectionLinks("seed", seeds);
-    
+  void linkToPrevious( Decision* d, const Decision* dOld) {
+    if ( dOld && dOld->hasObjectLink("self") ) {
+      // Internally de-dupes the "seed" collection of links
+      d->addObjectCollectionLink("seed", dOld->objectLink<DecisionContainer>("self"));  
+    } else {
+      throw GaudiException("Using linkToPrevious with a previous decision requires that decision to have its 'self' link set",
+        "TrigCompositeUtils::linkToPrevious", StatusCode::FAILURE);
+    }    
   }
 
   bool hasLinkToPrevious( const Decision* d ) {
-    return d->hasObjectLink( "seed" );
+    return d->hasObjectCollectionLinks( "seed" );
   }
 
-  ElementLinkVector <DecisionContainer> getLinkToPrevious( const Decision* d ) {
+  const ElementLinkVector<DecisionContainer> getLinkToPrevious( const Decision* d ) {
     return d->objectCollectionLinks<DecisionContainer>( "seed" );
   }
 
@@ -155,23 +147,35 @@ namespace TrigCompositeUtils {
 
  
   
-  const xAOD::TrigComposite* find( const xAOD::TrigComposite* start, const std::function<bool( const xAOD::TrigComposite* )>& filter ) {
+  const Decision* find( const Decision* start, const std::function<bool( const Decision* )>& filter ) {
     if ( filter( start ) ) return start;
 
-    if ( start->hasObjectLink( "seed" ) ) {
-      return find( start->object<xAOD::TrigComposite>( "seed" ), filter );
+    if ( hasLinkToPrevious(start) ) {
+      const ElementLinkVector<DecisionContainer> seeds = getLinkToPrevious(start);
+      for (const ElementLink<DecisionContainer>& seedEL : seeds) {
+        const Decision* result = find( *seedEL, filter );
+        if (result) return result;
+      }
     }
-    else return nullptr;
+    
+    return nullptr;
   }
 
-  bool HasObject::operator()( const xAOD::TrigComposite* composite ) const {
+  bool HasObject::operator()( const Decision* composite ) const {
     return composite->hasObjectLink( m_name );
   }
 
-  bool recursiveGetObjectLinks( const xAOD::TrigComposite* start, ElementLinkVector<xAOD::TrigCompositeContainer>& linkVector ){
+  bool HasObjectCollection::operator()( const Decision* composite ) const {
+    return composite->hasObjectCollectionLinks( m_name );
+  }
+
+  bool recursiveGetObjectLinks( const Decision* start, ElementLinkVector<DecisionContainer>& linkVector ){
     //recursively find in the seeds
-    if ( start->hasObjectLink( "seed" ) ) {
-      return recursiveGetObjectLinks( start->object<xAOD::TrigComposite>( "seed" ), linkVector );
+    if ( hasLinkToPrevious(start) ) {
+      const ElementLinkVector<DecisionContainer> seeds = getLinkToPrevious(start);
+      for (const ElementLink<DecisionContainer>& seedEL : seeds) {
+        recursiveGetObjectLinks( *seedEL, linkVector );
+      }
     }
 
     int isComposite=0;
@@ -183,7 +187,7 @@ namespace TrigCompositeUtils {
 
     // ElementLink<xAOD::TrigComposite> test;
     // test = start->objectLink( "childProxies" );
-    ElementLinkVector<xAOD::TrigCompositeContainer> links = start->objectCollectionLinks<xAOD::TrigCompositeContainer>( "childProxies" );
+    ElementLinkVector<DecisionContainer> links = start->objectCollectionLinks<DecisionContainer>( "childProxies" );
 
     linkVector.reserve( linkVector.size() + links.size() );
     std::move( links.begin(), links.end(), std::back_inserter( linkVector ) );
@@ -191,13 +195,13 @@ namespace TrigCompositeUtils {
     return true;
   }
 
-  std::string dump( const xAOD::TrigComposite*  tc, std::function< std::string( const xAOD::TrigComposite* )> printerFnc ) {
+  std::string dump( const Decision*  tc, std::function< std::string( const Decision* )> printerFnc ) {
     std::string ret; 
     ret += printerFnc( tc );
-    if ( tc->hasObjectLink("seed") ) {
-      const xAOD::TrigComposite* seedTc = tc->object<xAOD::TrigComposite>( "seed" );
-      if ( seedTc ) {
-	ret += " -> " + dump( seedTc, printerFnc );
+    if ( hasLinkToPrevious(tc) ) {
+      const ElementLinkVector<DecisionContainer> seeds = getLinkToPrevious(tc);
+      for (const ElementLink<DecisionContainer>& seedEL : seeds) {
+        ret += " -> " + dump( *seedEL, printerFnc );
       }
     }
     return ret;
diff --git a/Trigger/TrigSteer/DecisionHandling/test/TrigCompositeUtils_test.cxx b/Trigger/TrigSteer/DecisionHandling/test/TrigCompositeUtils_test.cxx
index 48940d6b33693bfa6b19b953d486a2fb675cc546..b2ef8139eb0987f54752253cd08413db790aec9d 100644
--- a/Trigger/TrigSteer/DecisionHandling/test/TrigCompositeUtils_test.cxx
+++ b/Trigger/TrigSteer/DecisionHandling/test/TrigCompositeUtils_test.cxx
@@ -13,12 +13,12 @@
 #include "TestTools/expect.h"
 #include "DecisionHandling/TrigCompositeUtils.h"
 #include "xAODTrigger/TrigCompositeAuxContainer.h"
+#include "CxxUtils/checker_macros.h"
 
-bool xAOD::TrigComposite::s_throwOnCopyError = true;
-
-int main() {
+int main ATLAS_NOT_THREAD_SAFE () {
 
   using namespace TrigCompositeUtils;
+  xAOD::TrigComposite::s_throwOnCopyError = true;
 
   errorcheck::ReportMessage::hideFunctionNames (true);
 
@@ -131,10 +131,10 @@ int main() {
   addDecisionID( 95, d3 );
   addDecisionID( 99, d3 );
   addDecisionID( 99, d3 );
-  auto storedDecisions  = d3->getDetail<std::vector<int>>( "decisions" );
+  auto storedDecisions  = d3->getDetail<std::vector<DecisionID>>( "decisions" );
   VALUE ( storedDecisions.size() ) EXPECTED ( 2 );
-  VALUE ( ( int )storedDecisions.front() ) EXPECTED ( 95 );
-  VALUE ( ( int )storedDecisions.back() ) EXPECTED ( 99 );
+  VALUE ( ( DecisionID )storedDecisions.front() ) EXPECTED ( 95 );
+  VALUE ( ( DecisionID )storedDecisions.back() ) EXPECTED ( 99 );
 
   // Make an EL with an invalid (zero) hash key and try to add it to a Decision
   auto data1 = std::make_unique<DecisionContainer>() ;
@@ -152,10 +152,12 @@ int main() {
   VALUE ( d3->setObjectLink( "bad", badEL2 ) ) EXPECTED ( false );
   // this fails, and cerr output also expected
 
-  // Make, store and retrieve a "seed" link
+  // Make, store and retrieve a "seed" link within a collection
   ElementLink<DecisionContainer> el( *dc, 1 );
-  assert( d3->setObjectLink( "seed", el ) );
-  ElementLink<DecisionContainer > resEl = d3->objectLink<DecisionContainer>("seed");
+  assert( d3->addObjectCollectionLink( "seed", el ) );
+  ElementLinkVector<DecisionContainer > resElVector = d3->objectCollectionLinks<DecisionContainer>("seed");
+  assert( resElVector.size() == 1 );
+  ElementLink<DecisionContainer> resEl = resElVector.front();
   VALUE( resEl.index() ) EXPECTED ( el.index() );
   VALUE( resEl.key() ) EXPECTED ( el.key() );
 
@@ -163,14 +165,16 @@ int main() {
   std::cout << std::endl;
   std::cout << "New decision d3b with name & context " << std::endl;
   auto d3b = newDecisionIn( dc, "d3b", ctx );
-  // Make, store and retrieve a "seed" link, with context
+  // Make, store and retrieve a "testLink" link, with context
   ElementLink<DecisionContainer> el2( *dc, 1, ctx );
   assert ( d3b->setObjectLink( "testlink", el2 ) );
   std::cout << "d3b: " << *d3b << std::endl;
   std::cout << "el2 " << el2.key() << " " << el2.index() << std::endl;
   ElementLink<DecisionContainer > resEl2 = d3b->objectLink<DecisionContainer>("testlink");
+  const Decision* res2 = d3b->object<Decision>("testlink");
   VALUE( resEl2.index() ) EXPECTED ( el2.index() );
   VALUE( resEl2.key() ) EXPECTED ( el2.key() );
+  VALUE( *resEl2.cptr() ) EXPECTED ( res2 );
 
   // check copyLinks (copies all)
   auto d4 = newDecisionIn( dc );
@@ -178,7 +182,8 @@ int main() {
   std::cout << "d3: " << *d3 << std::endl;
   std::cout << "d4: " << *d4 << std::endl;
   std::cout << "el: key " << el.key() << " index " << el.index() << std::endl;
-  ElementLink<DecisionContainer > resElCopied = d4->objectLink<DecisionContainer>("seed");
+  ElementLinkVector<DecisionContainer > resElCopiedVector = d4->objectCollectionLinks<DecisionContainer>("seed");
+  ElementLink<DecisionContainer> resElCopied = resElCopiedVector.front();
   VALUE ( resElCopied.index() ) EXPECTED ( el.index() );
   VALUE ( resElCopied.key() ) EXPECTED ( el.key() );
 
@@ -194,15 +199,19 @@ int main() {
   std::cout << "get d5 feature link " << std::endl;
   ElementLink<DecisionContainer > d5feature = d5->objectLink<DecisionContainer>("feature");
   std::cout << "get d6 feature link " << std::endl;
-  ElementLink<DecisionContainer > d6feature = d6->objectLink<DecisionContainer>("feature");
+  // We have to get this recursivly
+  LinkInfo<DecisionContainer> linkInfo = findLink<DecisionContainer>(d6, "feature");
+  VALUE ( linkInfo.isValid() ) EXPECTED ( true );
+  ElementLink<DecisionContainer > d6feature = linkInfo.link;
   std::cout << "compare feature links " << std::endl;
   VALUE ( d5feature.index() ) EXPECTED ( d6feature.index() );
   VALUE ( d5feature.key() ) EXPECTED ( d6feature.key() );
   std::cout << "get self and seed links " << std::endl;
   auto d5self = d5->objectLink<DecisionContainer>("self");
-  auto d6seed = d6->objectLink<DecisionContainer>("seed");
-  VALUE ( d5self.index()  ) EXPECTED ( d6seed.index() );
-  VALUE ( d5self.key()  ) EXPECTED ( d6seed.key() );
+  auto d6seedVector = getLinkToPrevious(d6);
+  auto d6seed = d6seedVector.front();
+  VALUE ( d5self.index() ) EXPECTED ( d6seed.index() );
+  VALUE ( d5self.key()   ) EXPECTED ( d6seed.key()   );
 
   return 0;
   
diff --git a/Trigger/TrigSteer/TrigSteering/src/ResultBuilder.cxx b/Trigger/TrigSteer/TrigSteering/src/ResultBuilder.cxx
index 15de84eae0ad378110cb21652fca08e0ccf44fe8..c298c238a60d32c6e8d6638ba9ab5fe02f1f7a74 100755
--- a/Trigger/TrigSteer/TrigSteering/src/ResultBuilder.cxx
+++ b/Trigger/TrigSteer/TrigSteering/src/ResultBuilder.cxx
@@ -614,6 +614,7 @@ ErrorCode ResultBuilder::fillTriggerInfo(const std::vector<SteeringChain*>& acti
   }
   
 
+#if 0
   //create xAOD::StreamTags
   std::vector < xAOD::EventInfo::StreamTag > xAODStreamTags;
   for (auto streamtag : m_uniqueStreams){
@@ -625,6 +626,7 @@ ErrorCode ResultBuilder::fillTriggerInfo(const std::vector<SteeringChain*>& acti
   xAOD::EventInfo* xeventInfo = const_cast<xAOD::EventInfo*>(constxEventInfo);
   xeventInfo->setStreamTags(xAODStreamTags);
   ATH_MSG_VERBOSE("Updated xAOD::StreamTags into xAOD::EventInfo:");
+#endif
   
   
    return HLT::OK;
diff --git a/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.cxx b/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.cxx
index 3929467e0389e801badc70d4508103ae34c6f7a5..f952bea82082e2181e2d1cc13b2378b38eca0346 100644
--- a/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.cxx
+++ b/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.cxx
@@ -13,7 +13,7 @@
 using namespace TrigCompositeUtils;
 
 EventViewCreatorAlgorithm::EventViewCreatorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
-  : InputMakerBase( name, pSvcLocator ) {}
+: InputMakerBase( name, pSvcLocator ) {}
 
 EventViewCreatorAlgorithm::~EventViewCreatorAlgorithm(){}
 
@@ -31,7 +31,7 @@ StatusCode EventViewCreatorAlgorithm::execute( const EventContext& context ) con
   // create the output decisions, similar to inputs (copy basic links)
   std::vector< SG::WriteHandle<TrigCompositeUtils::DecisionContainer> > outputHandles;
   ATH_CHECK (decisionInputToOutput(context, outputHandles));
- 
+
   // make the views
   auto viewsHandle = SG::makeHandle( m_viewsKey ); 
   auto viewVector1 = std::make_unique< ViewContainer >();
@@ -46,7 +46,7 @@ StatusCode EventViewCreatorAlgorithm::execute( const EventContext& context ) con
   unsigned int conditionsRun = context.getExtension<Atlas::ExtendedEventContext>().conditionsRun();
 
   //map all RoIs that are stored
-  std::vector <ElementLink<TrigRoiDescriptorCollection> > RoIsFromDecision;
+  ElementLinkVector<TrigRoiDescriptorCollection> RoIsFromDecision;
 
   // loop over decisions
   for (auto outputHandle: outputHandles) {
@@ -63,39 +63,40 @@ StatusCode EventViewCreatorAlgorithm::execute( const EventContext& context ) con
     // loop over output decisions in container of outputHandle, follow link to inputDecision
     for ( auto outputDecision : *outputHandle){ 
       ElementLinkVector<DecisionContainer> inputLinks = getLinkToPrevious(outputDecision);
+      ATH_MSG_DEBUG( "Got inputLinks with " << inputLinks.size() << " elements" );
       // loop over input links as predecessors
       for (auto input: inputLinks){
-	const Decision* inputDecision = *input;
-	// find the RoI
-	auto roiELInfo = TrigCompositeUtils::findLink<TrigRoiDescriptorCollection>( inputDecision, m_roisLink.value() );
-	auto roiEL = roiELInfo.link;
-	ATH_CHECK( roiEL.isValid() );
-	// check if already found
-	auto roiIt=find(RoIsFromDecision.begin(), RoIsFromDecision.end(), roiEL);
-	if ( roiIt == RoIsFromDecision.end() ){
-	  RoIsFromDecision.push_back(roiEL); // just to keep track of which we have used 
-	  const TrigRoiDescriptor* roi = *roiEL;
-	  ATH_MSG_DEBUG("Found RoI:" <<*roi<<" FS="<<roi->isFullscan());
-	  ATH_MSG_DEBUG( "Positive decisions on RoI, preparing view" );
-	  
-	  // make the view
-	  ATH_MSG_DEBUG( "Making the View" );
-	  auto newView = ViewHelper::makeView( name()+"_view", viewCounter++, m_viewFallThrough ); //pointer to the view
-	  viewVector->push_back( newView );
-	  contexts.emplace_back( context );
-	  contexts.back().setExtension( Atlas::ExtendedEventContext( viewVector->back(), conditionsRun, roi ) );
-	  
-	  // link decision to this view
-	  outputDecision->setObjectLink( "view", ElementLink< ViewContainer >(m_viewsKey.key(), viewVector->size()-1 ));//adding view to TC
-	  ATH_MSG_DEBUG( "Adding new view to new decision; storing view in viewVector component " << viewVector->size()-1 );
-	  ATH_CHECK( linkViewToParent( inputDecision, viewVector->back() ) );
-	  ATH_CHECK( placeRoIInView( roi, viewVector->back(), contexts.back() ) );	
-	}
-	else {
-	  int iview = roiIt-RoIsFromDecision.begin();
-	  outputDecision->setObjectLink( "view", ElementLink< ViewContainer >(m_viewsKey.key(), iview ) ); //adding view to TC
-	  ATH_MSG_DEBUG( "Adding already mapped view " << iview << " in ViewVector , to new decision");
-	}
+        const Decision* inputDecision = *input;
+        // find the RoI
+        auto roiELInfo = TrigCompositeUtils::findLink<TrigRoiDescriptorCollection>( inputDecision, m_roisLink.value() );
+        auto roiEL = roiELInfo.link;
+        ATH_CHECK( roiEL.isValid() );
+        // check if already found
+        auto roiIt=find(RoIsFromDecision.begin(), RoIsFromDecision.end(), roiEL);
+        if ( roiIt == RoIsFromDecision.end() ){
+          RoIsFromDecision.push_back(roiEL); // just to keep track of which we have used 
+          const TrigRoiDescriptor* roi = *roiEL;
+          ATH_MSG_DEBUG("Found RoI:" <<*roi<<" FS="<<roi->isFullscan());
+          ATH_MSG_DEBUG("Positive decisions on RoI, preparing view" );
+          
+          // make the view
+          ATH_MSG_DEBUG( "Making the View" );
+          auto newView = ViewHelper::makeView( name()+"_view", viewCounter++, m_viewFallThrough ); //pointer to the view
+          viewVector->push_back( newView );
+          contexts.emplace_back( context );
+          contexts.back().setExtension( Atlas::ExtendedEventContext( viewVector->back(), conditionsRun, roi ) );
+          
+          // link decision to this view
+          outputDecision->setObjectLink( "view", ElementLink< ViewContainer >(m_viewsKey.key(), viewVector->size()-1 ));//adding view to TC
+          ATH_MSG_DEBUG( "Adding new view to new decision; storing view in viewVector component " << viewVector->size()-1 );
+          ATH_CHECK( linkViewToParent( inputDecision, viewVector->back() ) );
+          ATH_CHECK( placeRoIInView( roi, viewVector->back(), contexts.back() ) );  
+        }
+        else {
+          int iview = roiIt - RoIsFromDecision.begin();
+          outputDecision->setObjectLink( "view", ElementLink< ViewContainer >(m_viewsKey.key(), iview ) ); //adding view to TC
+          ATH_MSG_DEBUG( "Adding already mapped view " << iview << " in ViewVector , to new decision");
+        }
       }// loop over previous inputs
     } // loop over decisions   
   }// loop over output keys
@@ -105,9 +106,9 @@ StatusCode EventViewCreatorAlgorithm::execute( const EventContext& context ) con
 
   ATH_MSG_DEBUG( "Launching execution in " << viewVector->size() << " views" );
   ATH_CHECK( ViewHelper::ScheduleViews( viewVector,           // Vector containing views
-					m_viewNodeName,             // CF node to attach views to
-					context,                    // Source context
-					m_scheduler.get() ) );
+          m_viewNodeName,             // CF node to attach views to
+          context,                    // Source context
+          m_scheduler.get() ) );
   
   // report number of views, stored already when container was created
   // auto viewsHandle = SG::makeHandle( m_viewsKey );
@@ -132,8 +133,8 @@ StatusCode EventViewCreatorAlgorithm::linkViewToParent( const TrigCompositeUtils
     if ( m_requireParentView ) {
       ATH_MSG_ERROR( "Parent view not linked because it could not be found" );
       ATH_MSG_ERROR( TrigCompositeUtils::dump( inputDecision, [](const xAOD::TrigComposite* tc){ 
-								return "TC " + tc->name() + ( tc->hasObjectLink("view") ? " has view " : " has no view " );
-							      } ) );
+        return "TC " + tc->name() + ( tc->hasObjectLink("view") ? " has view " : " has no view " );
+      } ) );
       return StatusCode::FAILURE;
     }
     
@@ -146,7 +147,7 @@ StatusCode EventViewCreatorAlgorithm::placeRoIInView( const TrigRoiDescriptor* r
   auto oneRoIColl = std::make_unique< ConstDataVector<TrigRoiDescriptorCollection> >();    
   oneRoIColl->clear( SG::VIEW_ELEMENTS ); //Don't delete the RoIs
   oneRoIColl->push_back( roi );
-	
+  
   //store the RoI in the view
   auto handle = SG::makeHandle( m_inViewRoIs, context );
   ATH_CHECK( handle.setProxyDict( view ) );
diff --git a/Trigger/TrigTools/TrigFTKTrackConverter/python/TrigFTKTrackConverter_Config.py b/Trigger/TrigTools/TrigFTKTrackConverter/python/TrigFTKTrackConverter_Config.py
index 0030fd1b73887eda8cb5e53f996f969399b9b92e..92dd11e939e88f103940b75ef0de7e9abf47d5cf 100644
--- a/Trigger/TrigTools/TrigFTKTrackConverter/python/TrigFTKTrackConverter_Config.py
+++ b/Trigger/TrigTools/TrigFTKTrackConverter/python/TrigFTKTrackConverter_Config.py
@@ -68,7 +68,7 @@ class ConfiguredTrigFTKTool(TrigFTKClusterConverterTool):
     def __init__(self, name = "ConfiguredTrigFTKClusterConverterTool"):
         TrigFTKClusterConverterTool.__init__(self, name) 
         from AthenaCommon.AppMgr import ToolSvc
-        from SiLorentzAngleSvc.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
+        from SiLorentzAngleTool.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
         sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup()
         TrigFTKClusterConverterTool.PixelLorentzAngleTool = ToolSvc.InDetTrigPixelLorentzAngleTool
         TrigFTKClusterConverterTool.SCTLorentzAngleTool = sctLorentzAngleToolSetup.SCTLorentzAngleTool
diff --git a/Trigger/TrigTools/TrigInDetConf/python/TrigInDetRecToolsFTK.py b/Trigger/TrigTools/TrigInDetConf/python/TrigInDetRecToolsFTK.py
index c62802a90a8d93ee406513101619b2c510fb9250..9cc70329891002abc20cd4d13989095e9ea9fd59 100644
--- a/Trigger/TrigTools/TrigInDetConf/python/TrigInDetRecToolsFTK.py
+++ b/Trigger/TrigTools/TrigInDetConf/python/TrigInDetRecToolsFTK.py
@@ -54,7 +54,7 @@ if (InDetTrigFlags.doPrintConfigurables()):
   print InDetTrigBroadPixelClusterOnTrackToolFTK
   
 # SiLorentzAngleTool for SCT
-from SiLorentzAngleSvc.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
+from SiLorentzAngleTool.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
 sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup()
 
 InDetTrigBroadSCT_ClusterOnTrackToolFTK = FTK_SCTClusterOnTrackTool("InDetTrigBroadSCT_ClusterOnTrackToolFTK",
diff --git a/Trigger/TrigTools/TrigInDetTrackFitter/python/TrigInDetTrackFitter_Config.py b/Trigger/TrigTools/TrigInDetTrackFitter/python/TrigInDetTrackFitter_Config.py
index 0af00a77642ee1a8c6fa2258f940a986bcdb9058..7930fe15ed88a6de4a4b398c91323c068a3e36f8 100644
--- a/Trigger/TrigTools/TrigInDetTrackFitter/python/TrigInDetTrackFitter_Config.py
+++ b/Trigger/TrigTools/TrigInDetTrackFitter/python/TrigInDetTrackFitter_Config.py
@@ -68,7 +68,7 @@ class ConfiguredTrigL2_InDetRotCreator(Trk__RIO_OnTrackCreator) :
         from InDetTrigRecExample.InDetTrigFlags import InDetTrigFlags
         
         # SiLorentzAngleTool
-        from SiLorentzAngleSvc.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
+        from SiLorentzAngleTool.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
         sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup()
 
         if InDetTrigFlags.doCommissioning() :
diff --git a/Trigger/TrigTools/TrigOnlineSpacePointTool/python/TrigOnlineSpacePointTool_Config.py b/Trigger/TrigTools/TrigOnlineSpacePointTool/python/TrigOnlineSpacePointTool_Config.py
index b55388c2af0bf1ea6a5ebc13014f8b15be85c3bc..7d3225a1a0938f65f9e04dd2e6a764c69e5fbfde 100644
--- a/Trigger/TrigTools/TrigOnlineSpacePointTool/python/TrigOnlineSpacePointTool_Config.py
+++ b/Trigger/TrigTools/TrigOnlineSpacePointTool/python/TrigOnlineSpacePointTool_Config.py
@@ -25,7 +25,7 @@ class ConfiguredOnlineSpacePointProviderTool(OnlineSpacePointProviderTool) :
         from InDetTrigRecExample.InDetTrigFlags import InDetTrigFlags
 
         # --- SiLorentzAngleTool
-        from SiLorentzAngleSvc.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
+        from SiLorentzAngleTool.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
         sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup()
         
         InDetL2TrigClusterMakerTool = InDet__ClusterMakerTool( name = "InDetL2TrigClusterMakerTool",
@@ -59,7 +59,7 @@ class ConfiguredOnlineSpacePointProviderTool(OnlineSpacePointProviderTool) :
         ToolSvc += InDetL2TrigSCT_ClusteringTool
 
         # SiLorentzAngleTool for FastSCT_RodDecoder
-        from SiLorentzAngleSvc.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
+        from SiLorentzAngleTool.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
         sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup() 
 
         # FastSCT_RodDecoder
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt b/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt
index 1812e23ad028517cf2a952c8838e4a4fc326b834..27a0c889194d815d2973eccea04ee4c3d0da632a 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt
+++ b/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt
@@ -139,7 +139,7 @@ atlas_add_test( jetMenu
 file( MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_fullMenu )
 atlas_add_test( fullMenu
    SCRIPT test/test_full_menu_build.sh
-   POST_EXEC_SCRIPT "trig-art-result-parser.sh fullMenu.log \"athena CheckLog RegTest RootComp\""
+   POST_EXEC_SCRIPT "trig-art-result-parser.sh fullMenu.log \"athena CheckLog RegTest\""
    PROPERTIES TIMEOUT 1000
    PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_fullMenu
    )
@@ -175,7 +175,7 @@ atlas_add_test( EmuStepProcessing
 file( MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_NewJO )
 atlas_add_test( NewJO
    SCRIPT test/test_newJO_build.sh
-   POST_EXEC_SCRIPT "trig-art-result-parser.sh NewJO.log \"Configuration athena CheckLog RegTest RootComp\""
+   POST_EXEC_SCRIPT "trig-art-result-parser.sh NewJO.log \"Configuration athena CheckLog RegTest\""
    PROPERTIES TIMEOUT 1000
    PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_NewJO
    )
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/InDetConfig.py b/Trigger/TrigValidation/TrigUpgradeTest/python/InDetConfig.py
index aa5e993d021cce89244bc306e401e1f74d54b78c..3c78e43548369302a7c24e16b155cb710c5c3561 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/python/InDetConfig.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/python/InDetConfig.py
@@ -4,6 +4,31 @@
 
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 
+class InDetCacheNames:
+  Pixel_ClusterKey   = "PixelTrigClustersCache"
+  SCT_ClusterKey     = "SCT_ClustersCache"
+  SpacePointCachePix = "PixelSpacePointCache"
+  SpacePointCacheSCT = "SctSpacePointCache"
+  SCTRDOCacheKey     = "SctRDOCache"
+  PixRDOCacheKey     = "PixRDOCache"
+
+def InDetIDCCacheCreatorCfg():
+  #Create IdentifiableCaches
+  acc = ComponentAccumulator()
+  from InDetPrepRawDataFormation.InDetPrepRawDataFormationConf import InDet__CacheCreator
+  InDetCacheCreatorTrig = InDet__CacheCreator(name = "InDetCacheCreatorTrig",
+                                       Pixel_ClusterKey   = InDetCacheNames.Pixel_ClusterKey,
+                                       SCT_ClusterKey     = InDetCacheNames.SCT_ClusterKey,
+                                       SpacePointCachePix = InDetCacheNames.SpacePointCachePix,
+                                       SpacePointCacheSCT = InDetCacheNames.SpacePointCacheSCT,
+                                       SCTRDOCacheKey     = InDetCacheNames.SCTRDOCacheKey,
+                                       PixRDOCacheKey     = InDetCacheNames.PixRDOCacheKey)
+
+  acc.addEventAlgo( InDetCacheCreatorTrig )
+  return acc
+
+
+
 #Set up ID GeoModel
 def InDetGMConfig( flags ):
   acc = ComponentAccumulator()
@@ -116,12 +141,12 @@ def TrigInDetCondConfig( flags ):
   acc.addCondAlgo(SCT_SiliconTempCondAlg(UseState = dcsTool.ReadAllDBFolders, DCSConditionsTool = dcsTool))
 
 
-  from SiLorentzAngleSvc.SiLorentzAngleSvcConf import SCTSiLorentzAngleCondAlg
+  from SiLorentzAngleTool.SiLorentzAngleToolConf import SCTSiLorentzAngleCondAlg
   acc.addCondAlgo(SCTSiLorentzAngleCondAlg(name = "SCTSiLorentzAngleCondAlg",
                                       SiConditionsTool = sctSiliconConditionsTool,
                                       UseMagFieldSvc = True,
                                       UseMagFieldDcs = False))
-  from SiLorentzAngleSvc.SiLorentzAngleSvcConf import SiLorentzAngleTool
+  from SiLorentzAngleTool.SiLorentzAngleToolConf import SiLorentzAngleTool
   SCTLorentzAngleTool = SiLorentzAngleTool(name = "SCTLorentzAngleTool", DetectorName="SCT", SiLorentzAngleCondData="SCTSiLorentzAngleCondData")
   SCTLorentzAngleTool.UseMagFieldSvc = True #may need also MagFieldSvc instance
   acc.addPublicTool(SCTLorentzAngleTool)
@@ -177,13 +202,13 @@ def TrigInDetCondConfig( flags ):
 
   acc.addPublicTool(TrigSiPropertiesTool)
 
-  from SiLorentzAngleSvc.SiLorentzAngleSvcConf import PixelSiLorentzAngleCondAlg
+  from SiLorentzAngleTool.SiLorentzAngleToolConf import PixelSiLorentzAngleCondAlg
   acc.addCondAlgo(PixelSiLorentzAngleCondAlg(name="PixelSiLorentzAngleCondAlg",
                                           SiPropertiesTool=TrigSiPropertiesTool,
                                           UseMagFieldSvc = True,
                                           UseMagFieldDcs = False))
 
-  from SiLorentzAngleSvc.SiLorentzAngleSvcConf import SiLorentzAngleTool
+  from SiLorentzAngleTool.SiLorentzAngleToolConf import SiLorentzAngleTool
   TrigPixelLorentzAngleTool = SiLorentzAngleTool(name = "PixelLorentzAngleTool", DetectorName="Pixel", SiLorentzAngleCondData="PixelSiLorentzAngleCondData")
 
   acc.addPublicTool(TrigPixelLorentzAngleTool)
@@ -203,17 +228,6 @@ def TrigInDetConfig( flags, roisKey="EMRoIs" ):
   acc.merge(TrigInDetCondConfig(flags))
 
   from InDetRecExample.InDetKeys import InDetKeys
-  #Create IdentifiableCaches
-  from InDetPrepRawDataFormation.InDetPrepRawDataFormationConf import InDet__CacheCreator
-  InDetCacheCreatorTrigViews = InDet__CacheCreator(name = "InDetCacheCreatorTrigViews",
-                                       Pixel_ClusterKey = "PixelTrigClustersCache",
-                                       SCT_ClusterKey   = "SCT_ClustersCache",
-                                       SpacePointCachePix = "PixelSpacePointCache",
-                                       SpacePointCacheSCT   = "SctSpacePointCache",
-                                       SCTRDOCacheKey       = "SctRDOCache",
-                                       PixRDOCacheKey = "PixRDOCache",)
-
-  acc.addCondAlgo( InDetCacheCreatorTrigViews )
 
   #Only add raw data decoders if we're running over raw data
   isMC = flags.Input.isMC
@@ -238,7 +252,7 @@ def TrigInDetConfig( flags, roisKey="EMRoIs" ):
                                                      #OutputLevel = INFO)
     InDetPixelRawDataProvider.isRoI_Seeded = True
     InDetPixelRawDataProvider.RoIs = roisKey
-    InDetPixelRawDataProvider.RDOCacheKey = InDetCacheCreatorTrigViews.PixRDOCacheKey
+    InDetPixelRawDataProvider.RDOCacheKey = InDetCacheNames.PixRDOCacheKey
     acc.addEventAlgo(InDetPixelRawDataProvider)
 
 
@@ -262,7 +276,7 @@ def TrigInDetConfig( flags, roisKey="EMRoIs" ):
                                                 #OutputLevel = INFO)
     InDetSCTRawDataProvider.isRoI_Seeded = True
     InDetSCTRawDataProvider.RoIs = roisKey
-    InDetSCTRawDataProvider.RDOCacheKey = InDetCacheCreatorTrigViews.SCTRDOCacheKey
+    InDetSCTRawDataProvider.RDOCacheKey = InDetCacheNames.SCTRDOCacheKey
 
     acc.addEventAlgo(InDetSCTRawDataProvider)
 
@@ -337,7 +351,7 @@ def TrigInDetConfig( flags, roisKey="EMRoIs" ):
                                                         ClustersName            = "PixelTrigClusters",)# OutputLevel = INFO)
   InDetPixelClusterization.isRoI_Seeded = True
   InDetPixelClusterization.RoIs = roisKey
-  InDetPixelClusterization.ClusterContainerCacheKey = InDetCacheCreatorTrigViews.Pixel_ClusterKey
+  InDetPixelClusterization.ClusterContainerCacheKey = InDetCacheNames.Pixel_ClusterKey
 
   acc.addEventAlgo(InDetPixelClusterization)
 
@@ -382,7 +396,7 @@ def TrigInDetConfig( flags, roisKey="EMRoIs" ):
                                                       conditionsTool          = InDetSCT_ConditionsSummaryToolWithoutFlagged)
   InDetSCT_Clusterization.isRoI_Seeded = True
   InDetSCT_Clusterization.RoIs = roisKey
-  InDetSCT_Clusterization.ClusterContainerCacheKey = InDetCacheCreatorTrigViews.SCT_ClusterKey
+  InDetSCT_Clusterization.ClusterContainerCacheKey = InDetCacheNames.SCT_ClusterKey
 
   acc.addEventAlgo(InDetSCT_Clusterization)
 
@@ -405,8 +419,8 @@ def TrigInDetConfig( flags, roisKey="EMRoIs" ):
                                                                     ProcessPixels          = DetFlags.haveRIO.pixel_on(),
                                                                     ProcessSCTs            = DetFlags.haveRIO.SCT_on(),
                                                                     ProcessOverlaps        = DetFlags.haveRIO.SCT_on(),
-                                                                    SpacePointCacheSCT = InDetCacheCreatorTrigViews.SpacePointCacheSCT,
-                                                                    SpacePointCachePix = InDetCacheCreatorTrigViews.SpacePointCachePix,)
+                                                                    SpacePointCacheSCT = InDetCacheNames.SpacePointCacheSCT,
+                                                                    SpacePointCachePix = InDetCacheNames.SpacePointCachePix,)
                                                                     #OutputLevel=INFO)
 
   acc.addEventAlgo(InDetSiTrackerSpacePointFinder)
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/InDetPT.py b/Trigger/TrigValidation/TrigUpgradeTest/python/InDetPT.py
new file mode 100644
index 0000000000000000000000000000000000000000..ef33054cedfb73ac5e8401213afacfef6e34fc56
--- /dev/null
+++ b/Trigger/TrigValidation/TrigUpgradeTest/python/InDetPT.py
@@ -0,0 +1,132 @@
+#  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+#
+#           Setup of precision tracking
+
+def makeInDetPrecisionTracking( whichSignature, verifier = False, inputFTFtracks='TrigFastTrackFinder_Tracks', outputTrackPrefixName = "InDetTrigPT" ):
+#def makeInDetPrecisionTracking( whichSignature, inputFTFtracks='TrigFastTrackFinder_Tracks', outputTrackPrefixName = "InDetTrigPT" ):
+  from AthenaCommon.AppMgr import ToolSvc
+
+#def makeInDetPrecisionTracking( whichSignature, inputFTFtracks, outputTrackPrefixName ):
+  #If signature specified add suffix to the algorithms
+  signature =  "_" + whichSignature if whichSignature else ''
+  
+  #Name settings
+  
+  #This first part is for ambiguity solver tracks
+  nameAmbiTrackCollection = outputTrackPrefixName + "Tracks" + signature
+  nameAmbiTrackParticles  = outputTrackPrefixName + "TrackParticles" + signature 
+  
+  
+  
+  #Potentialy other algs with more collections? Make a list just in case
+  nameTrackCollections = [ nameAmbiTrackCollection ]
+  nameTrackParticles = [ nameAmbiTrackParticles ]
+  
+  
+
+  #If run in views need to check data dependancies!
+  #if runInViews: 
+  #FIXME: check whether the passed argument is a verifier?
+  #NOTE: this seems necessary only when PT is called from a different view than FTF otherwise causes stalls
+  if verifier:
+         verifier.DataObjects += [  ( 'InDet::PixelGangedClusterAmbiguities' , 'StoreGateSvc+TrigPixelClusterAmbiguitiesMap' ),
+                                  ( 'TrackCollection' , 'StoreGateSvc+' + inputFTFtracks ) ] 
+      
+   
+
+  
+  #
+  # --- Ambiguity solver algorithm
+  #
+  #TODO:Check whether InDet alg have to be replaced by new ones
+  from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigTrackSummaryTool
+  from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigExtrapolator
+  from InDetTrackScoringTools.InDetTrackScoringToolsConf import InDet__InDetAmbiScoringTool
+  InDetTrigMTAmbiScoringTool =  InDet__InDetAmbiScoringTool( name                        = 'InDetTrigMTScoringTool' + signature ,
+                                                             Extrapolator                = InDetTrigExtrapolator,
+                                                             InputEmClusterContainerName = '', #need to be reset to empty string
+                                                             doEmCaloSeed                = False,
+                                                             SummaryTool                 = InDetTrigTrackSummaryTool)
+  
+  
+  
+  ToolSvc += InDetTrigMTAmbiScoringTool
+  
+  from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigAmbiTrackSelectionTool
+  from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigTrackFitter
+  from TrkAmbiguityProcessor.TrkAmbiguityProcessorConf import Trk__SimpleAmbiguityProcessorTool as ProcessorTool
+  InDetTrigMTAmbiguityProcessor = ProcessorTool(name          = 'InDetTrigMTAmbiguityProcessor' + signature,
+                                                Fitter        = InDetTrigTrackFitter,
+                                                ScoringTool   = InDetTrigMTAmbiScoringTool,
+                                                SelectionTool = InDetTrigAmbiTrackSelectionTool)
+  
+  
+  ToolSvc += InDetTrigMTAmbiguityProcessor
+  
+  
+  from TrkAmbiguitySolver.TrkAmbiguitySolverConf import Trk__TrkAmbiguitySolver
+  InDetTrigMTAmbiguitySolver = Trk__TrkAmbiguitySolver(name         = 'InDetTrigMTAmbiguitySolver' + signature,
+                                                       TrackInput         =[ inputFTFtracks ],
+                                                       TrackOutput        = nameAmbiTrackCollection, 
+                                                       AmbiguityProcessor = InDetTrigMTAmbiguityProcessor)
+  
+  #allViewAlgorithms += InDetTrigMTAmbiguitySolver
+  
+  
+  #
+  # --- Track particle conversion algorithm
+  #
+  
+  
+  from TrkParticleCreator.TrkParticleCreatorConf import Trk__TrackParticleCreatorTool
+  InDetTrigMTxAODParticleCreatorTool = Trk__TrackParticleCreatorTool(name =  "InDetTrigMTxAODParticleCreatorTool" + signature,
+                                                                     Extrapolator = InDetTrigExtrapolator,
+                                                                     #ForceTrackSummaryUpdate = False,
+                                                                     #TrackSummaryTool = InDetTrigTrackSummaryToolSharedHits) 
+                                                                     TrackSummaryTool = InDetTrigTrackSummaryTool)
+  
+  ToolSvc += InDetTrigMTxAODParticleCreatorTool
+  print InDetTrigMTxAODParticleCreatorTool
+  
+  
+  from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__TrackCollectionCnvTool
+  InDetTrigMTxAODTrackCollectionCnvTool= xAODMaker__TrackCollectionCnvTool(name = "InDetTrigMTxAODTrackCollectionCnvTool" + signature,
+                                                                           TrackParticleCreator = InDetTrigMTxAODParticleCreatorTool)
+  
+  ToolSvc += InDetTrigMTxAODTrackCollectionCnvTool
+  print InDetTrigMTxAODTrackCollectionCnvTool
+  
+  #This one shouldn't be necessary
+  #TODO: obsolete turn off
+  from xAODTrackingCnv.xAODTrackingCnvConf import  xAODMaker__RecTrackParticleContainerCnvTool
+  InDetTrigMTRecTrackParticleContainerCnvTool=  xAODMaker__RecTrackParticleContainerCnvTool(name = "InDetTrigMTRecTrackContainerCnvTool" + signature,
+                                                                                            TrackParticleCreator = InDetTrigMTxAODParticleCreatorTool)
+  
+  ToolSvc += InDetTrigMTRecTrackParticleContainerCnvTool
+  print InDetTrigMTRecTrackParticleContainerCnvTool
+  
+  from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__TrackParticleCnvAlg
+  InDetTrigMTxAODTrackParticleCnvAlg = xAODMaker__TrackParticleCnvAlg(name = "InDetTrigMTxAODParticleCreatorAlg" + signature,
+                                                                      # Properties below are used for:  TrackCollection -> xAOD::TrackParticle
+                                                                        ConvertTracks = True,  #Turn on  retrieve of TrackCollection, false by default
+                                                                        TrackContainerName = nameAmbiTrackCollection,
+                                                                        xAODTrackParticlesFromTracksContainerName = nameAmbiTrackParticles, 
+                                                                        TrackCollectionCnvTool = InDetTrigMTxAODTrackCollectionCnvTool,
+                                                                       ## Properties below are used for: Rec:TrackParticle, aod -> xAOD::TrackParticle (Turn off)
+                                                                        ConvertTrackParticles = False,  # Retrieve of Rec:TrackParticle, don't need this atm
+                                                                        xAODContainerName = '',  
+                                                                        RecTrackParticleContainerCnvTool = InDetTrigMTRecTrackParticleContainerCnvTool,
+                                                                        #PrintIDSummaryInfo = True, #Just to test and have some output
+                                                                        TrackParticleCreator = InDetTrigMTxAODParticleCreatorTool
+                                                                        )
+  
+  
+  #allViewAlgorithms += InDetTrigMTxAODTrackParticleCnvAlg
+  print  InDetTrigMTxAODTrackParticleCnvAlg
+  
+  #ToolSvc.InDetTrigHoleSearchTool.SctSummaryTool.InDetTrigInDetSCT_FlaggedConditionTool.SCT_FlaggedCondData = "SCT_FlaggedCondData_TRIG"
+
+  
+  #Return list of Track keys, TrackParticle keys, and PT algs
+  return  nameTrackCollections, nameTrackParticles, [InDetTrigMTAmbiguitySolver, InDetTrigMTxAODTrackParticleCnvAlg]
+  
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/InDetSetup.py b/Trigger/TrigValidation/TrigUpgradeTest/python/InDetSetup.py
index 30c1091e46c9481cdfc1ab234d52f3d3f880a9fc..690e08dc747dca06fdbb0542ccbdd645ce3443a6 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/python/InDetSetup.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/python/InDetSetup.py
@@ -2,13 +2,16 @@
 #  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 #
 
-def makeInDetAlgs():
+def makeInDetAlgs( whichSignature='' ):
+  #If signature specified add suffix to the algorithms
+  signature =  "_" + whichSignature if whichSignature else ''
+
   eventAlgs = []
   viewAlgs = []
   from InDetRecExample.InDetKeys import InDetKeys
   #Create IdentifiableCaches
   from InDetPrepRawDataFormation.InDetPrepRawDataFormationConf import InDet__CacheCreator
-  InDetCacheCreatorTrigViews = InDet__CacheCreator(name = "InDetCacheCreatorTrigViews",
+  InDetCacheCreatorTrigViews = InDet__CacheCreator(name = "InDetCacheCreatorTrigViews" + signature,
                                        Pixel_ClusterKey = "PixelTrigClustersCache",
                                        SCT_ClusterKey   = "SCT_ClustersCache",
                                        SpacePointCachePix = "PixelSpacePointCache",
@@ -27,11 +30,11 @@ def makeInDetAlgs():
     #Pixel
     
     from PixelRawDataByteStreamCnv.PixelRawDataByteStreamCnvConf import PixelRodDecoder
-    InDetPixelRodDecoder = PixelRodDecoder(name = "InDetPixelRodDecoder")
+    InDetPixelRodDecoder = PixelRodDecoder(name = "InDetPixelRodDecoder" + signature)
     ToolSvc += InDetPixelRodDecoder
     
     from PixelRawDataByteStreamCnv.PixelRawDataByteStreamCnvConf import PixelRawDataProviderTool
-    InDetPixelRawDataProviderTool = PixelRawDataProviderTool(name    = "InDetPixelRawDataProviderTool",
+    InDetPixelRawDataProviderTool = PixelRawDataProviderTool(name    = "InDetPixelRawDataProviderTool" + signature,
                                                              Decoder = InDetPixelRodDecoder)
     ToolSvc += InDetPixelRawDataProviderTool
 
@@ -41,7 +44,7 @@ def makeInDetAlgs():
     
     # load the PixelRawDataProvider
     from PixelRawDataByteStreamCnv.PixelRawDataByteStreamCnvConf import PixelRawDataProvider
-    InDetPixelRawDataProvider = PixelRawDataProvider(name         = "InDetPixelRawDataProvider",
+    InDetPixelRawDataProvider = PixelRawDataProvider(name         = "InDetPixelRawDataProvider"+ signature,
                                                      RDOKey       = InDetKeys.PixelRDOs(),
                                                      ProviderTool = InDetPixelRawDataProviderTool,)
                                                      #OutputLevel = INFO)
@@ -58,12 +61,12 @@ def makeInDetAlgs():
     
     #SCT
     from SCT_RawDataByteStreamCnv.SCT_RawDataByteStreamCnvConf import SCT_RodDecoder
-    InDetSCTRodDecoder = SCT_RodDecoder(name          = "InDetSCTRodDecoder",)
+    InDetSCTRodDecoder = SCT_RodDecoder(name          = "InDetSCTRodDecoder" + signature)
                                         # OutputLevel = INFO)
     ToolSvc += InDetSCTRodDecoder
     
     from SCT_RawDataByteStreamCnv.SCT_RawDataByteStreamCnvConf import SCTRawDataProviderTool
-    InDetSCTRawDataProviderTool = SCTRawDataProviderTool(name    = "InDetSCTRawDataProviderTool",
+    InDetSCTRawDataProviderTool = SCTRawDataProviderTool(name    = "InDetSCTRawDataProviderTool" + signature,
                                                         Decoder = InDetSCTRodDecoder)
     ToolSvc += InDetSCTRawDataProviderTool
     if (InDetFlags.doPrintConfigurables()):
@@ -71,7 +74,7 @@ def makeInDetAlgs():
     
     # load the SCTRawDataProvider
     from SCT_RawDataByteStreamCnv.SCT_RawDataByteStreamCnvConf import SCTRawDataProvider
-    InDetSCTRawDataProvider = SCTRawDataProvider(name         = "InDetSCTRawDataProvider",
+    InDetSCTRawDataProvider = SCTRawDataProvider(name         = "InDetSCTRawDataProvider" + signature,
                                                 RDOKey       = InDetKeys.SCT_RDOs(),
                                                 ProviderTool = InDetSCTRawDataProviderTool, )
                                                 #OutputLevel = INFO)
@@ -83,7 +86,7 @@ def makeInDetAlgs():
 
     # load the SCTEventFlagWriter
     from SCT_RawDataByteStreamCnv.SCT_RawDataByteStreamCnvConf import SCTEventFlagWriter
-    InDetSCTEventFlagWriter = SCTEventFlagWriter(name = "InDetSCTEventFlagWriter")
+    InDetSCTEventFlagWriter = SCTEventFlagWriter(name = "InDetSCTEventFlagWriter"+ signature)
 
     viewAlgs.append(InDetSCTEventFlagWriter)
 
@@ -94,23 +97,23 @@ def makeInDetAlgs():
     ServiceMgr += InDetTRTCalDbSvc
     
     from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_StrawStatusSummarySvc
-    InDetTRTStrawStatusSummarySvc = TRT_StrawStatusSummarySvc(name = "InDetTRTStrawStatusSummarySvc")
+    InDetTRTStrawStatusSummarySvc = TRT_StrawStatusSummarySvc(name = "InDetTRTStrawStatusSummarySvc" + signature)
     ServiceMgr += InDetTRTStrawStatusSummarySvc
     
     from TRT_RawDataByteStreamCnv.TRT_RawDataByteStreamCnvConf import TRT_RodDecoder
-    InDetTRTRodDecoder = TRT_RodDecoder(name = "InDetTRTRodDecoder",
+    InDetTRTRodDecoder = TRT_RodDecoder(name = "InDetTRTRodDecoder" + signature,
                                         LoadCompressTableDB = True)#(globalflags.DataSource() != 'geant4'))  
     ToolSvc += InDetTRTRodDecoder
       
     from TRT_RawDataByteStreamCnv.TRT_RawDataByteStreamCnvConf import TRTRawDataProviderTool
-    InDetTRTRawDataProviderTool = TRTRawDataProviderTool(name    = "InDetTRTRawDataProviderTool",
+    InDetTRTRawDataProviderTool = TRTRawDataProviderTool(name    = "InDetTRTRawDataProviderTool" + signature,
                                                           Decoder = InDetTRTRodDecoder)
     ToolSvc += InDetTRTRawDataProviderTool
     
       
     # load the TRTRawDataProvider
     from TRT_RawDataByteStreamCnv.TRT_RawDataByteStreamCnvConf import TRTRawDataProvider
-    InDetTRTRawDataProvider = TRTRawDataProvider(name         = "InDetTRTRawDataProvider",
+    InDetTRTRawDataProvider = TRTRawDataProvider(name         = "InDetTRTRawDataProvider" + signature,
                                                  RDOKey       = "TRT_RDOs",
                                                   ProviderTool = InDetTRTRawDataProviderTool)
     InDetTRTRawDataProvider.isRoI_Seeded = True
@@ -123,7 +126,7 @@ def makeInDetAlgs():
   from InDetTrigRecExample.InDetTrigConfigRecLoadTools import TrigPixelLorentzAngleTool, TrigSCTLorentzAngleTool
   
   from SiClusterizationTool.SiClusterizationToolConf import InDet__ClusterMakerTool
-  InDetClusterMakerTool = InDet__ClusterMakerTool(name                 = "InDetClusterMakerTool",
+  InDetClusterMakerTool = InDet__ClusterMakerTool(name                 = "InDetClusterMakerTool" + signature,
                                                   PixelCalibSvc        = None,
                                                   UsePixelCalibCondDB  = False,
                                                   SCTLorentzAngleTool = TrigSCTLorentzAngleTool,
@@ -133,7 +136,7 @@ def makeInDetAlgs():
   
   
   from SiClusterizationTool.SiClusterizationToolConf import InDet__MergedPixelsTool
-  InDetMergedPixelsTool = InDet__MergedPixelsTool(name                    = "InDetMergedPixelsTool",
+  InDetMergedPixelsTool = InDet__MergedPixelsTool(name                    = "InDetMergedPixelsTool" + signature,
                                                   globalPosAlg            = InDetClusterMakerTool,
                                                   MinimalSplitSize        = 0,
                                                   MaximalSplitSize        = 49,
@@ -143,11 +146,11 @@ def makeInDetAlgs():
   ToolSvc += InDetMergedPixelsTool
   
   from SiClusterizationTool.SiClusterizationToolConf import InDet__PixelGangedAmbiguitiesFinder
-  InDetPixelGangedAmbiguitiesFinder = InDet__PixelGangedAmbiguitiesFinder(name = "InDetPixelGangedAmbiguitiesFinder")
+  InDetPixelGangedAmbiguitiesFinder = InDet__PixelGangedAmbiguitiesFinder(name = "InDetPixelGangedAmbiguitiesFinder" + signature)
   ToolSvc += InDetPixelGangedAmbiguitiesFinder
   
   from InDetPrepRawDataFormation.InDetPrepRawDataFormationConf import InDet__PixelClusterization
-  InDetPixelClusterization = InDet__PixelClusterization(name                    = "InDetPixelClusterization",
+  InDetPixelClusterization = InDet__PixelClusterization(name                    = "InDetPixelClusterization" + signature,
                                                         clusteringTool          = InDetMergedPixelsTool,
                                                         gangedAmbiguitiesFinder = InDetPixelGangedAmbiguitiesFinder,
                                                         DetectorManagerName     = InDetKeys.PixelManager(),
@@ -167,7 +170,7 @@ def makeInDetAlgs():
   # InDetSCT_FlaggedConditionTool = sct_FlaggedConditionToolSetup.getTool()
   
   from SCT_ConditionsTools.SCT_ConditionsSummaryToolSetup import SCT_ConditionsSummaryToolSetup
-  sct_ConditionsSummaryToolSetup = SCT_ConditionsSummaryToolSetup("InDetSCT_ConditionsSummaryTool")
+  sct_ConditionsSummaryToolSetup = SCT_ConditionsSummaryToolSetup("InDetSCT_ConditionsSummaryTool" + signature)
   sct_ConditionsSummaryToolSetup.setup()
   InDetSCT_ConditionsSummaryTool = sct_ConditionsSummaryToolSetup.getTool()
   condTools = []
@@ -177,7 +180,7 @@ def makeInDetAlgs():
     if condTool not in condTools:
       if condTool != "SCT_FlaggedConditionTool/InDetSCT_FlaggedConditionTool":
         condTools.append(condTool)
-  sct_ConditionsSummaryToolSetupWithoutFlagged = SCT_ConditionsSummaryToolSetup("InDetSCT_ConditionsSummaryToolWithoutFlagged")
+  sct_ConditionsSummaryToolSetupWithoutFlagged = SCT_ConditionsSummaryToolSetup("InDetSCT_ConditionsSummaryToolWithoutFlagged" + signature)
   sct_ConditionsSummaryToolSetupWithoutFlagged.setup()
   InDetSCT_ConditionsSummaryToolWithoutFlagged = sct_ConditionsSummaryToolSetupWithoutFlagged.getTool()
   InDetSCT_ConditionsSummaryToolWithoutFlagged.ConditionsTools = condTools
@@ -186,7 +189,7 @@ def makeInDetAlgs():
   # --- SCT_ClusteringTool (public)
   #
   from SiClusterizationTool.SiClusterizationToolConf import InDet__SCT_ClusteringTool
-  InDetSCT_ClusteringTool = InDet__SCT_ClusteringTool(name              = "InDetSCT_ClusteringTool",
+  InDetSCT_ClusteringTool = InDet__SCT_ClusteringTool(name              = "InDetSCT_ClusteringTool" + signature,
                                                       globalPosAlg      = InDetClusterMakerTool,
                                                       conditionsTool    = InDetSCT_ConditionsSummaryToolWithoutFlagged)
   #
@@ -194,7 +197,7 @@ def makeInDetAlgs():
   #
 
   from InDetPrepRawDataFormation.InDetPrepRawDataFormationConf import InDet__SCT_Clusterization
-  InDetSCT_Clusterization = InDet__SCT_Clusterization(name                    = "InDetSCT_Clusterization",
+  InDetSCT_Clusterization = InDet__SCT_Clusterization(name                    = "InDetSCT_Clusterization" + signature,
                                                       clusteringTool          = InDetSCT_ClusteringTool,
                                                       # ChannelStatus         = InDetSCT_ChannelStatusAlg,
                                                       DataObjectName          = InDetKeys.SCT_RDOs(),
@@ -210,12 +213,12 @@ def makeInDetAlgs():
   #Space points and FTF
   
   from SiSpacePointTool.SiSpacePointToolConf import InDet__SiSpacePointMakerTool
-  InDetSiSpacePointMakerTool = InDet__SiSpacePointMakerTool(name = "InDetSiSpacePointMakerTool")
+  InDetSiSpacePointMakerTool = InDet__SiSpacePointMakerTool(name = "InDetSiSpacePointMakerTool" + signature)
   ToolSvc += InDetSiSpacePointMakerTool
 
   from AthenaCommon.DetFlags import DetFlags 
   from SiSpacePointFormation.SiSpacePointFormationConf import InDet__SiTrackerSpacePointFinder
-  InDetSiTrackerSpacePointFinder = InDet__SiTrackerSpacePointFinder(name                   = "InDetSiTrackerSpacePointFinder",
+  InDetSiTrackerSpacePointFinder = InDet__SiTrackerSpacePointFinder(name                   = "InDetSiTrackerSpacePointFinder" + signature,
                                                                     SiSpacePointMakerTool  = InDetSiSpacePointMakerTool,
                                                                     PixelsClustersName     = "PixelTrigClusters",
                                                                     SCT_ClustersName       = "SCT_TrigClusters",
@@ -239,13 +242,13 @@ def makeInDetAlgs():
       # Setup alignment folders and conditions algorithms
       from InDetCondFolders import InDetAlignFolders
       from SiSpacePointFormation.SiSpacePointFormationConf import InDet__SiElementPropertiesTableCondAlg
-      condSeq += InDet__SiElementPropertiesTableCondAlg(name = "InDetSiElementPropertiesTableCondAlg")
+      condSeq += InDet__SiElementPropertiesTableCondAlg(name = "InDetSiElementPropertiesTableCondAlg" + signature)
 
   from TrigInDetConf.TrigInDetRecCommonTools import InDetTrigFastTrackSummaryTool
   from TrigInDetConf.TrigInDetPostTools import  InDetTrigParticleCreatorToolFTF
 
   from InDetTrigParticleCreation.InDetTrigParticleCreationConf import InDet__TrigTrackingxAODCnvMT
-  theTrackParticleCreatorAlg = InDet__TrigTrackingxAODCnvMT(name = "InDetTrigTrackParticleCreatorAlg",
+  theTrackParticleCreatorAlg = InDet__TrigTrackingxAODCnvMT(name = "InDetTrigTrackParticleCreatorAlg" + signature,
                                                            doIBLresidual = False,
                                                            TrackName = "TrigFastTrackFinder_Tracks",
                                                            TrackParticlesName = "xAODTracks",
@@ -253,6 +256,7 @@ def makeInDetAlgs():
   theTrackParticleCreatorAlg.roiCollectionName = "EMViewRoIs"
   viewAlgs.append(theTrackParticleCreatorAlg)
 
-  
+
+
   return (viewAlgs, eventAlgs)
 
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py b/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py
index d02fdb7814448a6630c6cf5211c9009d9b84ebe1..fed58b913d3d1520ae1120316e47780411d02f28 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py
@@ -584,8 +584,32 @@ def muEFCBRecoSequence( RoIs, OutputLevel=INFO ):
   ViewVerifyTrk.DataObjects = [( 'xAOD::TrackParticleContainer' , 'StoreGateSvc+xAODTracks' ),( 'SCT_FlaggedCondData' , 'StoreGateSvc+SCT_FlaggedCondData' ), ( 'InDetBSErrContainer' , 'StoreGateSvc+SCT_ByteStreamErrs' ), ( 'xAOD::EventInfo' , 'StoreGateSvc+EventInfo' ),( 'xAOD::IParticleContainer' , 'StoreGateSvc+xAODTracks' ),( 'SCT_ByteStreamFractionContainer' , 'StoreGateSvc+SCT_ByteStreamFrac' ),( 'Muon::CscStripPrepDataContainer' , 'StoreGateSvc+CSC_Measurements' ),  ( 'Muon::MdtPrepDataContainer' , 'StoreGateSvc+MDT_DriftCircles' ),  ( 'xAOD::TrackParticleContainer' , 'StoreGateSvc+MuonSpectrometerTrackParticles' ) ]
   muEFCBRecoSequence += ViewVerifyTrk
 
+
+  #Precision Tracking 
+  PTAlgs = [] #List of precision tracking algs
+  PTTracks = [] #List of TrackCollectionKeys 
+  PTTrackParticles = [] #List of TrackParticleKeys
+
+  from TrigUpgradeTest.InDetPT import makeInDetPrecisionTracking   
+  #When run in a different view than FTF some data dependencies needs to be loaded through verifier
+  #Pass verifier as an argument and it will automatically append necessary DataObjects
+  #@NOTE: Don't provide any verifier if loaded in the same view as FTF
+  PTTracks, PTTrackParticles, PTAlgs = makeInDetPrecisionTracking( "muons",  ViewVerifyTrk ) 
+
+  #Get last tracks from the list as input for other alg
+
+  ##Not added to the sequence! Causing stall 
+  PTSeq = seqAND("precisionTrackingInMuons", PTAlgs  )
+  muEFCBRecoSequence += PTSeq
+
+  #Default from FTF
+  #trackParticles = "xAODTracks" 
+  #TODO: change according to what needs to be done here
+  #Last key in the list is for the TrackParticles after all PT stages (so far only one :) ) 
+  trackParticles = PTTrackParticles[-1] 
+
   #Make InDetCandidates
-  theIndetCandidateAlg = CfgMgr.MuonCombinedInDetCandidateAlg("TrigMuonCombinedInDetCandidateAlg",TrackSelector=getPublicTool("MuonCombinedInDetDetailedTrackSelectorTool"),TrackParticleLocation = ["xAODTracks"],ForwardParticleLocation="xAODTracks",OutputLevel=DEBUG)
+  theIndetCandidateAlg = CfgMgr.MuonCombinedInDetCandidateAlg("TrigMuonCombinedInDetCandidateAlg",TrackSelector=getPublicTool("MuonCombinedInDetDetailedTrackSelectorTool"),TrackParticleLocation = [ trackParticles ],ForwardParticleLocation=trackParticles,OutputLevel=DEBUG)
 
   #MuonCombinedCandidates
   theCaloMeasTool = getPublicToolClone("TrigCaloMeasTool", "MuidCaloEnergyMeas", CaloNoiseTool="", UseCaloNoiseTool=False,CellContainerLocation="")
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/RunMenuTest.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/RunMenuTest.ref
index e3e3846fd41d159f15b516788dcd1f7094530e1b..8373d8fc4fa8e311a2c270ff4b0b75ee45fe453b 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/RunMenuTest.ref
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/RunMenuTest.ref
@@ -2,8 +2,8 @@ TrigSignatureMoniMT                                INFO Chains passing step (1st
 TrigSignatureMoniMT                                INFO Chain name                   L1,      AfterPS, [... steps ...], Output
 TrigSignatureMoniMT                                INFO All                           20        20        0         0         17        
 TrigSignatureMoniMT                                INFO HLT_e3_etcut_L1EM3            20        20        18        17        17        
-TrigSignatureMoniMT                                INFO HLT_e3_etcut_L1EM3 decisions                      54        262       
+TrigSignatureMoniMT                                INFO HLT_e3_etcut_L1EM3 decisions                      54        342       
 TrigSignatureMoniMT                                INFO HLT_e5_etcut_L1EM3            20        20        17        16        16        
-TrigSignatureMoniMT                                INFO HLT_e5_etcut_L1EM3 decisions                      50        251       
+TrigSignatureMoniMT                                INFO HLT_e5_etcut_L1EM3 decisions                      50        329       
 TrigSignatureMoniMT                                INFO HLT_e7_etcut_L1EM3            20        20        15        14        14        
-TrigSignatureMoniMT                                INFO HLT_e7_etcut_L1EM3 decisions                      36        205       
+TrigSignatureMoniMT                                INFO HLT_e7_etcut_L1EM3 decisions                      36        264       
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/bJetMenu.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/bJetMenu.ref
index bf716b4bc559821984a2cfa5718aef8d52a1b301..7f1e238a59688cd7bbb989cb5d8af67f73a23a08 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/bJetMenu.ref
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/bJetMenu.ref
@@ -1,6 +1,6 @@
-TrigSignatureMoniMT                                INFO HLT_j35_gsc45_bmv2c1070       100       100       30        24        24        
-TrigSignatureMoniMT                                INFO HLT_j35_gsc45_bmv2c1070 decisions                    237       97        
-TrigSignatureMoniMT                                INFO HLT_j35_gsc45_bmv2c1070_split 100       100       30        24        24        
-TrigSignatureMoniMT                                INFO HLT_j35_gsc45_bmv2c1070_split decisions                    237       97        
-TrigSignatureMoniMT                                INFO HLT_j35_gsc45_boffperf_split  100       100       30        24        24        
-TrigSignatureMoniMT                                INFO HLT_j35_gsc45_boffperf_split decisions                    237       97  
+TrigSignatureMoniMT                                INFO HLT_j35_gsc45_bmv2c1070       100       100       28        22        22        
+TrigSignatureMoniMT                                INFO HLT_j35_gsc45_bmv2c1070 decisions                    61        38        
+TrigSignatureMoniMT                                INFO HLT_j35_gsc45_bmv2c1070_split 100       100       28        22        22        
+TrigSignatureMoniMT                                INFO HLT_j35_gsc45_bmv2c1070_split decisions                    61        38        
+TrigSignatureMoniMT                                INFO HLT_j35_gsc45_boffperf_split  100       100       28        22        22        
+TrigSignatureMoniMT                                INFO HLT_j35_gsc45_boffperf_split decisions                    61        38        
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/bJetMenuALLTE.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/bJetMenuALLTE.ref
index bf716b4bc559821984a2cfa5718aef8d52a1b301..7f1e238a59688cd7bbb989cb5d8af67f73a23a08 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/bJetMenuALLTE.ref
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/bJetMenuALLTE.ref
@@ -1,6 +1,6 @@
-TrigSignatureMoniMT                                INFO HLT_j35_gsc45_bmv2c1070       100       100       30        24        24        
-TrigSignatureMoniMT                                INFO HLT_j35_gsc45_bmv2c1070 decisions                    237       97        
-TrigSignatureMoniMT                                INFO HLT_j35_gsc45_bmv2c1070_split 100       100       30        24        24        
-TrigSignatureMoniMT                                INFO HLT_j35_gsc45_bmv2c1070_split decisions                    237       97        
-TrigSignatureMoniMT                                INFO HLT_j35_gsc45_boffperf_split  100       100       30        24        24        
-TrigSignatureMoniMT                                INFO HLT_j35_gsc45_boffperf_split decisions                    237       97  
+TrigSignatureMoniMT                                INFO HLT_j35_gsc45_bmv2c1070       100       100       28        22        22        
+TrigSignatureMoniMT                                INFO HLT_j35_gsc45_bmv2c1070 decisions                    61        38        
+TrigSignatureMoniMT                                INFO HLT_j35_gsc45_bmv2c1070_split 100       100       28        22        22        
+TrigSignatureMoniMT                                INFO HLT_j35_gsc45_bmv2c1070_split decisions                    61        38        
+TrigSignatureMoniMT                                INFO HLT_j35_gsc45_boffperf_split  100       100       28        22        22        
+TrigSignatureMoniMT                                INFO HLT_j35_gsc45_boffperf_split decisions                    61        38        
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/dataScoutingTest.py b/Trigger/TrigValidation/TrigUpgradeTest/share/dataScoutingTest.py
index 19ef84faf0d755e528139c3f5254fa14277c9e50..06ad199e389d1848358a3cae6b11daf0733ba886 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/dataScoutingTest.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/dataScoutingTest.py
@@ -119,7 +119,7 @@ decisionObjectsToRecord = []
 for d in decisionObjects:
     decisionObjectsToRecord.extend([
         "xAOD::TrigCompositeContainer_v1#%s" % d,
-        "xAOD::TrigCompositeAuxContainer_v2#%s.decisions" % d
+        "xAOD::TrigCompositeAuxContainer_v2#%s." % d
     ])
 
 ##########################################
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py b/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py
index 474e1c36b3f0a87a9d39ba72c4bd7f0307f565c5..00c05345fad1382118dc87f2e7a93cd4a9b81cbb 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py
@@ -349,7 +349,7 @@ serialiser = TriggerEDMSerialiserToolCfg("Serialiser")
 serialiser.OutputLevel=VERBOSE
 serialiser.addCollectionListToMainResult([
    "xAOD::TrigCompositeContainer_v1#remap_EgammaCaloDecisions",
-   "xAOD::TrigCompositeAuxContainer_v2#remap_EgammaCaloDecisionsAux.decisions",
+   "xAOD::TrigCompositeAuxContainer_v2#remap_EgammaCaloDecisionsAux.",
    "xAOD::TrigEMClusterContainer_v1#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters",
    "xAOD::TrigEMClusterAuxContainer_v2#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux.RoIword.clusterQuality.e233.e237.e277.e2tsts1.ehad1.emaxs1.energy.energySample.et.eta.eta1.fracs1.nCells.phi.rawEnergy.rawEnergySample.rawEt.rawEta.rawPhi.viewIndex.weta2.wstot",
    "xAOD::TrigElectronContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFex",
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/egammaRunData.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/egammaRunData.ref
index 1c772ff2c5efe1023d0853f5f99752afdcb877a1..0ae91dd2c15987a6d8412bd3200007d23ad0d0a8 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/egammaRunData.ref
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/egammaRunData.ref
@@ -1,129 +1,115 @@
 HLTRMakerAlg.MKTool.Serialiser          0   0     DEBUG xAOD::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 bytes
-HLTRMakerAlg.MKTool.Serialiser          0   0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :380 bytes
-HLTRMakerAlg.MKTool.Serialiser          0   0     DEBUG    Fragment size including 128 bytes from 1x DynAux : 508
+HLTRMakerAlg.MKTool.Serialiser          0   0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :396 bytes
 HLTRMakerAlg.MKTool.Serialiser          0   0     DEBUG xAOD::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
 HLTRMakerAlg.MKTool.Serialiser          0   0     DEBUG xAOD::TrigEMClusterAuxContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :804 bytes
 HLTRMakerAlg.MKTool.Serialiser          0   0     DEBUG    Fragment size including 88 bytes from 1x DynAux : 892
 HLTRMakerAlg.MKTool.Serialiser          0   0     DEBUG xAOD::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
-HLTRMakerAlg.MKTool.Serialiser          0   0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :748 bytes
-HLTRMakerAlg.MKTool.Serialiser          0   0     DEBUG    Fragment size including 1392 bytes from 14x DynAux : 2140
+HLTRMakerAlg.MKTool.Serialiser          0   0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :1116 bytes
+HLTRMakerAlg.MKTool.Serialiser          0   0     DEBUG    Fragment size including 1616 bytes from 14x DynAux : 2732
 HLTRMakerAlg.MKTool.Serialiser          1   0     DEBUG xAOD::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 bytes
-HLTRMakerAlg.MKTool.Serialiser          1   0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :664 bytes
-HLTRMakerAlg.MKTool.Serialiser          1   0     DEBUG    Fragment size including 184 bytes from 1x DynAux : 848
+HLTRMakerAlg.MKTool.Serialiser          1   0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :740 bytes
 HLTRMakerAlg.MKTool.Serialiser          1   0     DEBUG xAOD::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
 HLTRMakerAlg.MKTool.Serialiser          1   0     DEBUG xAOD::TrigEMClusterAuxContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :1764 bytes
 HLTRMakerAlg.MKTool.Serialiser          1   0     DEBUG    Fragment size including 100 bytes from 1x DynAux : 1864
 HLTRMakerAlg.MKTool.Serialiser          1   0     DEBUG xAOD::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
-HLTRMakerAlg.MKTool.Serialiser          1   0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :2864 bytes
-HLTRMakerAlg.MKTool.Serialiser          1   0     DEBUG    Fragment size including 2680 bytes from 14x DynAux : 5544
+HLTRMakerAlg.MKTool.Serialiser          1   0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :3140 bytes
+HLTRMakerAlg.MKTool.Serialiser          1   0     DEBUG    Fragment size including 2848 bytes from 14x DynAux : 5988
 HLTRMakerAlg.MKTool.Serialiser          2   0     DEBUG xAOD::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 bytes
-HLTRMakerAlg.MKTool.Serialiser          2   0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :856 bytes
-HLTRMakerAlg.MKTool.Serialiser          2   0     DEBUG    Fragment size including 204 bytes from 1x DynAux : 1060
+HLTRMakerAlg.MKTool.Serialiser          2   0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :948 bytes
 HLTRMakerAlg.MKTool.Serialiser          2   0     DEBUG xAOD::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
 HLTRMakerAlg.MKTool.Serialiser          2   0     DEBUG xAOD::TrigEMClusterAuxContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :2404 bytes
 HLTRMakerAlg.MKTool.Serialiser          2   0     DEBUG    Fragment size including 108 bytes from 1x DynAux : 2512
 HLTRMakerAlg.MKTool.Serialiser          2   0     DEBUG xAOD::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
-HLTRMakerAlg.MKTool.Serialiser          2   0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :1760 bytes
-HLTRMakerAlg.MKTool.Serialiser          2   0     DEBUG    Fragment size including 2008 bytes from 14x DynAux : 3768
+HLTRMakerAlg.MKTool.Serialiser          2   0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :2864 bytes
+HLTRMakerAlg.MKTool.Serialiser          2   0     DEBUG    Fragment size including 2680 bytes from 14x DynAux : 5544
 HLTRMakerAlg.MKTool.Serialiser          3   0     DEBUG xAOD::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 bytes
-HLTRMakerAlg.MKTool.Serialiser          3   0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :664 bytes
-HLTRMakerAlg.MKTool.Serialiser          3   0     DEBUG    Fragment size including 172 bytes from 1x DynAux : 836
+HLTRMakerAlg.MKTool.Serialiser          3   0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :728 bytes
 HLTRMakerAlg.MKTool.Serialiser          3   0     DEBUG xAOD::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
 HLTRMakerAlg.MKTool.Serialiser          3   0     DEBUG xAOD::TrigEMClusterAuxContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :1764 bytes
 HLTRMakerAlg.MKTool.Serialiser          3   0     DEBUG    Fragment size including 100 bytes from 1x DynAux : 1864
 HLTRMakerAlg.MKTool.Serialiser          3   0     DEBUG xAOD::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
-HLTRMakerAlg.MKTool.Serialiser          3   0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :3324 bytes
-HLTRMakerAlg.MKTool.Serialiser          3   0     DEBUG    Fragment size including 2960 bytes from 14x DynAux : 6284
+HLTRMakerAlg.MKTool.Serialiser          3   0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :3692 bytes
+HLTRMakerAlg.MKTool.Serialiser          3   0     DEBUG    Fragment size including 3184 bytes from 14x DynAux : 6876
 HLTRMakerAlg.MKTool.Serialiser          4   0     DEBUG xAOD::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 bytes
-HLTRMakerAlg.MKTool.Serialiser          4   0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :476 bytes
-HLTRMakerAlg.MKTool.Serialiser          4   0     DEBUG    Fragment size including 152 bytes from 1x DynAux : 628
+HLTRMakerAlg.MKTool.Serialiser          4   0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :516 bytes
 HLTRMakerAlg.MKTool.Serialiser          4   0     DEBUG xAOD::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
 HLTRMakerAlg.MKTool.Serialiser          4   0     DEBUG xAOD::TrigEMClusterAuxContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :1124 bytes
 HLTRMakerAlg.MKTool.Serialiser          4   0     DEBUG    Fragment size including 92 bytes from 1x DynAux : 1216
 HLTRMakerAlg.MKTool.Serialiser          4   0     DEBUG xAOD::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
-HLTRMakerAlg.MKTool.Serialiser          4   0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :1024 bytes
-HLTRMakerAlg.MKTool.Serialiser          4   0     DEBUG    Fragment size including 1560 bytes from 14x DynAux : 2584
+HLTRMakerAlg.MKTool.Serialiser          4   0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :1484 bytes
+HLTRMakerAlg.MKTool.Serialiser          4   0     DEBUG    Fragment size including 1840 bytes from 14x DynAux : 3324
 HLTRMakerAlg.MKTool.Serialiser          5   0     DEBUG xAOD::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 bytes
-HLTRMakerAlg.MKTool.Serialiser          5   0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :948 bytes
-HLTRMakerAlg.MKTool.Serialiser          5   0     DEBUG    Fragment size including 212 bytes from 1x DynAux : 1160
+HLTRMakerAlg.MKTool.Serialiser          5   0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :1052 bytes
 HLTRMakerAlg.MKTool.Serialiser          5   0     DEBUG xAOD::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
 HLTRMakerAlg.MKTool.Serialiser          5   0     DEBUG xAOD::TrigEMClusterAuxContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :2724 bytes
 HLTRMakerAlg.MKTool.Serialiser          5   0     DEBUG    Fragment size including 112 bytes from 1x DynAux : 2836
 HLTRMakerAlg.MKTool.Serialiser          5   0     DEBUG xAOD::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
-HLTRMakerAlg.MKTool.Serialiser          5   0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :4612 bytes
-HLTRMakerAlg.MKTool.Serialiser          5   0     DEBUG    Fragment size including 3744 bytes from 14x DynAux : 8356
+HLTRMakerAlg.MKTool.Serialiser          5   0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :7004 bytes
+HLTRMakerAlg.MKTool.Serialiser          5   0     DEBUG    Fragment size including 5200 bytes from 14x DynAux : 12204
 HLTRMakerAlg.MKTool.Serialiser          6   0     DEBUG xAOD::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 bytes
-HLTRMakerAlg.MKTool.Serialiser          6   0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :380 bytes
-HLTRMakerAlg.MKTool.Serialiser          6   0     DEBUG    Fragment size including 132 bytes from 1x DynAux : 512
+HLTRMakerAlg.MKTool.Serialiser          6   0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :400 bytes
 HLTRMakerAlg.MKTool.Serialiser          6   0     DEBUG xAOD::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
 HLTRMakerAlg.MKTool.Serialiser          6   0     DEBUG xAOD::TrigEMClusterAuxContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :804 bytes
 HLTRMakerAlg.MKTool.Serialiser          6   0     DEBUG    Fragment size including 88 bytes from 1x DynAux : 892
 HLTRMakerAlg.MKTool.Serialiser          6   0     DEBUG xAOD::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
-HLTRMakerAlg.MKTool.Serialiser          6   0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :1208 bytes
-HLTRMakerAlg.MKTool.Serialiser          6   0     DEBUG    Fragment size including 1672 bytes from 14x DynAux : 2880
+HLTRMakerAlg.MKTool.Serialiser          6   0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :840 bytes
+HLTRMakerAlg.MKTool.Serialiser          6   0     DEBUG    Fragment size including 1448 bytes from 14x DynAux : 2288
 HLTRMakerAlg.MKTool.Serialiser          7   0     DEBUG xAOD::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 bytes
-HLTRMakerAlg.MKTool.Serialiser          7   0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :568 bytes
-HLTRMakerAlg.MKTool.Serialiser          7   0     DEBUG    Fragment size including 160 bytes from 1x DynAux : 728
+HLTRMakerAlg.MKTool.Serialiser          7   0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :620 bytes
 HLTRMakerAlg.MKTool.Serialiser          7   0     DEBUG xAOD::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
 HLTRMakerAlg.MKTool.Serialiser          7   0     DEBUG xAOD::TrigEMClusterAuxContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :1444 bytes
 HLTRMakerAlg.MKTool.Serialiser          7   0     DEBUG    Fragment size including 96 bytes from 1x DynAux : 1540
 HLTRMakerAlg.MKTool.Serialiser          7   0     DEBUG xAOD::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
-HLTRMakerAlg.MKTool.Serialiser          7   0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :3048 bytes
-HLTRMakerAlg.MKTool.Serialiser          7   0     DEBUG    Fragment size including 2792 bytes from 14x DynAux : 5840
+HLTRMakerAlg.MKTool.Serialiser          7   0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :2312 bytes
+HLTRMakerAlg.MKTool.Serialiser          7   0     DEBUG    Fragment size including 2344 bytes from 14x DynAux : 4656
 HLTRMakerAlg.MKTool.Serialiser          8   0     DEBUG xAOD::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 bytes
-HLTRMakerAlg.MKTool.Serialiser          8   0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :476 bytes
-HLTRMakerAlg.MKTool.Serialiser          8   0     DEBUG    Fragment size including 160 bytes from 1x DynAux : 636
+HLTRMakerAlg.MKTool.Serialiser          8   0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :524 bytes
 HLTRMakerAlg.MKTool.Serialiser          8   0     DEBUG xAOD::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
 HLTRMakerAlg.MKTool.Serialiser          8   0     DEBUG xAOD::TrigEMClusterAuxContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :1124 bytes
 HLTRMakerAlg.MKTool.Serialiser          8   0     DEBUG    Fragment size including 92 bytes from 1x DynAux : 1216
 HLTRMakerAlg.MKTool.Serialiser          8   0     DEBUG xAOD::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
-HLTRMakerAlg.MKTool.Serialiser          8   0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :840 bytes
-HLTRMakerAlg.MKTool.Serialiser          8   0     DEBUG    Fragment size including 1448 bytes from 14x DynAux : 2288
+HLTRMakerAlg.MKTool.Serialiser          8   0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :1208 bytes
+HLTRMakerAlg.MKTool.Serialiser          8   0     DEBUG    Fragment size including 1672 bytes from 14x DynAux : 2880
 HLTRMakerAlg.MKTool.Serialiser          9   0     DEBUG xAOD::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 bytes
-HLTRMakerAlg.MKTool.Serialiser          9   0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :284 bytes
+HLTRMakerAlg.MKTool.Serialiser          9   0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :296 bytes
 HLTRMakerAlg.MKTool.Serialiser          9   0     DEBUG xAOD::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
 HLTRMakerAlg.MKTool.Serialiser          9   0     DEBUG xAOD::TrigEMClusterAuxContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :484 bytes
 HLTRMakerAlg.MKTool.Serialiser          9   0     DEBUG xAOD::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
 HLTRMakerAlg.MKTool.Serialiser          9   0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :472 bytes
 HLTRMakerAlg.MKTool.Serialiser          10  0     DEBUG xAOD::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 bytes
-HLTRMakerAlg.MKTool.Serialiser          10  0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :664 bytes
-HLTRMakerAlg.MKTool.Serialiser          10  0     DEBUG    Fragment size including 204 bytes from 1x DynAux : 868
+HLTRMakerAlg.MKTool.Serialiser          10  0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :760 bytes
 HLTRMakerAlg.MKTool.Serialiser          10  0     DEBUG xAOD::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
 HLTRMakerAlg.MKTool.Serialiser          10  0     DEBUG xAOD::TrigEMClusterAuxContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :1764 bytes
 HLTRMakerAlg.MKTool.Serialiser          10  0     DEBUG    Fragment size including 100 bytes from 1x DynAux : 1864
 HLTRMakerAlg.MKTool.Serialiser          10  0     DEBUG xAOD::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
-HLTRMakerAlg.MKTool.Serialiser          10  0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :3508 bytes
-HLTRMakerAlg.MKTool.Serialiser          10  0     DEBUG    Fragment size including 3072 bytes from 14x DynAux : 6580
+HLTRMakerAlg.MKTool.Serialiser          10  0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :3876 bytes
+HLTRMakerAlg.MKTool.Serialiser          10  0     DEBUG    Fragment size including 3296 bytes from 14x DynAux : 7172
 HLTRMakerAlg.MKTool.Serialiser          11  0     DEBUG xAOD::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 bytes
-HLTRMakerAlg.MKTool.Serialiser          11  0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :380 bytes
-HLTRMakerAlg.MKTool.Serialiser          11  0     DEBUG    Fragment size including 128 bytes from 1x DynAux : 508
+HLTRMakerAlg.MKTool.Serialiser          11  0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :396 bytes
 HLTRMakerAlg.MKTool.Serialiser          11  0     DEBUG xAOD::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
 HLTRMakerAlg.MKTool.Serialiser          11  0     DEBUG xAOD::TrigEMClusterAuxContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :804 bytes
 HLTRMakerAlg.MKTool.Serialiser          11  0     DEBUG    Fragment size including 88 bytes from 1x DynAux : 892
 HLTRMakerAlg.MKTool.Serialiser          11  0     DEBUG xAOD::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
-HLTRMakerAlg.MKTool.Serialiser          11  0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :840 bytes
-HLTRMakerAlg.MKTool.Serialiser          11  0     DEBUG    Fragment size including 1448 bytes from 14x DynAux : 2288
+HLTRMakerAlg.MKTool.Serialiser          11  0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :656 bytes
+HLTRMakerAlg.MKTool.Serialiser          11  0     DEBUG    Fragment size including 1336 bytes from 14x DynAux : 1992
 HLTRMakerAlg.MKTool.Serialiser          12  0     DEBUG xAOD::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 bytes
-HLTRMakerAlg.MKTool.Serialiser          12  0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :1044 bytes
-HLTRMakerAlg.MKTool.Serialiser          12  0     DEBUG    Fragment size including 256 bytes from 1x DynAux : 1300
+HLTRMakerAlg.MKTool.Serialiser          12  0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :1192 bytes
 HLTRMakerAlg.MKTool.Serialiser          12  0     DEBUG xAOD::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
 HLTRMakerAlg.MKTool.Serialiser          12  0     DEBUG xAOD::TrigEMClusterAuxContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :3044 bytes
 HLTRMakerAlg.MKTool.Serialiser          12  0     DEBUG    Fragment size including 116 bytes from 1x DynAux : 3160
 HLTRMakerAlg.MKTool.Serialiser          12  0     DEBUG xAOD::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
-HLTRMakerAlg.MKTool.Serialiser          12  0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :3876 bytes
-HLTRMakerAlg.MKTool.Serialiser          12  0     DEBUG    Fragment size including 3296 bytes from 14x DynAux : 7172
+HLTRMakerAlg.MKTool.Serialiser          12  0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :5440 bytes
+HLTRMakerAlg.MKTool.Serialiser          12  0     DEBUG    Fragment size including 4248 bytes from 14x DynAux : 9688
 HLTRMakerAlg.MKTool.Serialiser          13  0     DEBUG xAOD::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 bytes
-HLTRMakerAlg.MKTool.Serialiser          13  0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :476 bytes
-HLTRMakerAlg.MKTool.Serialiser          13  0     DEBUG    Fragment size including 164 bytes from 1x DynAux : 640
+HLTRMakerAlg.MKTool.Serialiser          13  0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :528 bytes
 HLTRMakerAlg.MKTool.Serialiser          13  0     DEBUG xAOD::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
 HLTRMakerAlg.MKTool.Serialiser          13  0     DEBUG xAOD::TrigEMClusterAuxContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :1124 bytes
 HLTRMakerAlg.MKTool.Serialiser          13  0     DEBUG    Fragment size including 92 bytes from 1x DynAux : 1216
 HLTRMakerAlg.MKTool.Serialiser          13  0     DEBUG xAOD::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
-HLTRMakerAlg.MKTool.Serialiser          13  0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :2496 bytes
-HLTRMakerAlg.MKTool.Serialiser          13  0     DEBUG    Fragment size including 2456 bytes from 14x DynAux : 4952
+HLTRMakerAlg.MKTool.Serialiser          13  0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :3324 bytes
+HLTRMakerAlg.MKTool.Serialiser          13  0     DEBUG    Fragment size including 2960 bytes from 14x DynAux : 6284
 HLTRMakerAlg.MKTool.Serialiser          14  0     DEBUG xAOD::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 bytes
-HLTRMakerAlg.MKTool.Serialiser          14  0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :380 bytes
-HLTRMakerAlg.MKTool.Serialiser          14  0     DEBUG    Fragment size including 132 bytes from 1x DynAux : 512
+HLTRMakerAlg.MKTool.Serialiser          14  0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :400 bytes
 HLTRMakerAlg.MKTool.Serialiser          14  0     DEBUG xAOD::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
 HLTRMakerAlg.MKTool.Serialiser          14  0     DEBUG xAOD::TrigEMClusterAuxContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :804 bytes
 HLTRMakerAlg.MKTool.Serialiser          14  0     DEBUG    Fragment size including 88 bytes from 1x DynAux : 892
@@ -131,31 +117,28 @@ HLTRMakerAlg.MKTool.Serialiser          14  0     DEBUG xAOD::TrigElectronContai
 HLTRMakerAlg.MKTool.Serialiser          14  0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :748 bytes
 HLTRMakerAlg.MKTool.Serialiser          14  0     DEBUG    Fragment size including 1392 bytes from 14x DynAux : 2140
 HLTRMakerAlg.MKTool.Serialiser          15  0     DEBUG xAOD::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 bytes
-HLTRMakerAlg.MKTool.Serialiser          15  0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :284 bytes
+HLTRMakerAlg.MKTool.Serialiser          15  0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :296 bytes
 HLTRMakerAlg.MKTool.Serialiser          15  0     DEBUG xAOD::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
 HLTRMakerAlg.MKTool.Serialiser          15  0     DEBUG xAOD::TrigEMClusterAuxContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :484 bytes
 HLTRMakerAlg.MKTool.Serialiser          15  0     DEBUG xAOD::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
 HLTRMakerAlg.MKTool.Serialiser          15  0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :472 bytes
 HLTRMakerAlg.MKTool.Serialiser          16  0     DEBUG xAOD::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 bytes
-HLTRMakerAlg.MKTool.Serialiser          16  0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :380 bytes
-HLTRMakerAlg.MKTool.Serialiser          16  0     DEBUG    Fragment size including 124 bytes from 1x DynAux : 504
+HLTRMakerAlg.MKTool.Serialiser          16  0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :392 bytes
 HLTRMakerAlg.MKTool.Serialiser          16  0     DEBUG xAOD::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
 HLTRMakerAlg.MKTool.Serialiser          16  0     DEBUG xAOD::TrigEMClusterAuxContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :804 bytes
 HLTRMakerAlg.MKTool.Serialiser          16  0     DEBUG    Fragment size including 88 bytes from 1x DynAux : 892
 HLTRMakerAlg.MKTool.Serialiser          16  0     DEBUG xAOD::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
 HLTRMakerAlg.MKTool.Serialiser          16  0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :472 bytes
 HLTRMakerAlg.MKTool.Serialiser          17  0     DEBUG xAOD::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 bytes
-HLTRMakerAlg.MKTool.Serialiser          17  0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :476 bytes
-HLTRMakerAlg.MKTool.Serialiser          17  0     DEBUG    Fragment size including 164 bytes from 1x DynAux : 640
+HLTRMakerAlg.MKTool.Serialiser          17  0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :528 bytes
 HLTRMakerAlg.MKTool.Serialiser          17  0     DEBUG xAOD::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
 HLTRMakerAlg.MKTool.Serialiser          17  0     DEBUG xAOD::TrigEMClusterAuxContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :1124 bytes
 HLTRMakerAlg.MKTool.Serialiser          17  0     DEBUG    Fragment size including 92 bytes from 1x DynAux : 1216
 HLTRMakerAlg.MKTool.Serialiser          17  0     DEBUG xAOD::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
-HLTRMakerAlg.MKTool.Serialiser          17  0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :1392 bytes
-HLTRMakerAlg.MKTool.Serialiser          17  0     DEBUG    Fragment size including 1784 bytes from 14x DynAux : 3176
+HLTRMakerAlg.MKTool.Serialiser          17  0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :1852 bytes
+HLTRMakerAlg.MKTool.Serialiser          17  0     DEBUG    Fragment size including 2064 bytes from 14x DynAux : 3916
 HLTRMakerAlg.MKTool.Serialiser          18  0     DEBUG xAOD::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 bytes
-HLTRMakerAlg.MKTool.Serialiser          18  0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :476 bytes
-HLTRMakerAlg.MKTool.Serialiser          18  0     DEBUG    Fragment size including 160 bytes from 1x DynAux : 636
+HLTRMakerAlg.MKTool.Serialiser          18  0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :524 bytes
 HLTRMakerAlg.MKTool.Serialiser          18  0     DEBUG xAOD::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
 HLTRMakerAlg.MKTool.Serialiser          18  0     DEBUG xAOD::TrigEMClusterAuxContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :1124 bytes
 HLTRMakerAlg.MKTool.Serialiser          18  0     DEBUG    Fragment size including 92 bytes from 1x DynAux : 1216
@@ -163,21 +146,20 @@ HLTRMakerAlg.MKTool.Serialiser          18  0     DEBUG xAOD::TrigElectronContai
 HLTRMakerAlg.MKTool.Serialiser          18  0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :840 bytes
 HLTRMakerAlg.MKTool.Serialiser          18  0     DEBUG    Fragment size including 1448 bytes from 14x DynAux : 2288
 HLTRMakerAlg.MKTool.Serialiser          19  0     DEBUG xAOD::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 bytes
-HLTRMakerAlg.MKTool.Serialiser          19  0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :568 bytes
-HLTRMakerAlg.MKTool.Serialiser          19  0     DEBUG    Fragment size including 152 bytes from 1x DynAux : 720
+HLTRMakerAlg.MKTool.Serialiser          19  0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :612 bytes
 HLTRMakerAlg.MKTool.Serialiser          19  0     DEBUG xAOD::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
 HLTRMakerAlg.MKTool.Serialiser          19  0     DEBUG xAOD::TrigEMClusterAuxContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :1444 bytes
 HLTRMakerAlg.MKTool.Serialiser          19  0     DEBUG    Fragment size including 96 bytes from 1x DynAux : 1540
 HLTRMakerAlg.MKTool.Serialiser          19  0     DEBUG xAOD::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
-HLTRMakerAlg.MKTool.Serialiser          19  0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :3324 bytes
-HLTRMakerAlg.MKTool.Serialiser          19  0     DEBUG    Fragment size including 2960 bytes from 14x DynAux : 6284
+HLTRMakerAlg.MKTool.Serialiser          19  0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :5624 bytes
+HLTRMakerAlg.MKTool.Serialiser          19  0     DEBUG    Fragment size including 4360 bytes from 14x DynAux : 9984
 TrigSignatureMoniMT                                INFO HLT_2e3_etcut                 20        10        6         5         5         
-TrigSignatureMoniMT                                INFO HLT_2e3_etcut decisions                           16        83        
-TrigSignatureMoniMT                                INFO HLT_e3_e5_etcut               20        20        12        10        10        
-TrigSignatureMoniMT                                INFO HLT_e3_e5_etcut decisions                         46        215       
+TrigSignatureMoniMT                                INFO HLT_2e3_etcut decisions                           16        100       
+TrigSignatureMoniMT                                INFO HLT_e3_e5_etcut               20        20        12        11        11        
+TrigSignatureMoniMT                                INFO HLT_e3_e5_etcut decisions                         46        279       
 TrigSignatureMoniMT                                INFO HLT_e3_etcut                  20        9         8         8         8         
-TrigSignatureMoniMT                                INFO HLT_e3_etcut decisions                            22        107       
+TrigSignatureMoniMT                                INFO HLT_e3_etcut decisions                            22        140       
 TrigSignatureMoniMT                                INFO HLT_e5_etcut                  20        20        17        17        17        
-TrigSignatureMoniMT                                INFO HLT_e5_etcut decisions                            52        255       
+TrigSignatureMoniMT                                INFO HLT_e5_etcut decisions                            52        333       
 TrigSignatureMoniMT                                INFO HLT_e7_etcut                  20        20        11        11        11        
-TrigSignatureMoniMT                                INFO HLT_e7_etcut decisions                            17        119       
+TrigSignatureMoniMT                                INFO HLT_e7_etcut decisions                            17        173       
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/electronMenu.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/electronMenu.ref
index 8e8cfe440bebbaa461fd8c198a1a0359ce07b417..9e7fb876f609783fd025f673b027c14ccc01c35d 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/electronMenu.ref
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/electronMenu.ref
@@ -94,10 +94,10 @@ TriggerSummaryStep1                     19  0     DEBUG  +++ HLT_e7_etcut ID#243
 TriggerSummaryStep2                     19  0     DEBUG  +++ HLT_e5_etcut ID#607406625
 TriggerSummaryStep2                     19  0     DEBUG  +++ HLT_e7_etcut ID#2430733989
 TrigSignatureMoniMT                                INFO HLT_e3_etcut                  20        9         8         7         7         
-TrigSignatureMoniMT                                INFO HLT_e3_etcut decisions                            22        105       
+TrigSignatureMoniMT                                INFO HLT_e3_etcut decisions                            22        137       
 TrigSignatureMoniMT                                INFO HLT_e3_etcut1step             20        20        18        0         18        
 TrigSignatureMoniMT                                INFO HLT_e3_etcut1step decisions                       54        0         
 TrigSignatureMoniMT                                INFO HLT_e5_etcut                  20        20        17        16        16        
-TrigSignatureMoniMT                                INFO HLT_e5_etcut decisions                            50        251       
+TrigSignatureMoniMT                                INFO HLT_e5_etcut decisions                            50        329       
 TrigSignatureMoniMT                                INFO HLT_e7_etcut                  20        20        15        14        14        
-TrigSignatureMoniMT                                INFO HLT_e7_etcut decisions                            36        205       
+TrigSignatureMoniMT                                INFO HLT_e7_etcut decisions                            36        264       
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.ref
index c3ef3fd3315ea425a09fa9be48ca5a5106b64d43..055a86e7c8ef2a445d48fe4c7cbd6f341efd5f21 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.ref
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.ref
@@ -179,15 +179,15 @@ TrigSignatureMoniMT                                INFO HLT_2mu6 decisions
 TrigSignatureMoniMT                                INFO HLT_2mu6Comb                  20        20        0         0         0         
 TrigSignatureMoniMT                                INFO HLT_2mu6Comb decisions                            0         0         
 TrigSignatureMoniMT                                INFO HLT_e3_etcut                  20        20        18        17        17        
-TrigSignatureMoniMT                                INFO HLT_e3_etcut decisions                            54        262       
+TrigSignatureMoniMT                                INFO HLT_e3_etcut decisions                            54        343       
 TrigSignatureMoniMT                                INFO HLT_e3_etcut1step             20        20        18        0         18        
 TrigSignatureMoniMT                                INFO HLT_e3_etcut1step decisions                       54        0         
 TrigSignatureMoniMT                                INFO HLT_e3_etcut_mu6              20        20        10        0         1         
 TrigSignatureMoniMT                                INFO HLT_e3_etcut_mu6 decisions                        17        0         
 TrigSignatureMoniMT                                INFO HLT_e5_etcut                  20        20        17        16        16        
-TrigSignatureMoniMT                                INFO HLT_e5_etcut decisions                            50        251       
+TrigSignatureMoniMT                                INFO HLT_e5_etcut decisions                            50        330       
 TrigSignatureMoniMT                                INFO HLT_e7_etcut                  20        20        15        14        14        
-TrigSignatureMoniMT                                INFO HLT_e7_etcut decisions                            36        205       
+TrigSignatureMoniMT                                INFO HLT_e7_etcut decisions                            36        265       
 TrigSignatureMoniMT                                INFO HLT_g5_etcut                  20        20        17        17        17        
 TrigSignatureMoniMT                                INFO HLT_g5_etcut decisions                            50        50        
 TrigSignatureMoniMT                                INFO HLT_j45                       20        20        3         0         3         
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/met_standalone.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/met_standalone.ref
index 0fd92ec58434e564311a669c5d747b1f1f10bb46..411aed960438769b9fc0df4c9c08fab56173fb31 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/met_standalone.ref
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/met_standalone.ref
@@ -1,4 +1,4 @@
-METHypoAlg                              0   0     DEBUG The MET value is 82
+METHypoAlg                              0   0     DEBUG The MET value is 81
 METHypoAlg                              1   0     DEBUG The MET value is 31
 METHypoAlg                              2   0     DEBUG The MET value is 39
 METHypoAlg                              3   0     DEBUG The MET value is 67
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/muMenu.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/muMenu.ref
index 11a3085361381bd3bbd2da276afe0ead09901723..40cec9c91507044bb75b21d8cb2fc5b944259851 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/muMenu.ref
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/muMenu.ref
@@ -3,8 +3,10 @@ TriggerSummaryStep1                     4   0     DEBUG  +++ HLT_mu6Comb ID#3933
 TriggerSummaryStep1                     4   0     DEBUG  +++ HLT_mu6nol1 ID#1250234908
 TriggerSummaryStep1                     4   0     DEBUG  +++ HLT_mu6 ID#1672162766
 TriggerSummaryStep1                     4   0     DEBUG  +++ HLT_mu6fast ID#2393852230
+TriggerSummaryStep2                     4   0     DEBUG  +++ HLT_mu20_ivar ID#267444585
 TriggerSummaryStep2                     4   0     DEBUG  +++ HLT_mu6Comb ID#393364983
 TriggerSummaryStep2                     4   0     DEBUG  +++ HLT_mu6 ID#1672162766
+TriggerSummaryStep3                     4   0     DEBUG  +++ HLT_mu20_ivar ID#267444585
 TriggerSummaryStep1                     6   0     DEBUG  +++ HLT_mu6Comb ID#393364983
 TriggerSummaryStep1                     6   0     DEBUG  +++ HLT_mu6nol1 ID#1250234908
 TriggerSummaryStep1                     6   0     DEBUG  +++ HLT_mu6 ID#1672162766
@@ -22,8 +24,8 @@ TrigSignatureMoniMT                                INFO HLT_2mu6
 TrigSignatureMoniMT                                INFO HLT_2mu6 decisions                                2         2         2         0         
 TrigSignatureMoniMT                                INFO HLT_2mu6Comb                  10        10        1         1         0         0         1         
 TrigSignatureMoniMT                                INFO HLT_2mu6Comb decisions                            2         2         0         0         
-TrigSignatureMoniMT                                INFO HLT_mu20_ivar                 10        10        1         0         0         0         0         
-TrigSignatureMoniMT                                INFO HLT_mu20_ivar decisions                           1         0         0         0         
+TrigSignatureMoniMT                                INFO HLT_mu20_ivar                 10        10        1         1         1         0         1         
+TrigSignatureMoniMT                                INFO HLT_mu20_ivar decisions                           1         1         1         0         
 TrigSignatureMoniMT                                INFO HLT_mu6                       10        10        2         2         1         1         1         
 TrigSignatureMoniMT                                INFO HLT_mu6 decisions                                 3         3         2         1         
 TrigSignatureMoniMT                                INFO HLT_mu6Comb                   10        10        2         2         0         0         2         
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py b/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py
index 50fbefbe84304dbddb1968a7c723aaff4a1c8eae..52d08bb197a1867bcebbcdcc4025ddaafe42608c 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py
@@ -61,15 +61,6 @@ acc.merge( TrigInDetCondConfig( flags ) )
 acc.getEventAlgo( "TrigSignatureMoniMT" ).OutputLevel=DEBUG
 print acc.getEventAlgo( "TrigSignatureMoniMT" )
 
-topSequence = acc.getSequence("HLTTop")
-muonCacheCreatorName = "MuonCacheCreator"
-mcc = findAlgorithm( topSequence, muonCacheCreatorName )
-if mcc:
-    owner = findOwningSequence( topSequence, muonCacheCreatorName )
-    owner.remove( mcc )
-    top = acc.getSequence("AthAlgSeq")
-    top += mcc
-
 
 # from TrigUpgradeTest.TestUtils import applyMenu
 # applyMenu( acc.getEventAlgo( "L1Decoder" ) )
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/pebTest.py b/Trigger/TrigValidation/TrigUpgradeTest/share/pebTest.py
index 5c2e333931c91e8850c3fc65a1d5b99672c18c66..45862afb45c47defcb21e35248d16973d819b481 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/pebTest.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/pebTest.py
@@ -120,7 +120,7 @@ decisionObjectsToRecord = []
 for d in decisionObjects:
     decisionObjectsToRecord.extend([
         "xAOD::TrigCompositeContainer_v1#%s" % d,
-        "xAOD::TrigCompositeAuxContainer_v2#%s.decisions" % d
+        "xAOD::TrigCompositeAuxContainer_v2#%s." % d
     ])
 
 ##########################################
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/testHLT_MT.py b/Trigger/TrigValidation/TrigUpgradeTest/share/testHLT_MT.py
index 4fbecdf062ba037b8cbf1400c613b0acd98bc683..87274d1411ce01ca11aab93c15a8d44ebf3c2df9 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/testHLT_MT.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/testHLT_MT.py
@@ -32,10 +32,10 @@ class opt :
     enableCostD3PD   = False          # enable cost monitoring
     doL1Unpacking    = True           # decode L1 data in input file if True, else setup emulation
     doL1Sim          = False          # (re)run L1 simulation
+    isOnline         = False          # isOnline flag (TEMPORARY HACK, should be True by default)
 #
 ################################################################################
 
-import AthenaCommon.CfgMgr as CfgMgr
 from AthenaCommon.AppMgr import theApp, ServiceMgr as svcMgr
 from AthenaCommon.Logging import logging
 log = logging.getLogger('testHLT_MT.py')
@@ -48,9 +48,9 @@ defaultOptions = [a for a in dir(opt) if not a.startswith('__')]
 for option in defaultOptions:
     if option in globals():
         setattr(opt, option, globals()[option])
-        print ' %20s = %s' % (option, getattr(opt, option))
+        print(' %20s = %s' % (option, getattr(opt, option)))
     else:        
-        print ' %20s = (Default) %s' % (option, getattr(opt, option))
+        print(' %20s = (Default) %s' % (option, getattr(opt, option)))
 
 #-------------------------------------------------------------
 # Setting Global Flags
@@ -61,35 +61,38 @@ from AthenaCommon.BeamFlags import jobproperties
 from TriggerJobOpts.TriggerFlags import TriggerFlags
 import TriggerRelease.Modifiers
 
-# Input format and file for athena running
+# Auto-configuration for athena
 if len(athenaCommonFlags.FilesInput())>0:
-    from RecExConfig.AutoConfiguration import ConfigureFromListOfKeys, GetRunNumber
-    ConfigureFromListOfKeys(['everything'])
-    TriggerRelease.Modifiers._run_number = GetRunNumber()
-else:
-    if '_run_number' in dir(): TriggerRelease.Modifiers._run_number = _run_number   # set by athenaHLT
-    globalflags.InputFormat = 'bytestream'  # default for athenaHLT
-    if opt.setupForMC:
-        globalflags.DetGeo = 'atlas'
-        globalflags.DataSource = 'geant4'
-    else:
-        globalflags.DetGeo = 'commis'
-        globalflags.DataSource = 'data'
-        jobproperties.Beam.beamType = 'collisions'
-        jobproperties.Beam.bunchSpacing = 25
-        globalflags.DetDescrVersion = TriggerFlags.OnlineGeoTag()
-        globalflags.ConditionsTag = TriggerFlags.OnlineCondTag()
-        
-
-# Overwrite tags if specified on command line
-if opt.setDetDescr is not None:
-    globalflags.DetDescrVersion = opt.setDetDescr
-if opt.setGlobalTag is not None:
-    globalflags.ConditionsTag = opt.setGlobalTag
-
+    import PyUtils.AthFile as athFile
+    af = athFile.fopen(athenaCommonFlags.FilesInput()[0])
+    globalflags.InputFormat = 'bytestream' if af.fileinfos['file_type']=='bs' else 'pool'
+    globalflags.DataSource = 'data' if af.fileinfos['evt_type'][0]=='IS_DATA' else 'geant4'
+    if opt.setDetDescr is None:
+        opt.setDetDescr = af.fileinfos.get('geometry',None)
+    if opt.setGlobalTag is None:
+        opt.setGlobalTag = af.fileinfos.get('conditions_tag',None) or \
+            (TriggerFlags.OnlineCondTag() if opt.isOnline else 'CONDBR2-BLKPA-2018-13')
+    TriggerRelease.Modifiers._run_number = af.fileinfos['run_number'][0]
+
+else:   # athenaHLT
+    globalflags.InputFormat = 'bytestream'
+    globalflags.DataSource = 'data' if not opt.setupForMC else 'data'
+    if '_run_number' in dir():
+        TriggerRelease.Modifiers._run_number = _run_number   # noqa, set by athenaHLT
+        del _run_number
+
+# Set final Cond/Geo tag based on input file, command line or default
+globalflags.DetDescrVersion = opt.setDetDescr or TriggerFlags.OnlineGeoTag()
+globalflags.ConditionsTag = opt.setGlobalTag or TriggerFlags.OnlineCondTag()
+
+# Other defaults
+jobproperties.Beam.beamType = 'collisions'
+jobproperties.Beam.bunchSpacing = 25
 globalflags.DatabaseInstance='CONDBR2' if opt.useCONDBR2 else 'COMP200'
+athenaCommonFlags.isOnline.set_Value_and_Lock(opt.isOnline)
 
-athenaCommonFlags.isOnline = False # for the moment, run in offline mode
+log.info('Configured the following global flags:')
+globalflags.print_JobProperties()
 
 #-------------------------------------------------------------
 # Transfer flags into TriggerFlags
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/src/TestHypoAlg.cxx b/Trigger/TrigValidation/TrigUpgradeTest/src/TestHypoAlg.cxx
index 94b86c7dfa59afef4fd0b43da787a54b6971f267..a220b43967725e4388bf3e4f3a4ff06955ce3278 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/src/TestHypoAlg.cxx
+++ b/Trigger/TrigValidation/TrigUpgradeTest/src/TestHypoAlg.cxx
@@ -6,9 +6,9 @@
 #include "TestHypoAlg.h"
 
 namespace HLTTest {
-  
+
   TestHypoAlg::TestHypoAlg( const std::string& name, ISvcLocator* pSvcLocator ) 
-    : ::HypoBase( name, pSvcLocator ) {}
+  : ::HypoBase( name, pSvcLocator ) {}
 
   TestHypoAlg::~TestHypoAlg() {}
   
@@ -51,9 +51,9 @@ namespace HLTTest {
 
     // find features:
     std::vector<const FeatureOBJ*> featureFromDecision;
-    for ( auto previousDecision: *previousDecisionsHandle ) {
-      auto linkInfo = TrigCompositeUtils::findLink<FeatureContainer>(previousDecision, m_linkName.value());
-      auto featureLink = linkInfo.link;
+    for ( const auto previousDecision: *previousDecisionsHandle ) {
+      const auto linkInfo = TrigCompositeUtils::findLink<FeatureContainer>(previousDecision, m_linkName.value());
+      const auto featureLink = linkInfo.link;
       CHECK( featureLink.isValid() );
       const FeatureOBJ* feature = *featureLink;
       featureFromDecision.push_back( feature);
@@ -62,51 +62,50 @@ namespace HLTTest {
     
     //map reco object and decision: find in reco obejct the initial RoI and map it to the correct decision
     size_t reco_counter = 0;
-    for (auto recoobj: *recoInput){
-      auto roiInfo = TrigCompositeUtils::findLink<TrigRoiDescriptorCollection>( recoobj, "initialRoI"  );
-      auto roiEL = roiInfo.link;
+    for (const auto recoobj: *recoInput){
+      const auto roiInfo = TrigCompositeUtils::findLink<TrigRoiDescriptorCollection>( recoobj, "initialRoI"  );
+      const auto roiEL = roiInfo.link;
       CHECK( roiEL.isValid() );
       
-      auto featureInfo = TrigCompositeUtils::findLink<FeatureContainer>( recoobj, m_linkName.value()  );
-      auto featurelink = featureInfo.link;
+      const auto featureInfo = TrigCompositeUtils::findLink<FeatureContainer>( recoobj, m_linkName.value()  );
+      const auto featurelink = featureInfo.link;
       CHECK( featurelink.isValid() );
       if ( not featurelink.isValid() )  {
-	ATH_MSG_ERROR( " Can not find reference to " + m_linkName.value() + " from the decision" );
-	return StatusCode::FAILURE;
+        ATH_MSG_ERROR( " Can not find reference to " + m_linkName.value() + " from the decision" );
+        return StatusCode::FAILURE;
       }
       
       ATH_MSG_DEBUG(" Found link from the reco object to feature "<<m_linkName.value() );
       const FeatureOBJ* feature = *featurelink;
       // find the same roi in the previous decisions
       bool foundFeatureInDecision=false;
-       size_t pos=distance(featureFromDecision.begin(), find(featureFromDecision.begin(), featureFromDecision.end(), feature));
-       if (pos < featureFromDecision.size()){
-	 foundFeatureInDecision=true;	 
-       }
-       
-       if (foundFeatureInDecision){
-	 ATH_MSG_DEBUG(" Found link from the reco object to the previous decision at position "<<pos);
-	 auto d = newDecisionIn(decisions);
-	 d->setObjectLink( "feature", ElementLink<xAOD::TrigCompositeContainer>(m_recoInput.key(), reco_counter) );// feature used by the Tool
-	 d->setObjectLink( m_linkName.value(), featurelink );
-	 linkToPrevious( d, decisionInput().key(), pos );
-       }
-       else{
-	 ATH_MSG_ERROR( " Can not find reference to previous decision from feature " + m_linkName.value() + " from reco object " << reco_counter );
-	 return StatusCode::FAILURE;
-       }
-       reco_counter++;
+      size_t pos=distance(featureFromDecision.begin(), find(featureFromDecision.begin(), featureFromDecision.end(), feature));
+      if (pos < featureFromDecision.size()){
+        foundFeatureInDecision=true;  
+      }
+
+      if (foundFeatureInDecision){
+        ATH_MSG_DEBUG(" Found link from the reco object to the previous decision at position "<<pos);
+        auto d = newDecisionIn(decisions);
+        d->setObjectLink( "feature", ElementLink<xAOD::TrigCompositeContainer>(m_recoInput.key(), reco_counter) );// feature used by the Tool
+        d->setObjectLink( m_linkName.value(), featurelink );
+        linkToPrevious( d, decisionInput().key(), pos );
+      }
+      else{
+        ATH_MSG_ERROR( " Can not find reference to previous decision from feature " + m_linkName.value() + " from reco object " << reco_counter );
+        return StatusCode::FAILURE;
+      }
+      reco_counter++;
     }
-    
- 
 
     if (decisions->size()>0){
       for ( auto tool: m_tools ) {
-	CHECK( tool->decide( decisions ) );
+        CHECK( tool->decide( decisions ) );
       }
     }
 
     ATH_MSG_DEBUG( "Exiting with "<< outputHandle->size() <<" decisions");
+
     //debug
     for (auto outh: *outputHandle){
       TrigCompositeUtils::DecisionIDContainer objDecisions;      
@@ -115,14 +114,11 @@ namespace HLTTest {
       ATH_MSG_DEBUG("Number of positive decisions for this input: " << objDecisions.size() );
 
       for ( TrigCompositeUtils::DecisionID id : objDecisions ) {
-       	ATH_MSG_DEBUG( " --- found new decision " << HLT::Identifier( id ) );
+        ATH_MSG_DEBUG( " --- found new decision " << HLT::Identifier( id ) );
       }  
-
     }
-
-
+  
     return StatusCode::SUCCESS;
   }
 
-  
 } //> end namespace HLTTest
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/src/TestHypoTool.cxx b/Trigger/TrigValidation/TrigUpgradeTest/src/TestHypoTool.cxx
index cac352bfc086e1737d36e2117255d525f33b91bd..e3f0bf919a51ab90d2b588afbd5acdf01411bb06 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/src/TestHypoTool.cxx
+++ b/Trigger/TrigValidation/TrigUpgradeTest/src/TestHypoTool.cxx
@@ -11,10 +11,10 @@ using namespace TrigCompositeUtils;
 namespace HLTTest {
 
   TestHypoTool::TestHypoTool( const std::string& type, 
-			      const std::string& name, 
-			      const IInterface* parent ) : 
-    ITestHypoTool( name ),
-    AthAlgTool( type, name, parent )
+    const std::string& name, 
+    const IInterface* parent ) : 
+  ITestHypoTool( name ),
+  AthAlgTool( type, name, parent )
   {
     m_decisionId=HLT::Identifier::fromToolName(name );
   }
@@ -28,59 +28,59 @@ namespace HLTTest {
     ATH_MSG_DEBUG("Link name is "<<m_linkName.value());
     ATH_MSG_DEBUG("threshold="<<m_threshold);
     ATH_MSG_DEBUG("property="<<m_property);   
-   return StatusCode::SUCCESS;
+    return StatusCode::SUCCESS;
   }
 
-
-  
   StatusCode TestHypoTool::decide( DecisionContainer* decisions ) const  {
     ATH_MSG_DEBUG( "Making new decisions " << name() );
     size_t counter = 0;
-    for ( auto d: *decisions )  {
+    for ( const auto d: *decisions )  {
       //get previous decisions
       ElementLinkVector<DecisionContainer> inputLinks = getLinkToPrevious(d);
       ATH_MSG_DEBUG("Got "<<inputLinks.size()<<" previous decisions");
-      for (auto previousDecisions: inputLinks){
-	
-	//auto previousDecisions = linkToPrevious( d);
-	TrigCompositeUtils::DecisionIDContainer objDecisions;      
-	TrigCompositeUtils::decisionIDs( *previousDecisions, objDecisions );
-      
-	ATH_MSG_DEBUG("Number of previous decisions ID for input "<< counter <<"= " << objDecisions.size() );
-      
-	for ( TrigCompositeUtils::DecisionID id : objDecisions ) {
-	  ATH_MSG_DEBUG( " -- found decision " << HLT::Identifier( id ) );
-	}
-
-	auto it= find(objDecisions.begin(), objDecisions.end(),  m_decisionId);
-	if (it != objDecisions.end()){      
-	  auto feature = d->objectLink<xAOD::TrigCompositeContainer>( "feature" );
-	  //auto feature = d->objectLink<xAOD::TrigCompositeContainer>( m_linkName.value() );
-	  if ( not feature.isValid() )  {
-	    ATH_MSG_ERROR( " Can not find reference to the object from the decision" );
-	    return StatusCode::FAILURE;
-	  }
-	  float v = (*feature)->getDetail<float>( m_property );
-	  if ( v > m_threshold ) { // actual cut will be more complex of course
-	    ATH_MSG_DEBUG( "  threshold " << m_threshold << " passed by value: " << v );	
-	    addDecisionID(  m_decisionId, d );
-	  }
-	  else ATH_MSG_DEBUG( "  threshold " << m_threshold << " not passed by value " << v );
-	}
-	else {
-	  ATH_MSG_DEBUG("No Input decisions requested by active chain "<< m_decisionId);
-	}       
-	counter++;
+      for (const auto previousDecisions: inputLinks){
+
+        TrigCompositeUtils::DecisionIDContainer objDecisions;      
+        TrigCompositeUtils::decisionIDs( *previousDecisions, objDecisions );
+
+        ATH_MSG_DEBUG("Number of previous decisions ID for input "<< counter <<"= " << objDecisions.size() );
+
+        for ( TrigCompositeUtils::DecisionID id : objDecisions ) {
+          ATH_MSG_DEBUG( " -- found decision " << HLT::Identifier( id ) );
+        }
+
+        const auto it = find(objDecisions.begin(), objDecisions.end(),  m_decisionId);
+        if (it != objDecisions.end()){      
+          
+          const auto feature = d->objectLink<xAOD::TrigCompositeContainer>( "feature" );
+          // Used to fetch m_linkName.value() but this was refactored to "feature"
+          if ( not feature.isValid() )  {
+            ATH_MSG_ERROR( " Can not find reference to the object from the decision" );
+            return StatusCode::FAILURE;
+          }
+          const float v = (*feature)->getDetail<float>( m_property );
+          if ( v > m_threshold ) { // actual cut will be more complex of course
+            ATH_MSG_DEBUG( "  threshold " << m_threshold << " passed by value: " << v );  
+            addDecisionID(  m_decisionId, d );
+          } else {
+            ATH_MSG_DEBUG( "  threshold " << m_threshold << " not passed by value " << v );
+          }
+        
+        } else { // it == objDecisions.end()
+
+          ATH_MSG_DEBUG("No Input decisions requested by active chain "<< m_decisionId);
+        
+        }       
+        counter++;
       }
     }
-    
     return StatusCode::SUCCESS;
   }
 
-  
+
   StatusCode TestHypoTool::finalize() {
     ATH_MSG_INFO( "Finalizing " << name() << "..." );
     return StatusCode::SUCCESS;
   }
 
-  } //> end namespace HLTTest
+} //> end namespace HLTTest
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/src/TestInputMaker.cxx b/Trigger/TrigValidation/TrigUpgradeTest/src/TestInputMaker.cxx
index 3d7b76d870f9b2df38d784cfebf4933b5fe119ef..226e7820b9ae739def0c571c41d0d28b0b38d194 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/src/TestInputMaker.cxx
+++ b/Trigger/TrigValidation/TrigUpgradeTest/src/TestInputMaker.cxx
@@ -10,11 +10,11 @@
 #include <vector>
 
 namespace HLTTest {
-  
+
   TestInputMaker::TestInputMaker( const std::string& name, 
-			    ISvcLocator* pSvcLocator )    
-    : InputMakerBase( name, pSvcLocator ) {}
-   
+    ISvcLocator* pSvcLocator )    
+  : InputMakerBase( name, pSvcLocator ) {}
+
 
   TestInputMaker::~TestInputMaker() {}
 
@@ -36,7 +36,7 @@ namespace HLTTest {
 
   StatusCode TestInputMaker::execute( const EventContext& context ) const {  
     ATH_MSG_DEBUG( "Executing " << name() << "..." );
- 
+
     // call base class helper method to read input decisions, loop over them create outputs and connect them, returns with outputHandles filled
     std::vector< SG::WriteHandle<TrigCompositeUtils::DecisionContainer> > outputHandles;
     CHECK (decisionInputToOutput(context, outputHandles));
@@ -50,51 +50,50 @@ namespace HLTTest {
     // loop over output decisions, navigate to inputs
     for (auto outputHandle: outputHandles) {
       if( not outputHandle.isValid() ) {
- 	ATH_MSG_DEBUG( "Got no decisions from output "<< outputHandle.key() << " because handle not valid");
- 	continue;
+        ATH_MSG_DEBUG( "Got no decisions from output "<< outputHandle.key() << " because handle not valid");
+        continue;
       }
       if( outputHandle->size() == 0){ // input filtered out
- 	ATH_MSG_ERROR( "Got no decisions from output "<< outputHandle.key()<<": handle is valid but container is empty. Is this expected?");
- 	return StatusCode::FAILURE;
+        ATH_MSG_ERROR( "Got no decisions from output "<< outputHandle.key()<<": handle is valid but container is empty. Is this expected?");
+        return StatusCode::FAILURE;
       }
+
       ATH_MSG_DEBUG( "Got output "<< outputHandle.key()<<" with " << outputHandle->size() << " elements" );
       // loop over output decisions in container of outputHandle, follow link to inputDecision
-      for ( auto outputDecision : *outputHandle){ 
-        ElementLinkVector<DecisionContainer> inputLinks = getLinkToPrevious(outputDecision);
-	for (auto input: inputLinks){
-	  ATH_MSG_DEBUG( "followed seed link to input "<< input.key() );
-	  const Decision* inputDecision = *input;
-	  auto roiELInfo = TrigCompositeUtils::findLink<TrigRoiDescriptorCollection>( inputDecision,  m_roisLink.value());
-	  CHECK( roiELInfo.isValid() );
-	
-	  // retrieve input feature from input decision (TrigComposite), will in this case be a TrigRoiDescriptor	  
-	  auto featureLinkInfo = TrigCompositeUtils::findLink<FeatureContainer>( inputDecision,  m_linkName.value());
-	  CHECK( featureLinkInfo.isValid() );
-	
-	  // link input reco object to outputDecision
-	  auto featureLink = featureLinkInfo.link;
-	  const FeatureOBJ* feature = *featureLink;
-	  ATH_MSG_DEBUG(" Found feature " <<m_linkName.value() );
-	  
-	  // merge reco outputs that are linked to the same feature (RoI): this avoids processing the same RoI from TC decisions from different chains
-	  
-	  // avoid adding the same feature multiple times: check if not in container, if not add it
-	  if ( find(featuresFromDecision.begin(), featuresFromDecision.end(), feature)
-	       == featuresFromDecision.end() ){
-	    featuresFromDecision.push_back(feature); // just to keep track of which we have used 
-	    // create the "reco" output: this would normally be a copy of the reco input or something derived from it, e.g. detector data inside a RoI. A TrigComposite is used here just for a trivial example.
-	    auto newFeature = new xAOD::TrigComposite;
-	    reco_output->push_back(newFeature); 
-	    newFeature->setObjectLink(m_linkName.value(), featureLink);
-	    ATH_MSG_DEBUG(" Added " <<m_linkName.value() << " and " << m_roisLink.value() << " to reco object");
-	  }
-	}//loop over previous inputs
+      for (const  auto outputDecision : *outputHandle){ 
+        const ElementLinkVector<DecisionContainer> inputLinks = getLinkToPrevious(outputDecision);
+        for (const auto input: inputLinks){
+          ATH_MSG_DEBUG( "followed seed link to input "<< input.key() );
+          const Decision* inputDecision = *input;
+          const auto roiELInfo = TrigCompositeUtils::findLink<TrigRoiDescriptorCollection>( inputDecision,  m_roisLink.value());
+          CHECK( roiELInfo.isValid() );
+
+          // retrieve input feature from input decision (TrigComposite), will in this case be a TrigRoiDescriptor   
+          const auto featureLinkInfo = TrigCompositeUtils::findLink<FeatureContainer>( inputDecision,  m_linkName.value());
+          CHECK( featureLinkInfo.isValid() );
+
+          // link input reco object to outputDecision
+          const auto featureLink = featureLinkInfo.link;
+          const FeatureOBJ* feature = *featureLink;
+          ATH_MSG_DEBUG(" Found feature " <<m_linkName.value() );
+
+          // merge reco outputs that are linked to the same feature (RoI): this avoids processing the same RoI from TC decisions from different chains
+
+          // avoid adding the same feature multiple times: check if not in container, if not add it
+          if ( find(featuresFromDecision.begin(), featuresFromDecision.end(), feature) == featuresFromDecision.end() ){
+            featuresFromDecision.push_back(feature); // just to keep track of which we have used 
+            // create the "reco" output: this would normally be a copy of the reco input or something derived from it, e.g. detector data inside a RoI. A TrigComposite is used here just for a trivial example.
+            auto newFeature = new xAOD::TrigComposite;
+            reco_output->push_back(newFeature); 
+            newFeature->setObjectLink(m_linkName.value(), featureLink);
+            ATH_MSG_DEBUG(" Added " <<m_linkName.value() << " and " << m_roisLink.value() << " to reco object");
+          }
+        }//loop over previous inputs
         // For early tests, create TC, link to RoiD, push back onto TCC.
         // Later will output RoID collection directly via tool.        
       } // loop over decisions      
     } // loop over input keys
-
-    
+   
     // Finally, record output
     ATH_MSG_DEBUG("Produced "<<reco_output->size() <<" reco objects and stored in "<<m_recoOutput);
     auto reco_outputHandle = SG::makeHandle(m_recoOutput, context);
@@ -106,5 +105,5 @@ namespace HLTTest {
     return StatusCode::SUCCESS;
   }
 
- 
+
 } //> end namespace HLTTest
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/src/TestMerger.cxx b/Trigger/TrigValidation/TrigUpgradeTest/src/TestMerger.cxx
index 43495b0c8053b1ef7a785970d177ae89624096a5..7a0af223d1a2d903634619ddedad3006511346fb 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/src/TestMerger.cxx
+++ b/Trigger/TrigValidation/TrigUpgradeTest/src/TestMerger.cxx
@@ -17,8 +17,8 @@ namespace HLTTest {
   // Constructors
   ////////////////
   TestMerger::TestMerger( const std::string& name, 
-			  ISvcLocator* pSvcLocator ) : 
-    ::AthAlgorithm( name, pSvcLocator )
+    ISvcLocator* pSvcLocator ) : 
+  ::AthAlgorithm( name, pSvcLocator )
   {
     declareProperty( "Inputs", m_inputs );
     declareProperty( "Output", m_outputKey );
@@ -51,17 +51,17 @@ namespace HLTTest {
     auto aux    = std::make_unique<DecisionAuxContainer>();
     output->setStore( aux.get() );
 
-    for ( auto input: m_inputs ) {
+    for (const auto input: m_inputs ) {
       auto iHandle = SG::ReadHandle<DecisionContainer>(input);
       if ( iHandle.isValid() ) {
-	size_t counter = 0;
-	for ( auto iDecisionIter  = iHandle->begin(); iDecisionIter != iHandle->end(); ++iDecisionIter, ++counter ) {
-	  auto d = newDecisionIn(output.get());
-	  linkToPrevious(d, input, counter );
-	}
-	ATH_MSG_DEBUG( "Input " << input << " present, linked " << counter << " inputs" );
+        size_t counter = 0;
+        for ( auto iDecisionIter  = iHandle->begin(); iDecisionIter != iHandle->end(); ++iDecisionIter, ++counter ) {
+          auto d = newDecisionIn(output.get());
+          linkToPrevious(d, *iDecisionIter );
+        }
+        ATH_MSG_DEBUG( "Input " << input << " present, linked " << counter << " inputs" );
       } else {
-	ATH_MSG_DEBUG( "Input " << input << " absent" );
+        ATH_MSG_DEBUG( "Input " << input << " absent" );
       }
     }
     
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/src/TestRoRSeqFilter.cxx b/Trigger/TrigValidation/TrigUpgradeTest/src/TestRoRSeqFilter.cxx
index 968b9f7e8c1826f1c9a37f86336889e753abdb45..db31e748bfd2c3a2825aca525e706b9a07dcacd9 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/src/TestRoRSeqFilter.cxx
+++ b/Trigger/TrigValidation/TrigUpgradeTest/src/TestRoRSeqFilter.cxx
@@ -15,8 +15,8 @@ using namespace TrigCompositeUtils;
 namespace HLTTest {
 
   TestRoRSeqFilter::TestRoRSeqFilter( const std::string& name, 
-				      ISvcLocator* pSvcLocator ) : 
-    ::AthAlgorithm( name, pSvcLocator )
+    ISvcLocator* pSvcLocator ) : 
+  ::AthAlgorithm( name, pSvcLocator )
   {
     declareProperty( "Inputs", m_inputs );
     declareProperty( "Outputs", m_outputs );
@@ -34,25 +34,28 @@ namespace HLTTest {
     ATH_MSG_DEBUG("Will consume the input data: " << m_inputs << " and produce " << m_outputs );
     ATH_MSG_DEBUG("This filter has alwaysPass=" << m_alwaysPass);
     ATH_MSG_DEBUG("Configured chains are:");
-    for ( auto& el: m_chainsProperty ) ATH_MSG_DEBUG(el);
+    for ( auto& el: m_chainsProperty ) {
+      ATH_MSG_DEBUG(el);
+    }
     // if ( m_inputs.size() != m_outputs.size() ) {
     //   ATH_MSG_ERROR("Inputs and Outputs have different size, the mapping is unclear");
     //   return StatusCode::FAILURE;
     // }
-  
-    for ( auto& el: m_chainsProperty ) 
+
+    for ( auto& el: m_chainsProperty ) {
       m_chains.insert( HLT::Identifier(el).numeric() );
-    
+    }
+
     // minimal validity crosscheck
     if ( m_chainsProperty.size() == 0 and m_alwaysPass == false ) {
       ATH_MSG_WARNING("This filter will always reject as it has no chains of interest configured");
     }
-  
+
     if ( m_chains.size() != m_chainsProperty.size() ) {
       ATH_MSG_ERROR("Repeated chain requirements (annoyance) or chain to hash conversion clash (major configuration issue therefore can not run)");
       return StatusCode::FAILURE;
     }  
-  
+
     return StatusCode::SUCCESS;
   }
 
@@ -67,7 +70,7 @@ namespace HLTTest {
   {
     ATH_MSG_DEBUG ( "Executing " << name() << "..." );
     bool pass = false;
-    
+
     for ( size_t inputIndex = 0; inputIndex < m_inputs.size(); ++inputIndex ) {
       auto input = m_inputs[inputIndex];
       ATH_MSG_DEBUG( "Processing input " << input );
@@ -79,22 +82,21 @@ namespace HLTTest {
 
       // not bother recording if there is no output
       if ( not decisionOutput->empty() ) {
-	ATH_MSG_DEBUG( "Saving output " << m_outputs[inputIndex] );
-	pass = true;      
-	SG::WriteHandle<DecisionContainer> outputDH( m_outputs[inputIndex] );
-	CHECK( outputDH.record( std::move( decisionOutput ), std::move( decisionAux ) ) );	
+        ATH_MSG_DEBUG( "Saving output " << m_outputs[inputIndex] );
+        pass = true;      
+        SG::WriteHandle<DecisionContainer> outputDH( m_outputs[inputIndex] );
+        CHECK( outputDH.record( std::move( decisionOutput ), std::move( decisionAux ) ) );  
       } else {
-	ATH_MSG_DEBUG( "None of the decisions in the input " << input << " passed, skipping recording output " );
+        ATH_MSG_DEBUG( "None of the decisions in the input " << input << " passed, skipping recording output " );
       }
     }
 
     ATH_MSG_DEBUG( "The overall decision is : " << ( pass or m_alwaysPass ? "positive" : "negative") );
-    
+
     setFilterPassed( pass or m_alwaysPass );
     return StatusCode::SUCCESS;
   }
 
-
   void TestRoRSeqFilter::copyPassing( const std::string& inputKey, DecisionContainer* output ) const {
     SG::ReadHandle<DecisionContainer> inputDH( inputKey );
     if ( not inputDH.isValid() ) {
@@ -103,29 +105,29 @@ namespace HLTTest {
     }
 
     ATH_MSG_DEBUG( "Filtering "<<inputDH->size()<<" obejcts with key "<<inputKey);
-    
+
     size_t counter=0;
     for ( auto objIter =  inputDH->begin(); objIter != inputDH->end(); ++objIter, ++counter ) {      
       DecisionIDContainer objDecisions;      
       decisionIDs( *objIter, objDecisions ); // this should be replaced in production code by method passingIDs but the later is not printing so in tests we want the IDs
       // here we have to sets of IDs, those we are interested in (via chain property) and those comming from the decision obj
-	
+
       std::vector<DecisionID> intersection;
       std::set_intersection( m_chains.begin(), m_chains.end(),
-			     objDecisions.begin(), objDecisions.end(),
-			     std::back_inserter( intersection ) );
-      
+      objDecisions.begin(), objDecisions.end(),
+      std::back_inserter( intersection ) );
+    
       ATH_MSG_DEBUG( "Found "<<intersection.size()<<" objects of interest for key "<<inputKey);
       for ( auto positive: intersection ) {
-	ATH_MSG_DEBUG( "Found positive decision for chain " << HLT::Identifier( positive ) );
+        ATH_MSG_DEBUG( "Found positive decision for chain " << HLT::Identifier( positive ) );
       }
 
       const bool positiveObjectDecision = not intersection.empty();
       if ( positiveObjectDecision ) {
-	auto d = newDecisionIn( output );
-	linkToPrevious( d, inputKey, counter );
+        auto d = newDecisionIn( output );
+        linkToPrevious( d, *objIter );
       } else {
-	ATH_MSG_DEBUG( "Skipping objects with key " << inputKey <<" as they passed no chain of interest to this filter" );
+        ATH_MSG_DEBUG( "Skipping objects with key " << inputKey <<" as they passed no chain of interest to this filter" );
       }
     }
   }
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/test_egamma_run_data.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/test_egamma_run_data.sh
index f7156c46c3c4aec55f6896c0a4077af1cb2bfa97..74e9973310d471cfab859f7e5cef03fe65a5069e 100755
--- a/Trigger/TrigValidation/TrigUpgradeTest/test/test_egamma_run_data.sh
+++ b/Trigger/TrigValidation/TrigUpgradeTest/test/test_egamma_run_data.sh
@@ -2,7 +2,7 @@
 # art-type: build
 # art-include: master/Athena
 
-#clear BS from previous runs
+#clear BS from previous runs 
 rm -rf  data_test.*.data
 athena  --threads=1 --skipEvents=10 --evtMax=20 --filesInput="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1" TrigUpgradeTest/egamma.withViews.py &&
 checkxAOD.py myESD.pool.root &&
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/test_newJO_build.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/test_newJO_build.sh
index cb8351b9d0370ed2ffc8c82e77b2f4bcff8e9839..eb228cfa982672ec83ba54f4ba57068ec7e3662a 100755
--- a/Trigger/TrigValidation/TrigUpgradeTest/test/test_newJO_build.sh
+++ b/Trigger/TrigValidation/TrigUpgradeTest/test/test_newJO_build.sh
@@ -18,7 +18,7 @@ export REGTESTEXP=".*ERROR (?\!attempt to add a duplicate).*|.*FATAL.*|.*newJOte
 # Find the regtest reference installed with the release
 export REGTESTREF=`find_data.py TrigUpgradeTest/NewJO.ref`
 
-get_files -jo TrigUpgradeTest/newJOtest.py
+get_files -remove -jo TrigUpgradeTest/newJOtest.py
 
 echo $(date "+%FT%H:%M %Z")"     Generate pickle file for test ${NAME}"
 python newJOtest.py &> athena.pickle.log # generate pickle
diff --git a/Trigger/TrigValidation/TrigValAlgs/CMakeLists.txt b/Trigger/TrigValidation/TrigValAlgs/CMakeLists.txt
index 395e1ccd0c75f2b384fc0505729f0bef14950633..db9b326dafec91e5cc57be1992f50a28f93a9b99 100644
--- a/Trigger/TrigValidation/TrigValAlgs/CMakeLists.txt
+++ b/Trigger/TrigValidation/TrigValAlgs/CMakeLists.txt
@@ -25,6 +25,7 @@ atlas_depends_on_subdirs( PUBLIC
                           PRIVATE
                           Control/AthenaKernel
                           Control/CxxUtils
+                          Control/AthViews
                           Event/EventInfo
                           Event/xAOD/xAODEventInfo
                           Event/xAOD/xAODBTagging
@@ -64,7 +65,7 @@ atlas_add_component( TrigValAlgs
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${XERCESC_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthAnalysisBaseCompsLib GaudiKernel TrigDecisionToolLib TrigCaloEvent TrigInDetEvent TrigMuonEvent TrigNavToolsLib TrigNavigationLib TrigParticle TrigSteeringEvent AthenaKernel CxxUtils EventInfo xAODEventInfo xAODBTagging xAODEgamma xAODJet xAODMuon xAODTau xAODTracking xAODTrigBphys xAODTrigCalo xAODTrigEgamma xAODTrigMinBias xAODTrigMissingET xAODTrigMuon xAODCore xAODTrigger AnalysisTriggerEvent MuonCombinedToolInterfaces Particle tauEvent VxSecVertex TrigConfigSvcLib TrigConfHLTData TrigRoiConversionLib TrigDecisionEvent TrigMissingEtEvent TrigInDetTruthEvent TrigT1Interfaces DecisionHandlingLib )
+                     LINK_LIBRARIES ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthAnalysisBaseCompsLib GaudiKernel TrigDecisionToolLib TrigCaloEvent TrigInDetEvent TrigMuonEvent TrigNavToolsLib TrigNavigationLib TrigParticle TrigSteeringEvent AthenaKernel CxxUtils EventInfo xAODEventInfo xAODBTagging xAODEgamma xAODJet xAODMuon xAODTau xAODTracking xAODTrigBphys xAODTrigCalo xAODTrigEgamma xAODTrigMinBias xAODTrigMissingET xAODTrigMuon xAODCore xAODTrigger AnalysisTriggerEvent MuonCombinedToolInterfaces Particle tauEvent VxSecVertex TrigConfigSvcLib TrigConfHLTData TrigRoiConversionLib TrigDecisionEvent TrigMissingEtEvent TrigInDetTruthEvent TrigT1Interfaces DecisionHandlingLib AthViews )
 
 # Install files from the package:
 atlas_install_headers( TrigValAlgs )
diff --git a/Trigger/TrigValidation/TrigValAlgs/src/TrigEDMChecker.cxx b/Trigger/TrigValidation/TrigValAlgs/src/TrigEDMChecker.cxx
index 4ccbf728073a0eae1e29bdd8cc23be549189e136..a9837a115caa3e58af77951f62ac1b141f8882a7 100644
--- a/Trigger/TrigValidation/TrigValAlgs/src/TrigEDMChecker.cxx
+++ b/Trigger/TrigValidation/TrigValAlgs/src/TrigEDMChecker.cxx
@@ -99,6 +99,9 @@
 
 #include "TrigT1Interfaces/RecEmTauRoI.h"
 
+#include "AthViews/ViewHelper.h"
+#include "AthViews/View.h"
+
 
 #include <iostream>
 #include <fstream>
@@ -4030,6 +4033,11 @@ StatusCode TrigEDMChecker::dumpTrigComposite() {
     m_dumpTrigCompositeContainers.clear();
     const CLID TrigCompositeCLID = static_cast<CLID>( ClassID_traits< xAOD::TrigCompositeContainer >::ID() );
     evtStore()->keys(TrigCompositeCLID, m_dumpTrigCompositeContainers);
+    std::string typeNameTC;
+    ATH_CHECK(m_clidSvc->getTypeNameOfID(TrigCompositeCLID, typeNameTC));
+    ATH_MSG_DEBUG("dumpTrigComposite got " <<  m_dumpTrigCompositeContainers.size() << " keys for " << typeNameTC);
+  } else {
+    ATH_MSG_DEBUG("Using supplied " <<  m_dumpTrigCompositeContainers.size() << " keys");
   }
 
   for ( const std::string & key: m_dumpTrigCompositeContainers ) {
@@ -4042,22 +4050,12 @@ StatusCode TrigEDMChecker::dumpTrigComposite() {
     const xAOD::TrigCompositeContainer* cont= nullptr;
     ATH_CHECK( evtStore()->retrieve( cont, key ) );
     
+    size_t count = 0;
     for ( auto tc: *cont ) {
-      ATH_MSG_DEBUG("name: " << tc->name());
-
-      // one gets a bit of info but is not that useful, we need to develop 
-      //SGdebug::print_aux_vars( *tc );
-      //SGdebug::dump_aux_vars( *tc );
-
-      // find the EL and check them
-      ATH_MSG_DEBUG( "Link col names   : " << tc->linkColNames() );
-      ATH_MSG_DEBUG( "Link col keys    : " << tc->linkColKeys() );
-      ATH_MSG_DEBUG( "Link col CLIDs   : " << tc->linkColClids() );
-      ATH_MSG_DEBUG( "Link col indices : " << tc->linkColIndices() );
-
+      ATH_MSG_DEBUG(" ########## ELEMENT " << count++);
+      ATH_MSG_DEBUG(*tc);
       // Get the objects we know of
       for (size_t i = 0; i < tc->linkColNames().size(); ++i) ATH_CHECK(checkTrigCompositeElementLink(tc, i));
-
     }
   }
   ATH_MSG_INFO( "REGTEST ==========END of xAOD::TrigCompositeContainer DUMP===========" );
@@ -4074,24 +4072,31 @@ StatusCode TrigEDMChecker::checkTrigCompositeElementLink(const xAOD::TrigComposi
   if (clid == ClassID_traits< TrigRoiDescriptorCollection >::ID()) { 
 
     const ElementLink<TrigRoiDescriptorCollection> elementLink = tc->objectLink<TrigRoiDescriptorCollection>(name);
-    if (!elementLink.isValid()) ATH_MSG_WARNING("Invalid element link from '" << tc->name() << "' to '" << name << "'");
-    else ATH_MSG_DEBUG("Got TrigRoiDescriptor:" << *elementLink);
+    if (!elementLink.isValid()) ATH_MSG_WARNING("  Invalid element link to TrigRoiDescriptorCollection, link name:'" << name << "'");
+    else ATH_MSG_DEBUG("  Dereferenced link '" << name << "'' to TrigRoiDescriptor:" << *elementLink);
 
   } else if (clid == ClassID_traits< DataVector< LVL1::RecEmTauRoI > >::ID()) { // There could be a few ROI types....
     // CLASS_DEF( DataVector< LVL1::RecEmTauRoI >, 6256, 1 )
 
     const ElementLink<DataVector< LVL1::RecEmTauRoI >> elementLink = tc->objectLink<DataVector< LVL1::RecEmTauRoI >>(name);
-    if (!elementLink.isValid()) ATH_MSG_WARNING("Invalid element link from '" << tc->name() << "' to '" << name << "'");
-    else ATH_MSG_DEBUG("Got LVL1::RecEmTauRoI:" << *elementLink);
+    if (!elementLink.isValid()) ATH_MSG_WARNING("  Invalid element link to LVL1::RecEmTauRoI, link name:'" << name << "'");
+    else ATH_MSG_DEBUG("  Dereferenced link '" << name << "' to LVL1::RecEmTauRoI:" << *elementLink);
 
    } else if (clid == ClassID_traits< xAOD::TrigCompositeContainer >::ID()) {
     
     const ElementLink<xAOD::TrigCompositeContainer> elementLink = tc->objectLink<xAOD::TrigCompositeContainer>(name);
-    if (!elementLink.isValid()) ATH_MSG_WARNING("Invalid element link from '" << tc->name() << "' to '" << name << "'");
-    else ATH_MSG_DEBUG("Got TrigComposite:" << (*elementLink)->name());
+    if (!elementLink.isValid()) ATH_MSG_WARNING("  Invalid element link to TrigComposite, link name:'" << name << "'");
+    else ATH_MSG_DEBUG("  Dereferenced link '" << name << "' to TrigComposite, TC name:'" << (*elementLink)->name() << "'");
+
+   } else if (clid == ClassID_traits< ViewContainer >::ID()) {
+    
+    const ElementLink<ViewContainer> elementLink = tc->objectLink<ViewContainer>(name);
+    if (!elementLink.isValid()) ATH_MSG_WARNING("  Invalid element link to View, link name:'" << name << "'");
+    else ATH_MSG_DEBUG("  Dereferenced link '" << name << "' to View:'" << *elementLink);
+
 
   } else {
-    ATH_MSG_DEBUG("Ignoring link to '" << name << "' with CLID " << clid);
+    ATH_MSG_DEBUG("  Ignoring link to '" << name << "' with link CLID " << clid);
   }
 
   return StatusCode::SUCCESS;
@@ -4104,11 +4109,11 @@ StatusCode TrigEDMChecker::TrigCompositeNavigationToDot(std::string& returnValue
   // This constexpr is evaluated at compile time
   const CLID TrigCompositeCLID = static_cast<CLID>( ClassID_traits< xAOD::TrigCompositeContainer >::ID() );
   std::vector<std::string> keys;
-  if ( m_doDumpAll ) {
+  if ( m_doDumpAllTrigComposite ) {
     evtStore()->keys(TrigCompositeCLID, keys);
   }
   else {
-    std::vector<std::string> keys = m_dumpTrigCompositeContainers;
+    keys = m_dumpTrigCompositeContainers;
   }
   std::string typeNameTC;
   ATH_CHECK(m_clidSvc->getTypeNameOfID(TrigCompositeCLID, typeNameTC));
@@ -4123,8 +4128,21 @@ StatusCode TrigEDMChecker::TrigCompositeNavigationToDot(std::string& returnValue
   ss << "  node [shape=rectangle]" << std::endl;
   ss << "  rankdir = BT" << std::endl;
 
+  const std::vector<std::string> vetoList = { // Patterns to ignore when dumping all
+    "TrigCostContainer",
+    "L1DecoderSummary"
+    };
+
   // Now process them
-  for (const std::string key : keys) {
+  for (const std::string& key : keys) {
+    bool veto = false;
+    for (const std::string& vetoStr : vetoList) {
+      if (m_doDumpAllTrigComposite && key.find(vetoStr) != std::string::npos) {
+        veto = true;
+        break;
+      }
+    }
+    if (veto) continue;
     ATH_CHECK( evtStore()->retrieve( container, key ) );
     size_t index = 0;
     ss << "  subgraph " << key << " {" << std::endl;
@@ -4146,21 +4164,23 @@ StatusCode TrigEDMChecker::TrigCompositeNavigationToDot(std::string& returnValue
       // Output all the things I link to
       for (size_t i = 0; i < tc->linkColNames().size(); ++i) {
         const std::string link = tc->linkColNames().at(i);
-        if (link == "seed") {
-          const xAOD::TrigComposite* seed = tc->object<xAOD::TrigComposite>("seed");
-          ss << "    \"" << tc << "\" -> \"" << seed << "\" [label=\"seed\"]" << std::endl; 
+        if (link == "self") {
+          continue; // Ignore the "self" link
+        } else if (link == "seed" || link == "seed__COLL") {
+          const xAOD::TrigComposite* seed = tc->object<xAOD::TrigComposite>(link);
+          ss << "    \"" << tc << "\" -> \"" << seed << "\" [label=\"seed\"]" << std::endl; // Print ptr address
         } else {
           // Start with my class ID
           const CLID linkCLID = static_cast<CLID>( tc->linkColClids().at(i) );
           // Use it to get my class name
           std::string tname;
           ATH_CHECK(m_clidSvc->getTypeNameOfID(linkCLID, tname));
-          // Now ge the sgkey I'm linking to & the index
+          // Now get the sgkey I'm linking to & the index
           const SG::sgkey_t key = static_cast<SG::sgkey_t>( tc->linkColKeys().at(i) );
           const unsigned index = tc->linkColIndices().at(i);
           // Look it up
           CLID checkCLID;
-          const std::string* keyStr = evtStore()->keyToString(key, checkCLID);
+          const std::string* keyStr = evtStore()->keyToString(key, checkCLID); // I don't own this str
           if (keyStr != nullptr && checkCLID != linkCLID) {
             std::string tnameOfCheck;
             m_clidSvc->getTypeNameOfID(checkCLID, tnameOfCheck).ignore(); // Might be invalid. But we don't care.
@@ -4168,7 +4188,7 @@ StatusCode TrigEDMChecker::TrigCompositeNavigationToDot(std::string& returnValue
               << ". We were expecting " << linkCLID << " [" << tname << "]");
           }
           // Print
-          ss << "    \"" << tc << "\" -> \"";
+          ss << "    \"" << tc << "\" -> \""; // Print ptr address
           ss << "Container=" << tname << "\\nKey=";
           if (keyStr != nullptr) ss << *keyStr;
           else ss << "[KEY "<< key <<" NOT IN STORE]"; 
diff --git a/Trigger/TrigValidation/TrigValTools/bin/atn_summary.pl b/Trigger/TrigValidation/TrigValTools/bin/atn_summary.pl
deleted file mode 100755
index 25a2404739f77f055b2b951dc9afda0741325846..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TrigValTools/bin/atn_summary.pl
+++ /dev/null
@@ -1,658 +0,0 @@
-#!/usr/bin/perl -w
-use strict;
-use File::Basename;
-use Date::Manip::Date;
-
-# Produce summary table for trigtest.pl tests in same dir or first parameter to script
-my $output="index.html";
-
-# If given, use first argument as output file
-if ($#ARGV>=0) {
-  $output=$ARGV[0];
-}
-print "Writing output to $output\n";
-
-# Test procedure.
-# 1. Identify nightly to use for test, and the path to the working directory, e.g.
-#    17.X.0 rel_1 TrigAnalsysTest:
-#    web http://atlas-computing.web.cern.ch/atlas-computing/links/buildDirectory/nightlies/devval/AtlasAnalysis/rel_1/NICOS_area/NICOS_atntest17X0VAL64BS5G4AnlOpt/triganalysistest_testconfiguration_work/
-#    afs /afs/cern.ch/atlas/software/builds/nightlies/devval/AtlasAnalysis/rel_1/NICOS_area/NICOS_atntest17X0VAL64BS5G4AnlOpt/triganalysistest_testconfiguration_work/
-# 2. Find the output from that nightly in the atn_summary log file, e.g.
-#    http://atlas-computing.web.cern.ch/atlas-computing/links/distDirectory/nightlies/developmentWebArea/nicos_web_area17X0VAL64BS5G4AnlOpt/NICOS_TestLog_rel_1/Trigger_TrigValidation_TrigAnalysisTest_36__TrigAnalysisTest_TestConfiguration__atn_xml_summary_table__x.html
-#    and cut and paste the environment settings from that:
-#    "To test, set the following environment:"
-# 3. Make a mock-up of the working directory for the tests 
-#   a) create a path that the script will recognise, e.g. from step 1 above, 
-#      take this path. You need at least the rel_ part:
-#        dir=builds/nightlies/17.X.0/AtlasAnalysis/rel_1/NICOS_area/NICOS_atntest17X064BS5G4AnlOpt/triganalysistest_testconfiguration_work/
-#        mkdir -p $dir
-#        cd $dir
-#   b) Make copies for files and links to test dirs from ATN itself
-#    find  /afs/cern.ch/atlas/software/$dir -maxdepth 1 -type d -exec ln -s {} . \;
-#    find  /afs/cern.ch/atlas/software/$dir -maxdepth 1 \! -type d -exec cp {} . \;
-# 
-# 4. Rename the previous index.html to something else e.g. 
-#    mv index.html index.html.orig
-# 5. Now you can run atn_summary.pl
-#    Check there are no warnings or errors of course.
-# 6. Compare index.html to index.html.orig, look for expected changes
-# 7. Use a web brower to view it, e.g.
-#    firefox -no-remote file://`pwd`/index.html
-
-# these lines must match trigtest.pl:
-my $regtestout = "regtest.log";
-my $htmldiffout = "regtest.html";
-my $summaryout = "summary.log";
-my $timerout = "timer.log";
-my $checklogout = "checklog.log";
-my $warnout = "warn.log";
-my $rootcompout = "rootcompout.log";
-my $checkcountout = "checkcountout.log";
-#my $edmcheckout = "edmcheckout.log";
-my $postcmdout = "postcmd.log";
-my $posttestrc = "post_test.exitcodes";
-my $docout = "doc.txt";
-my $athenalogglob = "*_{tail,test}.log{,.gz}"; # add .gz
-my $atn_timeline = "atn_timeline.png";
-my $atn_order = "atn_timeline_order.txt";
-my $no_of_nightlies=7;
-my %no_of_nightlies_exceptions = ('TrigMC',2);
-my %ERROR = (
-          OK => 0,
-          SCRIPT_MISC => 1,
-	      POST_TEST_BAD_EXIT => 2,
-	      ROOTCOMP_MISMATCH => 4,
-          ATHENA_BAD_EXIT => 8,
-          CHECKCOUNTS_FAILED => 16,
-          ATHENA_ERROR_IN_LOG => 32,
-          ATHENA_REGTEST_FAILED => 64,
-	      ATN_TIME_LIMIT => 128,
-          PRECONDITION_FAILED_SO_NOT_RUN => 256
-          );
-
-my $atn_rel = "unkown";
-my $atn_platform = "unkown";
-# use to fake env for testing - uncomment to enable
-my $testcwd;
-#my $testcwd = "/afs/cern.ch/atlas/software/builds/nightlies/17.X.0/AtlasAnalysis/rel_1/NICOS_area/NICOS_atntest17X064BS5G4AnlOpt/triganalysistest_testconfiguration_work/";  
-
-
-sub main();
-main();
-exit;
-
-sub main(){
-    # for debugging:
-    system("printenv > atn_summary_printenv.log");
-    print "\nTo test, set the following environment. If unset, results may not reproduce those within ATN. Read this script for more details on testing procedure.\n";
-    my $ev;
-    foreach $ev qw(AtlasProject AtlasVersion NICOS_GIT_RELBRANCH NICOS_PROJECT_RELNAME_COPY){
-        print "export " . $ev . "=" . getEnv($ev,"") . "\n";
-    }
-    print "\n";
-    my $context = getcontext();
-    my $testdir='.';
-    my @testnames=();
-    my %exitcodes=();
-    my %maskedcodes=();
-    my %doc=();
-    my %timer=();
-    my %order = getorder();
-    my $project = getEnv('AtlasProject',getEnv('NICOS_ATLAS_PROJECT',''));
-    my $gitbranch = getEnv('NICOS_GIT_RELBRANCH','');
-    my $release = getEnv('AtlasVersion','');
-    opendir(DIRHANDLE, $testdir) || die "Cannot opendir $testdir: $!";
-    foreach my $name (sort readdir(DIRHANDLE)) {
-        if (-d $name and $name !~ /^\./){
-            print "found dir: $name ... ";
-            push @testnames, $name;
-            if (-f "$name/$summaryout"){
-                print "found summary file\n";
-                open SUMMARYIN, "<$name/$summaryout";
-                while (<SUMMARYIN>){
-                    if (/exitcode = (\d+)/){
-                        $exitcodes{$name} = $1;
-                    }
-                    elsif (/maskedcode = (\d+)/){
-                        $maskedcodes{$name} = $1;
-                    }
-                }
-                close SUMMARYIN;
-                if (-f "$name/$timerout"){
-                    print "found timer file\n";
-                    open TIMERIN, "<$name/$timerout";
-                    while (<TIMERIN>){
-                        my ($wall,$user,$system)=split;
-                        $timer{$name}=$wall;
-                    }
-                    close TIMERIN;
-                } 
-                else {
-                    print "no timer file\n";
-                }
-            } else {
-                print "no summary file\n";
-            }
-            $doc{$name}="";
-            if (-f "$name/$docout"){
-                print "found doc file\n";
-                open DOCIN, "<$name/$docout";
-                while (<DOCIN>){
-                    chomp;
-                    $doc{$name}.=$_;
-                }
-                close DOCIN;
-            } 
-            else {
-                print "no doc file\n";
-            }
-            
-        }
-    }
-    closedir(DIRHANDLE);
-    
-    open HTMLOUT, "> $output" or die "failed to write to $output: $!";
-    print HTMLOUT "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">
-<html>\n<head>\n<script type=\"text/javascript\" src=\"http://atlas-project-trigger-release-validation.web.cern.ch/atlas-project-trigger-release-validation/www/js/sorttable.js\"></script>\n<script type=\"text/javascript\" src=\"http://atlas-project-trigger-release-validation.web.cern.ch/atlas-project-trigger-release-validation/www/js/suitehighlight.min.js\"></script>\n<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" >
-<title>Trigger ATN results for $project,$gitbranch,$release</title>\n
-<script type=\"text/javascript\">
-
-var thisRelease = null;
-var loaded = false;
-
-function highlightDiffs(clear) {
-  var table1 = document.getElementById('ATNResults');
-  var table2 = null;
-  if (!clear) {
-    try {
-      table2 = document.getElementById('DiffFrame').contentWindow.document.getElementById('ATNResults');
-    }
-    catch (e) {}
-  }
-
-  var diffs = 0;
-  for (var i=1; i < table1.rows.length; i++) {
-    var cells = table1.rows[i].cells;
-    for (var j=1; j < cells.length; j++) {   // skip name
-      if (j==9) continue;   // skip timing
-      if (!table2 || cells[j].textContent == table2.rows[i].cells[j].textContent) {
-        cells[j].style.backgroundColor = '';
-        cells[j].title = '';
-      }
-      else {
-        cells[j].style.backgroundColor = '#FFCCCC';
-        cells[j].title = table2.rows[i].cells[j].textContent || table2.rows[i].cells[j].innerText;
-        diffs++;
-      }
-    }
-  }
-  setDiffCount(diffs);
-}
-
-function setDiffCount(diffs) {
-  if (diffs>0) {        
-    document.getElementById('nDiffs').textContent = diffs+' differences';
-  }
-  else {
-    document.getElementById('nDiffs').textContent = '';
-  }
-}
-
-function loadPage() {
-  var diffRelease = document.DiffForm.rel.value;
-  var iframe = document.getElementById('DiffFrame');  
-  if (diffRelease != thisRelease) {
-    // Load second summary page in hidden iframe
-    var url = window.document.location.href;
-    iframe.src = url.replace(/rel_[0-6]/, diffRelease);
-  }
-  else {
-    highlightDiffs(true);  // remove all highlighting
-  }
-}
-
-function setRelease() {
-  var url = window.document.location.href;
-  thisRelease = url.match(/rel_[0-6]/);
-  if (thisRelease) {
-    thisRelease = thisRelease[0];
-    document.DiffForm.rel.value = thisRelease;
-  }
-  return true;
-}
-
-function popup(mylink, windowname) {
-  if (! window.focus) return true;
-  var href;
-  if (typeof(mylink) == 'string')
-    href=mylink;
-  else
-    href=mylink.href;
-  window.open(href, windowname, 'width=1000,height=300,toolbar=yes,resizable=yes,scrollbars=yes');
-  return false;
-}
-
-function showBuildFailures(failures,link) {
-  if (failures!='0') {
-    document.write('<a href=\"'+link+'\" style=\"color:Red\">Build failures: '+failures+'</a>');
-  }
-}
-
-</script>
-</head>
-<style type=\"text/css\">
-  tr.hi:hover {background-color:#E6E6E6;}
-</style>
-<body onload=\"highlightSuite({id:'ATNResults'});setDiffCount(0);\">
-<h1>Trigger ATN test results summary</h1>
-<form name=\"DiffForm\">
-";
-
-  
-    my $now=qx(date);
-    my $testWWWPage=getTestWWWPage();
-    my $nicosWWWPage=dirname($testWWWPage);
-
-    print HTMLOUT "<p>Last updated $now</p>\n";
-    
-	my $atn_relno = $atn_rel;
-	$atn_relno =~ s/rel_//;
-	print HTMLOUT "<p><a href=\"".$testWWWPage."\">Nightly test</a>: $project,$gitbranch,<b>$release</b> ($atn_platform)";
-	print HTMLOUT "<script src=\"".$nicosWWWPage."/build_failures_".$atn_relno.".js\" language=\"JavaScript\"></script>\n";
-	print HTMLOUT "<script type=\"text/javascript\">showBuildFailures(failures_".$atn_relno."(),"."\"".$nicosWWWPage."/nicos_buildsummary_".$atn_relno.".html\")</script>";
-
-    # Link to GitLab diff between today's and yesterday's release
-    my $fmt="%Y-%m-%dT%H%M";
-    my $date = new Date::Manip::Date;
-    $date->parse_format($fmt,$release);
-    my $delta = $date->new_delta();
-    $delta->set(d => -1);  # minus 1 day
-    my $yesterday = $date->calc($delta); 
-    my $prevrel = $yesterday->printf($fmt);
-    my $gitdiff = "https://gitlab.cern.ch/atlas/athena/compare/nightly%2F$gitbranch%2F$prevrel...nightly%2F$gitbranch%2F$release";	
-
-	print HTMLOUT "<br>Other nightlies: ";
-    if (defined $no_of_nightlies_exceptions{$project}){
-        $no_of_nightlies=$no_of_nightlies_exceptions{$project};
-        print "$project exceptionally has $no_of_nightlies nightly builds\n";
-    } else {
-        print "$project normally has $no_of_nightlies nightly builds\n";
-    }
-
-    my @dow = ('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
-	for (my $i=0; $i<$no_of_nightlies; $i++){
-	    if ("rel_$i" eq $atn_rel){
-            print HTMLOUT " $dow[$i] ";
-	    } else {
-            my $p=getrelpath();
-            $p =~ s/rel_\d/rel_$i/;
-            $p =~ s/rel_nightly/rel_$i/;
-            print HTMLOUT " <a href=\"$p\">$dow[$i]</a> ";
-	    }
-	}
-
-	print HTMLOUT "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-<a href=\"$gitdiff\">GitLab diff</a>
-&nbsp;&nbsp;&nbsp;&nbsp;Diff results: <select name=\"rel\" size=\"1\" onchange=\"loadPage()\">
-<option value='rel_0'>Sun</option>
-<option value='rel_1'>Mon</option>
-<option value='rel_2'>Tue</option>
-<option value='rel_3'>Wed</option>
-<option value='rel_4'>Thu</option>
-<option value='rel_5'>Fri</option>
-<option value='rel_6'>Sat</option>
-</select> <span id='nDiffs' style='font-weight:bold'></span>
-</form><script type=\"text/javascript\">setRelease();</script></p>";
-
-    print HTMLOUT "\n<table class=\"sortable\" id=\"ATNResults\" border=1><thead><tr>
-<th title=\"Click to sort by test suite\">Test name</th> 
-<th>Overall Result</th> 
-<th title=\"exit code of Athena\">Athena exit</th> 
-<th title=\"presence of any error messages in log\">Error Msgs</th> 
-<th title=\"number of warning messages in log\">Warn Msgs</th> 
-<th>Reg. tests</th> 
-<th title=\"expert histogram exact comparison to ref\">Root comp</th> 
-<th title=\"L2 + EF chain and trigger element counts within tolerance w.r.t. ref\"> Chain, TE cnts </th> 
-<th title=\"athena wall time in secs\">Time (s)</th> 
-<th title=\"trigtest.pl exit code, bare and masked for ATN\">Exit code</th> 
-<th>Post Tests</th> 
-<th>Dir. link</th> 
-<th>Log link</th></tr></thead><tbody>\n";
-    for my $name (@testnames){
-	my $atn_script = "-";
-	my $atn_timeout = "-";
-	my $athena_exit = "-";
-	my $error_msgs = "-";
-	my $error = "-";
-	my $warn = "-";
-	my $reg_tests = "-";
-	my $rootcomp = "-";
-	my $checkcount = "-";
-	my $timer = "-";
-	my $exitcode = "-";
-	my $maskedcode = "-";
-        my $postrc = 0;
-	my $logfile = "";
-	my $order = "";	
-	if (defined $exitcodes{$name}){
-	    $exitcode = $exitcodes{$name};
-	    if (defined $maskedcodes{$name}){
-		$maskedcode = $maskedcodes{$name};		
-		if ($maskedcodes{$name} != 0){
-		    $maskedcode = "<font color=\"red\">$maskedcodes{$name}</font>";		    
-		}
-	    }
-	    if (defined $timer{$name}){
-		$timer = $timer{$name};
-	    }
-	    $atn_script = testcode($exitcodes{$name},"SCRIPT_MISC");
-	    my $skipped = testcode($exitcodes{$name},"PRECONDITION_FAILED_SO_NOT_RUN");
-	    if ($skipped !~ /OK/){ 
-		$atn_script = "<div title=\"Not run because precondition failed\" style=\"color:gray\">SKIP</div>";
-		$logfile = "not run because precondition failed";
-	    }
-	    elsif ($atn_script !~ /OK/){
-		$atn_script = "<font color=\"red\">FAIL</font>";
-	    }
-	    else{
-		if ($maskedcodes{$name} != 0){
-		    my $errors = errornames($maskedcodes{$name});
-		    $atn_script = "<div title=\"Failures: $errors\" style=\"color:red\">ERROR</div>";
-		}
-
-		$atn_timeout = testcode($exitcodes{$name},"ATN_TIME_LIMIT");
-		$athena_exit = testcode($exitcodes{$name},"ATHENA_BAD_EXIT");
-		$rootcomp = testcode($exitcodes{$name},"ROOTCOMP_MISMATCH");
-		
-		if ($atn_timeout !~ /OK/){
-		    $athena_exit="<font color=\"yellow\">TIMEOUT</font>";
-		}
-		
-		# no checklog output file and no failure in exitcode
-		$error_msgs = testcode($exitcodes{$name},"ATHENA_ERROR_IN_LOG");
-		if (! -f "$name/$checklogout" and $error_msgs =~ /OK/){
-		    $error = "<font color=\"gray\">N/A</font>";
-		} else {
-		    my $error_count = '';
-		    if ($error_msgs !~ /OK/){
-			$error_count=qx(head -5 $name/$checklogout | grep 'Found messages in');
-			if ($error_count =~ /Found messages in.*\(([0-9]*)\).*/){
-			    $error_count="($1)";
-			}
-		    }
-		    print "error count: $error_count\n";
-		    $error = "<a type=\"text/plain\" href=\"$name/$checklogout\">$error_msgs$error_count</a>";
-		}
-		    
-		if (! -f "$name/$warnout"){
-		    $warn = "<font color=\"gray\">N/A</font>";
-		} else {
-                    my $warn_count=qx(head -5 $name/$warnout | grep 'Found messages in');
-		    if ($warn_count =~ /Found messages in.*\(([0-9]*)\).*/){
-                      $warn_count = $1;
-                      chomp $warn_count;
-                    }
-                    else {
-                      $warn_count = 'N/A'
-                    }
-		    print "warn count: $warn_count\n";
-		    $warn = "<a type=\"text/plain\" href=\"$name/$warnout\">$warn_count</a>";
-		}
-		if (! -e "$name/$regtestout"){
-		    $reg_tests = "<font color=\"gray\">N/A</font>";
-		} else {                  
-                    my $status = warncode($exitcodes{$name},"ATHENA_REGTEST_FAILED");
-                    my $tooltip = "";                    
-                    if ($status ne "OK") {
-                      my @diffs = `grep REGTEST $name/$regtestout | awk '{print \$2}' | sort -u`;
-                      chomp @diffs;
-                      if (scalar(@diffs) > 50) {
-                        $tooltip = "More than 50 sources of REGTEST differences!";
-                      }
-                      elsif (scalar(@diffs) > 0) {
-                        $tooltip = join(", ",@diffs);
-                      }
-                    }
-		    $reg_tests = "<a type=\"text/plain\" title=\"$tooltip\" href=\"$name/$regtestout\">" . $status . "</a>";
-                    if ($status ne "OK" and -e "$name/$htmldiffout"){
-                      $reg_tests .= " <a href=\"$name/$htmldiffout\">[ht]</a>"
-                    }
-		}
-		if (! -e "$name/$rootcompout"){
-		    $rootcomp = "<font color=\"gray\">N/A</font>";
-		} elsif ($rootcomp =~ /FAIL/){
-                    my @diffs = `egrep '^Different histograms:' $name/$rootcompout`;
-                    chomp @diffs;
-		    $rootcomp = "<a type=\"text/plain\" title=\"@diffs\" href=\"$name/$rootcompout\"><font color=\"red\">DIFF</font></a>";
-                    if (-e "$name/rootcomp.ps.gz") {
-                      $rootcomp .= " <a href=\"$name/rootcomp.ps.gz\">[ps]</a>";
-                    }
-		} elsif ($rootcomp =~ /OK/){
-		    $rootcomp = "<a type=\"text/plain\" href=\"$name/$rootcompout\"><font color=\"green\">MATCH</font></a>";
-		}
-		if (! -f "$name/$checkcountout"){
-		    $checkcount = "<font color=\"gray\">N/A</font>";
-		} else {
-		    my $checkcount1 = chaincountcheck("$name/$checkcountout");
-		    print "check chain counts: $checkcount1\n";
-		    $checkcount = "<a type=\"text/plain\" href=\"$name/$checkcountout\">$checkcount1</a>";
-		}
-		$postrc = 0;
-		if (! -e "$name/$posttestrc"){
-                  $postrc = "<font color=\"gray\">N/A</font>";
-                } elsif (($exitcodes{$name} & $ERROR{"POST_TEST_BAD_EXIT"})==0) {
-                  $postrc = "OK";
-                } else {                  
-                  $postrc = getposttests($name);
-		}
-
-	    }
-	}
-	my @logfiles = glob("$name/$athenalogglob");
-	for (@logfiles){
-	    my ($lfd, $lflabel) = split('/',$_);
-	    $lflabel = "[tail]" if ($lflabel =~ /tail/);
-	    $logfile .= "<a type=\"text/plain\" href=\"$_\"><font size=-2>$lflabel</font></a> ";
-	}
-	if (length($logfile)==0){
-	    $logfile = "&nbsp;";
-	}
-	print "logfile=$logfile\n";
-	
-	my $thename = $name;
-	my $logurl;
-	if ($context){
-	    $logurl = getlogpath($name,$testdir);
-	}
-	# special case when run by hand, log might be in current dir as testname.log
-	if (! defined $logurl and -f "$name.log"){
-	    $logurl="$name.log";
-	}
-	if (defined $logurl){
-	    $thename = "<a type=\"text/plain\" href=\"$logurl\">$name</a>";
-	    print "found URL: $logurl\n";
-	} else {
-	    print "not found URL for $name\n";
-	}
-
-	if (exists $order{$name}) {
-	    $order = "suite=\"$order{$name}[1]\" sorttable_customkey=\"$order{$name}[0]\"";
-	}
-	print HTMLOUT "<tr class=\"hi\"><td $order title=\"$doc{$name}\">$thename</td> <td>$atn_script</td> <td>$athena_exit</td> <td>$error</td> <td>$warn</td> <td style=\"white-space:nowrap\">$reg_tests</td> <td style=\"white-space:nowrap\">$rootcomp</td> <td>$checkcount</td> <td><a type=\"text/plain\" href=\"$name/$timerout\">$timer</a></td> <td>$exitcode/$maskedcode</td> <td>$postrc</td> <td><a href=\"$name\">dir</a></td><td>$logfile</td></tr>\n";
-    }
-    print HTMLOUT "</tbody></table>";
-    if (-e "$atn_timeline"){
-      print HTMLOUT "<font face=\"monospace\"><br>";
-      my @lines = `tail -3 *atn_timeline.log`;
-      print HTMLOUT join('<br>',@lines);
-      print HTMLOUT "<a href=\"atn_timeline.png\"> [timeline plot]</a>";
-      print HTMLOUT "</font>";
-    }
-    print HTMLOUT '<iframe onload="highlightDiffs(false)" id="DiffFrame" style="visibility:hidden;display:none;"></iframe></body></html>';
-    close HTMLOUT;
-    
-}
-
-sub chaincountcheck($){
-    my ($infile)=@_;
-    my $counts="";
-    my $nonexist = 0;
-    open COUNTIN, "<$infile" or return "-";
-    while (<COUNTIN>){
-	if (/Fraction inside tolerance\:\s+(\d+)\/(\d+)/){
-	    $counts .= "$1/$2 "
-	} elsif (/does not exist/){
-            $nonexist++;
-        }   
-    }
-    close COUNTIN;
-    $counts = "New" if ($counts eq "" &&  $nonexist >  0);
-    $counts = "OK" if ($counts eq "");
-    print "nonexistant counts: $nonexist\n"; 
-    return $counts;
-}
-
-sub testcode($$){
-    my ($code,$string) = @_;
-    my $value=$ERROR{$string};
-    return (($code & $value)? "<font color=\"red\">FAIL</font>" : "OK");
-}
-
-sub warncode($$){
-    my ($code,$string) = @_;
-    my $value=$ERROR{$string};
-    return (($code & $value)? "<font color=\"orange\">WARN</font>" : "OK");
-}
-
-sub getEnv($$){
-  my ($name,$default) = @_;
-  if (exists $ENV{$name}) {
-    return $ENV{$name};
-  }
-  else {
-    return $default;
-  }
-}
-
-# figure out which nightly this is and where logs are etc.
-# this wil only work if run in ATN.
-sub getcontext(){
-    my $cwd = '';
-    chomp($cwd=`pwd`);
-    # for testing: 
-    if (defined $testcwd){
-        print "!WARNING: TEST MODE!";
-        $cwd=$testcwd;
-    }
-    print "--------------------------------------------------------\n";
-    print "$cwd\n";
-    if ($cwd =~ /NICOS_.*test([\w\d]+)\//){   # NICOS_qmtest (old) or NICOS_atntest (new) directory
-	$atn_platform=$1;
-    print "ATN_JOB_LOGFILE=" . getEnv("ATN_JOB_LOGFILE","") . "\n";
-	print "ATN_PACKAGE=" . getEnv("ATN_PACKAGE","") . "\n";
-	print "--------------------------------------------------------\n";
-    }    
-    $atn_rel = $ENV{'NICOS_PROJECT_RELNAME_COPY'};
-    
-    if (defined $atn_platform and defined $atn_rel){
-	print "$atn_platform $atn_rel $cwd\n";
-    }else{
-	print "atn_platform and atn_rel not defined - probably running outside ATN\n";
-    }
-    return (defined $atn_platform && defined $atn_rel && defined $cwd);
-}
-
-sub getlogpath($){
-    my ($name,$testdir) = @_;
-    my $found;
-    opendir(DIRHANDLE, $testdir) || die "Cannot opendir $testdir: $!";
-    foreach my $file (sort readdir(DIRHANDLE)) {
-	if ($file =~ /__${name}.log/){
-	    #print "$name matches $file\n";
-	    $found="$file";
-	    last;
-	}
-    }
-    return $found;
-}
-
-# create a relative URL by going back (../) until rel_N is reached, then forward again to here. This can then be changed to use for other rel_N
-sub getrelpath(){
-    my $pcwd = '';
-    chomp($pcwd=`pwd`);
-    # for testing
-    if (defined $testcwd){
-        $pcwd=$testcwd;
-    }
-    my @pcwd = split('/',$pcwd);
-    my ($i, $n, $up, $down);
-    $up="";
-    $down="";
-    for ($i=$#pcwd; $i>=0; --$i){
-	$up.="../";
-	$down = $pcwd[$i]. "/" . $down;
-	if ($pcwd[$i] =~ /rel_/){
-	    last;
-	}
-    }
-    return "$up$down";
-}
-
-# find the directory name we are in, e.g. triganalysistest_testconfiguration_work
-sub gettestpkgdir(){
-    use File::Basename;
-    my $cwd = '';
-    chomp($cwd=`pwd`);
-    if (defined $testcwd){
-        $cwd=$testcwd;
-    }
-    return basename($cwd);
-}
-
-sub getposttests(){
-  my ($testname) = @_;
-  my $text;
-  open POSTRC, "<$testname/$posttestrc" or return "";
-  while (<POSTRC>){
-    chomp;
-    (my $name, my $rc) = split();
-    if ($rc!=0){
-      $text .= "<a type=\"text/plain\" href=\"$testname/post_test_$name.log\"><font color=\"red\">$name</font></a> ";
-    }
-  }
-  close POSTRC;
-  return "<font size=\"-2\">$text</font>";
-}
-
-sub getorder(){
-    my %order = ();
-    open ORDER,"<$atn_order" or return %order;
-    while (<ORDER>){
-	chomp;
-	(my $i, my $name, my $suite) = split();
-	$order{$name} = [$i,$suite]
-    }
-    return %order;
-}
-
-sub errornames() {
-    my ($code) = @_;
-    my @errors = ();
-    foreach my $key ( keys %ERROR ) {
-	if (($code & $ERROR{$key}) != 0) {
-	    push(@errors,$key);
-	}
-    }
-    return join(', ', @errors);
-}
-
-sub getTestWWWPage() {
-    open XML,"ATNOverview.xml" or return "";
-    while (<XML>){
-	chomp;
-	if (/<testWWWPage>(.*)<\/testWWWPage>/){
-	    return $1;
-	}
-    }
-    return "";	
-}
diff --git a/Trigger/TrigValidation/TrigValTools/bin/atn_summary_ART.pl b/Trigger/TrigValidation/TrigValTools/bin/atn_summary_ART.pl
deleted file mode 100755
index e90ca91cf87f1adf3f2486696c3b8cfb4bcc5b12..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TrigValTools/bin/atn_summary_ART.pl
+++ /dev/null
@@ -1,816 +0,0 @@
-#!/usr/bin/perl -w
-use strict;
-use File::Basename;
-use Date::Manip::Date;
-
-# Produce summary table for trigtest.pl tests in same dir or first parameter to script
-my $output="index.php";
-
-# If given, use first argument as output file
-if ($#ARGV>=0) {
-  $output=$ARGV[0];
-}
-print "Writing output to $output\n";
-
-# Test procedure.
-# 1. Identify nightly to use for test, and the path to the working directory, e.g.
-#    17.X.0 rel_1 TrigAnalsysTest:
-#    web http://atlas-computing.web.cern.ch/atlas-computing/links/buildDirectory/nightlies/devval/AtlasAnalysis/rel_1/NICOS_area/NICOS_atntest17X0VAL64BS5G4AnlOpt/triganalysistest_testconfiguration_work/
-#    afs /afs/cern.ch/atlas/software/builds/nightlies/devval/AtlasAnalysis/rel_1/NICOS_area/NICOS_atntest17X0VAL64BS5G4AnlOpt/triganalysistest_testconfiguration_work/
-# 2. Find the output from that nightly in the atn_summary log file, e.g.
-#    http://atlas-computing.web.cern.ch/atlas-computing/links/distDirectory/nightlies/developmentWebArea/nicos_web_area17X0VAL64BS5G4AnlOpt/NICOS_TestLog_rel_1/Trigger_TrigValidation_TrigAnalysisTest_36__TrigAnalysisTest_TestConfiguration__atn_xml_summary_table__x.html
-#    and cut and paste the environment settings from that:
-#    "To test, set the following environment:"
-# 3. Make a mock-up of the working directory for the tests 
-#   a) create a path that the script will recognise, e.g. from step 1 above, 
-#      take this path. You need at least the rel_ part:
-#        dir=builds/nightlies/17.X.0/AtlasAnalysis/rel_1/NICOS_area/NICOS_atntest17X064BS5G4AnlOpt/triganalysistest_testconfiguration_work/
-#        mkdir -p $dir
-#        cd $dir
-#   b) Make copies for files and links to test dirs from ATN itself
-#    find  /afs/cern.ch/atlas/software/$dir -maxdepth 1 -type d -exec ln -s {} . \;
-#    find  /afs/cern.ch/atlas/software/$dir -maxdepth 1 \! -type d -exec cp {} . \;
-# 
-# 4. Rename the previous index.html to something else e.g. 
-#    mv index.html index.html.orig
-# 5. Now you can run atn_summary.pl
-#    Check there are no warnings or errors of course.
-# 6. Compare index.html to index.html.orig, look for expected changes
-# 7. Use a web brower to view it, e.g.
-#    firefox -no-remote file://`pwd`/index.html
-
-# these lines must match trigtest.pl:
-my $regtestout = "regtest.log";
-my $htmldiffout = "regtest.html";
-my $summaryout = "summary.log";
-my $timerout = "timer.log";
-my $checklogout = "checklog.log";
-my $warnout = "warn.log";
-my $rootcompout = "rootcompout.log";
-my $checkcountout = "checkcountout.log";
-#my $edmcheckout = "edmcheckout.log";
-my $postcmdout = "postcmd.log";
-my $posttestrc = "post_test.exitcodes";
-my $docout = "doc.txt";
-my $athenalogglob = "*_{tail,test}.log{,.gz}"; # add .gz
-my $atn_timeline = "atn_timeline.png";
-my $atn_order = "atn_timeline_order.txt";
-my $no_of_nightlies=7;
-my %no_of_nightlies_exceptions = ('TrigMC',2);
-my %ERROR = (
-          OK => 0,
-          SCRIPT_MISC => 1,
-	      POST_TEST_BAD_EXIT => 2,
-	      ROOTCOMP_MISMATCH => 4,
-          ATHENA_BAD_EXIT => 8,
-          CHECKCOUNTS_FAILED => 16,
-          ATHENA_ERROR_IN_LOG => 32,
-          ATHENA_REGTEST_FAILED => 64,
-	      ATN_TIME_LIMIT => 128,
-          PRECONDITION_FAILED_SO_NOT_RUN => 256
-          );
-
-my $atn_rel = "unkown";
-my $atn_platform = "unkown";
-# use to fake env for testing - uncomment to enable
-my $testcwd;
-#my $testcwd = "/afs/cern.ch/atlas/software/builds/nightlies/17.X.0/AtlasAnalysis/rel_1/NICOS_area/NICOS_atntest17X064BS5G4AnlOpt/triganalysistest_testconfiguration_work/";  
-
-
-sub main();
-main();
-exit;
-
-sub main(){
-    # for debugging:
-    system("printenv > atn_summary_printenv.log");
-    print "\nTo test, set the following environment. If unset, results may not reproduce those within ATN. Read this script for more details on testing procedure.\n";
-    my $ev;
-    foreach $ev qw(AtlasProject AtlasVersion NICOS_GIT_RELBRANCH NICOS_PROJECT_RELNAME_COPY){
-        print "export " . $ev . "=" . getEnv($ev,"") . "\n";
-    }
-    print "\n";
-    my $context = getcontext();
-    my $testdir='.';
-    my @testnames=();
-    my %exitcodes=();
-    my %maskedcodes=();
-    my %doc=();
-    my %timer=();
-    my %order = getorder();
-    my $project = getEnv('AtlasProject',getEnv('NICOS_ATLAS_PROJECT',''));
-    my $gitbranch = getEnv('NICOS_GIT_RELBRANCH','');
-    my $release = getEnv('AtlasVersion','');
-    opendir(DIRHANDLE, $testdir) || die "Cannot opendir $testdir: $!";
-    # modification to run on ART jobs (ATR-17644i)
-    foreach my $upname (sort readdir(DIRHANDLE)) {
-      if (-d $upname and $upname !~ /^\./){
-        print "found updir: $upname ... \n";
-        # $upname=$testdir."/".$upname;
-        opendir(SUBDIRHANDLE, $upname) || die "Cannot opendir $upname: $!";
-        foreach my $name (sort readdir(SUBDIRHANDLE)) {
-            next if $name eq ".";
-            next if $name eq "..";
-            $name=$upname."/".$name;
-            if (-d $name){
-                print "found dir: $name ... ";
-                push @testnames, $name;
-                if (-f "$name/$summaryout"){
-                    print "found summary file\n";
-                    open SUMMARYIN, "<$name/$summaryout";
-                    while (<SUMMARYIN>){
-                        if (/exitcode = (\d+)/){
-                            $exitcodes{$name} = $1;
-                        }
-                        elsif (/maskedcode = (\d+)/){
-                            $maskedcodes{$name} = $1;
-                        }
-                    }
-                    close SUMMARYIN;
-                    if (-f "$name/$timerout"){
-                        print "found timer file\n";
-                        open TIMERIN, "<$name/$timerout";
-                        while (<TIMERIN>){
-                            my ($wall,$user,$system)=split;
-                            $timer{$name}=$wall;
-                        }
-                        close TIMERIN;
-                    } 
-                    else {
-                        print "no timer file\n";
-                    }
-                } else {
-                    print "no summary file\n";
-                }
-                $doc{$name}="";
-                if (-f "$name/$docout"){
-                    print "found doc file\n";
-                    open DOCIN, "<$name/$docout";
-                    while (<DOCIN>){
-                        chomp;
-                        $doc{$name}.=$_;
-                    }
-                    close DOCIN;
-                } 
-                else {
-                    print "no doc file\n";
-                }
-                
-            }
-        }
-        closedir(SUBDIRHANDLE);
-      }
-    }
-    closedir(DIRHANDLE);
-    
-    open HTMLOUT, "> $output" or die "failed to write to $output: $!";
-    print HTMLOUT "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">
-<html>\n<head>\n<script type=\"text/javascript\" src=\"http://atlas-project-trigger-release-validation.web.cern.ch/atlas-project-trigger-release-validation/www/js/sorttable.js\"></script>\n<script type=\"text/javascript\" src=\"http://atlas-project-trigger-release-validation.web.cern.ch/atlas-project-trigger-release-validation/www/js/suitehighlight.min.js\"></script>\n<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" >
-<title>Trigger ART results for $project,$gitbranch,$release</title>\n
-<script type=\"text/javascript\" src=\"https://www.gstatic.com/charts/loader.js\"></script>
-<script type=\"text/javascript\">
-
-    google.charts.load('current', {packages: ['corechart', 'line']});
-    google.charts.setOnLoadCallback(drawCrosshairs17000);
-    google.charts.setOnLoadCallback(drawCrosshairs9000);
-
-    function drawCrosshairs17000() {
-                var data = new google.visualization.DataTable();
-
-                data.addColumn('string', 'Nightly');
-
-                <?php
-                        
-                        \$nightlies = glob(dirname(__FILE__) . '/../../*');
-                        \$nightlies = array_values(\$nightlies);
-                        \$content = file_get_contents(dirname(__FILE__).'/test_HLT_physicsV7_menu_ART_and_ROSsim_build/HLT_physicsV7_ROSsim_17000/ATLASros2rob2018.py');
-                        //echo \$content;
-                        preg_match_all('/ROS-.[A-Z]+-.[A-Z]+-.[0-9]+/i',\$content,\$ROSes);
-                        \$ROSes = array_values(\$ROSes);
-                        foreach(\$ROSes as \$ros){
-                                \$ros = array_values(\$ros);
-                                foreach(\$ros as \$ros1){
-                                        echo \"                data.addColumn('number', '\$ros1'); \\n\";
-                                }
-                        }
-
-                        echo \"                data.addRows([\";
-                        foreach(\$nightlies as \$nightly){
-                                \$content = file_get_contents(\$nightly.'/TrigP1Test/test_HLT_physicsV7_menu_ART_and_ROSsim_build/HLT_physicsV7_ROSsim_17000/ROStest.reference.new');
-                                //echo \$content.'\\n';                           
-                                echo \"                ['\".basename(\$nightly).\"',\";
-                                foreach(\$ROSes as \$ros){
-                                        \$ros = array_values(\$ros);
-                                        foreach(\$ros as \$ros1){
-                                                //echo \$ros1.'\\n';
-                                                \$matched = preg_match_all('/'.\$ros1.'.[ \\t]+[|].[ \\t]+.[0-9]+.[ \t]+[|](.[.0-9]+)/', \$content,\$rates);
-                                                if(\$matched) echo \$rates[1][0].\",\";
-                                                else echo \"0.,\";
-                                                //print_r(\$rates);
-                                        }
-                                }
-                                echo \"],\";
-                        }
-                        echo \"                ]);\";
-                ?>
-
-        var options = {
-                title: 'ROS request rates in rejected events for lumi 1.7e34',
-                hAxis: {
-                        title: 'Nightly'
-                },
-                        vAxis: {
-                        title: 'ROS request rate'
-                },
-                //colors: ['#a52714', '#097138'],
-                crosshair: {
-                        color: '#000',
-                        trigger: 'selection'
-                }
-        };
-
-        var chart = new google.visualization.LineChart(document.getElementById('chart_div17000'));
-
-        chart.draw(data, options);
-
-    }
-    
-    function drawCrosshairs9000() {
-                var data = new google.visualization.DataTable();
-
-                data.addColumn('string', 'Nightly');
-
-                <?php
-                        
-                        \$nightlies = glob(dirname(__FILE__) . '/../../*');
-                        \$nightlies = array_values(\$nightlies);
-                        \$content = file_get_contents(dirname(__FILE__).'/test_HLT_physicsV7_menu_ART_and_ROSsim_build/HLT_physicsV7_ROSsim_9000/ATLASros2rob2018.py');
-                        //echo \$content;
-                        preg_match_all('/ROS-.[A-Z]+-.[A-Z]+-.[0-9]+/i',\$content,\$ROSes);
-                        \$ROSes = array_values(\$ROSes);
-                        foreach(\$ROSes as \$ros){
-                                \$ros = array_values(\$ros);
-                                foreach(\$ros as \$ros1){
-                                        echo \"                data.addColumn('number', '\$ros1'); \\n\";
-                                }
-                        }
-
-                        echo \"                data.addRows([\";
-                        foreach(\$nightlies as \$nightly){
-                                \$content = file_get_contents(\$nightly.'/TrigP1Test/test_HLT_physicsV7_menu_ART_and_ROSsim_build/HLT_physicsV7_ROSsim_9000/ROStest.reference.new');
-                                //echo \$content.'\\n';                           
-                                echo \"                ['\".basename(\$nightly).\"',\";
-                                foreach(\$ROSes as \$ros){
-                                        \$ros = array_values(\$ros);
-                                        foreach(\$ros as \$ros1){
-                                                //echo \$ros1.'\\n';
-                                                \$matched = preg_match_all('/'.\$ros1.'.[ \\t]+[|].[ \\t]+.[0-9]+.[ \t]+[|](.[.0-9]+)/', \$content,\$rates);
-                                                if(\$matched) echo \$rates[1][0].\",\";
-                                                else echo \"0.,\";
-                                                //print_r(\$rates);
-                                        }
-                                }
-                                echo \"],\";
-                        }
-                        echo \"                ]);\";
-                ?>
-
-        var options = {
-                title: 'ROS request rates in rejected events for lumi 0.9e34',
-                hAxis: {
-                        title: 'Nightly'
-                },
-                        vAxis: {
-                        title: 'ROS request rate'
-                },
-                //colors: ['#a52714', '#097138'],
-                crosshair: {
-                        color: '#000',
-                        trigger: 'selection'
-                }
-        };
-
-        var chart = new google.visualization.LineChart(document.getElementById('chart_div9000'));
-
-        chart.draw(data, options);
-
-    }
-
-</script>
-<script type=\"text/javascript\">
-
-var thisRelease = null;
-var loaded = false;
-
-
-
-
-function highlightDiffs(clear) {
-  var table1 = document.getElementById('ATNResults');
-  var table2 = null;
-  if (!clear) {
-    try {
-      table2 = document.getElementById('DiffFrame').contentWindow.document.getElementById('ATNResults');
-    }
-    catch (e) {}
-  }
-
-  var diffs = 0;
-  for (var i=1; i < table1.rows.length; i++) {
-    var cells = table1.rows[i].cells;
-    for (var j=1; j < cells.length; j++) {   // skip name
-      if (j==9) continue;   // skip timing
-      if (!table2 || cells[j].textContent == table2.rows[i].cells[j].textContent) {
-        cells[j].style.backgroundColor = '';
-        cells[j].title = '';
-      }
-      else {
-        cells[j].style.backgroundColor = '#FFCCCC';
-        cells[j].title = table2.rows[i].cells[j].textContent || table2.rows[i].cells[j].innerText;
-        diffs++;
-      }
-    }
-  }
-  setDiffCount(diffs);
-}
-
-function setDiffCount(diffs) {
-  if (diffs>0) {        
-    document.getElementById('nDiffs').innerHTML = '<a href=\"https://gitlab.cern.ch/atlas/athena/compare/nightly%2F21.1%2F'+document.DiffForm.rel.value+'...nightly%2F21.1%2F'+thisRelease+'\">'+diffs+' differences! click here for GitLab diff</a>';
-  }
-  else {
-    document.getElementById('nDiffs').textContent = '';
-  }
-}
-
-function loadPage() {
-  var diffRelease = document.DiffForm.rel.value;
-  var iframe = document.getElementById('DiffFrame');  
-  if (diffRelease != thisRelease) {
-    // Load second summary page in hidden iframe
-    var url = window.document.location.href;
-    iframe.src = url.replace(/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9][0-9][0-9]/, diffRelease);
-  }
-  else {
-    highlightDiffs(true);  // remove all highlighting
-  }
-}
-
-function setRelease() {
-  var url = window.document.location.href;
-  thisRelease = url.match(/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9][0-9][0-9]/);
-  if (thisRelease) {
-    thisRelease = thisRelease[0];
-    document.DiffForm.rel.value = thisRelease;
-  }
-  return true;
-}
-
-function popup(mylink, windowname) {
-  if (! window.focus) return true;
-  var href;
-  if (typeof(mylink) == 'string')
-    href=mylink;
-  else
-    href=mylink.href;
-  window.open(href, windowname, 'width=1000,height=300,toolbar=yes,resizable=yes,scrollbars=yes');
-  return false;
-}
-
-function showBuildFailures(failures,link) {
-  if (failures!='0') {
-    document.write('<a href=\"'+link+'\" style=\"color:Red\">Build failures: '+failures+'</a>');
-  }
-}
-
-</script>
-</head>
-<style type=\"text/css\">
-  tr.hi:hover {background-color:#E6E6E6;}
-</style>
-<body onload=\"highlightSuite({id:'ATNResults'});setDiffCount(0);\">
-<h1>Trigger ART test results summary</h1>
-<form name=\"DiffForm\">
-";
-
-  
-    my $now=qx(date);
-    my $testWWWPage=getTestWWWPage();
-    my $nicosWWWPage=dirname($testWWWPage);
-
-    print HTMLOUT "<p>Last updated $now. Contact: Daniele.Zanzi @ cern.ch</p>\n";
-
-#	my $atn_relno = $atn_rel;
-#	$atn_relno =~ s/rel_//;
-#	print HTMLOUT "<p><a href=\"".$testWWWPage."\">Nightly test</a>: $project,$gitbranch,<b>$release</b> ($atn_platform)";
-#	print HTMLOUT "<script src=\"".$nicosWWWPage."/build_failures_".$atn_relno.".js\" language=\"JavaScript\"></script>\n";
-#	print HTMLOUT "<script type=\"text/javascript\">showBuildFailures(failures_".$atn_relno."(),"."\"".$nicosWWWPage."/nicos_buildsummary_".$atn_relno.".html\")</script>";
-#
-    my $test_suite = gettestpkgdir(); # this is a basename of pwd (expected to be e.g. TrigP1Test)
-    print HTMLOUT "<p>Nightly test: $project, $gitbranch, $release\n\n";
-    print HTMLOUT "&emsp;Check other builds: <select name=\"select_other_builds\" onchange=\"location = this.value;\">\n";
-    print HTMLOUT "<option value=\"\" selected=\"selected\">-----</option>\n";
-    print HTMLOUT "<?php\n";
-    print HTMLOUT "             \$nightlies = glob(dirname(__FILE__) . '/../../*');\n";
-    print HTMLOUT "             \$nightlies = array_reverse(\$nightlies);\n";
-    print HTMLOUT "             \$current_page_link = \"\$_SERVER[REQUEST_URI]\";\n";
-    print HTMLOUT "             // protect against multiple slashes in a row\n";
-    print HTMLOUT "             \$current_page_link = preg_replace('#/+#','/',\$current_page_link);\n";
-    print HTMLOUT "             \$full_link = (isset(\$_SERVER['HTTPS']) ? \"https\" : \"http\") . \"://\$_SERVER[HTTP_HOST]\" . \$current_page_link;\n";
-    print HTMLOUT "             foreach(\$nightlies as \$nightly){\n";
-    print HTMLOUT "                 \$nightly = basename(\$nightly);\n";
-    print HTMLOUT "                 echo \"<option value='\" . \$full_link . \"../../\" . \$nightly . \"/$test_suite/\" . \"'>\".\$nightly.\"</option>\";\n";
-    print HTMLOUT "    }\n";
-    print HTMLOUT "?>\n";
-    print HTMLOUT "</select></p>\n";
-
-    print HTMLOUT "<p>Check differences: <select name=\"rel\" size=\"1\" onchange=\"loadPage()\">\n";
-    print HTMLOUT "<option value=\"\" selected=\"selected\">-----</option>\n";
-    print HTMLOUT "<?php\n";
-    print HTMLOUT "             \$nightlies = glob(dirname(__FILE__) . '/../../*');\n";
-    print HTMLOUT "             \$nightlies = array_reverse(\$nightlies);\n";
-    print HTMLOUT "             \$current_page_link = \"\$_SERVER[REQUEST_URI]\";\n";
-    print HTMLOUT "             // protect against multiple slashes in a row\n";
-    print HTMLOUT "             \$current_page_link = preg_replace('#/+#','/',\$current_page_link);\n";
-    print HTMLOUT "             \$full_link = (isset(\$_SERVER['HTTPS']) ? \"https\" : \"http\") . \"://\$_SERVER[HTTP_HOST]\" . \$current_page_link;\n";
-    print HTMLOUT "             foreach(\$nightlies as \$nightly){\n";
-    print HTMLOUT "                 \$nightly = basename(\$nightly);\n";
-    print HTMLOUT "                 echo \"<option value='\".\$nightly.\"'>\".\$nightly.\"</option>\";\n";
-    print HTMLOUT "    }\n";
-    print HTMLOUT "?>\n";
-    print HTMLOUT "</select> <span id='nDiffs' style='font-weight:bold'></span>
-</form><script type=\"text/javascript\">setRelease();</script></p>";
-
-
-    print HTMLOUT "\n<table class=\"sortable\" id=\"ATNResults\" border=1><thead><tr>
-<th title=\"Click to sort by test suite\">Test name</th> 
-<th>Overall Result</th> 
-<th title=\"exit code of Athena\">Athena exit</th> 
-<th title=\"presence of any error messages in log\">Error Msgs</th> 
-<th title=\"number of warning messages in log\">Warn Msgs</th> 
-<th>Reg. tests (incl. WARNING)</th> 
-<th title=\"expert histogram exact comparison to ref\">Root comp</th> 
-<th title=\"L2 + EF chain and trigger element counts within tolerance w.r.t. ref\"> Chain, TE cnts </th> 
-<th title=\"athena wall time in secs\">Time (s)</th> 
-<th title=\"trigtest.pl exit code, bare and masked for ATN\">Exit code</th> 
-<th>Post Tests</th> 
-<th>Dir. link</th> 
-<th>Log link</th></tr></thead><tbody>\n";
-    for my $name (@testnames){
-	my $atn_script = "-";
-	my $atn_timeout = "-";
-	my $athena_exit = "-";
-	my $error_msgs = "-";
-	my $error = "-";
-	my $warn = "-";
-	my $reg_tests = "-";
-	my $rootcomp = "-";
-	my $checkcount = "-";
-	my $timer = "-";
-	my $exitcode = "-";
-	my $maskedcode = "-";
-        my $postrc = 0;
-	my $logfile = "";
-	my $order = "";	
-	if (defined $exitcodes{$name}){
-	    $exitcode = $exitcodes{$name};
-	    if (defined $maskedcodes{$name}){
-		$maskedcode = $maskedcodes{$name};		
-		if ($maskedcodes{$name} != 0){
-		    $maskedcode = "<font color=\"red\">$maskedcodes{$name}</font>";		    
-		}
-	    }
-	    if (defined $timer{$name}){
-		$timer = $timer{$name};
-	    }
-	    $atn_script = testcode($exitcodes{$name},"SCRIPT_MISC");
-	    my $skipped = testcode($exitcodes{$name},"PRECONDITION_FAILED_SO_NOT_RUN");
-	    if ($skipped !~ /OK/){ 
-		$atn_script = "<div title=\"Not run because precondition failed\" style=\"color:gray\">SKIP</div>";
-		$logfile = "not run because precondition failed";
-	    }
-	    elsif ($atn_script !~ /OK/){
-		$atn_script = "<font color=\"red\">FAIL</font>";
-	    }
-	    else{
-		if ($maskedcodes{$name} != 0){
-		    my $errors = errornames($maskedcodes{$name});
-		    $atn_script = "<div title=\"Failures: $errors\" style=\"color:red\">ERROR</div>";
-		}
-
-		$atn_timeout = testcode($exitcodes{$name},"ATN_TIME_LIMIT");
-		$athena_exit = testcode($exitcodes{$name},"ATHENA_BAD_EXIT");
-		$rootcomp = testcode($exitcodes{$name},"ROOTCOMP_MISMATCH");
-		
-		if ($atn_timeout !~ /OK/){
-		    $athena_exit="<font color=\"yellow\">TIMEOUT</font>";
-		}
-		
-		# no checklog output file and no failure in exitcode
-		$error_msgs = testcode($exitcodes{$name},"ATHENA_ERROR_IN_LOG");
-		if (! -f "$name/$checklogout" and $error_msgs =~ /OK/){
-		    $error = "<font color=\"gray\">N/A</font>";
-		} else {
-		    my $error_count = '';
-		    if ($error_msgs !~ /OK/){
-			$error_count=qx(head -5 $name/$checklogout | grep 'Found messages in');
-			if ($error_count =~ /Found messages in.*\(([0-9]*)\).*/){
-			    $error_count="($1)";
-			}
-		    }
-		    print "error count: $error_count\n";
-		    $error = "<a type=\"text/plain\" href=\"$name/$checklogout\">$error_msgs$error_count</a>";
-		}
-		    
-		if (! -f "$name/$warnout"){
-		    $warn = "<font color=\"gray\">N/A</font>";
-		} else {
-                    my $warn_count=qx(head -5 $name/$warnout | grep 'Found messages in');
-		    if ($warn_count =~ /Found messages in.*\(([0-9]*)\).*/){
-                      $warn_count = $1;
-                      chomp $warn_count;
-                    }
-                    else {
-                      $warn_count = 'N/A'
-                    }
-		    print "warn count: $warn_count\n";
-		    $warn = "<a type=\"text/plain\" href=\"$name/$warnout\">$warn_count</a>";
-		}
-		if (! -e "$name/$regtestout"){
-		    $reg_tests = "<font color=\"gray\">N/A</font>";
-		} else {                  
-                    my $status = warncode($exitcodes{$name},"ATHENA_REGTEST_FAILED");
-                    my $tooltip = "";                    
-                    if ($status ne "OK") {
-                      my @diffs = `grep REGTEST $name/$regtestout | awk '{print \$2}' | sort -u`;
-                      chomp @diffs;
-                      if (scalar(@diffs) > 50) {
-                        $tooltip = "More than 50 sources of REGTEST differences!";
-                      }
-                      elsif (scalar(@diffs) > 0) {
-                        $tooltip = join(", ",@diffs);
-                      }
-                    }
-		    $reg_tests = "<a type=\"text/plain\" title=\"$tooltip\" href=\"$name/$regtestout\">" . $status . "</a>";
-                    if ($status ne "OK" and -e "$name/$htmldiffout"){
-                      $reg_tests .= " <a href=\"$name/$htmldiffout\">[ht]</a>"
-                    }
-		}
-		if (! -e "$name/$rootcompout"){
-		    $rootcomp = "<font color=\"gray\">N/A</font>";
-		} elsif ($rootcomp =~ /FAIL/){
-                    my @diffs = `egrep '^Different histograms:' $name/$rootcompout`;
-                    chomp @diffs;
-		    $rootcomp = "<a type=\"text/plain\" title=\"@diffs\" href=\"$name/$rootcompout\"><font color=\"red\">DIFF</font></a>";
-                    if (-e "$name/rootcomp.ps.gz") {
-                      $rootcomp .= " <a href=\"$name/rootcomp.ps.gz\">[ps]</a>";
-                    }
-		} elsif ($rootcomp =~ /OK/){
-		    $rootcomp = "<a type=\"text/plain\" href=\"$name/$rootcompout\"><font color=\"green\">MATCH</font></a>";
-		}
-		if (! -f "$name/$checkcountout"){
-		    $checkcount = "<font color=\"gray\">N/A</font>";
-		} else {
-		    my $checkcount1 = chaincountcheck("$name/$checkcountout");
-		    print "check chain counts: $checkcount1\n";
-		    $checkcount = "<a type=\"text/plain\" href=\"$name/$checkcountout\">$checkcount1</a>";
-		}
-		$postrc = 0;
-		if (! -e "$name/$posttestrc"){
-                  $postrc = "<font color=\"gray\">N/A</font>";
-                } elsif (($exitcodes{$name} & $ERROR{"POST_TEST_BAD_EXIT"})==0) {
-                  $postrc = "OK";
-                  $postrc .= gethistnumber($name);
-                } else {                  
-                  $postrc = getposttests($name);
-                  $postrc .= gethistnumber($name);
-		}
-
-	    }
-	}
-	my @logfiles = glob("$name/$athenalogglob");
-	for (@logfiles){
-	    my ($lfd, $lflabel) = split('/',$_);
-	    $lflabel = "[tail]" if ($lflabel =~ /tail/);
-	    $logfile .= "<a type=\"text/plain\" href=\"$_\"><font size=-2>$lflabel</font></a> ";
-	}
-	if (length($logfile)==0){
-	    $logfile = "&nbsp;";
-	}
-	print "logfile=$logfile\n";
-	
-	my $thename = $name;
-	my $logurl;
-	if ($context){
-	    $logurl = getlogpath($name,$testdir);
-	}
-	# special case when run by hand, log might be in current dir as testname.log
-	if (! defined $logurl and -f "$name.log"){
-	    $logurl="$name.log";
-	}
-	if (defined $logurl){
-	    $thename = "<a type=\"text/plain\" href=\"$logurl\">$name</a>";
-	    print "found URL: $logurl\n";
-	} else {
-	    print "not found URL for $name\n";
-	}
-
-	if (exists $order{$name}) {
-	    $order = "suite=\"$order{$name}[1]\" sorttable_customkey=\"$order{$name}[0]\"";
-	}
-	print HTMLOUT "<tr class=\"hi\"><td $order title=\"$doc{$name}\">$thename</td> <td>$atn_script</td> <td>$athena_exit</td> <td>$error</td> <td>$warn</td> <td style=\"white-space:nowrap\">$reg_tests</td> <td style=\"white-space:nowrap\">$rootcomp</td> <td>$checkcount</td> <td><a type=\"text/plain\" href=\"$name/$timerout\">$timer</a></td> <td>$exitcode/$maskedcode</td> <td>$postrc</td> <td><a href=\"$name\">dir</a></td><td>$logfile</td></tr>\n";
-    }
-    print HTMLOUT "</tbody></table>";
-    if (-e "$atn_timeline"){
-      print HTMLOUT "<font face=\"monospace\"><br>";
-      my @lines = `tail -3 *atn_timeline.log`;
-      print HTMLOUT join('<br>',@lines);
-      print HTMLOUT "<a href=\"atn_timeline.png\"> [timeline plot]</a>";
-      print HTMLOUT "</font>";
-    }
-    print HTMLOUT '<iframe onload="highlightDiffs(false)" id="DiffFrame" style="visibility:hidden;display:none;"></iframe>';
-    print HTMLOUT '<div id="chart_div17000" style="float: left; width: 50%; height: 500px"></div>';
-    print HTMLOUT '<div id="chart_div9000"  style="float: right; width: 50%; height: 500px"></div>';
-    print HTMLOUT '</body></html>';
-    close HTMLOUT;
-    
-}
-
-sub chaincountcheck($){
-    my ($infile)=@_;
-    my $counts="";
-    my $nonexist = 0;
-    open COUNTIN, "<$infile" or return "-";
-    while (<COUNTIN>){
-	if (/Fraction inside tolerance\:\s+(\d+)\/(\d+)/){
-	    $counts .= "$1/$2 "
-	} elsif (/does not exist/){
-            $nonexist++;
-        }   
-    }
-    close COUNTIN;
-    $counts = "New" if ($counts eq "" &&  $nonexist >  0);
-    $counts = "OK" if ($counts eq "");
-    print "nonexistant counts: $nonexist\n"; 
-    return $counts;
-}
-
-sub testcode($$){
-    my ($code,$string) = @_;
-    my $value=$ERROR{$string};
-    return (($code & $value)? "<font color=\"red\">FAIL</font>" : "OK");
-}
-
-sub warncode($$){
-    my ($code,$string) = @_;
-    my $value=$ERROR{$string};
-    return (($code & $value)? "<font color=\"orange\">WARN</font>" : "OK");
-}
-
-sub getEnv($$){
-  my ($name,$default) = @_;
-  if (exists $ENV{$name}) {
-    return $ENV{$name};
-  }
-  else {
-    return $default;
-  }
-}
-
-# figure out which nightly this is and where logs are etc.
-# this wil only work if run in ATN.
-sub getcontext(){
-    my $cwd = '';
-    chomp($cwd=`pwd`);
-    # for testing: 
-    if (defined $testcwd){
-        print "!WARNING: TEST MODE!";
-        $cwd=$testcwd;
-    }
-    print "--------------------------------------------------------\n";
-    print "$cwd\n";
-    if ($cwd =~ /NICOS_.*test([\w\d]+)\//){   # NICOS_qmtest (old) or NICOS_atntest (new) directory
-	$atn_platform=$1;
-    print "ATN_JOB_LOGFILE=" . getEnv("ATN_JOB_LOGFILE","") . "\n";
-	print "ATN_PACKAGE=" . getEnv("ATN_PACKAGE","") . "\n";
-	print "--------------------------------------------------------\n";
-    }    
-    $atn_rel = $ENV{'NICOS_PROJECT_RELNAME_COPY'};
-    
-    if (defined $atn_platform and defined $atn_rel){
-	print "$atn_platform $atn_rel $cwd\n";
-    }else{
-	print "atn_platform and atn_rel not defined - probably running outside ATN\n";
-    }
-    return (defined $atn_platform && defined $atn_rel && defined $cwd);
-}
-
-sub getlogpath($){
-    my ($name,$testdir) = @_;
-    my $found;
-    opendir(DIRHANDLE, $testdir) || die "Cannot opendir $testdir: $!";
-    foreach my $file (sort readdir(DIRHANDLE)) {
-	if ($file =~ /__${name}.log/){
-	    #print "$name matches $file\n";
-	    $found="$file";
-	    last;
-	}
-    }
-    return $found;
-}
-
-# create a relative URL by going back (../) until rel_N is reached, then forward again to here. This can then be changed to use for other rel_N
-sub getrelpath(){
-    my $pcwd = '';
-    chomp($pcwd=`pwd`);
-    # for testing
-    if (defined $testcwd){
-        $pcwd=$testcwd;
-    }
-    my @pcwd = split('/',$pcwd);
-    my ($i, $n, $up, $down);
-    $up="";
-    $down="";
-    for ($i=$#pcwd; $i>=0; --$i){
-	$up.="../";
-	$down = $pcwd[$i]. "/" . $down;
-	if ($pcwd[$i] =~ /rel_/){
-	    last;
-	}
-    }
-    return "$up$down";
-}
-
-# find the directory name we are in, e.g. triganalysistest_testconfiguration_work
-sub gettestpkgdir(){
-    use File::Basename;
-    my $cwd = '';
-    chomp($cwd=`pwd`);
-    if (defined $testcwd){
-        $cwd=$testcwd;
-    }
-    return basename($cwd);
-}
-
-sub gethistnumber(){
-  my ($testname) = @_;
-  my $text;
-  open POSTRC, "<$testname/post_test_checkHist.log" or return "";
-  while (<POSTRC>){
-    chomp;
-    if ($_ =~ /Total histograms/)
-    {    
-         $text = $_;
-         return "<font size=\"-2\">$text</font>";
-     }
-  }
-  return "No hist number found";
-}
-
-sub getposttests(){
-  my ($testname) = @_;
-  my $text;
-  open POSTRC, "<$testname/$posttestrc" or return "";
-  while (<POSTRC>){
-    chomp;
-    (my $name, my $rc) = split();
-    if ($rc!=0){
-      $text .= "<a type=\"text/plain\" href=\"$testname/post_test_$name.log\"><font color=\"red\">$name</font></a> ";
-    }
-  }
-  close POSTRC;
-  return "<font size=\"-2\">$text</font>";
-}
-
-sub getorder(){
-    my %order = ();
-    open ORDER,"<$atn_order" or return %order;
-    while (<ORDER>){
-	chomp;
-	(my $i, my $name, my $suite) = split();
-	$order{$name} = [$i,$suite]
-    }
-    return %order;
-}
-
-sub errornames() {
-    my ($code) = @_;
-    my @errors = ();
-    foreach my $key ( keys %ERROR ) {
-	if (($code & $ERROR{$key}) != 0) {
-	    push(@errors,$key);
-	}
-    }
-    return join(', ', @errors);
-}
-
-sub getTestWWWPage() {
-    open XML,"ATNOverview.xml" or return "";
-    while (<XML>){
-	chomp;
-	if (/<testWWWPage>(.*)<\/testWWWPage>/){
-	    return $1;
-	}
-    }
-    return "";	
-}
diff --git a/Trigger/TrigValidation/TrigValTools/bin/atn_timeline.py b/Trigger/TrigValidation/TrigValTools/bin/atn_timeline.py
deleted file mode 100755
index 040d6cce260690667a26af1bd2cf5b0ac89970b3..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TrigValTools/bin/atn_timeline.py
+++ /dev/null
@@ -1,198 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-"""Analyse and create a graph of the ATN test timeline."""
-
-__author__ = "Frank Winklmeier"
-
-import glob
-import re
-import sys
-import os
-import operator
-from datetime import datetime
-
-import matplotlib
-from matplotlib.dates import date2num
-from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
-from matplotlib.figure import Figure
-
-class Test:
-   def __init__(self):
-      self.name = None
-      self.t1 = None
-      self.t2 = None
-      self.suite = None
-
-def getSuites(dir):
-   """Read test suites from python dict dumped into NICOS log file"""
-
-   f = open(os.path.join(dir,'nicos_test.loglog'),'r')
-   for line in f:
-      if line.find('atn_streams_config: dictStreams')!=-1:
-         streams = eval(f.next().strip())
-         return streams
-   return {}
-
-def parseTestLog(log):
-   """Extract time stamps from NICOS logs"""
-   
-   test = Test()
-   f = open(log,'r')
-
-   # Test name from log file name
-   # Example: Trigger_TrigValidation_TrigP1Test_49__TrigP1Test_TestConfiguration__AllPT_physicsV1_magField_on_off_on__x.loglog
-   m = re.match('.*?_([0-9]+.*)\.loglog',log)
-   if m==None:
-      print "Cannot deduce test name from %s" % log
-      test.name = log
-      test.alias = ''
-   else:
-      test.name = re.match('.*?_([0-9]+.*)\.loglog',log).group(1)
-      test.alias = test.name.split('__')[2]
-   
-   for line in f:
-      # Old NICOS version
-      if line.find('qmtest.start_time')!=-1:
-         test.t1 = f.next().strip()
-         test.t1 = datetime.strptime(test.t1, '%Y-%m-%dT%H:%M:%SZ')
-         continue
-      if line.find('qmtest.end_time')!=-1:
-         test.t2 = f.next().strip()
-         test.t2 = datetime.strptime(test.t2, '%Y-%m-%dT%H:%M:%SZ')
-         continue
-
-      # New NICOS version without QMTest
-      if line.find('ATN, test start time')!=-1:
-         test.t1 = line.split('] ')[1].strip()
-         test.t1 = datetime.strptime(test.t1, '%a %b %d %H:%M:%S %Z %Y')
-         continue
-      if line.find('ATN, test end time')!=-1:
-         test.t2 = line.split('] ')[1].strip()
-         test.t2 = datetime.strptime(test.t2, '%a %b %d %H:%M:%S %Z %Y')
-         continue
-         
-   return test
-
-def getTimes(dir, package):
-   """Loop over all test log files and extract test info"""
-   
-   tests = {}
-   suites = getSuites(dir)
-   if len(suites)==0: return None
-   
-   for log in glob.iglob(os.path.join(dir,"*%s*.loglog" % package)):
-      test = parseTestLog(log)
-      if test.t1==None or test.t2==None:
-         print "Missing start/stop time for %s" % test.name
-      else:
-         tests[test.name] = test
-
-      for s,v in suites.iteritems():
-         if test.name.lower() in v: test.suite = s
-         
-   return tests
-   
-def main():
-   import optparse
-   parser = optparse.OptionParser(description=__doc__,
-                                  usage="%prog [Options] TESTDIR")
-
-   parser.add_option("-p", dest="package", type="string", action="store",
-                     help="Test package (e.g. TrigP1Test)")
-
-   parser.add_option("-o", dest="output", type="string", action="store", default = 'atn_timeline.png',
-                     help="File name for graphics [%default]")
-
-   parser.add_option("--atn", action="store_true",
-                     help="ATN mode for nightly tests")
-
-   (opts, args) = parser.parse_args()
-
-   if not opts.package:
-      parser.error("Specify test package")
-      return 1
-   
-   if len(args)==0 and not opts.atn:
-      parser.print_help()
-      return 1
-
-   if opts.atn:
-      testdir = '../../NICOS_TestLog%s' % os.environ['NICOS_SUFFIX']
-   else:   
-      testdir = args[0]
-      
-   tests = getTimes(testdir, opts.package)
-   if tests==None or len(tests)==0:
-      print 'No test suites available for %s in %s' % (opts.package,testdir)
-      return 0
-
-   # Print tests and stats
-   suites = []
-   print '%-40s %-20s %-19s  %-19s  %s' % ('Test', 'Suite', 'Start', 'Stop', 'Duration')
-   for t in sorted(tests.values(), key=operator.attrgetter('t1')):
-      print '%-40s %-20s %s  %s  %s' % (t.alias, t.suite, t.t1, t.t2, t.t2-t.t1)
-      if not t.suite in suites: suites += [t.suite]
-   suites.sort()
-
-   f = open('atn_timeline_order.txt','w')
-   for i,t in enumerate(sorted(tests.values(), key=operator.attrgetter('suite','t1'))):
-      f.write('%d %s %s\n' % (i,t.alias,t.suite))
-   f.close()
-
-   dmin = sorted(tests.values(), key=operator.attrgetter('t1'))[0].t1
-   dmax = sorted(tests.values(), key=operator.attrgetter('t1'))[-1].t2
-   print
-   print 'First test started: %s' % dmin
-   print 'Last test finished: %s' % dmax
-   print 'Total duration:     %s' % (dmax-dmin)
-
-   # Create graphics
-   DPI = 80
-   fig = Figure(figsize=(1200/DPI,800/DPI), dpi=DPI)
-   canvas = FigureCanvas(fig)
-   ax = fig.add_subplot(111)
-
-   # Just to get the x-axis as time
-   ax.plot_date([date2num(dmin)-0.001,date2num(dmax)+0.001], [1,1], markersize=0)
-
-   # Plot tests   
-   n = 0
-   suite = None
-   for t in sorted(tests.values(), key=operator.attrgetter('suite','t1')):
-      t1 = date2num(t.t1)
-      t2 = date2num(t.t2)
-      dt = '%s' % (t.t2-t.t1).seconds
-      y = suites.index(t.suite)   
-      ax.hlines([y], t1, t2, color='red')
-      ax.vlines(t1, y-0.1, y+0.1, color='red')
-      ax.vlines(t2, y-0.1, y+0.1, color='red')
-
-      # Labels
-      if suite!=t.suite:
-         ax.text(date2num(dmin), y+0.35, 'Suite: %s' % t.suite, color='blue')
-         suite = t.suite
-         n = 0
-      else:
-         n += 1
-      
-      if n%4==0: offset = -0.3
-      elif n%4==1: offset = 0.1
-      elif n%4==2: offset = -0.45
-      elif n%4==3: offset = 0.25
-
-      ax.text(t1, y+offset, '%d) %s' % (n+1,t.alias))
-      ax.text(t1+0.5*(t2-t1), y+0.02, dt, color='red', ha='center')
-
-
-   ax.text(0, 1, testdir, transform = ax.transAxes)
-   ax.xaxis.set_major_formatter(matplotlib.dates.DateFormatter('%H:%M:%S'))
-   ax.yaxis.set_ticklabels([])
-
-   canvas.print_figure(opts.output, dpi=DPI)
-   
-if __name__ == "__main__":
-   try:
-      sys.exit(main())
-   except KeyboardInterrupt:
-      sys.exit(1)
diff --git a/Trigger/TrigValidation/TrigValTools/bin/rootcomp.py b/Trigger/TrigValidation/TrigValTools/bin/rootcomp.py
index 11aa6208f8d21d6f158609127936d39859d293a5..81638d612216d5e80ac3548e6b51d1429b471ca1 100755
--- a/Trigger/TrigValidation/TrigValTools/bin/rootcomp.py
+++ b/Trigger/TrigValidation/TrigValTools/bin/rootcomp.py
@@ -1,26 +1,11 @@
 #!/usr/bin/env python
-
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+#
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 # @file:    rootcomp.py
 # @purpose: Script to compare the histograms in two root files
 # @author:  Frank Winklmeier, Will Buttinger
 #
-# $Id: rootcomp.py,v 1.18 2009-04-18 20:06:28 sgeorge Exp $
-
-"""
-Compares the histograms in two root files.
-
-Return value: totalHistograms > 0 : 
-                   (totalHistograms - matchingHistograms - missingHistograms)
-              totalHistograms = 0 :
-                   255
-              (i.e. script returns 0 if all histograms match)     
-"""              
-
-__author__  = "Frank Winklmeier, Will Buttinger"
-__version__ = "$Revision: 1.18 $"
-__doc__     = "Script to compare the histograms in two root files"
-
+from __future__ import print_function
 import sys
 import os
 import os.path
@@ -80,12 +65,10 @@ def diffFiles(ref,file,opts):
       selection = lambda x : reduce(lambda a,b:a|b,[re.search(pat,x)!=None for pat in opts.select])
       
    refonly = filter(selection,filter(lambda s:s[0]=='-',diff))
-   #fileonly = filter(selection,filter(lambda s:s[0]=='+',diff))
 
    if len(refonly)>0:
-      print
-      print "Histograms only found in reference:"
-      for s in refonly: print s
+      print("\nHistograms only found in reference:")
+      for s in refonly: print(s)
 
    return
 
@@ -165,7 +148,6 @@ def main():
                      action = "store_true", default = False,
                      help = "be verbose")
 
-
    parser.add_option("--atnMode",
                      action = "store_true", default = False, help = "reference file is one from previous atn nightly test")
    
@@ -178,7 +160,7 @@ def main():
       for i in range(1,7):
          refFile = getPreviousNightlyPath(i) + "/" + args[0]
          if os.path.isfile(refFile): break
-         print "Could not find file %s" % refFile
+         print("Could not find file %s" % refFile)
       args = [refFile] + args
 
    if len(args)!=2:
@@ -187,6 +169,7 @@ def main():
 
    if not opts.noSkipList:
       opts.skip += ["TIMERS"]
+      opts.skip += ["/TIME_"]
       opts.skip += ["TimerTot"]         # For TrigCalo[Cell,Cluster,Tower]Maker
       opts.skip += ["FullCalo_Total"]   # TrigCaloCellMaker_fullcalo/FullCalo_Total
       opts.skip += ["signatureAcceptance"]
@@ -214,21 +197,18 @@ def main():
       if opts.chi2: opts.threshold = 0.95
       else: opts.threshold = 1e-6
       
-   print "-"*70
-   print " rootcomp.py, "+__version__
-   print
-   print "Command    : rootcomp.py %s" % (" ".join(sys.argv[1:]))
-   print
-   print "Reference  : %s" % (args[0])
-   print "File       : %s" % (args[1])
-   print "Comparison :",
-   if opts.chi2: print "CHI2 (%.2f)" % opts.threshold
-   elif opts.axis: print "AXIS"
-   else: print "BIN-BY-BIN (%.1e)" % opts.threshold
-   if not opts.skip==[]: print "Ignored histograms: %s" % (", ".join(opts.skip))
-   if not opts.select==[]: print "Selected histograms: %s" % (", ".join(opts.select))   
-
-   print "-"*70
+   print("-"*70)
+   print("Command    : rootcomp.py %s\n" % (" ".join(sys.argv[1:])))
+   print("Reference  : %s" % args[0])
+   print("File       : %s" % args[1])
+   print("Comparison : ", end="")
+   if opts.chi2: print("CHI2 (%.2f)" % opts.threshold)
+   elif opts.axis: print("AXIS")
+   else: print("BIN-BY-BIN (%.1e)" % opts.threshold)
+   if not opts.skip==[]: print("Ignored histograms: %s" % (", ".join(opts.skip)))
+   if not opts.select==[]: print("Selected histograms: %s" % (", ".join(opts.select)))
+
+   print("-"*70)
 
 
    # Now import ROOT
@@ -283,7 +263,7 @@ def main():
    
    # Run
    rc = valid.setReferenceFile(args[0],opts.refBaseDir)
-   if rc==False:
+   if rc is False:
       return 255
 
    rc = valid.run(args[1],opts.fileBaseDir)
@@ -292,7 +272,7 @@ def main():
    sys.stderr.flush()
    
    if opts.zip and not opts.pdf:
-      print "GZipping postscript file -> %s.ps.gz" % (opts.outFile)
+      print("GZipping postscript file -> %s.ps.gz" % opts.outFile)
       os.system("gzip -f %s.ps" % (opts.outFile))
 
    # List histograms that are only found in reference
@@ -313,11 +293,9 @@ def main():
 
    if opts.html:
       os.system("root2html.py *.root")
-   
 
-   print "Overall test result: %i" % result
+   print("Overall test result: %i" % result)
    return result
 
-
 if __name__ == "__main__":
    sys.exit(main())
diff --git a/Trigger/TrigValidation/TrigValTools/bin/test-xml-autoconf.py b/Trigger/TrigValidation/TrigValTools/bin/test-xml-autoconf.py
deleted file mode 100755
index 820942beb24485e6cc9ec5975e9e05d9297f7285..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TrigValTools/bin/test-xml-autoconf.py
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-#
-# Takes test xml file and enabled/disables tests marked with:
-#
-#  <!-- DISABLE-IN-PROJECT-BEGIN: AtlasTier0 AtlasProduction-->
-#    <TEST name="HelloWorld" type="script" suite="TrigOnline">
-#    ...
-#    </TEST>
-#  <!-- DISABLE-IN-PROJECT-END -->
-#
-#  or
-#
-#  <!-- ENABLE-IN-PROJECT-BEGIN: AtlasHLT -->
-#    <TEST name="HelloWorld" type="script" suite="TrigOnline">
-#    ...
-#    </TEST>
-#  <!-- ENABLE-IN-PROJECT-END -->
-#
-#
-import sys
-import os
-import re
-
-if len(sys.argv) < 2:
-   print 'Syntax: text-xml-autoconf.py test.xml [output.xml]'
-   sys.exit(1)
-
-output = sys.stdout
-if len(sys.argv)==3:
-   output = open(sys.argv[2],'w')
-
-# Get project from NICOS or asetup environment   
-project = os.environ.get('NICOS_PROJECT_NAME',os.environ.get('AtlasProject',''))
-if len(project)==0:
-   print 'Cannot read $AtlasProject or $NICOS_PROJECT_NAME'
-   sys.exit(1)
-   
-reDisable = re.compile(".*<\!--\s*DISABLE-IN-PROJECT-BEGIN:\s*(.*)-->")
-reEnable = re.compile(".*<\!--\s*ENABLE-IN-PROJECT-BEGIN:\s*(.*)-->")
-reEnd = re.compile(".*<\!--.*-IN-PROJECT-END.*-->")
-disable = False
-
-f = open(sys.argv[1],'r')
-for line in f:
-   
-   m = reDisable.match(line)   
-   if m and (project in m.group(1).split()):
-      disable = True
-      continue
-      
-   m = reEnable.match(line)
-   if m and not (project in m.group(1).split()):
-      disable = True
-      continue
-
-   if disable and reEnd.match(line):      
-      disable = False
-      continue
-
-   if not disable: output.write(line)
-
diff --git a/Trigger/TrigValidation/TrigValTools/bin/trigtest.pl b/Trigger/TrigValidation/TrigValTools/bin/trigtest.pl
deleted file mode 100755
index aeadb4440fdef11fa0b7e3273c52ef3fbe973d74..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TrigValTools/bin/trigtest.pl
+++ /dev/null
@@ -1,1372 +0,0 @@
-#!/usr/bin/perl -w
-# Script to manage Trigger tests
-# $Id: trigtest.pl,v 1.16 2009-05-20 15:53:22 sgeorge Exp $
-
-use Getopt::Long;
-use File::Basename;
-use File::Spec;
-use File::Copy;
-use File::Path;
-use constant TRUE => 1;
-use constant FALSE => 0;
-use constant UNDEFINED => "undefined";
-$prog = basename $0;
-$config = {};
-$fullregtest = '<fullregtest>';
-$customregtest = '<customregtest>';
-# set some output file names
-$regtestout = "regtest.log";
-$htmldiffout = "regtest.html";
-$summaryout = "summary.log";
-$timerout = "timer.log";
-$checklogout = "checklog.log";
-$warnout = "warn.log";
-$rootcompout = "rootcompout.log";
-$checkcountout = "checkcountout.log";
-$checkmergeout = "checkmergeout.log";
-$edmcheckout = "edmcheckout.log";
-$postcmdout = "postcmd.log";
-$posttestrc = "post_test.exitcodes";
-$docout = "doc.txt";
-
-# define error codes - must match atn_summary.pl
-%ERROR = (
-	  OK => 0,
-	  SCRIPT_MISC => 1,
-	  POST_TEST_BAD_EXIT => 2,
-	  ROOTCOMP_MISMATCH => 4,
-	  ATHENA_BAD_EXIT => 8,
-	  CHECKCOUNTS_FAILED => 16,
-	  ATHENA_ERROR_IN_LOG => 32,
-	  ATHENA_REGTEST_FAILED => 64,
-	  ATN_TIME_LIMIT => 128,
-	  PRECONDITION_FAILED_SO_NOT_RUN => 256
-	  );
-# max bit: 128. Bash takes return codes 0-256.
-# Larger numbers are taken mod 256 so effectively masked off. Can be used for internal signalling only.
-
-# mask off those codes above which you do not want to flag in the exit code
-# i.e. so ATN does not interpret them as the test failing. 
-# bit positions marked 1 will be used, 0 will not be used.
-# SCRIPT_MISC is on the right, ATN_TIME_LIMIT on the left
-# This default mask can be modified via the 'extra_failure_codes' test directive
-# only "shout" if we see/have: ATHENA_BAD_EXIT => 8 decimal 8 in bit is 0b00001000 thus 
-$default_exitmask = 0b00001001;
-
-# Exit mask of the last run test. Not nice but the easiest way to implement
-# this on top of all the other ugly things in this script.
-$exitmask = $default_exitmask;
-    
-# command to use for rootcomp
-$rootcomp_cmd = "rootcomp.py --pdf --noRoot";
-$checkcount_cmd = "trigtest_checkcounts.sh";
-$checkmerge_cmd = "trigtest_check_merge.sh";
-sub main();
-main();
-exit -10;
-####
-
-sub main(){
-    # trap errors from here on
-    $SIG{'INT'} = 'CLEANUP_INT';
-    $SIG{'TERM'} = 'CLEANUP_TERM';
-    $t0=time(); # timer
-    $failures = 0; # count number of tests which fail
-    $statuscode = 0; # combination of errors from last test
-    command_line();
-    parse_config();
-    if ($verify){
-	print_config();
-    }
-    exit if ($verifyconfig);
-    check_tests();
-    do_tests();
-    results_summary();
-    timer($t0);
-    if ($statuscode != 0){
-	prog_error_exit("at end",@statuscodes);
-    }
-    exit 0;
-    # exit($statuscode); # status code of last test
-    # exit($failures); # number of tests which fail
-}
-
-sub CLEANUP_INT {
-    print "\n\n$prog: Caught Interrupt (^C), probably ATN time exceeded, finish up and exit\n";
-    push @statuscodes, 'ATN_TIME_LIMIT';
-    timer($t0);
-    if ($statuscode != 0){
-	prog_error_exit("at end",@statuscodes);
-    }
-    exit(1); # never reaches this line in principle
-}
-
-sub CLEANUP_TERM {
-    print "\n\n$prog: Caught TERM signal, finish up and exit\n";
-    push @statuscodes, 'ATN_TIME_LIMIT';
-    timer($t0);
-    if ($statuscode != 0){
-	prog_error_exit("at end",@statuscodes);
-    }
-    exit(1); # never reaches this line in principle
-}
-
-sub prog_error_exit($$){
-    my ($message,@error_strings) = @_ or die;
-    my $exitcode_unmasked = process_error_codes(@error_strings);
-    # for ATN purposes, mask less significant codes
-    my $exitcode = $exitcode_unmasked & $exitmask;
-    if ($exitcode!=0){
-	printf "$prog: $failkey $message (unmasked=%#.8b exitcode=%#.8b)\n", $exitcode_unmasked, $exitcode;
-    } else {
-	printf "$prog: $warnkey $message (unmasked=%#.8b exitcode=%#.8b)\n", $exitcode_unmasked, $exitcode;
-    }
-    exit($exitcode);
-
-}
-
-sub process_error_codes(@) {
-    my (@error_strings) = @_;
-    my $exitcode=0;
-    # | sort | uniq
-    my %saw;
-    undef %saw;
-    @saw{@error_strings} = ();
-    my @error_strings_uniq = sort keys %saw;
-    print "$prog: debug: all statuscodes: @error_strings\n" if ($debug);
-    print "$prog: debug: uniq statuscodes: @error_strings_uniq\n" if ($debug);
-    # convert strings, keep numbers as they are, add together
-    print "=== These errors occured: ";
-    open SUMMARY, ">$summaryout";
-    for (@error_strings_uniq){
-	my $code;
-	if (/^\d+$/){
-	    # it's already a number
-	    $code = $_;
-	} else {
-	    # translate string
-	    $code = $ERROR{$_};
-	}
-	$exitcode += $code;
-	if ($code != 0){ # print all except ok.
-	    print "$_ ($code) ";
-	    print SUMMARY "$_ ($code)\n";
-	}
-    }
-    print "\n";
-    my $maskedcode = $exitcode & $exitmask;
-    print "$prog:process_error_codes() debug exitcode = $exitcode maskedcode = $maskedcode\n" if ($debug);
-    print SUMMARY " exitcode = $exitcode\n";
-    print SUMMARY " maskedcode = $maskedcode\n";
-    close SUMMARY;
-    return $exitcode;
-}
-
-# command line arguments
-sub command_line(){
-  # parse command arguments and check usage
-  $debug = FALSE;
-  $verify = FALSE;
-  $verifyconfig = FALSE;
-  $configfile = 'trigtest.conf'; # default
-  $failkey = 'FAILURE';
-  $warnkey = 'WARNING';
-  $showsummary = FALSE;
-  @tests = ();
-  $run_dir = '../run'; # working directory, relative to cmt dir
-  $clear_dir = FALSE;
-  print "=== Command to repeat this test:\n  $prog @ARGV\n";
-  my $result = GetOptions ('help' => \$help,
-                           'debug!' => \$debug,
-                           'verify!' => \$verify,
-                           'verifyconfig!' => \$verifyconfig,
-                           'showsummary' => \$showsummary,
-                           'failkey=s' => \$failkey,
-                           'warnkey=s' => \$warnkey,
-                           'config=s' => \$configfile,
-			               'test=s' => \@tests,
-			               'rundir=s' => \$run_dir,
-			               'cleardir!' => \$clear_dir,
-			               'package=s' => \$testpackagefq);
-  if ($help || !$result) {
-      usage();
-      prog_error_exit("usage",'SCRIPT_MISC');
-  }
-  $verify = TRUE if ($verifyconfig);
-  if (defined $testpackagefq){
-      print "\n$prog info: note that the --package option is deprecated and will be removed in a \nfuture release. It no longer does anything.\n";
-  }
-}
-
-# usage message
-sub usage(){
-    print "
-  Usage: $prog [options] 
-
-  Testing tool for managing Trigger software tests
-
-  Options:
-
-  --help                show this information
-  --debug               print debug information, for the script maintainer
-  --verify              verify config file and show what would be done
-                        for the tests but don't run athena (see tip below)
-  --verifyconfig        just verify config file and stop
-  --showsummary         print a short summary table of tests results at the end
-  --failkey <string>    keyword to be printed to indicate to the test 
-                        framework that a test has failed, default $failkey
-  --failkey <string>    keyword to be printed to indicate a problem, but not
-                        seen as failure by test framework, default $warnkey
-  --config <file>       specify config file, default trigtest.conf
-                        tries with get_files from DATAPATH if it doesn't exist 
-  --rundir <dir>        specify directory in which to run tests, default ../run
-  --cleardir            remove/clear rundir before running (FALSE by default)
-  --package <string>    (deprecated, does nothing, will be removed in future release)
-  --test <test name|id> specify test to run, see below
-
-  A test name or id can optionally be specified after the --test
-  option to run only that test. By default, all tests will be run in
-  the order they are defined in the config file. The verify option
-  will list all the available tests that are defined in the config
-  file. The --test option may be repeated, and tests will be run in the
-  order the come on the command line.
-
-  See the sample config file for test configuration information.
-
-  It is expected that this tool be run from the cmt or run directory
-  under TriggerTest, after the necessary cmt environment has been set
-  up.  If you changed any files in TriggerTest or checked out a
-  version different from the release you are using, then you need to
-  gmake before running these tests. The --package option can be used
-  to change this default location to another package for reference
-  files and the check_log config file.
-
-  Output from $prog will always be preceeded by its name (for error
-  and debug messages) or '===' for the few messages you get without
-  debug. All other messages come from other programs and commands it
-  has run.
-
-  Tip: after running a test for the first time, run again in verify
-  mode and the same log files will be re-used. This is a good way to
-  quickly test the config file, regression tests, and for script
-  development.
-
-  The exit code refers only to the last test - be sure to read the 
-  output if you run multiple tests!
-  The exit code can be any combination of these values:
-";
-    my $errorcode;
-    foreach $error_name (sort { $ERROR{$a} <=> $ERROR{$b} } keys %ERROR) {
-	printf "      %20s %4d\n", $error_name, $ERROR{$error_name};
-    }
-}
-
-
-# If using a file for stdin, 
-# try to find it with get_files
-# then check it is there
-# and return with < pre-pended,
-# or return empty string if failed
-sub getStdinFile($){
-    my ($stdinfile) = @_;
-    $stdinfile =~ s/^\s+$//; # kill file names that are only spaces
-    $stdinfile = $stdinfile;
-    if (length($stdinfile)>0){
-	if (! -e "$stdinfile" ){
-	    print "$prog debug: $stdinfile does not exist, so copying it with get_files\n" if ($debug);
-	    systemcall("get_files -data $stdinfile");
-	} else {
-	    print "$prog debug: $stdinfile already exists; not copying it\n" if ($debug);
-	}
-	if (! -e $stdinfile){
-	    prog_error_exit ("stdin defined as '$stdinfile' but this is not found", 'SCRIPT_MISC');
-	    $stdinfile = "";
-	} else {
-	    $stdinfile = "< $stdinfile";
-	}
-    } else {
-	$stdinfile = "";
-    }
-    return $stdinfile;
-}
-
-# parse config file
-sub parse_config(){
-
-    # if specified config file does not exist, try get_files. If still not there, fail.
-    print "$prog debug: config file is specified as $configfile\n" if ($debug);
-    if (! -r $configfile) {
-	print "$prog debug: $configfile does not exist, so try copying it with get_files\n" if ($debug);
-	systemcall("get_files -data -symlink -remove $configfile",TRUE);
-	if (! -r $configfile){ 
-	    prog_error_exit ("config file $configfile not found. Specify a config file with the option --config <filename>", 'SCRIPT_MISC');
-	}
-    }
-    open CONFIG, "<$configfile" 
-	or prog_error_exit ("failed opening $configfile: $!\n", 'SCRIPT_MISC');
-    print "\n$prog debug: start of config file\n" if ($debug);
-    my $first = TRUE;
-    my $this_test = {};
-    my $current_test_id = '';
-    while (<CONFIG>){
-	chomp;
-	# strip out comments
-	$endofline = index $_, '#';
-	if ($endofline == -1){
-	    $endofline = length;
-	}
-	$line = substr($_, 0, $endofline);
-	# strip leading white space
-	$line =~ s/^\s+//;
-	# skip empty lines and lines with only spaces
-	next if (length $line == 0);
-	next if (/^\s+$/);
-	#print "$prog debug: config $. >$line<\n" if ($debug);
-	# test keyword
-	if ($line =~ /^test/){
-	    if ($line =~ /^test\s+(\w+)/){
-		my $id = $1;
-		print "$prog debug: config id = >$id<\n" if ($debug);
-		if ($current_test_id eq $id or exists $config{$id}){
-		    prog_error_exit ("test id $id is not unique",'SCRIPT_MISC');
-		}
-		# save old test config
-		if (! $first){
-		    $config{$current_test_id} = $this_test;
-		    push @test_order, $current_test_id;
-		}
-		# new test config
-		$first = FALSE;
-		$current_test_id = $id;
-		$this_test = {};
-		# defaults
-		$this_test->{'name'} = "test_$id";
-		$this_test->{'disabled'} = FALSE;
-		$this_test->{'checklog'} = FALSE;
-#		$this_test->{'checklog_opts'} = "--config check_log.conf --showexcludestats";
-		$this_test->{'checklog_opts'} = "--showexcludestats";
-		$this_test->{'datafile'} = UNDEFINED;
-		$this_test->{'datafilelink'} = 'ZEBRA.P';
-		$this_test->{'joboptions'} = UNDEFINED;
-		$this_test->{'pre_condition'} = ();
-		$this_test->{'pre_command'} = ();
-		$this_test->{'post_command'} = ();
-        $this_test->{'post_test'} = ();
-		$this_test->{'athena_env'} = 'export STAGE_SVCCLASS=atlascerngroupdisk;export STAGE_HOST=castoratlast3';
-		$this_test->{'athena_args'} = UNDEFINED;
-		$this_test->{'athena_cmd'} = 'athena.py -b';
-		$this_test->{'exitmask'} = $default_exitmask;
-		$this_test->{'stdinfile'} = '';
-		$this_test->{'regtest'} = ();
-        $this_test->{'filterlog'} = '';
-		$this_test->{'compresslog'} = FALSE;
-		$this_test->{'rootcomp'} = FALSE;
-		$this_test->{'rootcomp_cmd'} = "";
-		$this_test->{'rootcomp_file1'} = "";
-		$this_test->{'rootcomp_file2'} = "";
-        $this_test->{'checkcount'} = FALSE;
-        $this_test->{'checkcount_file'} = "";
-        $this_test->{'checkcount_tolerance'} = 1;
-        $this_test->{'checkcount_level'} = "BOTH";
-        $this_test->{'checkmerge'} = FALSE;
-        $this_test->{'checkmerge_file'} = "";
-        $this_test->{'checkmerge_reffile'} = "";
-        $this_test->{'checkmerge_tolerance'} = 1;
-        $this_test->{'emdcheck'} = ();
-		$this_test->{'doc'} = "";
-		next;
-	    }
-	    else {
-		print "$prog: Error: config line $. incorrect, test definition invalid - ignoring line\n";
-		next;
-	    }
-	}
-	if ($line =~ /^name\s+([^\s]+)/){
-	    $this_test->{'name'} = $1;
-	    print "$prog debug: config test name >$1<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^datafile\s+([^\s]+)\s+([^\s]+)/){
-	    $this_test->{'datafile'} = $1;
-	    $this_test->{'datafilelink'} = $2;
-	    print "$prog debug: config datafile >$1< link >$2<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^datafile\s+([^\s]+)/){
-	    $this_test->{'datafile'} = $1;
-	    print "$prog debug: config datafile >$1<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^joboptions\s+([^\s]+)/){
-	    $this_test->{'joboptions'} = $1;
-	    print "$prog debug: config joboptions >$1<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^pre_condition\s+(.+)$/){
-	    my $pre_condition = $1;
-	    push @{$this_test->{'pre_condition'}}, $pre_condition;
-	    print "$prog debug: config pre_condition >$pre_condition<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^pre_command\s+(.+)$/){
-	    my $pre_command = $1;
-	    push @{$this_test->{'pre_command'}}, $pre_command;
-	    print "$prog debug: config pre_command >$pre_command<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^post_command\s+(.+)$/){
-	    my $post_command = $1;
-	    push @{$this_test->{'post_command'}}, $post_command;
-	    print "$prog debug: config post_command >$post_command<\n" if ($debug);
-	    next;
-	}
-        if ($line =~ /^post_test\s+([^\s]+)\s+(.+)$/){
-	    my $post_test = {'name' => $1, 'cmd' => $2};
-	    push @{$this_test->{'post_test'}}, $post_test;            
-	    print "$prog debug: config post_test >$1< >$2<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^athena_args\s+(.+)$/){
-	    $this_test->{'athena_args'} = $1;
-	    print "$prog debug: config athena_args >$1<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^athena_env\s+(.+)$/){
-	    $this_test->{'athena_env'} = $1;
-	    print "$prog debug: config athena_env >$1<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^athena_cmd\s+(.+)$/){
-	    $this_test->{'athena_cmd'} = $1;
-	    print "$prog debug: config athena_cmd >$1<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^extra_failure_codes\s+(.+)$/){
-	    $this_test->{'exitmask'} = $default_exitmask;	    
-	    my @codes = split('\s',$1);
-	    for (@codes) {
-		if (exists $ERROR{$_}) {
-		    $this_test->{'exitmask'} |= $ERROR{$_};
-		}
-		else {
-		    my @tmp = keys %ERROR;
-		    prog_error_exit ("Exit code '$_' unknown. Allowed values are: @tmp",'SCRIPT_MISC');
-		}
-	    }	    	    
-	    print "$prog debug: config extra_failure_codes >$1<\n" if ($debug);
-	    next;
-	}	
-	if ($line =~ /^stdinfile\s+(.+)$/){
-	    $this_test->{'stdinfile'} = $1;
-	    print "$prog debug: config stdinfile >$1<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^disable/){
-	    $this_test->{'disabled'} = TRUE;
-	    print "$prog debug: config disabled >" . ( $_ ? "true" : "false") . "<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^checklog\s+(.+)$/){
-	    $this_test->{'checklog'} = TRUE;
-	    $this_test->{'checklog_opts'} = $1;
-	    print "$prog debug: config checklog >" . ( $_ ? "true" : "false") . "<\n" if ($debug);
-	    print "$prog debug: config checklog_opts >$1<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^checklog\s*$/){
-	    $this_test->{'checklog'} = TRUE;
-	    print "$prog debug: config checklog >" . ( $_ ? "true" : "false") . "<\n" if ($debug);
-	    next;
-	}
-        if ($line =~ /^filterlog\s+(.+)$/){
-	    $this_test->{'filterlog'} = $1;
-	    print "$prog debug: config filterlog >$1<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^compresslog/){
-	    $this_test->{'compresslog'} = TRUE;
-	    print "$prog debug: config compresslog >" . ( $_ ? "true" : "false") . "<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^regtest\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)/){
-	    my $regtest = { 'algoname' => $1, 'match' => $2, 'reffile' => $3};
-	    push @{$this_test->{'regtest'}}, $regtest;
-	    print "$prog debug: config regtest >$1< >$2< >$3<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^edmcheck\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)/){
-	    my $edmcheck = { 'algoname' => $1, 'edmfile' => $2, 'edmreffile' => $3};
-	    push @{$this_test->{'edmcheck'}}, $edmcheck;
-	    print "$prog debug: config edmcheck >$1< >$2< >$3<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^fullregtest\s+([^\s]+)\s+([^\s]+)/){
-	    my $regtest = { 'algoname' => $fullregtest, 'match' => $1, 'reffile' => $2};
-	    push @{$this_test->{'regtest'}}, $regtest;
-	    print "$prog debug: config fullregtest >$1< >$2<\n" if ($debug);
-	    next;
-	}
-        if ($line =~ /^customregtest\s+(.+)$/){
-            my $regtest = { 'algoname' => $customregtest, 'match' => $1, 'reffile' => ''};
-	    push @{$this_test->{'regtest'}}, $regtest;
-	    print "$prog debug: config customregtest >$1<\n" if ($debug);
-	    next;
-	}
-	#check merge
-	if ($line =~ /^checkmerge\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)/){
-	    $this_test->{'checkmerge'} = TRUE;
-	    $this_test->{'checkmerge_file'} = $1;
-            $this_test->{'checkmerge_reffile'}= $2;
-            $this_test->{'checkmerge_tolerance'}= $3;
-	    print "$prog debug: config checkmerge >" . ( $_ ? "true" : "false") . "<\n" if ($debug);
-	    print "$prog debug: config checkmerge_file >$1<\n" if ($debug);
-	    print "$prog debug: config checkmerge_reffile >$2<\n" if ($debug);
-	    print "$prog debug: config checkmerge_tolerance >$3<\n" if ($debug);
-	    next;
-	}
-        #  check for 3rd argument (L2, EF or BOTH)
-	if ($line =~ /^checkcount\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)/){
-	    $this_test->{'checkcount'} = TRUE;
-	    $this_test->{'checkcount_file'} = $1;
-            $this_test->{'checkcount_tolerance'}=$2;
-            $this_test->{'checkcount_level'}=$3;
-	    print "$prog debug: config checkcount >" . ( $_ ? "true" : "false") . "<\n" if ($debug);
-	    print "$prog debug: config checkcount_file >$1<\n" if ($debug);
-	    print "$prog debug: config checkcount_tolerance >$2<\n" if ($debug);
-	    print "$prog debug: config checkcount_level >$3<\n" if ($debug);
-	    next;
-	}
-        # only 2 arguments, assume BOTH
-	if ($line =~ /^checkcount\s+([^\s]+)\s+([^\s]+)/){
-	    $this_test->{'checkcount'} = TRUE;
-	    $this_test->{'checkcount_file'} = $1;
-            $this_test->{'checkcount_tolerance'}=$2;
-	    print "$prog debug: config checkcount >" . ( $_ ? "true" : "false") . "<\n" if ($debug);
-	    print "$prog debug: config checkcount_file >$1<\n" if ($debug);
-	    print "$prog debug: config checkcount_tolerance >$2<\n" if ($debug);
-	    next;
-	}
-        # optional 2nd argument
-	if ($line =~ /^rootcomp\s+([^\s]+)\s*([^\s]*)$/){
-	    $this_test->{'rootcomp'} = TRUE;
-	    $this_test->{'rootcomp_cmd'} = $rootcomp_cmd;
-            if ($2 eq "") {
-              $this_test->{'rootcomp_file1'} = "expert-monitoring.root";
-              $this_test->{'rootcomp_file2'} = $1;
-            }
-            else {
-              $this_test->{'rootcomp_file1'} = $1;
-              $this_test->{'rootcomp_file2'} = $2;
-            }
-	    print "$prog debug: config rootcomp >" . ( $_ ? "true" : "false") . "<\n" if ($debug);
-	    print "$prog debug: config rootcomp_file1 >$this_test->{'rootcomp_file1'}<\n" if ($debug);            
-	    print "$prog debug: config rootcomp_file2 >$this_test->{'rootcomp_file2'}<\n" if ($debug);
-	    next;
-	}
-    # old style                                                                                                                                                                
-    if ($line =~ /^customrootcomp\s+([^\s]+)\s+([^\s]+)$/){
-        $this_test->{'rootcomp'} = TRUE;
-        $this_test->{'rootcomp_cmd'} = $1;
-        $this_test->{'rootcomp_file2'} = $2;
-        print "$prog debug: config custom rootcomp >" . ( $_ ? "true" : "false") . "<\n" if ($debug);
-        print "$prog debug: config custom rootcomp_cmd >$1<\n" if ($debug);
-        print "$prog debug: config custom rootcomp_file2 >$2<\n" if ($debug);
-        next;
-    }
-    # optional 3rd argument                                                                                                                                                    
-    if ($line =~ /^customrootcomp\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)$/){
-        $this_test->{'rootcomp'} = TRUE;
-        $this_test->{'rootcomp_cmd'} = $1;
-        $this_test->{'rootcomp_file1'} = $2;
-        $this_test->{'rootcomp_file2'} = $3;
-        print "$prog debug: config custom rootcomp >" . ( $_ ? "true" : "false") . "<\n" if ($debug);
-        print "$prog debug: config custom rootcomp_cmd >$1<\n" if ($debug);
-        print "$prog debug: config custom rootcomp_file1 >$2<\n" if ($debug);
-        print "$prog debug: config custom rootcomp_file2 >$3<\n" if ($debug);
-        next;
-    }
-	if ($line =~ /^doc\s+(.+)$/){
-	    $this_test->{'doc'} = $1;
-	    print "$prog debug: config doc >$1<\n" if ($debug);
-	    next;
-	}
-	else {
-	    print "$prog: Warning: config line $. not recognised, ignoring it: $line\n";
-	    next;
-	}
-    }
-    close CONFIG;
-    print "$prog debug: end of config file\n\n" if ($debug);
-    # save last test config
-    if (! $first){
-	$config{$current_test_id} = $this_test;
-	push @test_order, $current_test_id;
-    }
-
-}
-
-# display details of the configured tests
-sub print_config(){
-    print "=== Test Configuration\n";
-    foreach (keys %config){
-	print "test: $_\n";
-	print "  name '" . $config{$_}->{'name'} . "' \n";
-	print "  doc '" . $config{$_}->{'doc'} . "'\n";
-	print "  disabled '" . ( $config{$_}->{'disabled'} ? "true" : "false") . "'\n";
-	print "  checklog '" . ( $config{$_}->{'checklog'} ? "true" : "false") . "'\n";
-	print "  checklog_opts '" . $config{$_}->{'checklog_opts'} . "'\n";
-        print "  filterlog '" . $config{$_}->{'filterlog'} . "'\n";
-	print "  compresslog '" . ( $config{$_}->{'compresslog'} ? "true" : "false") . "'\n";
-	print "  rootcomp '" . ( $config{$_}->{'rootcomp'} ? "true" : "false") . "'\n";
-	print "  rootcomp_cmd '" . $config{$_}->{'rootcomp_cmd'} . "'\n";
-	print "  rootcomp_file1 '" . $config{$_}->{'rootcomp_file1'} . "'\n";        
-	print "  rootcomp_file2 '" . $config{$_}->{'rootcomp_file2'} . "'\n";
-	print "  checkcount '" . ( $config{$_}->{'checkcount'} ? "true" : "false") . "'\n";
-	print "  checkcount_file '" . $config{$_}->{'checkcount_file'} . "'\n";
-	print "  checkcount_tolerance '" . $config{$_}->{'checkcount_tolerance'} . "'\n";
-	print "  checkcount_level '" . $config{$_}->{'checkcount_level'} . "'\n";
-	print "  checkmerge '" . ( $config{$_}->{'checkcount'} ? "true" : "false") . "'\n";
-	print "  checkmerge_file '" . $config{$_}->{'checkcount_file'} . "'\n";
-	print "  checkmerge_tolerance '" . $config{$_}->{'checkcount_tolerance'} . "'\n";
-	print "  checkmerge_reffile '" . $config{$_}->{'checkcount_file'} . "'\n";
-	print "  datafile '" . $config{$_}->{'datafile'} . "'\n";
-	print "  datafilelink '" . $config{$_}->{'datafilelink'} . "'\n";
-	print "  joboptions '" . $config{$_}->{'joboptions'} . "'\n";
-	for (@{$config{$_}->{'pre_condition'}}){
-	    print "  pre_condition $_'\n";
-	}
-	for (@{$config{$_}->{'pre_command'}}){
-	    print "  pre_command $_'\n";
-	}
-	for (@{$config{$_}->{'post_command'}}){
-	    print "  post_command $_'\n";
-	}
-	for (@{$config{$_}->{'post_test'}}){
-	    print "  post_test $_'\n";
-	}        
-        print "  athena_env'"  . $config{$_}->{'athena_env'} . "'\n";
-	print "  athena_cmd '" . $config{$_}->{'athena_cmd'} . "'\n";
-	print "  athena_args '" . $config{$_}->{'athena_args'} . "'\n";
-	printf "  exitmask %#.8b \n", $config{$_}->{'exitmask'};
-	print "  stdinfile '" . $config{$_}->{'stdinfile'} . "'\n";
-	if ($#{$config{$_}->{'regtest'}} == -1){
-	    print "  (no regtests defined)\n";
-	}
-	for (@{$config{$_}->{'regtest'}}){
-	    print "  regtest: algorithm name '" . $_->{'algoname'} . "'\n";
-	    print "           match message pattern '" . $_->{'match'} . "'\n";
-	    print "           reference file '" . $_->{'reffile'} . "'\n";
-	}
-	if ($#{$config{$_}->{'edmcheck'}} == -1){
-	    print "  (no edmtests defined)\n";
-	}
-	for (@{$config{$_}->{'edmcheck'}}){
-	    print "  edmcheck: algorithm name  '" . $_->{'algoname'} . "'\n";
-	    print "           edmfile          '" . $_->{'edmfile'} . "'\n";
-	    print "           reference file   '" . $_->{'edmreffile'} . "'\n";
-	}
-    }
-}
-
-# check that tests specified on command line exist
-# replace names by ids
-sub check_tests(){
-
-    # build map of tests by name
-    my $test_id_byname = {};
-    foreach (keys %config){
-	my $name = $config{$_}->{'name'};
-	if (exists $test_id_byname{$name}){
-	    print "$prog: error: test name $name is not unique\n";
-	} else {
-	    $test_id_byname{$name} = $_;
-	}
-    }   
-    
-    # check that tests specified on command line exist
-    # replace names by ids
-    for ( my $i=0; $i<=$#tests; $i++ ){
-	if ( exists $config{$tests[$i]} ){
-	    next;
-	} elsif ( exists $test_id_byname{$tests[$i]} ) {
-	    $tests[$i] = $test_id_byname{$tests[$i]};
-	    next;
-	} else {
-	    prog_error_exit ("test name/id $tests[$i] is not defined in the config file", 'SCRIPT_MISC');
-	}
-    }
-
-    # if no tests are specified, do them all in the order they were read in.
-    if ($#tests == -1){
-	@tests = @test_order;
-    }
-}
-
-
-# loop over tests, skip those that are disabled
-sub do_tests(){
-    my $first = TRUE;
-    for (@tests){
-	my $id = $_;	
-	@statuscodes = ( 'OK' ); # reset for status code of latest test
-	$exitmask = $config{$id}->{'exitmask'};	# exitmask of latest test
-	#print "-------------------------------------------------------\n";
-	print "=== Test $id: " . $config{$id}->{'name'};
-	if ($config{$id}->{'disabled'}) {
-	    print " is disabled\n";
-	} else {
-	    print "\n";
-	    if ($first){
-		first_test_prep();
-		$first = FALSE;
-	    }
- 	    run_test($id);
-	    if ($#statuscodes>0){
-		$failures++;
-	    }
-	    $statuscode = process_error_codes(@statuscodes);
-	    $testresults{$id}=$statuscode;	    
-	}
-	print "--------------------------------------------------------------------------------\n";
-    }
-}
-
-# Timer subroutine
-# given an initial time t0 in seconds since the epoch (i.e. as given by perl time function), calculates and prints the total elapsed (aka wallclock) time, user time and system time. Do not expect these to add up, e.g. if the system is busy with other users or you have to wait for castor.
-# NB if called multiple times, the last call will overwrite previous output files.
-sub timer($){
-    my ($t0) = @_;
-    my $t1=time();
-    my ($tuser,$tsystem,$tcuser,$tcsystem) = times;
-    printf( "=== Timer: total elapsed %d s, total user %6.2f s, total system %6.2f s\n", 
-	    $t1-$t0, $tuser+$tcuser, $tsystem+$tcsystem);
-    open TIMER, ">$timerout";
-    printf TIMER "%d %f %f\n",$t1-$t0, $tuser+$tcuser, $tsystem+$tcsystem;
-    close TIMER;
-    
-}
-
-sub results_summary(){
-    return if (!$showsummary);
-    print "=== Test results summary\n";
-    printf "  %3s %-20s %-10s\n", "Id", "Test Name", "Result";
-    for (@tests){
-	my $id = $_;
-	printf "  %3s %-20s ", $id, $config{$id}->{'name'};
-	if ($config{$id}->{'disabled'}){
-	    print "(disabled)\n";
-	    next;
-	}
-	if ($testresults{$id} == 0){
-	    print "passed";
-	} else {
-	    print "failed ($testresults{$id})";
-	}
-	print "\n";
-    }
-}
-
-# preparations before first test is run
-sub first_test_prep {
-
-    # create run dir if it doesn't already exist
-    if ( $clear_dir ) {
-        system "rm -fr $run_dir";
-    }
-    if ( ! -d $run_dir ){
-	mkpath $run_dir 
-	    #or die "$prog: error: failed mkpath $run_dir: $!\n";
-    }
-    chdir $run_dir or prog_error_exit( "failed chdir $run_dir: $!\n", 'SCRIPT_MISC');
-
-    # get log file from env
-    my $ajl = $ENV{'ATN_JOB_LOGFILE'};
-    if (defined($ajl)){
-	system "echo $ajl > atn_job_logfile_name";
-    }
-
-    # run script to get relevant file
-    my $id = $_;
-    my $jobopts = $config{$id}->{'joboptions'};
-    print "$prog debug: job options:$jobopts\n" if ($debug);
-}
-
-# run a test
-sub run_test($){
-    my ($id) = @_;
-    my $name = $config{$id}->{'name'};
-
-    # prepare file names
-    my $jobopts = $config{$id}->{'joboptions'};
-    my $logfile = "atn_test.log";
-    my $logfiletail = "atn_tail.log";
-    my $local_jobopts = "";
-    print "$prog debug: job options:$jobopts\n" if ($debug);
-    systemcall("echo \"$config{$id}->{'doc'}\" > $docout");
-    if ( $jobopts  ne 'None' and $jobopts ne UNDEFINED ){
-        my @suffixlist = ( '.py', '.txt' );
-        my ($filename,$path,$suffix) = fileparse($jobopts,@suffixlist);
-        $local_jobopts = $filename . "_test" . $suffix;
-        $logfile = "$filename" . "_test.log";
-        $logfiletail = "$filename" . "_tail.log";
-        print "$prog debug: $jobopts  $local_jobopts $logfile\n" if ($debug);
-    
-    # get copy of joboptions file to customise for this job, 
-    # if it's not already there
-    # allow for the case of no jobotions (AthanMT)
-        if (! -e "$filename$suffix" ){
-	    print "$prog debug: $filename$suffix does not exist, so copying it with get_files\n" if ($debug);
-	    systemcall("get_files -jo $jobopts");
-        }
-        if (-e "$filename$suffix"){ # check: will not be there in verify mode
-	    copy "$filename$suffix", "$local_jobopts"
-	        or prog_error_exit( "failed copying $filename$suffix to $local_jobopts: $!\n", 'SCRIPT_MISC');
-        }
-        # check permissions on local joboptions file before trying to append to it
-        if (! -w $local_jobopts){
-	    chmod 0644, $local_jobopts
-	         or prog_error_exit( "failed to set write permission for $local_jobopts: $!\n", 'SCRIPT_MISC');
-        }
-     
-
-        # append joboptions to set algorithm output level to 2, 
-        # for algorithms to be regression tested.
-        open JOBOPTS, ">> $local_jobopts" 
-	    or prog_error_exit ("failed opening $local_jobopts: $!\n", 'SCRIPT_MISC');
-        print JOBOPTS "\n";
-#    for (@{$config{$id}->{'regtest'}}){
-#	my $algoname = $_->{'algoname'};
-	# require some alphanumeric chars for a valid algoname
-#	if ($algoname =~ /\w/){
-#	    print "$prog debug: appending to joboptions file: $algoname.Outputlevel = 2\n"  if ($debug);
-#	    print JOBOPTS "Algorithm(\"$algoname\").Outputlevel = DEBUG\n";
-#	print JOBOPTS "MessageSvc.debugLimit = 2000\n";
-#	    print JOBOPTS "MessageSvc.defaultLimit = 2000\n";
-#	} else {
-#	    print "$prog warning: not setting output level for algorithm \"$algoname\" since it doesn't look like a valid name (no alphanumeric chars)\n";
-#	}
-#    }
-        close JOBOPTS;
-    }
-    # run any pre-condition - they must all succeeed or else the job won't run
-    my $pre_condition; 
-    my $precondrc=TRUE;
-    for $pre_condition (@{$config{$id}->{'pre_condition'}}){
-	my $precondrc1=systemcall("$pre_condition");
-	print "$prog debug: pre_condition \"$pre_condition\" returned $precondrc1\n" if ($debug);
-	if ($precondrc1!=0){
-	    print "$prog info: pre_condition \"$pre_condition\" failed (exit code $precondrc1)\n";
-	    $precondrc=FALSE;
-	}
-    }
-    if ($precondrc){
-	print "$prog debug: pre-conditions met\n" if ($debug);
-    } else {
-	print "$prog info: pre-conditions failed so test cannot be run. This is not a test failure.\n";
-	push @statuscodes, 'PRECONDITION_FAILED_SO_NOT_RUN';
-	return;
-    }
-
-    # run any pre-command
-    my $pre_command; 
-    for $pre_command (@{$config{$id}->{'pre_command'}}){
-	systemcall("$pre_command");
-    }
-
-    # link data file if specified
-    my $datafile = $config{$id}->{'datafile'};
-    my $datafilelink = $config{$id}->{'datafilelink'};
-    if ($datafile ne UNDEFINED){
-	# expand environment variables in datafile
-	while ($datafile =~ /\$\{(.+)\}/){ 
-	    my $var = $1;
-	    if (exists $ENV{$var}){ 
-		my $sub=$ENV{$var};
-		$datafile =~ s/\$\{$var\}/$sub/;
-		print "$prog debug: expanding env var '$var' in datafile yields: $datafile\n" if ($debug);
-	    } else {
-		print "$prog: Warning: env var '$var' used in datafile definition is undefined, replacing with blank\n";
-		$datafile =~ s/\$\{$1\}//;
-	    }
-	}
-
-	print "$prog debug: linking data file to $datafilelink: $datafile\n"  
-	    if ($debug);
-	if (-e $datafilelink or -l $datafilelink){
-	    print "$prog debug: first removing $datafilelink\n" if ($debug);
-	    unlink $datafilelink
-		or die "$prog: error: failed to delete $datafilelink: $!\n";
-	}
-	symlink $datafile, $datafilelink
-	    or die "$prog: error: failed to symlink $datafilelink: $!\n";
-    }
-
-    # run athena
-    my $athena_env = $config{$id}->{'athena_env'};
-    my $athena_cmd = $config{$id}->{'athena_cmd'};
-    my $athena_args = $config{$id}->{'athena_args'};
-    my $filter_cmd = $config{$id}->{'filterlog'};
-    $filter_cmd = " 2>&1 | " . $filter_cmd if (length($filter_cmd)>0);
-    $athena_args = "" if ($athena_args eq UNDEFINED);
-    my $stdinfile = getStdinFile($config{$id}->{'stdinfile'});
-    print "=== Athena env '$athena_env' \n";
-    print "=== Running '$athena_cmd $athena_args $local_jobopts $stdinfile $filter_cmd'\n";
-    # the stderr redirection needs to be exactly at this place
-    my $athenarc = systemcall("$athena_env ; $athena_cmd $athena_args $local_jobopts $stdinfile $filter_cmd > $logfile 2>&1");
-
-    # the way to recognise a timeout
-    $timeout = FALSE;
-    if (! open LOG, "tail -600 $logfile|"){
-	print "$prog: error: failed opening $logfile to read: $!\n";
-	print "-> $failkey Aborting this test\n";
-	# will happen later: return; # go on to next test
-    }
-    while (<LOG>){
-	if (/CRITICAL stopped by user interrupt/ or
-        /ERROR Keyboard interruption caught/ or
-	    /^Signal handler: Killing [0-9]+ with 15/){
-	    $timeout = TRUE;
-	    last;
-	}
-
-    }
-    close LOG;
-
-    print "$prog: debug: timeout=$timeout " . ($timeout?"true":"false") . " athenarc=$athenarc \n" if ($debug);
-
-    # check athena return code
-    #print "-------------------------------------------------------\n";
-    if ($athenarc == 0 and not $timeout){
-	print "=== $name OK: Athena exited normally\n";
-    } elsif ($timeout){
-    # or $athenarc == 35584 -> sometimes this exit code is just a seg fault
-	print "=== $name $warnkey: Athena exceeded time limit and was killed\n";
-	push @statuscodes, 'ATN_TIME_LIMIT';
-    } else {
-	print "=== $name $failkey : Athena exited abnormally! Exit code: $athenarc\n";
-	push @statuscodes, 'ATHENA_BAD_EXIT';
-    }
-
-	
-    # run any post-commands
-    unlink "$postcmdout" if (-f "$postcmdout");
-#    if 
-    if (defined $config{$id}->{'post_command'} 
-	and   @{$config{$id}->{'post_command'}}>0) {
-      my $post_command;
-      @postrc=();
-
-      for $post_command (@{$config{$id}->{'post_command'}}){
-        # All post command share the same log file
-	push @postrc, systemcall("($post_command) >> $postcmdout 2>&1");
-      }
-      systemcall("cat $postcmdout");
-      print "$prog debug: post_command #commands: ".@postrc."  return codes: @postrc \n" if ($debug);
-    }
-
-    my %reldata = release_metadata();
-    my $nightly = (exists $reldata{'nightly name'} ? $reldata{'nightly name'} : "UNKNOWN");
-    $nightly = $nightly . "/latest";
-    print "$prog: looking for histograms and references for nightly $nightly \n";
-
-    # run any post-tests    
-    unlink "$posttestrc" if (-f "$posttestrc");
-    if ( defined(@{$config{$id}->{'post_test'}}) ) {
-      my $post_test;
-      my $total_rc = 0;
-      @postrc=();
-      open (POSTTEST, '>', $posttestrc);
-      for $post_test (@{$config{$id}->{'post_test'}}){
-        # Each post test has its own log file
-        my $post_test_log = "post_test_$post_test->{'name'}.log";
-        # Replace '$logfile' with the actual file name
-        my $post_test_cmd = $post_test->{'cmd'};
-        $post_test_cmd =~ s/\$logfile/$logfile/;
-	# If there is a comparison to a reference file, make sure that the correct path is used
-        $post_test_cmd =~ s/latest/$nightly/g;
-        my $rc = systemcall("($post_test_cmd) > $post_test_log 2>&1");
-        $total_rc += $rc;
-        # Save return codes in separate text file
-        print POSTTEST "$post_test->{'name'} $rc\n";
-      }
-      close POSTTEST;
-      if ($total_rc>0) {
-        push @statuscodes, 'POST_TEST_BAD_EXIT';
-      }
-    }
-
-    my $pwd = `pwd`;
-    chomp $pwd;
-    # make a URL by substituting the lxbuild local disk path for the web 
-    # server URL if it does not match the lxbuild local disk path then it 
-    # will be left as a file path instead. 
-    # NB gives wrong address for incremental nightlies because the build is always done in atlrel_0 then copied to altrel_1-5 as appropriate
-    my $logfileURL = $logfile;
-    $logfileURL =~ s%/pool/build/atnight/localbuilds/nightlies%http://atlas-computing.web.cern.ch/atlas-computing/links/buildDirectory/nightlies%;
-    print "=== Log file: " . $pwd . "/$logfileURL\nNB replace rel_0 with actual nightly in this URL.\n";
-    if (! -e $logfile or -z $logfile){
-	print "=== Error: log file does not exist or is empty, skipping the rest of this test\n";
-	return;
-    }
-    # get data file LFN/PFN from log file + pool file catalogue
-    if (! open LOG, "<$logfile"){
-	print "$prog: error: failed opening $logfile to read: $!\n";
-	print "-> $warnkey Aborting this test\n";
-	return; # go on to next test
-    }
-    my $dataLFN="unknown";
-    my $dataPFN="";
-    my $eventCounter=0;
-    while (my $line = <LOG>){
-      if ($line =~ /InputCollections\s+\= \['(.*)'\]/){  # athena
-	$dataLFN=$1;
-      }
-      elsif ($line =~ /event stream from file list\s+\['(.*)'\]/){  # athenaHLT
-	$dataLFN=$1;
-      }
-      # count events for athena job
-      ++$eventCounter if ($line =~ /AthenaEventLoopMgr\s+INFO\s+===>>>  done processing event/);
-      # handle athenaHLT case
-      if ($line =~ /Py:athenaHLT\s+INFO\s+Processed ([0-9]+) events/){
-        $eventCounter=$1;
-      }
-    }
-    close LOG;
-
-    print "$prog debug: dataLFN=$dataLFN\n" if ($debug);
-    if ($dataLFN ne "unknown"){
-	my $dataLFNstripped = $dataLFN;
-	$dataLFNstripped =~ s/^LFN\://;
-	my $cmdout1 = qx(FClistPFN -u xmlcatalog_file:PoolFileCatalog.xml -l $dataLFNstripped);
-	chomp $cmdout1;
-	if (length($cmdout1)>0){
-	    $dataPFN = $cmdout1;
-	}
-	print "$prog debug: dataLFNstripped=$dataLFNstripped dataPFN=$dataPFN\n" if ($debug);
-	print "$prog debug: cmdout1=$cmdout1\n" if ($debug);
-    }
-    print "=== Data file: $dataLFN   $dataPFN\n";
-
-    # write how many events processed
-    print "=== Events processed: $eventCounter\n";
-
-    # check log file for likely errors and known false positives
-    if ($config{$id}->{'checklog'}){
-      my $checklog_opts =  $config{$id}->{'checklog_opts'};
-      # ERRORs
-      my $logrc = systemcall("check_log.pl $checklog_opts $logfile > $checklogout 2>&1");
-      systemcall("cat $checklogout");
-      if ($logrc != 0){
-	print "=== $name $failkey : problem detected in log file\n";
-	push @statuscodes, 'ATHENA_ERROR_IN_LOG';
-      }
-      # WARNINGs
-      $rc = systemcall("check_log.pl $checklog_opts --noerrors --warnings $logfile > $warnout 2>&1");
-      # Ignore rc.
-    }
-
-    #make short file with last 600 lines only
-    systemcall("tail -600 $logfile > $logfiletail");
- 
-
-    # rootcomp
-    if ($config{$id}->{'rootcomp'}){
-      	my $rootcomp_file1 =  $config{$id}->{'rootcomp_file1'};
-        my $rootcomp_file2 =  $config{$id}->{'rootcomp_file2'};
-        if( $nightly ne "" ) {
-           # allow for custom tests with two files
-           $rootcomp_file2  =~ s/latest/$nightly/g ;
-	}
-        $rootcomp_file1 = resolveSymlinks($rootcomp_file1);
-        $rootcomp_file2 = resolveSymlinks($rootcomp_file2);
-    
-    if (-e $rootcomp_file1) {
-        if (-e $rootcomp_file2) {
-	my $rc=systemcall("$config{$id}->{'rootcomp_cmd'} $rootcomp_file1 $rootcomp_file2 > $rootcompout 2>&1", TRUE);
- 	if ($rc != 0){
-	    print "=== $name WARNING: monitoring histogram mismatch detected by rootcomp\n";
-	    push @statuscodes, 'ROOTCOMP_MISMATCH';
-	} else {
-	    print "=== $name: rootcomp: monitoring histograms match. \n";
-	}
-        }
-        else {
-            print "=== Alert: $rootcomp_file2 does not exist \n";
-        }
-    }
-        else {
-            print "=== Alert: $rootcomp_file1 does not exist \n";
-        }
-	#systemcall("cat $rootcompout");
-        if (-e $rootcompout) {
-	systemcall("grep -A 5 '^Summary' $rootcompout");
-        }
-      }
-
-    # checkcount
-    if ($config{$id}->{'checkcount'}){
-	my $checkcount_file =  $config{$id}->{'checkcount_file'};
-        my $checkcount_tolerance = $config{$id}->{'checkcount_tolerance'};
-        my $checkcount_level = $config{$id}->{'checkcount_level'};
-        if( $nightly ne "" ) {
-           $checkcount_file  =~ s/latest/$nightly/ ;
-	}
-        $checkcount_file = resolveSymlinks($checkcount_file);
-	print "$prog: checking trigger and TE counts \n";
-        print "=== Running $checkcount_cmd $checkcount_tolerance $checkcount_file $checkcount_level > $checkcountout 2>&1 \n";
-	my $rc=systemcall("$checkcount_cmd $checkcount_tolerance $checkcount_file $checkcount_level > $checkcountout 2>&1", TRUE);
- 	if ($rc != 0){
-	    print "=== $name WARNING: trigger count mismatch detected by checkcount\nSee $checkcountout for details.\n";
-	    push @statuscodes, 'CHECKCOUNTS_FAILED';
-	} else {
-	    print "=== $name: countcheck: trigger counts match. \n";
-	}
-	#systemcall("cat $rootcompout");
-        #Grep for FAILURE here so that bad runs will be flagged as such  
-	systemcall("grep 'FAILURE' $checkcountout");
-	systemcall("grep 'test warning' $checkcountout");
-	systemcall("grep 'tolerance' $checkcountout");
-    }
-
- # checkmerge
-    if ($config{$id}->{'checkmerge'}){
-	my $checkmerge_file =  $config{$id}->{'checkmerge_file'};
-        my $checkmerge_tolerance = $config{$id}->{'checkmerge_tolerance'};
-        my $checkmerge_reffile = $config{$id}->{'checkmerge_reffile'};
-        if( $nightly ne "" ) {
-           $checkmerge_file  =~ s/latest/$nightly/ ;
-	}
-        $checkmerge_file = resolveSymlinks($checkmerge_file);
-	print "$prog: checking trigger histograms for merged system \n";
-        print "=== Running $checkmerge_cmd $checkmerge_file $checkmerge_reffile $checkmerge_tolerance > $checkmergeout 2>&1 \n";
-	my $rc=systemcall("$checkmerge_cmd $checkmerge_file $checkmerge_reffile $checkmerge_tolerance > $checkmergeout 2>&1", TRUE);
-
- 	if ($rc != 0){
-	    print "=== $name WARNING: Errors detected by checkmerge\nSee $checkmergeout for details.\n";
-	    push @statuscodes, 'POST_TEST_BAD_EXIT';
-	} else {
-	    print "=== $name: mergecheck: the test passed successfully. \n";
-	}
-	systemcall("grep 'ERROR' $checkmergeout");
-	systemcall("grep 'WARNING' $checkmergeout");
-    }
-    
-   # EDM tests
-    my $emdcheckresult=TRUE;
-  EDMCHECK:
-    for (@{$config{$id}->{'edmcheck'}}){
-        # truncate algorithm name for 30 characters
-	my $algoname = $_->{'algoname'};
-	my $truncalgoname = substr($algoname, 0, 30);
-	my $edmfile = $_->{'edmfile'};
-	my $edmreffile = $_->{'edmreffile'};
-	# if file exist for this sepecfic nightly use it, otherwise
-	# use default
-        if( $nightly ne "" ) {
-	  $newedmreffile =  $edmreffile;
-	  # substitute  e.g. devval/latest for latest
-	  $newedmreffile =~ s/latest/$nightly/ ;
-	  # check if the reference file for this nightly exists
-	  if ( -e $edmreffile ) {
-	      $edmreffile = $newedmreffile;
-	      print "New reference file name $edmreffile \n";
-	  }
-	}
-        $edmreffile = resolveSymlinks($edmreffile);
-	my $rc=systemcall("$truncalgoname -f $edmfile -r $edmreffile >>$edmcheckout 2>&1", TRUE);
-        if ($rc != 0){
-	    print "=== $name WARNING: trigger edmcheck mismatch detected by $truncalgoname\nSee $edmcheckout for details.\n";
-            print "=== $name if differences are understood cp $edmfile  $edmreffile \n"; 
-	} else {
-	    print "=== $name: edmcheck: files matched \n";
-	}
-    }
-
-    # regression tests
-    my $regtestresult=TRUE;
-  REGTEST:
-    for (@{$config{$id}->{'regtest'}}){
-        # truncate algorithm name for 15 characters
-	my $algoname = $_->{'algoname'};
-	my $truncalgoname = substr($algoname, 0, 30);
-	my $match = $_->{'match'};
-	my $reffile = $_->{'reffile'};
-	my $newfile = $reffile . ".new";
-        # reference file caser
-        if( substr($newfile, 0, 5) eq "/tmp/" ){ 
-	  # ref file is in /tmp, eg. from another tst (due to tmp filling up, avoid this)
-	  $newfile = substr($newfile, 5);
-	} elsif ( substr($newfile,0,3) eq "../"){
-	  # reference is to another test -- other test must be first in test/xxx_TestConfigruation.xml
-	  my $lslash = rindex $newfile, '/';
-          $newfile = substr($newfile, $lslash+1 );
-          # in this case ref-file for an existing test will end in .new
-          $reffile = $reffile . ".new";
-	}  elsif      ( substr($newfile, 0, 5) eq "/afs/" ){
-          # should be usual case: ref file is in afs  
-          my $lslash = rindex $newfile, '/';
-          $newfile = substr($newfile, $lslash+1 );
-          if( $nightly ne "" ) {
-	    $newreffile =  $reffile;
-	    # substitute  e.g. devval/latest for latest
-	    $newreffile =~ s/latest/$nightly/ ;
-	    # check if the reference file for this nightly exists
-	    if ( -e $newreffile ) {
-	      $reffile = $newreffile;
-	      print "New reference file name $reffile \n";
-	    }
-	  }
-	}
-	print "$prog debug: truncated algoname $truncalgoname\n" if ($debug);
-	# extract regression test lines for this algorithm from log file
-	open NEW, ">$newfile"
-	    or die "$prog: error: failed opening $newfile to write: $!\n";
-	if (! open LOG, "<$logfile"){
-	    print "$prog: error: failed opening $logfile to read: $!\n";
-	    print "-> $warnkey Aborting this test\n";
-	    return FALSE; # go on to next test
-	}
-	my $lines=0;
-	if ($algoname eq $fullregtest){
-	    while (<LOG>){
-		if (/$match/){
-		    print NEW;
-		    $lines++;
-		}
-	    }
-	    print "$prog debug: fullregtest $lines lines matched $match in LOG\n" if ($debug);
-        } elsif ($algoname eq $customregtest){
-          $rc = systemcall("$match >> $regtestout", TRUE);
-          $regtestresult = ( $rc==0 ? TRUE : FALSE );
-          next REGTEST;
-        }
-        else {
-	    while (<LOG>){
-		if (/$truncalgoname.*$match/){
-		    print NEW;
-		    $lines++;
-		}
-	    }
-	    print "$prog debug: regtest $lines lines matched $truncalgoname $match in LOG\n" if ($debug);
-	}
-
-	close LOG;
-	close NEW;
-	# check whether any lines matched - if zero it's an error straight away
-	# and no point in doing the diff
-	if ($lines == 0){
-	    # print failure keyword here to flag it as an error
-	    print "=== Alert! $warnkey no lines matching $match were found for $truncalgoname in log file\n";
-	    $regtestresult = FALSE;
-	    next REGTEST;
-	}
-	# diff the output and the reference
-	# even if verify is off
-	my $rc = 0;
-        $reffile = resolveSymlinks($reffile);
-        print  "old/reference file $reffile\n";
-        print  "new/test      file $newfile\n";
-        print  "< old/reference\n> new/test\n";
-	print substr($reffile, 0, 4);
-# identify location of ref file
-	if( substr($reffile, 0, 4) eq "/tmp" ){
-	  print "=== This test looks for reference in /tmp directory\n";
-	} elsif( substr($reffile, 0, 3) eq "../" ){
-	  print "=== This test looks for reference in another directory\n";
-        } elsif (substr($reffile, 0, 1) eq "/" ){
-	  print "=== This test looks for reference in /afs or /localhome directory\n";
-  	} else {
-	  print "=== This test looks for reference from svn\n";
-	}
-        if (-e $reffile) {
-            #            print "old/reference file exists!\n";
-	systemcall("echo -e 'total lines in old/reference:' `wc -l $reffile` >>$regtestout",TRUE); 
-	systemcall("echo -e 'total lines in new/test     :' `wc -l $newfile` >>$regtestout",TRUE); 
-	systemcall("echo -e '< old/reference\n> new/test' >> $regtestout", TRUE);
-	$rc = systemcall("diff $reffile $newfile", TRUE);
-	$rc = systemcall("diff $reffile $newfile >> $regtestout", TRUE);
-
-	# Do HTML diff if differences are small enough
-	$difflines = `wc -l $regtestout | cut -d' ' -f1`;
-	if ($difflines < 1000) {
-	    systemcall("htmldiff.py -w 80 $reffile $newfile > $htmldiffout 2>&1", TRUE);
-	}
-	if ($rc == 0){
-	    print "=== Output is the same as reference for $algoname\n";
-	} else {
-	    # print failure keyword here to flag it as an error
-	    print "=== Alert! $warnkey Output differs from reference for $algoname\n";
-	    print "    If this change is understood, please update the reference file";
-            if(substr($reffile, 0, 4) eq "/afs" ){
-		print "by typing:\n    cp $newfile $reffile\n";
-	    } else {
-		print ".\n";
-	    }
-	    $regtestresult = FALSE;
-	    next REGTEST;
-	}
-        }
-        else {
-          print "=== Alert! old/reference file: $reffile does not exist - check if this is a new release!\n";  
-        }
-    }
-    if (!$regtestresult){
-	push @statuscodes, 'ATHENA_REGTEST_FAILED';
-    }
-
-    # compress log file
-    if ($config{$id}->{'compresslog'}){
-	systemcall("gzip -9 $logfile");
-    }
-
-#    print "$prog debug: returning result $result (" 
-#	. ($result ? "true" : "false") . ")\n"      if ($debug);
-    return;
-}
-
-
-# wrap system calls to provide for verify and debug modes.
-# second, optional argument overrides verify mode if TRUE
-sub systemcall($;$){
-    my $override_verify = FALSE;
-    my $command;
-    ($command, $override_verify) = @_;
-    
-    my $rc = 0;
-    if ($verify or $debug){
-	print "$prog: command: $command\n"; 
-    }
-    if (!$verify or $override_verify){
-        $rc = system ($command); 
-    }
-    $rc = ($rc >> 8);  # see http://perldoc.perl.org/functions/system.html
-    if ($debug){
-	print "$prog: return code " . $rc . "\n";
-    }
-    return $rc;
-}
-
-# Resolve all symlinks in given path
-sub resolveSymlinks() {
-  my ($path) = @_;
-  return $path if (length $path == 0);
-  my $respath = `readlink -f $path`;
-  if ($? != 0) {
-      return $path;    # failure: return original path
-  }
-  chomp $respath;
-  return $respath;
-}
-
-# Read ReleaseData file and return dictionary with content
-sub release_metadata() {
-    my %data;
-    my @dir = grep(/\/$ENV{'AtlasProject'}\//, split(':',$ENV{'LD_LIBRARY_PATH'}));
-    open RELDATA, "$dir[0]/../ReleaseData" or print "=== Alert! Cannot open ReleaseData file\n";
-    while (<RELDATA>) {
-        chomp;
-        my @kv = split(':');
-        $data{$kv[0]} = $kv[1];
-    }
-    return %data;
-}
diff --git a/Trigger/TrigValidation/TrigValTools/bin/trigtest_ART.pl b/Trigger/TrigValidation/TrigValTools/bin/trigtest_ART.pl
deleted file mode 100755
index 4e7729dfbd45c8cb5a0ecb714be5526406a81735..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TrigValTools/bin/trigtest_ART.pl
+++ /dev/null
@@ -1,1393 +0,0 @@
-#!/usr/bin/perl -w
-# Script to manage Trigger tests
-# $Id: trigtest.pl,v 1.16 2009-05-20 15:53:22 sgeorge Exp $
-
-use Getopt::Long;
-use File::Basename;
-use File::Spec;
-use File::Copy;
-use File::Path;
-use constant TRUE => 1;
-use constant FALSE => 0;
-use constant UNDEFINED => "undefined";
-$prog = basename $0;
-$config = {};
-$fullregtest = '<fullregtest>';
-$customregtest = '<customregtest>';
-# set some output file names
-$regtestout = "regtest.log";
-$htmldiffout = "regtest.html";
-$summaryout = "summary.log";
-$timerout = "timer.log";
-$checklogout = "checklog.log";
-$warnout = "warn.log";
-$rootcompout = "rootcompout.log";
-$checkcountout = "checkcountout.log";
-$checkmergeout = "checkmergeout.log";
-$edmcheckout = "edmcheckout.log";
-$postcmdout = "postcmd.log";
-$posttestrc = "post_test.exitcodes";
-$docout = "doc.txt";
-
-# define error codes - must match atn_summary.pl
-%ERROR = (
-	  OK => 0,
-	  SCRIPT_MISC => 1,
-	  POST_TEST_BAD_EXIT => 2,
-	  ROOTCOMP_MISMATCH => 4,
-	  ATHENA_BAD_EXIT => 8,
-	  CHECKCOUNTS_FAILED => 16,
-	  ATHENA_ERROR_IN_LOG => 32,
-	  ATHENA_REGTEST_FAILED => 64,
-	  ATN_TIME_LIMIT => 128,
-	  PRECONDITION_FAILED_SO_NOT_RUN => 256
-	  );
-# max bit: 128. Bash takes return codes 0-256.
-# Larger numbers are taken mod 256 so effectively masked off. Can be used for internal signalling only.
-
-# mask off those codes above which you do not want to flag in the exit code
-# i.e. so ATN does not interpret them as the test failing. 
-# bit positions marked 1 will be used, 0 will not be used.
-# SCRIPT_MISC is on the right, ATN_TIME_LIMIT on the left
-# This default mask can be modified via the 'extra_failure_codes' test directive
-# only "shout" if we see/have: ATHENA_BAD_EXIT => 8 decimal 8 in bit is 0b00001000 thus 
-$default_exitmask = 0b00001001;
-
-# Exit mask of the last run test. Not nice but the easiest way to implement
-# this on top of all the other ugly things in this script.
-$exitmask = $default_exitmask;
-    
-# command to use for rootcomp
-$rootcomp_cmd = "rootcomp.py --pdf --noRoot";
-$checkcount_cmd = "trigtest_checkcounts.sh";
-$checkmerge_cmd = "trigtest_check_merge.sh";
-sub main();
-main();
-exit -10;
-####
-
-sub main(){
-    # trap errors from here on
-    $SIG{'INT'} = 'CLEANUP_INT';
-    $SIG{'TERM'} = 'CLEANUP_TERM';
-    $t0=time(); # timer
-    $failures = 0; # count number of tests which fail
-    $statuscode = 0; # combination of errors from last test
-    command_line();
-    parse_config();
-    if ($verify){
-	print_config();
-    }
-    exit if ($verifyconfig);
-    check_tests();
-    do_tests();
-    results_summary();
-    timer($t0);
-    if ($statuscode != 0){
-	prog_error_exit("at end",@statuscodes);
-    }
-    exit 0;
-    # exit($statuscode); # status code of last test
-    # exit($failures); # number of tests which fail
-}
-
-sub CLEANUP_INT {
-    print "\n\n$prog: Caught Interrupt (^C), probably ATN time exceeded, finish up and exit\n";
-    push @statuscodes, 'ATN_TIME_LIMIT';
-    timer($t0);
-    if ($statuscode != 0){
-	prog_error_exit("at end",@statuscodes);
-    }
-    exit(1); # never reaches this line in principle
-}
-
-sub CLEANUP_TERM {
-    print "\n\n$prog: Caught TERM signal, finish up and exit\n";
-    push @statuscodes, 'ATN_TIME_LIMIT';
-    timer($t0);
-    if ($statuscode != 0){
-	prog_error_exit("at end",@statuscodes);
-    }
-    exit(1); # never reaches this line in principle
-}
-
-sub prog_error_exit($$){
-    my ($message,@error_strings) = @_ or die;
-    my $exitcode_unmasked = process_error_codes(@error_strings);
-    # for ATN purposes, mask less significant codes
-    my $exitcode = $exitcode_unmasked & $exitmask;
-    if ($exitcode!=0){
-	printf "$prog: $failkey $message (unmasked=%#.8b exitcode=%#.8b)\n", $exitcode_unmasked, $exitcode;
-    } else {
-	printf "$prog: $warnkey $message (unmasked=%#.8b exitcode=%#.8b)\n", $exitcode_unmasked, $exitcode;
-    }
-    exit($exitcode);
-
-}
-
-sub process_error_codes(@) {
-    my (@error_strings) = @_;
-    my $exitcode=0;
-    # | sort | uniq
-    my %saw;
-    undef %saw;
-    @saw{@error_strings} = ();
-    my @error_strings_uniq = sort keys %saw;
-    print "$prog: debug: all statuscodes: @error_strings\n" if ($debug);
-    print "$prog: debug: uniq statuscodes: @error_strings_uniq\n" if ($debug);
-    # convert strings, keep numbers as they are, add together
-    print "=== These errors occured: ";
-    open SUMMARY, ">$summaryout";
-    for (@error_strings_uniq){
-	my $code;
-	if (/^\d+$/){
-	    # it's already a number
-	    $code = $_;
-	} else {
-	    # translate string
-	    $code = $ERROR{$_};
-	}
-	$exitcode += $code;
-	if ($code != 0){ # print all except ok.
-	    print "$_ ($code) ";
-	    print SUMMARY "$_ ($code)\n";
-	}
-    }
-    print "\n";
-    my $maskedcode = $exitcode & $exitmask;
-    print "$prog:process_error_codes() debug exitcode = $exitcode maskedcode = $maskedcode\n" if ($debug);
-    print SUMMARY " exitcode = $exitcode\n";
-    print SUMMARY " maskedcode = $maskedcode\n";
-    close SUMMARY;
-    return $exitcode;
-}
-
-# command line arguments
-sub command_line(){
-  # parse command arguments and check usage
-  $debug = FALSE;
-  $verify = FALSE;
-  $verifyconfig = FALSE;
-  $configfile = 'trigtest.conf'; # default
-  $failkey = 'FAILURE';
-  $warnkey = 'WARNING';
-  $showsummary = FALSE;
-  @tests = ();
-  $run_dir = '../run'; # working directory, relative to cmt dir
-  $clear_dir = FALSE;
-  print "=== Command to repeat this test:\n  $prog @ARGV\n";
-  my $result = GetOptions ('help' => \$help,
-                           'debug!' => \$debug,
-                           'verify!' => \$verify,
-                           'verifyconfig!' => \$verifyconfig,
-                           'showsummary' => \$showsummary,
-                           'failkey=s' => \$failkey,
-                           'warnkey=s' => \$warnkey,
-                           'config=s' => \$configfile,
-			               'test=s' => \@tests,
-			               'rundir=s' => \$run_dir,
-			               'cleardir!' => \$clear_dir,
-			               'package=s' => \$testpackagefq);
-  if ($help || !$result) {
-      usage();
-      prog_error_exit("usage",'SCRIPT_MISC');
-  }
-  $verify = TRUE if ($verifyconfig);
-  if (defined $testpackagefq){
-      print "\n$prog info: note that the --package option is deprecated and will be removed in a \nfuture release. It no longer does anything.\n";
-  }
-}
-
-# usage message
-sub usage(){
-    print "
-  Usage: $prog [options] 
-
-  Testing tool for managing Trigger software tests
-
-  Options:
-
-  --help                show this information
-  --debug               print debug information, for the script maintainer
-  --verify              verify config file and show what would be done
-                        for the tests but don't run athena (see tip below)
-  --verifyconfig        just verify config file and stop
-  --showsummary         print a short summary table of tests results at the end
-  --failkey <string>    keyword to be printed to indicate to the test 
-                        framework that a test has failed, default $failkey
-  --failkey <string>    keyword to be printed to indicate a problem, but not
-                        seen as failure by test framework, default $warnkey
-  --config <file>       specify config file, default trigtest.conf
-                        tries with get_files from DATAPATH if it doesn't exist 
-  --rundir <dir>        specify directory in which to run tests, default ../run
-  --cleardir            remove/clear rundir before running (FALSE by default)
-  --package <string>    (deprecated, does nothing, will be removed in future release)
-  --test <test name|id> specify test to run, see below
-
-  A test name or id can optionally be specified after the --test
-  option to run only that test. By default, all tests will be run in
-  the order they are defined in the config file. The verify option
-  will list all the available tests that are defined in the config
-  file. The --test option may be repeated, and tests will be run in the
-  order the come on the command line.
-
-  See the sample config file for test configuration information.
-
-  It is expected that this tool be run from the cmt or run directory
-  under TriggerTest, after the necessary cmt environment has been set
-  up.  If you changed any files in TriggerTest or checked out a
-  version different from the release you are using, then you need to
-  gmake before running these tests. The --package option can be used
-  to change this default location to another package for reference
-  files and the check_log config file.
-
-  Output from $prog will always be preceeded by its name (for error
-  and debug messages) or '===' for the few messages you get without
-  debug. All other messages come from other programs and commands it
-  has run.
-
-  Tip: after running a test for the first time, run again in verify
-  mode and the same log files will be re-used. This is a good way to
-  quickly test the config file, regression tests, and for script
-  development.
-
-  The exit code refers only to the last test - be sure to read the 
-  output if you run multiple tests!
-  The exit code can be any combination of these values:
-";
-    my $errorcode;
-    foreach $error_name (sort { $ERROR{$a} <=> $ERROR{$b} } keys %ERROR) {
-	printf "      %20s %4d\n", $error_name, $ERROR{$error_name};
-    }
-}
-
-
-# If using a file for stdin, 
-# try to find it with get_files
-# then check it is there
-# and return with < pre-pended,
-# or return empty string if failed
-sub getStdinFile($){
-    my ($stdinfile) = @_;
-    $stdinfile =~ s/^\s+$//; # kill file names that are only spaces
-    $stdinfile = $stdinfile;
-    if (length($stdinfile)>0){
-	if (! -e "$stdinfile" ){
-	    print "$prog debug: $stdinfile does not exist, so copying it with get_files\n" if ($debug);
-	    systemcall("get_files -data $stdinfile");
-	} else {
-	    print "$prog debug: $stdinfile already exists; not copying it\n" if ($debug);
-	}
-	if (! -e $stdinfile){
-	    prog_error_exit ("stdin defined as '$stdinfile' but this is not found", 'SCRIPT_MISC');
-	    $stdinfile = "";
-	} else {
-	    $stdinfile = "< $stdinfile";
-	}
-    } else {
-	$stdinfile = "";
-    }
-    return $stdinfile;
-}
-
-# parse config file
-sub parse_config(){
-
-    # if specified config file does not exist, try get_files. If still not there, fail.
-    print "$prog debug: config file is specified as $configfile\n" if ($debug);
-    if (! -r $configfile) {
-	print "$prog debug: $configfile does not exist, so try copying it with get_files\n" if ($debug);
-	systemcall("get_files -data -symlink -remove $configfile",TRUE);
-	if (! -r $configfile){ 
-	    prog_error_exit ("config file $configfile not found. Specify a config file with the option --config <filename>", 'SCRIPT_MISC');
-	}
-    }
-    open CONFIG, "<$configfile" 
-	or prog_error_exit ("failed opening $configfile: $!\n", 'SCRIPT_MISC');
-    print "\n$prog debug: start of config file\n" if ($debug);
-    my $first = TRUE;
-    my $this_test = {};
-    my $current_test_id = '';
-    while (<CONFIG>){
-	chomp;
-	# strip out comments
-	$endofline = index $_, '#';
-	if ($endofline == -1){
-	    $endofline = length;
-	}
-	$line = substr($_, 0, $endofline);
-	# strip leading white space
-	$line =~ s/^\s+//;
-	# skip empty lines and lines with only spaces
-	next if (length $line == 0);
-	next if (/^\s+$/);
-	#print "$prog debug: config $. >$line<\n" if ($debug);
-	# test keyword
-	if ($line =~ /^test/){
-	    if ($line =~ /^test\s+(\w+)/){
-		my $id = $1;
-		print "$prog debug: config id = >$id<\n" if ($debug);
-		if ($current_test_id eq $id or exists $config{$id}){
-		    prog_error_exit ("test id $id is not unique",'SCRIPT_MISC');
-		}
-		# save old test config
-		if (! $first){
-		    $config{$current_test_id} = $this_test;
-		    push @test_order, $current_test_id;
-		}
-		# new test config
-		$first = FALSE;
-		$current_test_id = $id;
-		$this_test = {};
-		# defaults
-		$this_test->{'name'} = "test_$id";
-		$this_test->{'disabled'} = FALSE;
-		$this_test->{'checklog'} = FALSE;
-#		$this_test->{'checklog_opts'} = "--config check_log.conf --showexcludestats";
-		$this_test->{'checklog_opts'} = "--showexcludestats";
-		$this_test->{'datafile'} = UNDEFINED;
-		$this_test->{'datafilelink'} = 'ZEBRA.P';
-		$this_test->{'joboptions'} = UNDEFINED;
-		$this_test->{'pre_condition'} = ();
-		$this_test->{'pre_command'} = ();
-		$this_test->{'post_command'} = ();
-        $this_test->{'post_test'} = ();
-		$this_test->{'athena_env'} = 'export STAGE_SVCCLASS=atlascerngroupdisk;export STAGE_HOST=castoratlast3';
-		$this_test->{'athena_args'} = UNDEFINED;
-		$this_test->{'athena_cmd'} = 'athena.py -b';
-		$this_test->{'exitmask'} = $default_exitmask;
-		$this_test->{'stdinfile'} = '';
-		$this_test->{'regtest'} = ();
-        $this_test->{'filterlog'} = '';
-		$this_test->{'compresslog'} = FALSE;
-		$this_test->{'rootcomp'} = FALSE;
-		$this_test->{'rootcomp_cmd'} = "";
-		$this_test->{'rootcomp_file1'} = "";
-		$this_test->{'rootcomp_file2'} = "";
-        $this_test->{'checkcount'} = FALSE;
-        $this_test->{'checkcount_file'} = "";
-        $this_test->{'checkcount_tolerance'} = 1;
-        $this_test->{'checkcount_level'} = "BOTH";
-        $this_test->{'checkmerge'} = FALSE;
-        $this_test->{'checkmerge_file'} = "";
-        $this_test->{'checkmerge_reffile'} = "";
-        $this_test->{'checkmerge_tolerance'} = 1;
-        $this_test->{'emdcheck'} = ();
-		$this_test->{'doc'} = "";
-		next;
-	    }
-	    else {
-		print "$prog: Error: config line $. incorrect, test definition invalid - ignoring line\n";
-		next;
-	    }
-	}
-	if ($line =~ /^name\s+([^\s]+)/){
-	    $this_test->{'name'} = $1;
-	    print "$prog debug: config test name >$1<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^datafile\s+([^\s]+)\s+([^\s]+)/){
-	    $this_test->{'datafile'} = $1;
-	    $this_test->{'datafilelink'} = $2;
-	    print "$prog debug: config datafile >$1< link >$2<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^datafile\s+([^\s]+)/){
-	    $this_test->{'datafile'} = $1;
-	    print "$prog debug: config datafile >$1<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^joboptions\s+([^\s]+)/){
-	    $this_test->{'joboptions'} = $1;
-	    print "$prog debug: config joboptions >$1<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^pre_condition\s+(.+)$/){
-	    my $pre_condition = $1;
-	    push @{$this_test->{'pre_condition'}}, $pre_condition;
-	    print "$prog debug: config pre_condition >$pre_condition<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^pre_command\s+(.+)$/){
-	    my $pre_command = $1;
-	    push @{$this_test->{'pre_command'}}, $pre_command;
-	    print "$prog debug: config pre_command >$pre_command<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^post_command\s+(.+)$/){
-	    my $post_command = $1;
-	    push @{$this_test->{'post_command'}}, $post_command;
-	    print "$prog debug: config post_command >$post_command<\n" if ($debug);
-	    next;
-	}
-        if ($line =~ /^post_test\s+([^\s]+)\s+(.+)$/){
-	    my $post_test = {'name' => $1, 'cmd' => $2};
-	    push @{$this_test->{'post_test'}}, $post_test;            
-	    print "$prog debug: config post_test >$1< >$2<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^athena_args\s+(.+)$/){
-	    $this_test->{'athena_args'} = $1;
-	    print "$prog debug: config athena_args >$1<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^athena_env\s+(.+)$/){
-	    $this_test->{'athena_env'} = $1;
-	    print "$prog debug: config athena_env >$1<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^athena_cmd\s+(.+)$/){
-	    $this_test->{'athena_cmd'} = $1;
-	    print "$prog debug: config athena_cmd >$1<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^extra_failure_codes\s+(.+)$/){
-	    $this_test->{'exitmask'} = $default_exitmask;	    
-	    my @codes = split('\s',$1);
-	    for (@codes) {
-		if (exists $ERROR{$_}) {
-		    $this_test->{'exitmask'} |= $ERROR{$_};
-		}
-		else {
-		    my @tmp = keys %ERROR;
-		    prog_error_exit ("Exit code '$_' unknown. Allowed values are: @tmp",'SCRIPT_MISC');
-		}
-	    }	    	    
-	    print "$prog debug: config extra_failure_codes >$1<\n" if ($debug);
-	    next;
-	}	
-	if ($line =~ /^stdinfile\s+(.+)$/){
-	    $this_test->{'stdinfile'} = $1;
-	    print "$prog debug: config stdinfile >$1<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^disable/){
-	    $this_test->{'disabled'} = TRUE;
-	    print "$prog debug: config disabled >" . ( $_ ? "true" : "false") . "<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^checklog\s+(.+)$/){
-	    $this_test->{'checklog'} = TRUE;
-	    $this_test->{'checklog_opts'} = $1;
-	    print "$prog debug: config checklog >" . ( $_ ? "true" : "false") . "<\n" if ($debug);
-	    print "$prog debug: config checklog_opts >$1<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^checklog\s*$/){
-	    $this_test->{'checklog'} = TRUE;
-	    print "$prog debug: config checklog >" . ( $_ ? "true" : "false") . "<\n" if ($debug);
-	    next;
-	}
-        if ($line =~ /^filterlog\s+(.+)$/){
-	    $this_test->{'filterlog'} = $1;
-	    print "$prog debug: config filterlog >$1<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^compresslog/){
-	    $this_test->{'compresslog'} = TRUE;
-	    print "$prog debug: config compresslog >" . ( $_ ? "true" : "false") . "<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^regtest\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)/){
-	    my $regtest = { 'algoname' => $1, 'match' => $2, 'reffile' => $3};
-	    push @{$this_test->{'regtest'}}, $regtest;
-	    print "$prog debug: config regtest >$1< >$2< >$3<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^edmcheck\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)/){
-	    my $edmcheck = { 'algoname' => $1, 'edmfile' => $2, 'edmreffile' => $3};
-	    push @{$this_test->{'edmcheck'}}, $edmcheck;
-	    print "$prog debug: config edmcheck >$1< >$2< >$3<\n" if ($debug);
-	    next;
-	}
-	if ($line =~ /^fullregtest\s+([^\s]+)\s+([^\s]+)/){
-	    my $regtest = { 'algoname' => $fullregtest, 'match' => $1, 'reffile' => $2};
-	    push @{$this_test->{'regtest'}}, $regtest;
-	    print "$prog debug: config fullregtest >$1< >$2<\n" if ($debug);
-	    next;
-	}
-        if ($line =~ /^customregtest\s+(.+)$/){
-            my $regtest = { 'algoname' => $customregtest, 'match' => $1, 'reffile' => ''};
-	    push @{$this_test->{'regtest'}}, $regtest;
-	    print "$prog debug: config customregtest >$1<\n" if ($debug);
-	    next;
-	}
-	#check merge
-	if ($line =~ /^checkmerge\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)/){
-	    $this_test->{'checkmerge'} = TRUE;
-	    $this_test->{'checkmerge_file'} = $1;
-            $this_test->{'checkmerge_reffile'}= $2;
-            $this_test->{'checkmerge_tolerance'}= $3;
-	    print "$prog debug: config checkmerge >" . ( $_ ? "true" : "false") . "<\n" if ($debug);
-	    print "$prog debug: config checkmerge_file >$1<\n" if ($debug);
-	    print "$prog debug: config checkmerge_reffile >$2<\n" if ($debug);
-	    print "$prog debug: config checkmerge_tolerance >$3<\n" if ($debug);
-	    next;
-	}
-        #  check for 3rd argument (L2, EF or BOTH)
-	if ($line =~ /^checkcount\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)/){
-	    $this_test->{'checkcount'} = TRUE;
-	    $this_test->{'checkcount_file'} = $1;
-            $this_test->{'checkcount_tolerance'}=$2;
-            $this_test->{'checkcount_level'}=$3;
-	    print "$prog debug: config checkcount >" . ( $_ ? "true" : "false") . "<\n" if ($debug);
-	    print "$prog debug: config checkcount_file >$1<\n" if ($debug);
-	    print "$prog debug: config checkcount_tolerance >$2<\n" if ($debug);
-	    print "$prog debug: config checkcount_level >$3<\n" if ($debug);
-	    next;
-	}
-        # only 2 arguments, assume BOTH
-	if ($line =~ /^checkcount\s+([^\s]+)\s+([^\s]+)/){
-	    $this_test->{'checkcount'} = TRUE;
-	    $this_test->{'checkcount_file'} = $1;
-            $this_test->{'checkcount_tolerance'}=$2;
-	    print "$prog debug: config checkcount >" . ( $_ ? "true" : "false") . "<\n" if ($debug);
-	    print "$prog debug: config checkcount_file >$1<\n" if ($debug);
-	    print "$prog debug: config checkcount_tolerance >$2<\n" if ($debug);
-	    next;
-	}
-        # optional 2nd argument
-	if ($line =~ /^rootcomp\s+([^\s]+)\s*([^\s]*)$/){
-	    $this_test->{'rootcomp'} = TRUE;
-	    $this_test->{'rootcomp_cmd'} = $rootcomp_cmd;
-            if ($2 eq "") {
-              $this_test->{'rootcomp_file1'} = "expert-monitoring.root";
-              $this_test->{'rootcomp_file2'} = $1;
-            }
-            else {
-              $this_test->{'rootcomp_file1'} = $1;
-              $this_test->{'rootcomp_file2'} = $2;
-            }
-	    print "$prog debug: config rootcomp >" . ( $_ ? "true" : "false") . "<\n" if ($debug);
-	    print "$prog debug: config rootcomp_file1 >$this_test->{'rootcomp_file1'}<\n" if ($debug);            
-	    print "$prog debug: config rootcomp_file2 >$this_test->{'rootcomp_file2'}<\n" if ($debug);
-	    next;
-	}
-    # old style                                                                                                                                                                
-    if ($line =~ /^customrootcomp\s+([^\s]+)\s+([^\s]+)$/){
-        $this_test->{'rootcomp'} = TRUE;
-        $this_test->{'rootcomp_cmd'} = $1;
-        $this_test->{'rootcomp_file2'} = $2;
-        print "$prog debug: config custom rootcomp >" . ( $_ ? "true" : "false") . "<\n" if ($debug);
-        print "$prog debug: config custom rootcomp_cmd >$1<\n" if ($debug);
-        print "$prog debug: config custom rootcomp_file2 >$2<\n" if ($debug);
-        next;
-    }
-    # optional 3rd argument                                                                                                                                                    
-    if ($line =~ /^customrootcomp\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)$/){
-        $this_test->{'rootcomp'} = TRUE;
-        $this_test->{'rootcomp_cmd'} = $1;
-        $this_test->{'rootcomp_file1'} = $2;
-        $this_test->{'rootcomp_file2'} = $3;
-        print "$prog debug: config custom rootcomp >" . ( $_ ? "true" : "false") . "<\n" if ($debug);
-        print "$prog debug: config custom rootcomp_cmd >$1<\n" if ($debug);
-        print "$prog debug: config custom rootcomp_file1 >$2<\n" if ($debug);
-        print "$prog debug: config custom rootcomp_file2 >$3<\n" if ($debug);
-        next;
-    }
-	if ($line =~ /^doc\s+(.+)$/){
-	    $this_test->{'doc'} = $1;
-	    print "$prog debug: config doc >$1<\n" if ($debug);
-	    next;
-	}
-	else {
-	    print "$prog: Warning: config line $. not recognised, ignoring it: $line\n";
-	    next;
-	}
-    }
-    close CONFIG;
-    print "$prog debug: end of config file\n\n" if ($debug);
-    # save last test config
-    if (! $first){
-	$config{$current_test_id} = $this_test;
-	push @test_order, $current_test_id;
-    }
-
-}
-
-# display details of the configured tests
-sub print_config(){
-    print "=== Test Configuration\n";
-    foreach (keys %config){
-	print "test: $_\n";
-	print "  name '" . $config{$_}->{'name'} . "' \n";
-	print "  doc '" . $config{$_}->{'doc'} . "'\n";
-	print "  disabled '" . ( $config{$_}->{'disabled'} ? "true" : "false") . "'\n";
-	print "  checklog '" . ( $config{$_}->{'checklog'} ? "true" : "false") . "'\n";
-	print "  checklog_opts '" . $config{$_}->{'checklog_opts'} . "'\n";
-        print "  filterlog '" . $config{$_}->{'filterlog'} . "'\n";
-	print "  compresslog '" . ( $config{$_}->{'compresslog'} ? "true" : "false") . "'\n";
-	print "  rootcomp '" . ( $config{$_}->{'rootcomp'} ? "true" : "false") . "'\n";
-	print "  rootcomp_cmd '" . $config{$_}->{'rootcomp_cmd'} . "'\n";
-	print "  rootcomp_file1 '" . $config{$_}->{'rootcomp_file1'} . "'\n";        
-	print "  rootcomp_file2 '" . $config{$_}->{'rootcomp_file2'} . "'\n";
-	print "  checkcount '" . ( $config{$_}->{'checkcount'} ? "true" : "false") . "'\n";
-	print "  checkcount_file '" . $config{$_}->{'checkcount_file'} . "'\n";
-	print "  checkcount_tolerance '" . $config{$_}->{'checkcount_tolerance'} . "'\n";
-	print "  checkcount_level '" . $config{$_}->{'checkcount_level'} . "'\n";
-	print "  checkmerge '" . ( $config{$_}->{'checkcount'} ? "true" : "false") . "'\n";
-	print "  checkmerge_file '" . $config{$_}->{'checkcount_file'} . "'\n";
-	print "  checkmerge_tolerance '" . $config{$_}->{'checkcount_tolerance'} . "'\n";
-	print "  checkmerge_reffile '" . $config{$_}->{'checkcount_file'} . "'\n";
-	print "  datafile '" . $config{$_}->{'datafile'} . "'\n";
-	print "  datafilelink '" . $config{$_}->{'datafilelink'} . "'\n";
-	print "  joboptions '" . $config{$_}->{'joboptions'} . "'\n";
-	for (@{$config{$_}->{'pre_condition'}}){
-	    print "  pre_condition $_'\n";
-	}
-	for (@{$config{$_}->{'pre_command'}}){
-	    print "  pre_command $_'\n";
-	}
-	for (@{$config{$_}->{'post_command'}}){
-	    print "  post_command $_'\n";
-	}
-	for (@{$config{$_}->{'post_test'}}){
-	    print "  post_test $_'\n";
-	}        
-        print "  athena_env'"  . $config{$_}->{'athena_env'} . "'\n";
-	print "  athena_cmd '" . $config{$_}->{'athena_cmd'} . "'\n";
-	print "  athena_args '" . $config{$_}->{'athena_args'} . "'\n";
-	printf "  exitmask %#.8b \n", $config{$_}->{'exitmask'};
-	print "  stdinfile '" . $config{$_}->{'stdinfile'} . "'\n";
-	if ($#{$config{$_}->{'regtest'}} == -1){
-	    print "  (no regtests defined)\n";
-	}
-	for (@{$config{$_}->{'regtest'}}){
-	    print "  regtest: algorithm name '" . $_->{'algoname'} . "'\n";
-	    print "           match message pattern '" . $_->{'match'} . "'\n";
-	    print "           reference file '" . $_->{'reffile'} . "'\n";
-	}
-	if ($#{$config{$_}->{'edmcheck'}} == -1){
-	    print "  (no edmtests defined)\n";
-	}
-	for (@{$config{$_}->{'edmcheck'}}){
-	    print "  edmcheck: algorithm name  '" . $_->{'algoname'} . "'\n";
-	    print "           edmfile          '" . $_->{'edmfile'} . "'\n";
-	    print "           reference file   '" . $_->{'edmreffile'} . "'\n";
-	}
-    }
-}
-
-# check that tests specified on command line exist
-# replace names by ids
-sub check_tests(){
-
-    # build map of tests by name
-    my $test_id_byname = {};
-    foreach (keys %config){
-	my $name = $config{$_}->{'name'};
-	if (exists $test_id_byname{$name}){
-	    print "$prog: error: test name $name is not unique\n";
-	} else {
-	    $test_id_byname{$name} = $_;
-	}
-    }   
-    
-    # check that tests specified on command line exist
-    # replace names by ids
-    for ( my $i=0; $i<=$#tests; $i++ ){
-	if ( exists $config{$tests[$i]} ){
-	    next;
-	} elsif ( exists $test_id_byname{$tests[$i]} ) {
-	    $tests[$i] = $test_id_byname{$tests[$i]};
-	    next;
-	} else {
-	    prog_error_exit ("test name/id $tests[$i] is not defined in the config file", 'SCRIPT_MISC');
-	}
-    }
-
-    # if no tests are specified, do them all in the order they were read in.
-    if ($#tests == -1){
-	@tests = @test_order;
-    }
-}
-
-
-# loop over tests, skip those that are disabled
-sub do_tests(){
-    my $first = TRUE;
-    for (@tests){
-	my $id = $_;	
-	@statuscodes = ( 'OK' ); # reset for status code of latest test
-	$exitmask = $config{$id}->{'exitmask'};	# exitmask of latest test
-	#print "-------------------------------------------------------\n";
-	print "=== Test $id: " . $config{$id}->{'name'};
-	if ($config{$id}->{'disabled'}) {
-	    print " is disabled\n";
-	} else {
-	    print "\n";
-	    if ($first){
-		first_test_prep();
-		$first = FALSE;
-	    }
- 	    run_test($id);
-	    if ($#statuscodes>0){
-		$failures++;
-	    }
-	    $statuscode = process_error_codes(@statuscodes);
-	    $testresults{$id}=$statuscode;	    
-	}
-	print "--------------------------------------------------------------------------------\n";
-    }
-}
-
-# Timer subroutine
-# given an initial time t0 in seconds since the epoch (i.e. as given by perl time function), calculates and prints the total elapsed (aka wallclock) time, user time and system time. Do not expect these to add up, e.g. if the system is busy with other users or you have to wait for castor.
-# NB if called multiple times, the last call will overwrite previous output files.
-sub timer($){
-    my ($t0) = @_;
-    my $t1=time();
-    my ($tuser,$tsystem,$tcuser,$tcsystem) = times;
-    printf( "=== Timer: total elapsed %d s, total user %6.2f s, total system %6.2f s\n", 
-	    $t1-$t0, $tuser+$tcuser, $tsystem+$tcsystem);
-    open TIMER, ">$timerout";
-    printf TIMER "%d %f %f\n",$t1-$t0, $tuser+$tcuser, $tsystem+$tcsystem;
-    close TIMER;
-    
-}
-
-sub results_summary(){
-    return if (!$showsummary);
-    print "=== Test results summary\n";
-    printf "  %3s %-20s %-10s\n", "Id", "Test Name", "Result";
-    for (@tests){
-	my $id = $_;
-	printf "  %3s %-20s ", $id, $config{$id}->{'name'};
-	if ($config{$id}->{'disabled'}){
-	    print "(disabled)\n";
-	    next;
-	}
-	if ($testresults{$id} == 0){
-	    print "passed";
-	} else {
-	    print "failed ($testresults{$id})";
-	}
-	print "\n";
-    }
-}
-
-# preparations before first test is run
-sub first_test_prep {
-
-    # create run dir if it doesn't already exist
-    if ( $clear_dir ) {
-        system "rm -fr $run_dir";
-    }
-    if ( ! -d $run_dir ){
-	mkpath $run_dir 
-	    #or die "$prog: error: failed mkpath $run_dir: $!\n";
-    }
-    chdir $run_dir or prog_error_exit( "failed chdir $run_dir: $!\n", 'SCRIPT_MISC');
-
-    # get log file from env
-    my $ajl = $ENV{'ATN_JOB_LOGFILE'};
-    if (defined($ajl)){
-	system "echo $ajl > atn_job_logfile_name";
-    }
-
-    # run script to get relevant file
-    my $id = $_;
-    my $jobopts = $config{$id}->{'joboptions'};
-    print "$prog debug: job options:$jobopts\n" if ($debug);
-}
-
-# run a test
-sub run_test($){
-    my ($id) = @_;
-    my $name = $config{$id}->{'name'};
-
-    # prepare file names
-    my $jobopts = $config{$id}->{'joboptions'};
-    my $logfile = "atn_test.log";
-    my $logfiletail = "atn_tail.log";
-    my $local_jobopts = "";
-    print "$prog debug: job options:$jobopts\n" if ($debug);
-    systemcall("echo \"$config{$id}->{'doc'}\" > $docout");
-    if ( $jobopts  ne 'None' and $jobopts ne UNDEFINED ){
-        my @suffixlist = ( '.py', '.txt' );
-        my ($filename,$path,$suffix) = fileparse($jobopts,@suffixlist);
-        $local_jobopts = $filename . "_test" . $suffix;
-        $logfile = "$filename" . "_test.log";
-        $logfiletail = "$filename" . "_tail.log";
-        print "$prog debug: $jobopts  $local_jobopts $logfile\n" if ($debug);
-    
-    # get copy of joboptions file to customise for this job, 
-    # if it's not already there
-    # allow for the case of no jobotions (AthanMT)
-        if (! -e "$filename$suffix" ){
-	    print "$prog debug: $filename$suffix does not exist, so copying it with get_files\n" if ($debug);
-	    systemcall("get_files -jo $jobopts");
-        }
-        if (-e "$filename$suffix"){ # check: will not be there in verify mode
-	    copy "$filename$suffix", "$local_jobopts"
-	        or prog_error_exit( "failed copying $filename$suffix to $local_jobopts: $!\n", 'SCRIPT_MISC');
-        }
-        # check permissions on local joboptions file before trying to append to it
-        if (! -w $local_jobopts){
-	    chmod 0644, $local_jobopts
-	         or prog_error_exit( "failed to set write permission for $local_jobopts: $!\n", 'SCRIPT_MISC');
-        }
-     
-
-        # append joboptions to set algorithm output level to 2, 
-        # for algorithms to be regression tested.
-        open JOBOPTS, ">> $local_jobopts" 
-	    or prog_error_exit ("failed opening $local_jobopts: $!\n", 'SCRIPT_MISC');
-        print JOBOPTS "\n";
-#    for (@{$config{$id}->{'regtest'}}){
-#	my $algoname = $_->{'algoname'};
-	# require some alphanumeric chars for a valid algoname
-#	if ($algoname =~ /\w/){
-#	    print "$prog debug: appending to joboptions file: $algoname.Outputlevel = 2\n"  if ($debug);
-#	    print JOBOPTS "Algorithm(\"$algoname\").Outputlevel = DEBUG\n";
-#	print JOBOPTS "MessageSvc.debugLimit = 2000\n";
-#	    print JOBOPTS "MessageSvc.defaultLimit = 2000\n";
-#	} else {
-#	    print "$prog warning: not setting output level for algorithm \"$algoname\" since it doesn't look like a valid name (no alphanumeric chars)\n";
-#	}
-#    }
-        close JOBOPTS;
-    }
-    # run any pre-condition - they must all succeeed or else the job won't run
-    my $pre_condition; 
-    my $precondrc=TRUE;
-    for $pre_condition (@{$config{$id}->{'pre_condition'}}){
-	my $precondrc1=systemcall("$pre_condition");
-	print "$prog debug: pre_condition \"$pre_condition\" returned $precondrc1\n" if ($debug);
-	if ($precondrc1!=0){
-	    print "$prog info: pre_condition \"$pre_condition\" failed (exit code $precondrc1)\n";
-	    $precondrc=FALSE;
-	}
-    }
-    if ($precondrc){
-	print "$prog debug: pre-conditions met\n" if ($debug);
-    } else {
-	print "$prog info: pre-conditions failed so test cannot be run. This is not a test failure.\n";
-	push @statuscodes, 'PRECONDITION_FAILED_SO_NOT_RUN';
-	return;
-    }
-
-    # run any pre-command
-    my $pre_command; 
-    for $pre_command (@{$config{$id}->{'pre_command'}}){
-	systemcall("$pre_command");
-    }
-
-    # link data file if specified
-    my $datafile = $config{$id}->{'datafile'};
-    my $datafilelink = $config{$id}->{'datafilelink'};
-    if ($datafile ne UNDEFINED){
-	# expand environment variables in datafile
-	while ($datafile =~ /\$\{(.+)\}/){ 
-	    my $var = $1;
-	    if (exists $ENV{$var}){ 
-		my $sub=$ENV{$var};
-		$datafile =~ s/\$\{$var\}/$sub/;
-		print "$prog debug: expanding env var '$var' in datafile yields: $datafile\n" if ($debug);
-	    } else {
-		print "$prog: Warning: env var '$var' used in datafile definition is undefined, replacing with blank\n";
-		$datafile =~ s/\$\{$1\}//;
-	    }
-	}
-
-	print "$prog debug: linking data file to $datafilelink: $datafile\n"  
-	    if ($debug);
-	if (-e $datafilelink or -l $datafilelink){
-	    print "$prog debug: first removing $datafilelink\n" if ($debug);
-	    unlink $datafilelink
-		or die "$prog: error: failed to delete $datafilelink: $!\n";
-	}
-	symlink $datafile, $datafilelink
-	    or die "$prog: error: failed to symlink $datafilelink: $!\n";
-    }
-
-    # run athena
-    my $athena_env = $config{$id}->{'athena_env'};
-    my $athena_cmd = $config{$id}->{'athena_cmd'};
-    my $athena_args = $config{$id}->{'athena_args'};
-    my $filter_cmd = $config{$id}->{'filterlog'};
-    $filter_cmd = " 2>&1 | " . $filter_cmd if (length($filter_cmd)>0);
-    $athena_args = "" if ($athena_args eq UNDEFINED);
-    my $stdinfile = getStdinFile($config{$id}->{'stdinfile'});
-    print "=== Athena env '$athena_env' \n";
-    print "=== Running '$athena_cmd $athena_args $local_jobopts $stdinfile $filter_cmd'\n";
-    # the stderr redirection needs to be exactly at this place
-    my $athenarc = systemcall("$athena_env ; $athena_cmd $athena_args $local_jobopts $stdinfile $filter_cmd > $logfile 2>&1");
-
-    # the way to recognise a timeout
-    $timeout = FALSE;
-    if (! open LOG, "tail -600 $logfile|"){
-	print "$prog: error: failed opening $logfile to read: $!\n";
-	print "-> $failkey Aborting this test\n";
-	# will happen later: return; # go on to next test
-    }
-    while (<LOG>){
-	if (/CRITICAL stopped by user interrupt/ or
-        /ERROR Keyboard interruption caught/ or
-	    /^Signal handler: Killing [0-9]+ with 15/){
-	    $timeout = TRUE;
-	    last;
-	}
-
-    }
-    close LOG;
-
-    print "$prog: debug: timeout=$timeout " . ($timeout?"true":"false") . " athenarc=$athenarc \n" if ($debug);
-
-    # check athena return code
-    #print "-------------------------------------------------------\n";
-    if ($athenarc == 0 and not $timeout){
-	print "=== $name OK: Athena exited normally\n";
-        print "art-result: 0 athena.$name\n";
-    } elsif ($timeout){
-    # or $athenarc == 35584 -> sometimes this exit code is just a seg fault
-	print "=== $name $warnkey: Athena exceeded time limit and was killed\n";
-        print "art-result: 1 athena.$name\n";
-	push @statuscodes, 'ATN_TIME_LIMIT';
-    } else {
-	print "=== $name $failkey : Athena exited abnormally! Exit code: $athenarc\n";
-        print "art-result: 2 athena.$name\n";
-	push @statuscodes, 'ATHENA_BAD_EXIT';
-    }
-
-	
-    # run any post-commands
-    unlink "$postcmdout" if (-f "$postcmdout");
-#    if 
-    if (defined $config{$id}->{'post_command'} 
-	and   @{$config{$id}->{'post_command'}}>0) {
-      my $post_command;
-      @postrc=();
-
-      for $post_command (@{$config{$id}->{'post_command'}}){
-        # All post command share the same log file
-	push @postrc, systemcall("($post_command) >> $postcmdout 2>&1");
-      }
-      systemcall("cat $postcmdout");
-      print "$prog debug: post_command #commands: ".@postrc."  return codes: @postrc \n" if ($debug);
-    }
-
-    my %reldata = release_metadata();
-    my $nightly = (exists $reldata{'nightly name'} ? $reldata{'nightly name'} : "UNKNOWN");
-    # modification for ART (ATR-17618)
-    # $nightly = $nightly . "/latest";
-    print "$prog: looking for histograms and references for nightly $nightly \n";
-
-    # run any post-tests    
-    unlink "$posttestrc" if (-f "$posttestrc");
-    if ( defined(@{$config{$id}->{'post_test'}}) ) {
-      my $post_test;
-      my $total_rc = 0;
-      @postrc=();
-      open (POSTTEST, '>', $posttestrc);
-      for $post_test (@{$config{$id}->{'post_test'}}){
-        # Each post test has its own log file
-        my $post_test_log = "post_test_$post_test->{'name'}.log";
-        # Replace '$logfile' with the actual file name
-        my $post_test_cmd = $post_test->{'cmd'};
-        $post_test_cmd =~ s/\$logfile/$logfile/;
-	# If there is a comparison to a reference file, make sure that the correct path is used
-        $post_test_cmd =~ s/latest/$nightly/g;
-        my $rc = systemcall("($post_test_cmd) > $post_test_log 2>&1");
-        $total_rc += $rc;
-        # Save return codes in separate text file
-        print POSTTEST "$post_test->{'name'} $rc\n";
-      }
-      close POSTTEST;
-      if ($total_rc>0) {
-        push @statuscodes, 'POST_TEST_BAD_EXIT';
-      }
-    }
-
-    my $pwd = `pwd`;
-    chomp $pwd;
-    # make a URL by substituting the lxbuild local disk path for the web 
-    # server URL if it does not match the lxbuild local disk path then it 
-    # will be left as a file path instead. 
-    # NB gives wrong address for incremental nightlies because the build is always done in atlrel_0 then copied to altrel_1-5 as appropriate
-    my $logfileURL = $logfile;
-    $logfileURL =~ s%/pool/build/atnight/localbuilds/nightlies%http://atlas-computing.web.cern.ch/atlas-computing/links/buildDirectory/nightlies%;
-    print "=== Log file: " . $pwd . "/$logfileURL\nNB replace rel_0 with actual nightly in this URL.\n";
-    if (! -e $logfile or -z $logfile){
-	print "=== Error: log file does not exist or is empty, skipping the rest of this test\n";
-	return;
-    }
-    # get data file LFN/PFN from log file + pool file catalogue
-    if (! open LOG, "<$logfile"){
-	print "$prog: error: failed opening $logfile to read: $!\n";
-	print "-> $warnkey Aborting this test\n";
-	return; # go on to next test
-    }
-    my $dataLFN="unknown";
-    my $dataPFN="";
-    my $eventCounter=0;
-    while (my $line = <LOG>){
-      if ($line =~ /InputCollections\s+\= \['(.*)'\]/){  # athena
-	$dataLFN=$1;
-      }
-      elsif ($line =~ /event stream from file list\s+\['(.*)'\]/){  # athenaHLT
-	$dataLFN=$1;
-      }
-      # count events for athena job
-      ++$eventCounter if ($line =~ /AthenaEventLoopMgr\s+INFO\s+===>>>  done processing event/);
-      # handle athenaHLT case
-      if ($line =~ /Py:athenaHLT\s+INFO\s+Processed ([0-9]+) events/){
-        $eventCounter=$1;
-      }
-    }
-    close LOG;
-
-    print "$prog debug: dataLFN=$dataLFN\n" if ($debug);
-    if ($dataLFN ne "unknown"){
-	my $dataLFNstripped = $dataLFN;
-	$dataLFNstripped =~ s/^LFN\://;
-	my $cmdout1 = qx(FClistPFN -u xmlcatalog_file:PoolFileCatalog.xml -l $dataLFNstripped);
-	chomp $cmdout1;
-	if (length($cmdout1)>0){
-	    $dataPFN = $cmdout1;
-	}
-	print "$prog debug: dataLFNstripped=$dataLFNstripped dataPFN=$dataPFN\n" if ($debug);
-	print "$prog debug: cmdout1=$cmdout1\n" if ($debug);
-    }
-    print "=== Data file: $dataLFN   $dataPFN\n";
-
-    # write how many events processed
-    print "=== Events processed: $eventCounter\n";
-
-    # check log file for likely errors and known false positives
-    if ($config{$id}->{'checklog'}){
-      my $checklog_opts =  $config{$id}->{'checklog_opts'};
-      # ERRORs
-      my $logrc = systemcall("check_log.pl $checklog_opts $logfile > $checklogout 2>&1");
-      systemcall("cat $checklogout");
-      if ($logrc != 0){
-	print "=== $name $failkey : problem detected in log file\n";
-        print "art-result: 1 $name.CheckLog\n";
-	push @statuscodes, 'ATHENA_ERROR_IN_LOG';
-      } else {
-        print "art-result: 0 $name.CheckLog\n";
-      }
-      # WARNINGs
-      $rc = systemcall("check_log.pl $checklog_opts --noerrors --warnings $logfile > $warnout 2>&1");
-      # Ignore rc.
-    }
-
-    #make short file with last 600 lines only
-    systemcall("tail -600 $logfile > $logfiletail");
- 
-
-    # rootcomp
-    if ($config{$id}->{'rootcomp'}){
-      	my $rootcomp_file1 =  $config{$id}->{'rootcomp_file1'};
-        my $rootcomp_file2 =  $config{$id}->{'rootcomp_file2'};
-        if( $nightly ne "" ) {
-           # allow for custom tests with two files
-           $rootcomp_file2  =~ s/latest/$nightly/g ;
-	}
-        $rootcomp_file1 = resolveSymlinks($rootcomp_file1);
-        $rootcomp_file2 = resolveSymlinks($rootcomp_file2);
-    
-    if (-e $rootcomp_file1) {
-        if (-e $rootcomp_file2) {
-	my $rc=systemcall("$config{$id}->{'rootcomp_cmd'} $rootcomp_file1 $rootcomp_file2 > $rootcompout 2>&1", TRUE);
- 	if ($rc != 0){
-	    print "=== $name WARNING: monitoring histogram mismatch detected by rootcomp\n";
-            print "art-result: 1 $name.RootComp\n";
-	    push @statuscodes, 'ROOTCOMP_MISMATCH';
-	} else {
-	    print "=== $name: rootcomp: monitoring histograms match. \n";
-            print "art-result: 0 $name.RootComp\n";
-	}
-        }
-        else {
-            print "=== Alert: $rootcomp_file2 does not exist \n";
-            print "art-result: 2 $name.RootComp\n";
-        }
-    }
-        else {
-            print "=== Alert: $rootcomp_file1 does not exist \n";
-            print "art-result: 2 $name.RootComp\n";
-        }
-	#systemcall("cat $rootcompout");
-        if (-e $rootcompout) {
-	systemcall("grep -A 5 '^Summary' $rootcompout");
-        }
-      }
-
-    # checkcount
-    if ($config{$id}->{'checkcount'}){
-	my $checkcount_file =  $config{$id}->{'checkcount_file'};
-        my $checkcount_tolerance = $config{$id}->{'checkcount_tolerance'};
-        my $checkcount_level = $config{$id}->{'checkcount_level'};
-        if( $nightly ne "" ) {
-           $checkcount_file  =~ s/latest/$nightly/ ;
-	}
-        $checkcount_file = resolveSymlinks($checkcount_file);
-	print "$prog: checking trigger and TE counts \n";
-        print "=== Running $checkcount_cmd $checkcount_tolerance $checkcount_file $checkcount_level > $checkcountout 2>&1 \n";
-	my $rc=systemcall("$checkcount_cmd $checkcount_tolerance $checkcount_file $checkcount_level > $checkcountout 2>&1", TRUE);
- 	if ($rc != 0){
-	    print "=== $name WARNING: trigger count mismatch detected by checkcount\nSee $checkcountout for details.\n";
-            print "art-result: 1 $name.CheckCounts\n";
-	    push @statuscodes, 'CHECKCOUNTS_FAILED';
-	} else {
-	    print "=== $name: countcheck: trigger counts match. \n";
-            print "art-result: 0 $name.CheckCounts\n";
-	}
-	#systemcall("cat $rootcompout");
-        #Grep for FAILURE here so that bad runs will be flagged as such  
-	systemcall("grep 'FAILURE' $checkcountout");
-	systemcall("grep 'test warning' $checkcountout");
-	systemcall("grep 'tolerance' $checkcountout");
-    }
-
- # checkmerge
-    if ($config{$id}->{'checkmerge'}){
-	my $checkmerge_file =  $config{$id}->{'checkmerge_file'};
-        my $checkmerge_tolerance = $config{$id}->{'checkmerge_tolerance'};
-        my $checkmerge_reffile = $config{$id}->{'checkmerge_reffile'};
-        if( $nightly ne "" ) {
-           $checkmerge_file  =~ s/latest/$nightly/ ;
-	}
-        $checkmerge_file = resolveSymlinks($checkmerge_file);
-	print "$prog: checking trigger histograms for merged system \n";
-        print "=== Running $checkmerge_cmd $checkmerge_file $checkmerge_reffile $checkmerge_tolerance > $checkmergeout 2>&1 \n";
-	my $rc=systemcall("$checkmerge_cmd $checkmerge_file $checkmerge_reffile $checkmerge_tolerance > $checkmergeout 2>&1", TRUE);
-
- 	if ($rc != 0){
-	    print "=== $name WARNING: Errors detected by checkmerge\nSee $checkmergeout for details.\n";
-            print "art-result: 1 $name.CheckMerge\n";  
-	    push @statuscodes, 'POST_TEST_BAD_EXIT';
-	} else {
-	    print "=== $name: mergecheck: the test passed successfully. \n";
-            print "art-result: 0 $name.CheckMerge\n";
-	}
-	systemcall("grep 'ERROR' $checkmergeout");
-	systemcall("grep 'WARNING' $checkmergeout");
-    }
-    
-   # EDM tests
-    my $emdcheckresult=TRUE;
-  EDMCHECK:
-    for (@{$config{$id}->{'edmcheck'}}){
-        # truncate algorithm name for 30 characters
-	my $algoname = $_->{'algoname'};
-	my $truncalgoname = substr($algoname, 0, 30);
-	my $edmfile = $_->{'edmfile'};
-	my $edmreffile = $_->{'edmreffile'};
-	# if file exist for this sepecfic nightly use it, otherwise
-	# use default
-        if( $nightly ne "" ) {
-	  $newedmreffile =  $edmreffile;
-	  # substitute  e.g. devval/latest for latest
-	  $newedmreffile =~ s/latest/$nightly/ ;
-	  # check if the reference file for this nightly exists
-	  if ( -e $edmreffile ) {
-	      $edmreffile = $newedmreffile;
-	      print "New reference file name $edmreffile \n";
-	  }
-	}
-        $edmreffile = resolveSymlinks($edmreffile);
-	my $rc=systemcall("$truncalgoname -f $edmfile -r $edmreffile >>$edmcheckout 2>&1", TRUE);
-        if ($rc != 0){
-	    print "=== $name WARNING: trigger edmcheck mismatch detected by $truncalgoname\nSee $edmcheckout for details.\n";
-            print "=== $name if differences are understood cp $edmfile  $edmreffile \n";
-            print "art-result: 1 $name.EdmCheck\n"; 
-	} else {
-	    print "=== $name: edmcheck: files matched \n";
-            print "art-result: 0 $name.EdmCheck\n";  
-	}
-    }
-
-    # regression tests
-    my $regtestresult=TRUE;
-  REGTEST:
-    for (@{$config{$id}->{'regtest'}}){
-        # truncate algorithm name for 15 characters
-	my $algoname = $_->{'algoname'};
-	my $truncalgoname = substr($algoname, 0, 30);
-	my $match = $_->{'match'};
-	my $reffile = $_->{'reffile'};
-	my $newfile = $reffile . ".new";
-        # reference file caser
-        if( substr($newfile, 0, 5) eq "/tmp/" ){ 
-	  # ref file is in /tmp, eg. from another tst (due to tmp filling up, avoid this)
-	  $newfile = substr($newfile, 5);
-	} elsif ( substr($newfile,0,3) eq "../"){
-	  # reference is to another test -- other test must be first in test/xxx_TestConfigruation.xml
-	  my $lslash = rindex $newfile, '/';
-          $newfile = substr($newfile, $lslash+1 );
-          # in this case ref-file for an existing test will end in .new
-          $reffile = $reffile . ".new";
-	}  elsif      ( substr($newfile, 0, 7) eq "/cvmfs/" ){
-          # should be usual case: ref file is in cvmfs for ART (was /afs/ for ATN)  
-          my $lslash = rindex $newfile, '/';
-          $newfile = substr($newfile, $lslash+1 );
-          if( $nightly ne "" ) {
-	    $newreffile =  $reffile;
-	    # substitute  e.g. devval/latest for latest
-	    $newreffile =~ s/latest/$nightly/ ;
-	    # check if the reference file for this nightly exists
-	    if ( -e $newreffile ) {
-	      $reffile = $newreffile;
-	      print "New reference file name $reffile \n";
-	    }
-	  }
-	}
-	print "$prog debug: truncated algoname $truncalgoname\n" if ($debug);
-	# extract regression test lines for this algorithm from log file
-	open NEW, ">$newfile"
-	    or die "$prog: error: failed opening $newfile to write: $!\nart-result: 2 $name.Regtest\n";
-	if (! open LOG, "<$logfile"){
-	    print "$prog: error: failed opening $logfile to read: $!\n";
-	    print "-> $warnkey Aborting this test\nart-result: 2 $name.Regtest\n";
-	    return FALSE; # go on to next test
-	}
-	my $lines=0;
-	if ($algoname eq $fullregtest){
-	    while (<LOG>){
-		if (/$match/){
-		    print NEW;
-		    $lines++;
-		}
-	    }
-	    print "$prog debug: fullregtest $lines lines matched $match in LOG\n" if ($debug);
-        } elsif ($algoname eq $customregtest){
-          $rc = systemcall("$match >> $regtestout", TRUE);
-          $regtestresult = ( $rc==0 ? TRUE : FALSE );
-          next REGTEST;
-        }
-        else {
-	    while (<LOG>){
-		if (/$truncalgoname.*$match/){
-		    print NEW;
-		    $lines++;
-		}
-	    }
-	    print "$prog debug: regtest $lines lines matched $truncalgoname $match in LOG\n" if ($debug);
-	}
-
-	close LOG;
-	close NEW;
-	# check whether any lines matched - if zero it's an error straight away
-	# and no point in doing the diff
-	if ($lines == 0){
-	    # print failure keyword here to flag it as an error
-	    print "=== Alert! $warnkey no lines matching $match were found for $truncalgoname in log file\n";
-            print "art-result: 2 $name.Regtest\n";
-	    $regtestresult = FALSE;
-	    next REGTEST;
-	}
-	# diff the output and the reference
-	# even if verify is off
-	my $rc = 0;
-        $reffile = resolveSymlinks($reffile);
-        print  "old/reference file $reffile\n";
-        print  "new/test      file $newfile\n";
-        print  "< old/reference\n> new/test\n";
-	print substr($reffile, 0, 4);
-# identify location of ref file
-	if( substr($reffile, 0, 4) eq "/tmp" ){
-	  print "=== This test looks for reference in /tmp directory\n";
-	} elsif( substr($reffile, 0, 3) eq "../" ){
-	  print "=== This test looks for reference in another directory\n";
-        } elsif (substr($reffile, 0, 1) eq "/" ){
-	  print "=== This test looks for reference in /cvmfs or /afs or /localhome directory\n";
-  	} else {
-	  print "=== This test looks for reference from svn\n";
-	}
-        if (-e $reffile) {
-            #            print "old/reference file exists!\n";
-	systemcall("echo -e 'total lines in old/reference:' `wc -l $reffile` >>$regtestout",TRUE); 
-	systemcall("echo -e 'total lines in new/test     :' `wc -l $newfile` >>$regtestout",TRUE); 
-	systemcall("echo -e '< old/reference\n> new/test' >> $regtestout", TRUE);
-	$rc = systemcall("diff $reffile $newfile", TRUE);
-	$rc = systemcall("diff $reffile $newfile >> $regtestout", TRUE);
-
-	# Do HTML diff if differences are small enough
-	$difflines = `wc -l $regtestout | cut -d' ' -f1`;
-	if ($difflines < 1000) {
-	    systemcall("htmldiff.py -w 80 $reffile $newfile > $htmldiffout 2>&1", TRUE);
-	}
-	if ($rc == 0){
-	    print "=== Output is the same as reference for $algoname\n";
-            print "art-result: 0 $name.Regtest\n";
-	} else {
-	    # print failure keyword here to flag it as an error
-	    print "=== Alert! $warnkey Output differs from reference for $algoname\n";
-	    print "    If this change is understood, please update the reference file";
-            if(substr($reffile, 0, 6) eq "/cvmfs" ){
-		print "by typing:\n    cp $newfile $reffile\n";
-	    } else {
-		print ".\n";
-	    }
-            print "art-result: 1 $name.Regtest\n";
-	    $regtestresult = FALSE;
-	    next REGTEST;
-	}
-        }
-        else {
-          print "=== Alert! old/reference file: $reffile does not exist - check if this is a new release!\n";  
-          print "art-result: 2 $name.Regtest\n";
-        }
-    }
-    if (!$regtestresult){
-	push @statuscodes, 'ATHENA_REGTEST_FAILED';
-    }
-
-    # compress log file
-    if ($config{$id}->{'compresslog'}){
-	systemcall("gzip -9 $logfile");
-    }
-
-#    print "$prog debug: returning result $result (" 
-#	. ($result ? "true" : "false") . ")\n"      if ($debug);
-    return;
-}
-
-
-# wrap system calls to provide for verify and debug modes.
-# second, optional argument overrides verify mode if TRUE
-sub systemcall($;$){
-    my $override_verify = FALSE;
-    my $command;
-    ($command, $override_verify) = @_;
-    
-    my $rc = 0;
-    if ($verify or $debug){
-	print "$prog: command: $command\n"; 
-    }
-    if (!$verify or $override_verify){
-        $rc = system ($command); 
-    }
-    $rc = ($rc >> 8);  # see http://perldoc.perl.org/functions/system.html
-    if ($debug){
-	print "$prog: return code " . $rc . "\n";
-    }
-    return $rc;
-}
-
-# Resolve all symlinks in given path
-sub resolveSymlinks() {
-  my ($path) = @_;
-  return $path if (length $path == 0);
-  my $respath = `readlink -f $path`;
-  if ($? != 0) {
-      return $path;    # failure: return original path
-  }
-  chomp $respath;
-  return $respath;
-}
-
-# Read ReleaseData file and return dictionary with content
-sub release_metadata() {
-    my %data;
-    my @dir = grep(/\/$ENV{'AtlasProject'}\//, split(':',$ENV{'LD_LIBRARY_PATH'}));
-    open RELDATA, "$dir[0]/../ReleaseData" or print "=== Alert! Cannot open ReleaseData file\n";
-    while (<RELDATA>) {
-        chomp;
-        my @kv = split(':');
-        $data{$kv[0]} = $kv[1];
-    }
-    return %data;
-}
diff --git a/Trigger/TrigValidation/TrigValTools/bin/trigtestlink.py b/Trigger/TrigValidation/TrigValTools/bin/trigtestlink.py
deleted file mode 100755
index 99c2c0e97578b76d224677bb8991cc55628b0aec..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TrigValTools/bin/trigtestlink.py
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-import os,re,sys
-
-if len(sys.argv)==1:
-    print "This creates a soft link to the specified test in the nightly directory\n"
-    print "%s <testname>   ... to link a test" % os.path.basename(sys.argv[0])
-    print "%s -l           ... to show all tests" % os.path.basename(sys.argv[0])
-    sys.exit(1)
-
-testname = sys.argv[1]
-
-path = os.environ['PATH']
-
-projects = '|'.join(["AtlasP1HLT","AtlasCAFHLT","AtlasTestHLT","AtlasTrigger","AtlasAnalysis","AtlasHLT","AtlasProduction"])
-
-for p in path.split(':'):
-
-    #m = re.match('(?P<base>/afs/cern.ch/atlas/software/.*\.X.*/(?:%s)/.*)/InstallArea/share/bin' % projects, p)
-    m = re.match('(?P<base>/afs/cern.ch/atlas/software/.*/(?:%s)/.*)/InstallArea/share/bin' % projects, p)
-    if not m: continue
-    nicosarea = "%s/NICOS_area" % m.groupdict()['base']
-
-    for dirname, subdirs, files in os.walk(nicosarea):
-
-        basename = os.path.basename(dirname)
-
-        if basename == "NICOS_area":
-            # pick out the atntest area (only exists for nigthly releases)
-            subdirs[:] = [x for x in subdirs if re.match("NICOS_atntest.*",x)]
-            if len(subdirs)>0:
-                atnarea = subdirs[0] # usually the opt build
-            else:
-                atnarea = ""
-            continue
-
-        if basename == atnarea:
-            subdirs[:] = ["trigp1test_testconfiguration_work", "triggertest_testconfiguration_work", "triganalysistest_testconfiguration_work"]
-            continue
-
-
-        if basename in ["trigp1test_testconfiguration_work", "triggertest_testconfiguration_work", "triganalysistest_testconfiguration_work"]:
-            if testname == "-l":
-                conf = { "trigp1test_testconfiguration_work" : "TrigP1Test.conf",
-                         "triggertest_testconfiguration_work" : "TriggerTest.conf",
-                         "triganalysistest_testconfiguration_work" : "TrigAnalysisTest.conf" }[basename]
-                # list all tests
-                print "\n"+basename+":"
-                print len(basename)*"=" + "="
-                w = max(len(x) for x in subdirs)
-                for test in sorted(subdirs):
-                    print "%-*s   ==>  trigtest.pl --cleardir --test %s --rundir %s --conf %s" % (w, test,test,test,conf)
-                continue
-
-        if basename == testname:
-            try:
-                os.symlink(dirname,basename)
-                print "Linking to",dirname
-            except OSError, e:
-                print "File can't be linked, because:",e
-                sys.exit(1)
-
-            sys.exit(0)
-    
-
-if testname != "-l":
-    print "Did not find %s in %s/%s/trig{p1,ger,analysis}test_testconfiguration_work" % (testname,nicosarea,atnarea)
diff --git a/Trigger/TrigValidation/TrigValTools/share/leakCheck.py b/Trigger/TrigValidation/TrigValTools/share/leakCheck.py
deleted file mode 100644
index bd580ea6a6a13f1435b6048717f846126140d83a..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TrigValTools/share/leakCheck.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# add for memory tracking
-import Hephaestus.MemoryTracker as memtrack
-# Try to write the leaks into separate file 
-try: 
-  memtrack.depth( 22 )            # sets the total search depth
-  memtrack.MemoryTrace.size( 19 ) # size of traces kept in memory
-  memtrack.outstream( open("LeakCheck.txt","w") )
-except: 
-  print "ERROR setting memory depth"
-
diff --git a/Trigger/TrigValidation/TrigValTools/share/trig_counts_summary.py b/Trigger/TrigValidation/TrigValTools/share/trig_counts_summary.py
deleted file mode 100755
index ceea9269bf9e54a0c23d771adbe2797d76d7ea9f..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TrigValTools/share/trig_counts_summary.py
+++ /dev/null
@@ -1,523 +0,0 @@
-#!/bin/env python
-#
-# atn basepath
-# /afs/cern.ch/atlas/software/builds/nightlies/devval/AtlasTrigger/$rel/NICOS_area/NICOS_qmtest15X0VAL32BS4TrgOpt/triggertest_testconfiguration_work/$test/$ref
-
-
-import glob
-from itertools import chain
-import ROOT
-import os
-from datetime import datetime
-import logging as log
-import xml.etree.cElementTree as ET
-import re
-
-log.basicConfig(format='%(levelname)-15s  %(message)s', level=log.ERROR)
-
-#exec (file("/afs/cern.ch/atlas/software/dist/AtlasLogin/python/atlconfiguration.py"))
-
-
-
-class CountsSummaryException:
-    pass
-#atlconf = Configuration()
-class Utils:
-    @staticmethod
-    def today():
-        return datetime.today().isoweekday()%7
-
-    @staticmethod
-    def testdate(file):
-        """
-        Returnd date when the test was run.        
-        """
-        return datetime.fromtimestamp(os.path.getmtime(file))
-
-    @staticmethod
-    def wildcarding(list_of_tests):
-        def __can_be_wildcarded(str1, str2):
-            if len(str1) == len(str2):
-                different = ''.join([ (x[0], '*')[x[0] != x[1]] for x in zip(str1, str2)])
-                if different.count('*') == 1:
-                    return different
-            return None
-        
-        tests = sorted(list(list_of_tests), key=lambda x: str(len(x))+x)
-        #print tests
-
-        possible_wildcards = set()
-        for pair in zip(tests[:-1], tests[1:]):
-            pattern = __can_be_wildcarded(pair[0], pair[1])
-            #print pattern, pair
-            if pattern:
-                possible_wildcards.add(pattern)
-        tests.extend(possible_wildcards)
-        return tests
-
-
-
-class CountsCheck:
-    """
-    Counts checkers.
-    """
-    def __init__(self, failed, text):
-        self.failed = bool(failed)
-        self.text = text
-
-    @staticmethod
-    def any_different(counts):
-            return CountsCheck(len(set(counts)) != 1, 'diff')
-
-    @staticmethod
-    def two_perecnt(counts):
-        day_to_day = zip(counts[:-1], counts[1:])
-        diffs = map(lambda x: 1.0*abs(x[0]-x[1]) > 0.02*max(x), day_to_day)
-        return CountsCheck(bool(diffs.count(True)), "day-to-day>2%" )
-
-    @staticmethod
-    def five_perecnt(counts):
-        day_to_day = zip(counts[:-1], counts[1:])
-        diffs = map(lambda x: 1.0*abs(x[0]-x[1]) > 0.05*max(x), day_to_day)
-        return CountsCheck(bool(diffs.count(True)), "day-to-day>5%" )
-
-    @staticmethod
-    def went_to_zero(counts):
-        return CountsCheck( CountsCheck.any_different(counts).failed and counts.count(0) , "hit zero")
-
-    @staticmethod
-    def disabled(counts):
-        return CountsCheck( counts.count(-1) , "disabled")
-
-    @staticmethod
-    def rtt_robust_check(counts):
-        day_to_day = zip(counts[:-1], counts[1:])
-        diffs = map(lambda x: 1.*abs(x[0]-x[1])>5, day_to_day) 
-        return CountsCheck(bool(diffs.count(True)) and CountsCheck.five_perecnt(counts), "rtt check" )
-
-class Atn:
-
-    def location(self, build, test, rel):
-        """ Finds the location of the ATN test
-
-        It needs to know build, test name and release. It searches 4 possible projects
-        AtlasTrigger, AtlasHLT, AtlasP1HLt, AtlasCAFHLT (this is this nasty piece with square brackets ..
-           I could not make glow working with (Atlas|HLT|...).
-
-        Returned value is list of matching paths, and list of actual test names
-        """
-        tog = '/afs/cern.ch/atlas/software/builds/nightlies/'+build+'/Atlas[TPCH][r1AL]*/'+\
-              rel+'/NICOS_area/NICOS_atntest*32BS5G4*Opt/*/'+test
-        #print tog
-        g = glob.glob(tog)
-        return g, [x.split('/')[-1] for x in g]
-
-
-
-    def available_tests(self, build='*'):
-        #tog='/afs/cern.ch/atlas/software/builds/nightlies/*/Atlas[TPCH][r1AL]*/rel_*/'
-        def basic_from_path(path):
-            return path.split('/')[7:10] 
-
-        def build_test_from_path(path):
-            return tuple(path.split('/')[7:14:6]) # the build is at position 7 and at 13 is the test dir (7+6 == 13)
-        
-        tog='/afs/cern.ch/atlas/software/builds/nightlies/'+build+'/Atlas[TPCH][r1AL]*/rel_*/'
-        stage1 = glob.glob(tog)
-        #print stage1
-
-        tests = {}
-        for path in stage1:
-            details = basic_from_path(path)
-            #print details
-            tog = '/afs/cern.ch/atlas/software/builds/nightlies/'+details[0]+'/'+details[1]+'/'+details[2]+'/NICOS_area/NICOS_atntest*32BS5G4*Opt/trig*configuration_work/*/expert-monitoring.root'
-            # print '.... scanning ', tog
-            stage2 = glob.glob(tog)
-            for zz in stage2:
-                build, test_name = build_test_from_path(zz)
-                # print build, testdir
-                tests.setdefault(build, set()).add(test_name)
-        return tests
-
-    def checks(self):
-        return [ CountsCheck.any_different,                              
-                 CountsCheck.went_to_zero,
-                 CountsCheck.disabled ]
-
-                        
-   
-class Rtt:
-    __domain='*'
-    def __init__(self, domain):
-        self.__memoized_tests = {} # keyed by the test_name
-        self.__memoized_test_names = []
-        Rtt.__domain=domain
-
-    @staticmethod
-    def __test_name(path):
-        br = path.split('/')
-        f = '/'.join(br[:-1])+'/rttjobinfo.xml'
-        name = None
-        try:
-            et = ET.parse(f)
-            name = et.getroot().findall('.//jobDisplayName')[0].text.strip('\n\t ')
-            if name == '':                
-                name = et.getroot().findall('.//jobName')[0].text.strip('\n\t ')
-            del et
-        except:
-            log.warning("... problem finding jobDisplayName in: %s, ignoring this test" % f)
-        return name
-
-    @staticmethod
-    def __details(path):
-        br = path.split('/')
-        # get info from the path                    
-        rel     = br[9] 
-        build   = br[10]
-        return rel, build
-
-    @staticmethod
-    def __path(build, rel='*'):
-        #p = '/afs/cern.ch/atlas/project/RTT/prod/Results/rtt/%s/%s/build/i686-slc5-gcc43-opt/%s/Trig*Test/*/*/*/expert-monitoring.root' % (rel, build, Rtt.__domain)
-        p = '/afs/cern.ch/atlas/project/RTT/prod/Results/rtt/%s/%s/build/i686-slc5-gcc43-opt/%s/Trig*Test/*/expert-monitoring.root' % (rel, build, Rtt.__domain)
-        log.debug('rtt path: %s' % p)
-        return  p
-    
-    def location(self, build, test, rel, domain='*'):
-        """
-        Return locations and actual test names (the test param can be wildcard).
-        
-        """
-        key = test+build
-        if key not in self.__memoized_test_names:
-            #print ".... memoizing test name", test, build, rel
-            self.__memoized_test_names.append(key)
-            tog = Rtt.__path(build)
-            dirs = glob.glob(tog)
-            for path in dirs:
-                test_name = Rtt.__test_name(path)
-                if test_name != None:
-                    self.__memoized_tests.setdefault(test_name, []).append(path)
-
-        cre = re.compile(test)
-        paths = []
-        real_names = []
-        
-        for test_name, allp in self.__memoized_tests.iteritems():
-            for p in allp:
-                r, b = Rtt.__details(p)
-                if cre.match(test_name) and rel == r and build == b:
-                    log.debug(".... test matching keyword: %s -  (%s) (%s) (%s) (%s) " %  (test, test_name, build, rel, p) )
-                    paths.append('/'.join(p.split('/')[:-1]))
-                    real_names.append(test_name)
-
-        return paths, real_names
-    
-    def available_tests(self, build='*'):
-        tog = Rtt.__path(build)
-        log.debug('scanning RTT dir: ' + tog )
-        dirs = glob.glob(tog)
-        log.debug('found '+str(len(dirs))+ ' directories')
-        tests = {}
-        for path in dirs:
-            test_name = Rtt.__test_name(path)
-            if test_name != None and test_name != '':
-                tests.setdefault(build, set()).add(test_name)
-        return tests
-
-    def checks(self):
-        return [ CountsCheck.rtt_robust_check,
-                 CountsCheck.disabled ]
-
-        
-        
-        
-class TestSystem:
-    def __init__(self):
-        self.__system = None
-
-    def set(self, system):
-        self.__system = system
-        
-    def __call__(self):
-        return self.__system
-
-TestSystem = TestSystem()
-
-            
-class Counts:
-    def __init__(self, build, test_name, rel):
-        """ crates access point to L2 and EF counts given build  (i.e. dev), test name (i.e. AthenaTrigRDO), and release/nighly (rel_1)
-        
-        """        
-        self.__build = build
-        self.__rel   = rel
-        self.__test_name  = test_name
-
-        self.__dirnames, self.__tests = TestSystem().location(build, test_name, rel)
-        if len(self.__dirnames) == 0:
-            log.warning("No data for the "+build+" "+test_name+" "+rel)
-            raise CountsSummaryException
-        
-        log.debug('... Counts dirctories seems to be ok: %s' % str(self.__dirnames))
-
-        self.__date          = max([Utils.testdate(d) for d in self.__dirnames])
-        
-
-        self.__counts = {'L2': None, 'EF': None}
-        self.__events = {'L2': None, 'EF': None}
-
-    def datetime(self):
-        return self.__date
-
-    def build(self):
-        return self.__build
-    
-    def rel(self):
-        return self.__rel
-
-    def tests(self):
-        return  self.__tests
-
-    def reduce_pool_of_tests(self, test_names):
-        self.__dirnames,  self.__tests = zip(*[ t for t in zip(self.__dirnames,  self.__tests) if t[1] in test_names ])
-        self.__counts = {'L2': None, 'EF': None} # scratch so far summed up counts counts
-        self.__events = {'L2': None, 'EF': None} 
-
-    def scale(self, level, factor):
-
-        if self.events(level) == 0.:
-            return            
-        scale_by = factor/self.events(level)
-        log.info("scalling up by:%f", scale_by)        
-        for k,v in self.counts(level).iteritems():
-            self.__counts[level][k] = int(v*scale_by)
-
-    def events(self, level):
-        counts = self.counts(level)
-        return self.__events[level]
-
-    def counts(self, level='L2'):
-        """
-        Gives back dictionary where key is chain name and value is count of passed events.
-
-        Counts are teken from L2Chain.txt or EFChain.txt if they exist. Else stright from the expert-monitoring.root file.
-        If none exists ... empty dict is returned.
-
-        It is expensive call for the first time. Then it uses it's own cache.
-        """
-        if self.__counts[level] != None:
-            return self.__counts[level]
-
-        
-        self.__counts[level] = {}
-        
-        rootnames  = [ d+'/expert-monitoring.root' for d in self.__dirnames]
-        #print '... rootfiles ', rootnames
-        
-        for counts_file in rootnames:
-            ROOT.gErrorIgnoreLevel =7000;
-            r = ROOT.TFile(counts_file, "OLD")
-            ROOT.gErrorIgnoreLevel =0;
-            hist = r.Get('TrigSteer_'+level+'/ChainAcceptance');
-            if hist:
-                #print hist
-                this_test_counts = [[hist.GetXaxis().GetBinLabel(bin), int(hist.GetBinContent(bin))]  for bin in range(1, 1+hist.GetNbinsX()) ]
-                for cnt in this_test_counts:
-                    self.__counts[level].setdefault(cnt[0], 0)
-                    self.__counts[level][cnt[0]] += cnt[1]
-            log.debug("looking for the SignatureAcceptance hist in: %s" % counts_file)            
-            hist = r.Get('TrigSteer_'+level+'/SignatureAcceptance_runsummary')
-            if hist:
-                if self.__events[level] == None:
-                    self.__events[level] = 0.                
-                self.__events[level] += hist.GetBinContent(1,2) # there we have total number of input events
-                    
-            r.Close()
-
-        return self.__counts[level]
-
-
-class Overview:
-    def __init__(self, builds, test_name, options):
-        whole_week = []
-        for build in builds:
-            for day in range(7):
-                try:
-                    c = Counts(build=build, test_name=test_name, rel='rel_%d' % day)
-                    whole_week.append(c)
-                except CountsSummaryException :
-                    log.debug( '.. missing test for: %d test %s build %s' % (day, test_name, build) )
-                except:
-                    raise
-                
-        # and assure that the tests intersect
-        if options.intersect:
-            tests_across_week = [set(d.tests()) for d in whole_week]
-            tests_running_every_day  = tests_across_week[0]
-            tests_running_any_day    = tests_across_week[0]            
-
-            for t in tests_across_week:
-                tests_running_every_day = tests_running_every_day.intersection(t)
-                tests_running_any_day.update(t)                
-
-            log.debug('tests running whole week          : '+' '.join(tests_running_every_day))
-            log.debug('tests running at least once a week: '+' '.join(tests_running_any_day))
-            [ d.reduce_pool_of_tests(list(tests_running_every_day)) for d in whole_week ] 
-            
-        # eliminate days when test gave no counts        
-        self.__week = [d for d in whole_week if d.counts('L2') != {} or d.counts('EF') != {} ]
-        del whole_week
-
-        # normalize counts to the best day
-        if options.normalize:
-            log.info('Will normalize the counts')
-            ev_max = max([d.events('L2') for d in self.__week ])
-            [d.scale('L2', ev_max)  for d in self.__week ]
-            ev_max = max([d.events('EF') for d in self.__week ])
-            [d.scale('EF', ev_max)  for d in self.__week ]        
-
-        self.sort(options)
-
-
-    def chains(self, level):
-        ch = list(set(reduce( lambda x,y: x+y, [ d.counts(level).keys() for d in self.__week ], [])))
-        #print ch
-        return ch
-    #return [set( chain.from_iterable([ d.counts(level).keys() for d in self.__week ]))]
-
-    def sort(self, options):
-        def __by_date_or_rel( d ):
-            return "%05d" % ( ((d.datetime().month*31)+d.datetime().day)*24+d.datetime().hour)
-        
-        if 'rel' in options.ordering:
-            log.info("Will sort the counts by nightly")
-            __by_date_or_rel = lambda d: d.rel() 
-
-        __ordering = __by_date_or_rel
-        
-        if options.ordering == 'build':
-            log.info("Will sort the counts by build")
-            __ordering = lambda d: d.build()+__by_date_or_rel(d)
-
-        self.__week.sort(key = __ordering )
-
-    def __difference(self, counts):
-        """
-        Returns list of results for all registered checks which failed.
-        """
-        return [ c for c in map( lambda x: x(counts), TestSystem().checks() ) ]
-
-    def ascii(self, print_all):
-        """
-        Print on the terminal.
-        
-        """
-        week = self.__week
-            
-        print 'counts evolution for: ', opt.builds, opt.test
-        print 'overall sum of tests: ', ' '.join(list(set(chain.from_iterable([w.tests() for w in  self.__week]))))
-        # figure out all tests which are summed up
-        if len(set([len(w.tests()) for w in  self.__week])) != 1:
-            log.warning( '. number of summed up tests not equal for each week, consider using option -i' )
-        
-        print '-'*(40+1+7*len(week))
-        format  = '%-40s '+''.join([' %6d']*len(week))
-        sformat = '%-40s '+''.join([' %6s']*len(week))
-        print sformat  % tuple(["build"] + [d.build().split('.')[-1] for d in week] )
-        print format  % tuple(["day of the month"] + [d.datetime().day for d in week] )
-
-        print sformat % tuple(["rel"]+[ d.rel() for d in week ]), '   _checks which failed_'
-        try:
-            print sformat % tuple(["events L2"]+[ int(d.events('L2')) for d in week ])
-            print sformat % tuple(["events EF"]+[ int(d.events('EF')) for d in week ])
-        except: pass
- 
-        def __print_one_level(level):
-            print sformat % tuple(['----'+level+'---------'] + ['----']*len(week))
-            keys = set( chain.from_iterable([ d.counts(level).keys() for d in week ]))
-            for k in sorted(keys): 
-                # figure out if there was any change
-                # collect counts for this chain for all week
-                counts = [ d.counts(level).setdefault(k, -1) for d in week]
-                diff_checks = self.__difference(counts)
-                diff = map( lambda x: x.failed, diff_checks).count(True)
-                
-                if print_all or diff:
-                    print format % tuple([k]+counts), ' & '.join([ (' '*len(c.text), c.text)[c.failed]  for c in diff_checks ] )
-
-        __print_one_level('L2')
-        __print_one_level('EF')
-
-    def dictionarize(self):
-        ret = {}
-
-        day   = [d.datetime().day for d in self.__week]        
-        today = map(lambda x: [0, 1][Utils.today()==x], [int(d.rel()[-1]) for d in self.__week] )
-        build = [d.build() for d in self.__week]
-        rel   = [ d.rel() for d in self.__week ]
-        l2ev  = [ d.events('L2') for d in self.__week ]
-        efev  = [ d.events('EF') for d in self.__week ]
-        
-        ret['meta'] = zip( day, today, build, rel, l2ev, efev)
-        def __dict_counts(level):
-            keys = self.chains(level)
-            l = {}
-            for k in keys:
-                counts = [ d.counts(level).setdefault(k, -1) for d in self.__week]
-                diff_checks = self.__difference(counts)
-                l[k] = (counts, diff_checks)
-            return l
-        ret['L2'] = __dict_counts('L2')
-        ret['EF'] = __dict_counts('EF')
-        return ret
-    
-
-if __name__ == "__main__":
-    import optparse
-    parser = optparse.OptionParser('show chain counts for tests')
-    
-    parser.add_option('-b', '--builds', default='dev',
-                      help='builds, coma separated list of  '+' '.join( [ n.split('/')[-1] for n in  glob.glob('/afs/cern.ch/atlas/software/builds/nightlies/*')])  , metavar='BUILD')
-    parser.add_option('-d', '--domain', default='*', 
-                       help='test suite domain [p1hlt|offline], if not specified test results will be merged')    
-    parser.add_option('-t', '--test', default='AthenaTrigRDO',
-                      help='test name, look at NICOS test page for test names', metavar='TEST')
-    parser.add_option('-a', '--all', default=False,  action='store_true',
-                      help='print all chains (not only those changing)')
-    parser.add_option('-l', '--list', default=False, action='store_true',
-                      help='print all tests in all builds (takes long time to execute, and output is just huge)')    
-    parser.add_option('-s', '--sys', default='ATN', 
-                      help='Test system, either ATN (default) or RTT')
-    parser.add_option('-v', '--verbose', default=0, action='store_true',
-                      help='More verbose output')
-    parser.add_option('-i', '--intersect', default=0, action='store_true',
-                      help='from the set of tests (when wildcard is used) ')
-    parser.add_option('-n', '--normalize', default=0, action='store_true',
-                      help='normalize (scaling up to the day wiht highest number of processed events) the counts before comparison')
-    parser.add_option('-o', '--ordering', default='date', 
-                      help='results ordering: date(default), build, rel')    
-
-    (opt,args) = parser.parse_args()
-    if opt.verbose:
-        log.getLogger().setLevel(log.DEBUG)
-        log.debug('... more debug ')
-    
-    TestSystem.set(Atn())
-    if opt.sys == 'RTT':
-        TestSystem.set(Rtt(opt.domain))
-    
-    if opt.list:
-        log.debug('... scanning for available tests')
-        tests = TestSystem().available_tests(opt.builds)
-        for build, tests in tests.iteritems():
-            print '-'*80
-            print 'Build: ', build        
-            print  '\n'.join(sorted(Utils.wildcarding(tests)))
-        import sys
-        sys.exit(0)
-        
-    over = Overview(opt.builds.split(','), opt.test, opt)
-    over.ascii(opt.all)
-
-    
diff --git a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDM.py b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDM.py
index 1860061ee18421d06dbcf97e3b8a767f4c52adab..cc3b00049c213c7ab3baf137fd4dc36d79b44ac2 100644
--- a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDM.py
+++ b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDM.py
@@ -610,6 +610,10 @@ TriggerHLTList = [
     ('xAOD::JetContainer#HLT_a4sktclcwnojcalibFS',                       'BS ESD AODFULL', 'Jet'),
     ('xAOD::JetTrigAuxContainer#HLT_a4sktclcwnojcalibFSAux.',            'BS ESD AODFULL', 'Jet'),
 
+    # SoftKiller
+    ('xAOD::JetContainer#HLT_a4_sktclcwnojcalibFS',                      'BS ESD AODFULL', 'Jet'),
+    ('xAOD::JetTrigAuxContainer#HLT_a4_sktclcwnojcalibFSAux.',           'BS ESD AODFULL', 'Jet'),
+
     #GSC
     ('xAOD::JetContainer#HLT_GSCJet', 						'BS ESD AODFULL AODSLIM AODVERYSLIM', 'Bjet'),
     ('xAOD::JetTrigAuxContainer#HLT_GSCJetAux.', 				'BS ESD AODFULL AODSLIM AODVERYSLIM', 'Bjet'),    
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py
index 16edb349cb7f3b4a8947114885f8e44c59bdfa08..9fbf72f64a17698d05e01c90944b93e1a575fe94 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py
@@ -7,7 +7,7 @@ from AthenaCommon.Logging import logging
 __log = logging.getLogger('TriggerConfig')
 
 def collectHypos( steps ):
-    """ 
+    """
     Method iterating over the CF and picking all the Hypothesis algorithms
 
     Returned is a map with the step name and list of all instances of hypos in that step.
@@ -21,11 +21,11 @@ def collectHypos( steps ):
         if "filter" in stepSeq.name():
             __log.info("Skipping filtering steps " +stepSeq.name() )
             continue
-        
+
         __log.info( "collecting hypos from step " + stepSeq.name() )
 #        start = {}
         for seq,algs in flatAlgorithmSequences( stepSeq ).iteritems():
-            
+
             for alg in algs:
                 # will replace by function once dependencies are sorted
                 if 'HypoInputDecisions'  in alg.getProperties():
@@ -38,7 +38,7 @@ def collectHypos( steps ):
 def __decisionsFromHypo( hypo ):
     """ return all chains served by this hypo and the key of produced decision object """
     if hypo.getType() == 'ComboHypo':
-        return hypo.MultiplicitiesMap.keys(), hypo.HypoOutputDecisions[0]            
+        return hypo.MultiplicitiesMap.keys(), hypo.HypoOutputDecisions[0]
     else: # regular hypos
         return [ t.name() for t in hypo.HypoTools ], hypo.HypoOutputDecisions
 
@@ -46,11 +46,11 @@ def __decisionsFromHypo( hypo ):
 
 def collectFilters( steps ):
     """
-    Similarly to collectHypos but works for filter algorithms    
+    Similarly to collectHypos but works for filter algorithms
 
-    The logic is simpler as all filters are grouped in step filter sequences    
+    The logic is simpler as all filters are grouped in step filter sequences
     Returns map: step name -> list of all filters of that step
-    """    
+    """
     __log.info("Collecting hypos")
     from collections import defaultdict
     filters = defaultdict( list )
@@ -68,29 +68,29 @@ def collectDecisionObjects(  hypos, filters, l1decoder ):
     decisionObjects = set()
     __log.info("Collecting decision obejcts from L1 decoder instance")
     decisionObjects.update([ d.Decisions for d in l1decoder.roiUnpackers ])
-    decisionObjects.update([ d.Decisions for d in l1decoder.rerunRoiUnpackers ]) 
+    decisionObjects.update([ d.Decisions for d in l1decoder.rerunRoiUnpackers ])
+
 
-    
     __log.info("Collecting decision obejcts from hypos")
     __log.info(hypos)
     for step, stepHypos in hypos.iteritems():
         for hypoAlg in stepHypos:
             __log.debug( "Hypo %s with input %s and output %s " % (hypoAlg.getName(), str(hypoAlg.HypoInputDecisions), str(hypoAlg.HypoOutputDecisions) ) )
-            __log.debug( "and hypo tools %s " % (str( [ t.getName() for t in hypoAlg.HypoTools ] ) ) ) 
+            __log.debug( "and hypo tools %s " % (str( [ t.getName() for t in hypoAlg.HypoTools ] ) ) )
             decisionObjects.add( hypoAlg.HypoInputDecisions )
             decisionObjects.add( hypoAlg.HypoOutputDecisions )
-        
+
     __log.info("Collecting decision obejcts from filters")
     for step, stepFilters in filters.iteritems():
         for filt in stepFilters:
             decisionObjects.update( filt.Input )
             decisionObjects.update( filt.Output )
-    
+
     return decisionObjects
 
-    
+
 def triggerSummaryCfg(flags, hypos):
-    """ 
+    """
     Configures an algorithm(s) that should be run after the slection process
     Returns: ca, algorithm
     """
@@ -101,15 +101,15 @@ def triggerSummaryCfg(flags, hypos):
     for stepName, stepHypos in sorted( hypos.items() ):
         for hypo in stepHypos:
             hypoChains,hypoOutputKey = __decisionsFromHypo( hypo )
-            allChains.update( dict.fromkeys( hypoChains, hypoOutputKey ) ) 
+            allChains.update( dict.fromkeys( hypoChains, hypoOutputKey ) )
 
     for c, cont in allChains.iteritems():
-        __log.info("Final decision of chain  " + c + " will be red from " + cont ) 
+        __log.info("Final decision of chain  " + c + " will be red from " + cont )
     decisionSummaryAlg.FinalDecisionKeys = list(set(allChains.values()))
     decisionSummaryAlg.FinalStepDecisions = allChains
     decisionSummaryAlg.DecisionsSummaryKey = "HLTSummary" # Output
     return acc, decisionSummaryAlg
-        
+
 
 
 def triggerMonitoringCfg(flags, hypos, l1Decoder):
@@ -131,21 +131,21 @@ def triggerMonitoringCfg(flags, hypos, l1Decoder):
         for hypo in stepHypos:
             hypoChains, hypoOutputKey  = __decisionsFromHypo( hypo )
             stepDecisionKeys.append( hypoOutputKey )
-            allChains.update( hypoChains )                              
-        
+            allChains.update( hypoChains )
+
         dcTool = DecisionCollectorTool( "DecisionCollector" + stepName, Decisions=stepDecisionKeys )
         __log.info( "The step monitoring decisions in " + dcTool.name() + " " +str( dcTool.Decisions ) )
         mon.CollectorTools += [ dcTool ]
 
-    
+
     #mon.FinalChainStep = allChains
     mon.L1Decisions  = l1Decoder.getProperties()['L1DecoderSummaryKey'] if l1Decoder.getProperties()['L1DecoderSummaryKey'] != '<no value>' else l1Decoder.getDefaultProperty('L1DecoderSummary')
     allChains.update( l1Decoder.ChainToCTPMapping.keys() )
-    mon.ChainsList = list( allChains )    
+    mon.ChainsList = list( allChains )
     return acc, mon
 
 def triggerOutputStreamCfg( flags, decObj, outputType ):
-    """ 
+    """
     Configure output stream according to the menu setup (decision objects)
     and TrigEDMCOnfig
     """
@@ -161,7 +161,7 @@ def triggerOutputStreamCfg( flags, decObj, outputType ):
     from TrigEDMConfig.TriggerEDMRun3 import TriggerHLTList
     EDMCollectionsToRecord=filter( lambda x: outputType in x[1] and "TrigCompositeContainer" not in x[0],  TriggerHLTList )
     itemsToRecord.extend( [ el[0] for el in EDMCollectionsToRecord ] )
-    
+
     # summary objects
     __log.debug( outputType + " trigger content "+str( itemsToRecord ) )
     acc = OutputStreamCfg( flags, outputType, ItemList=itemsToRecord )
@@ -169,10 +169,10 @@ def triggerOutputStreamCfg( flags, decObj, outputType ):
     streamAlg.ExtraInputs = [("xAOD::TrigCompositeContainer", "HLTSummary")]
 
     return acc
-    
+
 def triggerAddMissingEDMCfg( flags, decObj ):
 
-    from DecisionHandling.DecisionHandlingConf import TriggerSummaryAlg    
+    from DecisionHandling.DecisionHandlingConf import TriggerSummaryAlg
     EDMFillerAlg = TriggerSummaryAlg( "EDMFillerAlg" )
     EDMFillerAlg.InputDecision  = "L1DecoderSummary"
 
@@ -186,7 +186,7 @@ def triggerAddMissingEDMCfg( flags, decObj ):
     for c in collectionsThatNeedMerging:
         tool = HLTEDMCreator(c[0].split("#")[1]+"merger")
         ctype, cname = c[0].split("#")
-        ctype = ctype.split(":")[-1]        
+        ctype = ctype.split(":")[-1]
         viewsColl = c[3].split(":")[-1]
         setattr(tool, ctype+"Views", [ viewsColl ] )
         setattr(tool, ctype+"InViews", [ cname ] )
@@ -197,8 +197,8 @@ def triggerAddMissingEDMCfg( flags, decObj ):
 #egammaViewsMerger.TrigEMClusterContainer = [ clustersKey ]
 
     return EDMFillerAlg
-    
-    
+
+
 def setupL1DecoderFromMenu( flags, l1Decoder ):
     """ Post setup of the L1Decoder, once approved, it should be moved to L1DecoderCfg function """
 
@@ -207,16 +207,18 @@ def setupL1DecoderFromMenu( flags, l1Decoder ):
 
 
 def triggerRunCfg( flags, menu=None ):
-    """ 
+    """
     top of the trigger config (for real triggering online or on MC)
     Returns: ca only
     """
     if flags.Trigger.doLVL1:
         # conigure L1 simulation
         pass
-    
+
     acc = ComponentAccumulator()
 
+    acc.merge( triggerIDCCacheCreatorsCfg( flags ) )
+
     from L1Decoder.L1DecoderConfig import L1DecoderCfg
     #TODO
     # information about the menu has to be injected into L1 decoder config
@@ -224,53 +226,65 @@ def triggerRunCfg( flags, menu=None ):
     # and item to threshold (the later can be maybe extracted from L1 config file)
     l1DecoderAcc, l1DecoderAlg = L1DecoderCfg( flags )
     setupL1DecoderFromMenu( flags, l1DecoderAlg )
-    acc.merge( l1DecoderAcc )    
-            
+    acc.merge( l1DecoderAcc )
+
 
     # detour to the menu here, (missing now, instead a temporary hack)
     if menu:
         menuAcc = menu( flags )
         HLTSteps = menuAcc.getSequence( "HLTAllSteps" )
         __log.info( "Configured menu with "+ str( len(HLTSteps.getChildren()) ) +" steps" )
-    
-    
+
+
     # collect hypothesis algorithms from all sequence
-    hypos = collectHypos( HLTSteps )           
+    hypos = collectHypos( HLTSteps )
     filters = collectFilters( HLTSteps )
-    
+
     summaryAcc, summaryAlg = triggerSummaryCfg( flags, hypos )
-    acc.merge( summaryAcc ) 
-    
+    acc.merge( summaryAcc )
+
     #once menu is included we should configure monitoring here as below
-    
+
     monitoringAcc, monitoringAlg = triggerMonitoringCfg( flags, hypos, l1DecoderAlg )
     acc.merge( monitoringAcc )
 
     decObj = collectDecisionObjects( hypos, filters, l1DecoderAlg )
     __log.info( "Number of decision objects found in HLT CF %d" % len( decObj ) )
     __log.info( str( decObj ) )
-    
+
     HLTTop = seqOR( "HLTTop", [ l1DecoderAlg, HLTSteps, summaryAlg, monitoringAlg ] )
     acc.addSequence( HLTTop )
-        
+
     acc.merge( menuAcc )
 
     # output
     # if any output stream is requested, schedule "gap" filling algorithm
     if flags.Output.ESDFileName != "" or flags.Output.AODFileName != "":
         acc.addEventAlgo( triggerAddMissingEDMCfg( flags, decObj ), sequenceName= "HLTTop" )
-        
+
     # configure streams
     if flags.Output.ESDFileName != "":
         acc.merge( triggerOutputStreamCfg( flags, decObj, "ESD" ) )
 
-    if flags.Output.AODFileName != "":        
+    if flags.Output.AODFileName != "":
         acc.merge( triggerOutputStreamCfg( flags, decObj, "AOD" ) )
 
-        
-    
+
+
     return acc
 
+def triggerIDCCacheCreatorsCfg(flags):
+    """
+    Configures IDC cache loading, for now unconditionally, may make it menu dependent in future
+    """
+    acc = ComponentAccumulator()
+    from MuonConfig.MuonBytestreamDecodeConfig import MuonCacheCfg
+    acc.merge( MuonCacheCfg() )
+
+    from TrigUpgradeTest.InDetConfig import InDetIDCCacheCreatorCfg
+    acc.merge( InDetIDCCacheCreatorCfg() )
+
+    return acc
 
 def triggerPostRunCfg(flags):
     """
@@ -279,7 +293,7 @@ def triggerPostRunCfg(flags):
     """
     acc = ComponentAccumulator()
     # configure in order BS decodnig, EDM gap filling, insertion of trigger metadata to ESD
-    
+
     return acc
 
 
@@ -290,16 +304,15 @@ if __name__ == "__main__":
 
     ConfigFlags.Trigger.L1Decoder.forceEnableAllChains = True
     ConfigFlags.Input.Files = ["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1",]
-    ConfigFlags.lock()    
+    ConfigFlags.lock()
 
     def testMenu(flags):
         menuCA = ComponentAccumulator()
         menuCA.addSequence( seqAND("HLTAllSteps") )
         return menuCA
-    
+
     acc = triggerRunCfg( ConfigFlags, testMenu )
 
     f=open("TriggerRunConf.pkl","w")
     acc.store(f)
     f.close()
-
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/jet/AlgFactory.py b/Trigger/TriggerCommon/TriggerMenu/python/jet/AlgFactory.py
index f7a604febe659ae1169684f66a4897162bfe22cd..5894c321ffd3ab5048b2cb6f295ee21457077e1e 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/jet/AlgFactory.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/jet/AlgFactory.py
@@ -99,6 +99,10 @@ def _get_energy_density_radius():
     """Provide a common source for the energy density akt radius"""
     return 0.4
 
+def _get_soft_killer_grid_size():
+    """Provide a common source for the SoftKiller grid size"""
+    return 0.4,0.4
+
 
 class AlgFactory(object):
     def __init__(self, chain_config):
@@ -172,9 +176,9 @@ class AlgFactory(object):
         factory = 'TrigHLTJetRecFromCluster'
         # add factory to instance label to facilitate log file searches
         trkstr = self.menu_data.trkopt
-        if 'ftk' in self.menu_data.trkopt:
-                name = '"%s_%s%s"' %(factory, self.fex_params.fex_label, trkstr)	
-                outputcollectionlabel = "'%s%s'" % (self.fex_params.fex_label, trkstr)
+        if 'ftk' in trkstr:
+            name = '"%s_%s%s"' %(factory, self.fex_params.fex_label, trkstr)	
+            outputcollectionlabel = "'%s%s'" % (self.fex_params.fex_label, trkstr)
         else:
                 name = '"%s_%s"' %(factory, self.fex_params.fex_label)
                 outputcollectionlabel = "'%s'" % (self.fex_params.fex_label)
@@ -223,13 +227,20 @@ class AlgFactory(object):
 
         factory = 'TrigHLTTrackMomentHelpers'
 
-        name = '"%s"' % factory
+        trkstr = self.menu_data.trkopt
+        
+        name = '"%s_%s"' % ( factory, trkstr )
+        
+        tvassocsgkey = 'HLT_'+trkstr+'_JetTrackVtxAssoc'
+        tracksgkey = 'HLT_'+trkstr+'_InDetTrackParticles'
+        primvtxsgkey = 'HLT_'+trkstr+'_PrimaryVertices'
         
         kwds = {
             'name': name,  # instance label
-            'tvassocSGkey': "'HLT_FTK_JetTrackVtxAssoc'",
-            'trackSGkey': "'HLT_FTK_InDetTrackParticles'",
-            'primVtxSGkey': "'HLT_FTK_PrimaryVertices'",
+            'trkopt' : "'%s'" % trkstr,
+            'tvassocSGkey': "'%s'" % tvassocsgkey,
+            'trackSGkey': "'%s'" % tracksgkey,
+            'primVtxSGkey': "'%s'" % primvtxsgkey,
         }
 
         return [Alg(factory, (), kwds)]
@@ -638,6 +649,30 @@ class AlgFactory(object):
         return [Alg(factory, (), kwds)]
 
 
+    def softKillerAlg(self):
+        factory = 'TrigHLTSoftKiller'
+
+        # assign a name which identifies the fex sequence and
+        # the python class to be instantiated.
+        sk_grid_param_eta,sk_grid_param_phi = _get_soft_killer_grid_size()
+
+        name = '"%s_%s%s"' % (
+            factory,
+            str(int(10*sk_grid_param_eta))+str(int(10*sk_grid_param_phi)),
+            self.fex_params.cluster_calib,
+        )
+        
+        # we do not carry the SoftKiller grid sizes
+        # so hard wire it here (to be fixed)
+        kwds = {'name': name,
+                'cluster_calib': '"%s"' %self.fex_params.cluster_calib_fex,
+                'sk_grid_param_eta': sk_grid_param_eta,
+                'sk_grid_param_phi': sk_grid_param_phi
+            }
+
+        return [Alg(factory, (), kwds)]
+
+
     def dataScoutingAlg1(self, manual_attrs):
         factory = 'ScoutingStreamWriter'
         manual_attrs = manual_attrs
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/jet/JetDef.py b/Trigger/TriggerCommon/TriggerMenu/python/jet/JetDef.py
index 3dd7f4fa65860fbb0c92c1ad8c89e12d72e345c0..f50e03545c4b806befa4c70c08f8d556d2de2330 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/jet/JetDef.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/jet/JetDef.py
@@ -77,7 +77,7 @@ def _check_values(chain_parts):
             raise RuntimeError(msg)
 
     dataTypes = [p['dataType'] for p in chain_parts]
-    bad = [r for r in dataTypes if r not in ('TT', 'tc', 'ion')]
+    bad = [r for r in dataTypes if r not in ('TT', 'tc', 'ion', 'sktc')]
 
     if bad:
         msg = '%s unknown dataType(s): %s' % (err_hdr, ' '.join(bad))
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/jet/JetSequencesBuilder.py b/Trigger/TriggerCommon/TriggerMenu/python/jet/JetSequencesBuilder.py
index e4e24ec5ef48c7f0097f7501fa18bc78f2238af1..dd23eca9b51b0863f1ad1f825c6d47964bc7750c 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/jet/JetSequencesBuilder.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/jet/JetSequencesBuilder.py
@@ -91,6 +91,7 @@ class JetSequencesBuilder(object):
                        'cmfs1': self.make_cmfs1,  # cell maker full scan
                        'cmfs2': self.make_cmfs2,  # cluster maker full scan
                        'ed': self.make_ed,  # energy density
+                       'sk': self.make_sk,  # SoftKiller
                        'ftk': self.make_ftk,  # run algos for ftk track finding and xaod conversion
                        'tm': self.make_tm, # track moments helper
                        'jr': self.make_jr_clusters,  # jet rec
@@ -161,9 +162,14 @@ class JetSequencesBuilder(object):
             ('tc', 'PS', False, 'notrk'): ['ps', 'cm', 'jr'],
             ('ion', 'FS', False, 'notrk'): ['fs2','cmfs1','hicm','hijr'],
             ('TT', 'FS', False, 'notrk'): ['tt', 'jt'],
-            ('tc', 'FS', True, 'notrk'): ['fs2', 'cmfs1', 'cmfs2','ed', 'tr']}.get((data_type,
-                                                           scan_type,
-                                                           do_trimming,trkopt), [])
+            ('tc', 'FS', True, 'notrk'): ['fs2', 'cmfs1', 'cmfs2','ed', 'tr'],
+            # SoftKiller topoclusters, no need for EventDensity for rho*area subtraction
+            ('sktc','FS',False, 'notrk'):    ['fs2','cmfs1','cmfs2','sk','jr'],
+            ('sktc','FS',False, 'ftk'):      ['fs2','cmfs1','cmfs2','sk','ftk','tm','jr'],
+            ('sktc','FS',False,' ftkrefit'): ['fs2','cmfs1','cmfs2','sk','ftk','tm','jr'],
+            }.get((data_type,
+                   scan_type,
+                   do_trimming,trkopt), [])
 
         if not seq_order:
             msg = '%s._make_sequence_list: cannot determine sequence'\
@@ -296,6 +302,7 @@ class JetSequencesBuilder(object):
             ftksequence_list = TrigInDetFTKSequence("FullScan", "fullScan", sequenceFlavour=["FTKVtx"]).getSequence()
         elif ftkopt == 'ftkrefit':
             ftksequence_list = TrigInDetFTKSequence("FullScan", "fullScan", sequenceFlavour=["FTKVtx", "refit"]).getSequence()
+            alias = 'ftkrefittracking'
         ftkalgo_list = []
 
         for seq in ftksequence_list:
@@ -311,6 +318,16 @@ class JetSequencesBuilder(object):
 
         return AlgList(alg_list=self.alg_factory.trackmoment_helpers(), alias=alias)
 
+    def make_sk(self):
+        """Return SoftKiller Alg"""
+        fex_params = self.chain_config.menu_data.fex_params
+        alias = 'softkiller_%s' % fex_params.cluster_calib
+
+        algs = []
+        [algs.extend(f()) for f in (self.alg_factory.softKillerAlg,)]
+
+        return AlgList(algs,alias=alias)
+
     def make_cm(self):
         """Return cellmaker for non partial scan running.
         CellMaker does not use certain read-out optimization,
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/jet/jetDefInstantiator.py b/Trigger/TriggerCommon/TriggerMenu/python/jet/jetDefInstantiator.py
index c795faae88102729931067c27b048c09d55b01b2..d0f17e660d2df90e16ae327b877b7a6ad2ab7a0d 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/jet/jetDefInstantiator.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/jet/jetDefInstantiator.py
@@ -43,6 +43,7 @@ from TrigHLTJetRec.TrigHLTJetRecConfig import (TrigHLTJetDiagnostics_named,
                                                TrigHLTHypoDiagnostics_named,
                                                TrigHLTJetDebug,
                                                TrigHLTEnergyDensity,
+                                               TrigHLTSoftKiller,
                                                TrigHLTJetDSSelector,
                                                TrigHLTTrackMomentHelpers,)
 
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_pp_v7.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_pp_v7.py
index 0426c0ba1d8cec0a3449efb8703d0bacd053b8e4..9d546c5bab985b8521a59c358313037bb236413b 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_pp_v7.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_pp_v7.py
@@ -254,6 +254,14 @@ def setupMenu():
         ['j175_lcw_subjesIS', 'L1_J100', [], [PhysicsStream], ['Rate:SingleJet', 'BW:Jet'], -1],
         ['j420_subjesIS',     'L1_J100', [], [PhysicsStream], ['Rate:SingleJet', 'BW:Jet'], -1],
         ['j420_lcw_subjesIS', 'L1_J100', [], [PhysicsStream], ['Rate:SingleJet', 'BW:Jet'], -1],
+
+        # SoftKiller test and comparison chains
+        ['j60_sktc_em_nojcalib',  'L1_J20',  [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j60_tc_em_nojcalib',    'L1_J20',  [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j60_tc_em_sub',         'L1_J20',  [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j60_sktc_lcw_nojcalib', 'L1_J20',  [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j60_tc_lcw_nojcalib',   'L1_J20',  [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j60_tc_lcw_sub',        'L1_J20',  [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
         
         # data scouting
         ['j0_perf_ds1_L1All',      'L1_All',  [], ['DataScouting_05_Jets'], ['RATE:Cosmic_Jets_DS', 'BW:Jet'], -1],
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_pp_v8.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_pp_v8.py
new file mode 100644
index 0000000000000000000000000000000000000000..b0fbcaafe01f50256d54541a2f2b29b60266e553
--- /dev/null
+++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_pp_v8.py
@@ -0,0 +1,1299 @@
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+
+
+import TriggerMenu.menu.Physics_pp_v8 as physics_menu
+
+from TriggerJobOpts.TriggerFlags          import TriggerFlags
+from copy                                 import deepcopy
+
+import re
+
+from AthenaCommon.Logging import logging
+log = logging.getLogger( 'MC_pp_v8.py' )
+
+
+#---------------------------------------------------------------------
+#---------------------------------------------------------------------
+def setupMenu():
+
+    physics_menu.setupMenu()
+    PhysicsStream="Main"
+
+    ### Remove HLT items that have a remapped L1 threshold and therefore not available in MC
+    L1toRemove = []
+
+    for prop in dir(TriggerFlags):
+        if prop[-5:]!='Slice': continue
+        sliceName=prop
+        m_slice=getattr(TriggerFlags,sliceName).signatures()
+        for chain in reversed(m_slice):
+            if chain[1] in L1toRemove:
+                del m_slice[m_slice.index(chain)]
+
+    # stream, BW and RATE tags for Bphysics items that appear in Muon and Bphysics slice.signatures
+    BPhysicsStream     = "BphysLS"
+    #BMultiMuonStream   = "Main"  
+    RATE_BphysTag      = 'RATE:Bphysics'
+    RATE_BMultiMuonTag = 'RATE:MultiMuon'  # can become RATE:BMultiMuon' with one letter change 
+    BW_BphysTag        = 'BW:Bphys'
+    #RATE_DYTag         = 'RATE:Muon'
+    #BW_DYTag           = 'BW:Muon'   
+    
+    
+    # ---------------------------------------------------------------------------------------
+    # INPUT FORMAT FOR CHAINS:
+    # ['chainName',  'L1itemforchain', [L1 items for chainParts], [stream], [groups], EBstep], OPTIONAL: [mergingStrategy, offset,[merginOrder] ]], topoStartsFrom = False
+    # ----------------------------------------------------------------------------------------
+
+    TriggerFlags.TestSlice.signatures = TriggerFlags.TestSlice.signatures() + [
+			 ]
+
+    TriggerFlags.AFPSlice.signatures = TriggerFlags.AFPSlice.signatures() + [
+        ['afp_jetexc_L1J50',  'L1_J50',  [],  [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['afp_jetexc_L1J75',  'L1_J75',  [],  [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['afp_jetexc_L1J100',  'L1_J100',  [],  [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ]
+
+
+
+    TriggerFlags.MuonSlice.signatures = TriggerFlags.MuonSlice.signatures() + [
+        ['mu28_ivarmedium',	     'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream], ['Primary:20000','RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu80',                   'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream], ['Primary:20000','RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu60',                   'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream], ['Primary:20000','RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu20_ivarmedium_L1MU10', 'L1_MU10',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu26',                   'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu22',                   'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu20',                   'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu24',                   'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream, 'express'], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu20_msonly',            'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu14_ivarloose',         'L1_MU10',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu6',                    'L1_MU6',            [], [PhysicsStream,'express'], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu6_msonly',             'L1_MU6',            [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu4',                    'L1_MU4',            [], [PhysicsStream,'express'], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu24_idperf',            'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream, 'express'], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1],
+        ['mu20_idperf',            'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream, 'express'], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1],
+        ['mu40_idperf',            'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream, 'express'], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1],
+        ['mu10_idperf',            'L1_MU10',           [], [PhysicsStream], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1],
+        ['mu6_idperf',             'L1_MU6',            [], [PhysicsStream, 'express'], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1],
+        ['mu4_idperf',             'L1_MU4',            [], [PhysicsStream], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1],
+        ['mu4_nomucomb',                   'L1_MU4',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu6_nomucomb',                   'L1_MU6',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu10_nomucomb',                   'L1_MU10',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu11_nomucomb',                   'L1_MU11',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu24_ivarmedium',	     'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream, 'express'], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu26_ivartight',          'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream], ['Primary:20000','RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu28_ivartight',          'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream], ['Primary:20000','RATE:SingleMuon', 'BW:Muon'], -1],
+        ['2mu15_L12MU10',          'L1_2MU10',          [], [PhysicsStream], ['Primary:20000','RATE:MultiMuon', 'BW:Muon'], -1],
+        ['3mu8_msonly',            'L1_3MU6',           [], [PhysicsStream], ['Primary:20000','RATE:MultiMuon', 'BW:Muon'], -1],
+        ['mu24_mu8noL1',           'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream, 'express'], ['Primary:20000','RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu24','mu8noL1']]],
+        ['mu24_mu10noL1',          'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['Primary:20000','RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu24','mu10noL1']]],
+        ['mu24_mu12noL1' ,         'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['Primary:20000','RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu24','mu12noL1']]],
+        ['mu24_2mu4noL1',          'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['Primary:20000','RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu24','2mu4noL1']]],
+        ['mu26_mu8noL1',           'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['Primary:20000','RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu26','mu8noL1']]],
+        ['mu26_mu10noL1',          'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['Primary:20000','RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu26','mu10noL1']]],
+        ['mu28_mu8noL1',           'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['Primary:20000','RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu28','mu8noL1']]],
+        ['mu22_2mu4noL1',          'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['Primary:20000','RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu22','2mu4noL1']]],
+        ['mu20_2mu2noL1_JpsimumuFS', 'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], [RATE_BMultiMuonTag,'BW:Muon'], -1,['serial',-1,['mu20','2mu2noL1_JpsimumuFS']]],  # OI - who owns these triggers? Bphys?
+        ['mu20_2mu4_JpsimumuL2',     'L1_MU20MU21', ['L1_MU20','L1_2MU4'], [PhysicsStream], [RATE_BMultiMuonTag,'BW:Muon'], -1,['serial',-1,['2mu4_JpsimumuL2','mu20']]], # OI - who owns these triggers?
+        ['mu22_mu8noL1_mu6noL1',   'L1_MU20MU21',       ['L1_MU20','',''], [PhysicsStream], ['Primary:20000','RATE:MultiMuon', 'BW:Muon'],  -1,['serial',-1,['mu22','mu8noL1','mu6noL1']]],
+        ['mu20_msonly_mu15noL1_msonly_nscan05_noComb',   'L1_MU20MU21',   ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu15noL1_msonly_nscan05_noComb']]],
+        ['mu20_msonly_mu6noL1_msonly_nscan05', 'L1_MU20MU21',      ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan05']]],
+        ['mu10',                   'L1_MU10',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu10_mgonly_L1LATE-MU10_XE50',         'L1_LATE-MU10_XE50',          [], [PhysicsStream], ['Primary:20000','RATE:SingleMuon', 'BW:Muon'], -1],
+
+
+        #ATR-19267
+        ['mu14',                   'L1_MU10',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu15',                   'L1_MU10',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu18',                   'L1_MU10',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ]
+
+
+    if TriggerFlags.doFTK():
+        TriggerFlags.MuonSlice.signatures = TriggerFlags.MuonSlice.signatures() + [
+            ['mu24_idperf_FTK_L1MU20MU21_FTK',       'L1_MU20MU21_FTK', ['L1_MU20_FTK'], [PhysicsStream], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1], 
+            ['mu6_idperf_FTK_L1MU6_FTK',             'L1_MU6_FTK',            [], [PhysicsStream], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1],
+            ['mu24_idperf_FTKRefit_L1MU20MU21_FTK',  'L1_MU20MU21_FTK', ['L1_MU20_FTK'], [PhysicsStream], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1], 
+            ['mu6_idperf_FTKRefit_L1MU6_FTK',        'L1_MU6_FTK',            [], [PhysicsStream], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1],
+            ['mu22_mu8noL1_FTKFS_L1MU20MU21_FTK',    'L1_MU20MU21_FTK', ['L1_MU20_FTK',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu22','mu8noL1_FTKFS']]],
+            ['mu26_ivarmedium_FTK_L1MU20MU21_FTK',   'L1_MU20MU21_FTK', ['L1_MU20_FTK'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+]
+
+    TriggerFlags.JetSlice.signatures = TriggerFlags.JetSlice.signatures() + [
+        ['j0_perf_ds1_L1J50',      'L1_J50',  [], ['DataScouting_05_Jets'], ['RATE:Jets_DS', 'BW:Jet'], -1],
+        ['j0_perf_ds1_L1J40',      'L1_J40',  [], ['DataScouting_05_Jets'], ['RATE:Jets_DS', 'BW:Jet'], -1],
+        ['j0_perf_ds1_L1J50_DETA20-J50J',     'L1_J50_DETA20-J50J',  [], ['DataScouting_05_Jets'], ['RATE:Jets_DS', 'BW:Jet'], -1],
+        ['j25',                         'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j35',                         'L1_RD0_FILLED', [], [PhysicsStream,'express'], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j45',                         'L1_J15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j45_L1RD0_FILLED',            'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j60',                         'L1_J20',  [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j60_L1RD0_FILLED',            'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j85',                         'L1_J20',  [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j110',                        'L1_J30',  [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j260',                        'L1_J75', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j360',                        'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j400',                        'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j440',                        'L1_J120', [], [PhysicsStream], ['Primary:17000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j450',                        'L1_J120', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j460',                        'L1_J120', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j480',                        'L1_J120', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j500',                        'L1_J120', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j520',                        'L1_J120', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j225_gsc400_boffperf_split',  'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j225_gsc440_boffperf_split',  'L1_J120', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j225_gsc450_boffperf_split',  'L1_J120', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j225_gsc460_boffperf_split',  'L1_J120', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j225_gsc480_boffperf_split',  'L1_J120', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j225_gsc500_boffperf_split',  'L1_J120', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j35_subjes',                  'L1_RD0_FILLED', [], [PhysicsStream,'express'], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j35_jes',                     'L1_RD0_FILLED', [], [PhysicsStream,'express'], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j35_sub',                     'L1_RD0_FILLED', [], [PhysicsStream,'express'], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j35_nojcalib',                'L1_RD0_FILLED', [], [PhysicsStream,'express'], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j35_lcw',                     'L1_RD0_FILLED', [], [PhysicsStream,'express'], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j35_lcw_subjes',              'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j35_lcw_jes',                 'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j35_lcw_sub',                 'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j35_lcw_nojcalib',            'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j450_subjes',                 'L1_J120', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j450_jes',                    'L1_J120', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j450_sub',                    'L1_J120', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j450_nojcalib',               'L1_J120', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j450_lcw',                    'L1_J120', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j450_lcw_subjes',             'L1_J120', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j450_lcw_jes',                'L1_J120', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j450_lcw_sub',                'L1_J120', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j450_lcw_nojcalib',           'L1_J120', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j15_320eta490',               'L1_RD0_FILLED',  [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j25_320eta490',               'L1_RD0_FILLED',  [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j35_320eta490',               'L1_RD0_FILLED',  [], [PhysicsStream,'express'], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j45_320eta490',               'L1_J15.31ETA49', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j60_320eta490',               'L1_J20.31ETA49', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j85_320eta490',               'L1_J20.31ETA49', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j175_320eta490',              'L1_J50.31ETA49', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j35_320eta490_subjes',        'L1_RD0_FILLED', [], [PhysicsStream,'express'], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j35_320eta490_jes',           'L1_RD0_FILLED', [], [PhysicsStream,'express'], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j35_320eta490_sub',           'L1_RD0_FILLED', [], [PhysicsStream,'express'], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j35_320eta490_nojcalib',      'L1_RD0_FILLED', [], [PhysicsStream,'express'], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j35_320eta490_lcw',           'L1_RD0_FILLED', [], [PhysicsStream,'express'], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j35_320eta490_lcw_subjes',    'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j35_320eta490_lcw_jes',       'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j35_320eta490_lcw_sub',       'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j35_320eta490_lcw_nojcalib',  'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j260_320eta490_subjes',       'L1_J75.31ETA49', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j260_320eta490_jes',          'L1_J75.31ETA49', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j260_320eta490_lcw',          'L1_J75.31ETA49', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j260_320eta490_lcw_subjes',   'L1_J75.31ETA49', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j260_320eta490_lcw_jes',      'L1_J75.31ETA49', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j260_320eta490_lcw_nojcalib', 'L1_J75.31ETA49', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j110_a10_lcw_subjes_L1J30',       'L1_J30', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j175_a10_lcw_subjes_L1J50',       'L1_J50', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j440_a10_lcw_subjes_L1J100',      'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j480_a10_lcw_subjes_L1J100',      'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j500_a10_lcw_subjes_L1J100',      'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j520_a10_lcw_subjes_L1J100',      'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j540_a10_lcw_subjes_L1J100',      'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j260_a10_sub_L1J75',              'L1_J75', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j260_a10_nojcalib_L1J75',         'L1_J75', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j260_a10_lcw_sub_L1J75',          'L1_J75', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j260_a10_lcw_nojcalib_L1J75',     'L1_J75', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j480_a10_sub_L1J100',             'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j480_a10_nojcalib_L1J100',        'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j480_a10_lcw_sub_L1J100',         'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j480_a10_lcw_nojcalib_L1J100',    'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j440_a10_lcw_subjes_L1SC111', 'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j480_a10_lcw_subjes_L1SC111',             'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j500_a10_lcw_subjes_L1SC111', 'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j520_a10_lcw_subjes_L1SC111', 'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j540_a10_lcw_subjes_L1SC111', 'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j260_a10r_L1J75',                 'L1_J75', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j440_a10r_L1J100',                'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j480_a10r_L1J100',                'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j500_a10r_L1J100',                'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j520_a10r_L1J100',                'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j540_a10r_L1J100',                'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j440_a10r_L1SC111', 'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j480_a10r_L1SC111',               'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j500_a10r_L1SC111', 'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j520_a10r_L1SC111', 'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j540_a10r_L1SC111', 'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j260_a10t_lcw_jes_L1J75',         'L1_J75', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j420_a10t_lcw_jes_L1J100',        'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j480_a10t_lcw_jes_L1J100',        'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j500_a10t_lcw_jes_L1J100',        'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j520_a10t_lcw_jes_L1J100',        'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j540_a10t_lcw_jes_L1J100',        'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j260_a10t_lcw_nojcalib_L1J75',    'L1_J75', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j480_a10t_lcw_nojcalib_L1J100',   'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j480_a10t_lcw_jes_L1SC111',               'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j500_a10t_lcw_jes_L1SC111', 'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j520_a10t_lcw_jes_L1SC111', 'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j540_a10t_lcw_jes_L1SC111', 'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j390_a10t_lcw_jes_30smcINF_L1J100',               'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j420_a10t_lcw_jes_30smcINF_L1J100',               'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j440_a10t_lcw_jes_30smcINF_L1J100',               'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j390_a10t_lcw_jes_35smcINF_L1J100',               'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j440_a10t_lcw_jes_35smcINF_L1J100',               'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j440_a10t_lcw_jes_35smcINF_L1SC111',              'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j390_a10t_lcw_jes_40smcINF_L1J100',               'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j420_a10t_lcw_jes_40smcINF_L1J100',               'L1_J100', [], [PhysicsStream], ['Primary:17000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j440_a10t_lcw_jes_40smcINF_L1J100',               'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j390_a10t_lcw_jes_L1J100',                        'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j420_a10t_lcw_jes_L1SC111',                       'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['2j330_a10t_lcw_jes_30smcINF_L1J100',              'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['2j340_a10t_lcw_jes_35smcINF_L1J100',              'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['2j340_a10t_lcw_jes_35smcINF_L1SC111',             'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['2j350_a10t_lcw_jes_35smcINF_L1J100',              'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['2j350_a10t_lcw_jes_35smcINF_L1SC111',             'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['2j360_a10t_lcw_jes_35smcINF_L1J100',              'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['2j370_a10t_lcw_jes_35smcINF_L1J100',              'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['2j380_a10t_lcw_jes_35smcINF_L1J100',              'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['2j330_a10t_lcw_jes_40smcINF_L1J100',              'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['2j340_a10t_lcw_jes_40smcINF_L1J100',              'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['2j350_a10t_lcw_jes_40smcINF_L1J100',              'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j325_a10t_lcw_jes_60smcINF_j325_a10t_lcw_jes_L1SC111',   'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j340_a10t_lcw_jes_60smcINF_j340_a10t_lcw_jes_L1SC111',   'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j370_a10t_lcw_jes_40smcINF_j370_a10t_lcw_jes_L1SC111',   'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j370_a10t_lcw_jes_50smcINF_j370_a10t_lcw_jes_L1SC111',   'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j370_a10t_lcw_jes_60smcINF_j370_a10t_lcw_jes_L1SC111',   'L1_SC111-CJ15', [], [PhysicsStream], ['Primary:17000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j380_a10t_lcw_jes_40smcINF_j380_a10t_lcw_jes_L1SC111',   'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j380_a10t_lcw_jes_50smcINF_j380_a10t_lcw_jes_L1SC111',   'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['2j330_a10t_lcw_jes_L1SC111',                      'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['3j160',                       'L1_J75', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['3j225',                       'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['3j250',                       'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['4j25',                        'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['4j90',                        'L1_3J50', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['4j130',                       'L1_3J50', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['4j85_gsc120_boffperf_split',  'L1_3J50', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['4j85_gsc130_boffperf_split',  'L1_3J50', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j25',                        'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j45',                        'L1_4J15', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j70_L14J15',                 'L1_4J15', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j70_L14J150ETA25',           'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j70',                        'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j85',                        'L1_4J20', [], [PhysicsStream], ['Primary:17000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j90_L14J150ETA25',           'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j90',                        'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j100_L14J150ETA25',          'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j100',                       'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j90_L14J15',                 'L1_4J15', [], [PhysicsStream], ['Primary:17000', 'RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j100_L14J15',                'L1_4J15', [], [PhysicsStream], ['Primary:17000', 'RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j50_gsc70_boffperf_split_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j50_gsc70_boffperf_split',               'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j55_gsc75_boffperf_split_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j55_gsc75_boffperf_split',               'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j60_gsc85_boffperf_split',               'L1_4J20', [], [PhysicsStream], ['Primary:17000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j60_gsc90_boffperf_split_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j60_gsc90_boffperf_split',               'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j85_gsc100_boffperf_split_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j85_gsc100_boffperf_split',               'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j60_gsc90_boffperf_split_L14J15',         'L1_4J15', [], [PhysicsStream], ['Primary:17000', 'RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j65_0eta240_L14J15',         'L1_4J15', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j65_0eta240_L14J150ETA25',   'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j65_0eta240',                'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j70_0eta240',                'L1_4J20', [], [PhysicsStream], ['Primary:17000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j75_0eta240_L14J150ETA25',   'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j75_0eta240',                'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j85_0eta240_L14J150ETA25',   'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j85_0eta240',                'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j75_0eta240_L14J15',         'L1_4J15', [], [PhysicsStream], ['Primary:17000', 'RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j85_0eta240_L14J15',         'L1_4J15', [], [PhysicsStream], ['Primary:17000', 'RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j50_gsc65_boffperf_split_0eta240_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j50_gsc65_boffperf_split_0eta240',               'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j50_gsc70_boffperf_split_0eta240',               'L1_4J20', [], [PhysicsStream], ['Primary:17000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j55_gsc75_boffperf_split_0eta240_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j55_gsc75_boffperf_split_0eta240',               'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j55_gsc75_boffperf_split_0eta240_L14J15', 'L1_4J15', [], [PhysicsStream], ['Primary:17000', 'RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j25',                        'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],        
+        ['6j45',                        'L1_4J15', [], [PhysicsStream,'express'], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j60_L14J15',                 'L1_4J15', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j60_L14J150ETA25',           'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j60',                        'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j70',                        'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j85_L14J150ETA25',           'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j85',                        'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j85_L14J15',                 'L1_4J15', [], [PhysicsStream], ['Primary:17000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j45_gsc60_boffperf_split_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j45_gsc60_boffperf_split',               'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j45_gsc60_boffperf_split_L15J150ETA25',  'L1_5J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j50_gsc65_boffperf_split_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j50_gsc65_boffperf_split',               'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j50_gsc65_boffperf_split_L15J150ETA25',  'L1_5J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j50_gsc70_boffperf_split',               'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j50_gsc70_boffperf_split_L15J150ETA25',  'L1_5J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j60_gsc85_boffperf_split',               'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j60_gsc85_boffperf_split_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j60_gsc85_boffperf_split_L15J150ETA25',  'L1_5J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j60_gsc85_boffperf_split_L14J15', 'L1_4J15', [], [PhysicsStream], ['Primary:17000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j45_0eta240',                'L1_4J15', [], [PhysicsStream,'express'], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j50_0eta240_L14J15',         'L1_4J15', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j50_0eta240_L14J150ETA25',   'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j50_0eta240_L14J20',         'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j50_0eta240_L15J150ETA25',   'L1_5J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j55_0eta240_L14J20',         'L1_4J20', [], [PhysicsStream], ['Primary:17000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j55_0eta240_L15J150ETA25',   'L1_5J15.0ETA25', [], [PhysicsStream], ['Primary:17000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j60_0eta240_L14J150ETA25',   'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j60_0eta240_L14J20',         'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j60_0eta240_L15J150ETA25',   'L1_5J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j60_0eta240_L14J15',              'L1_4J15', [], [PhysicsStream], ['Primary:17000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j35_gsc45_boffperf_split_0eta240_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j35_gsc50_boffperf_split_0eta240_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j35_gsc50_boffperf_split_0eta240_L14J20',        'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j35_gsc50_boffperf_split_0eta240_L15J150ETA25',  'L1_5J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j45_gsc55_boffperf_split_0eta240_L14J20',        'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j45_gsc55_boffperf_split_0eta240_L15J150ETA25',  'L1_5J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j45_gsc60_boffperf_split_0eta240_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j45_gsc60_boffperf_split_0eta240_L14J20',        'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j45_gsc60_boffperf_split_0eta240_L15J150ETA25',  'L1_5J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j45_gsc60_boffperf_split_0eta240_L14J15', 'L1_4J15', [], [PhysicsStream], ['Primary:17000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j45_subjes',                 'L1_4J15', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j45_jes',                    'L1_4J15', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j45_sub',                    'L1_4J15', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j45_nojcalib',               'L1_4J15', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j45_lcw',                    'L1_4J15', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j45_lcw_subjes',             'L1_4J15', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j45_lcw_jes',                'L1_4J15', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j45_lcw_sub',                'L1_4J15', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j45_lcw_nojcalib',           'L1_4J15', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j25',                        'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],      
+        ['7j45_L14J20',                 'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j45',                        'L1_6J15', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j50_L14J150ETA25',           'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j50_L14J20',                 'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j50',                        'L1_6J15', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j50_L14J15',                              'L1_4J15', [], [PhysicsStream], ['Primary:17000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j35_gsc45_boffperf_split_L14J20',                'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j35_gsc45_boffperf_split_L15J150ETA25',          'L1_5J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j35_gsc50_boffperf_split_L14J150ETA25',          'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j35_gsc50_boffperf_split_L14J20',                'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j35_gsc50_boffperf_split_L15J150ETA25',          'L1_5J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j35_gsc50_boffperf_split_L14J15',         'L1_4J15', [], [PhysicsStream], ['Primary:17000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j45_0eta240_L14J20',         'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j45_0eta240_L15J150ETA25',   'L1_5J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j45_0eta240',                'L1_6J15', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j35_gsc45_boffperf_split_0eta240_L14J20',        'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j35_gsc45_boffperf_split_0eta240_L15J150ETA25',  'L1_5J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j35_gsc50_boffperf_split_0eta240_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j35_gsc50_boffperf_split_0eta240_L14J20',        'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j35_gsc50_boffperf_split_0eta240_L15J150ETA25',  'L1_5J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j35_gsc50_boffperf_split_0eta240_L14J15', 'L1_4J15', [], [PhysicsStream], ['Primary:17000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['10j40_L14J20',                'L1_4J20' , [], [PhysicsStream], ['Primary:20000','RATE:MultiJet', 'BW:Jet'], -1],
+        ['10j40_L16J15',                'L1_6J15' , [], [PhysicsStream], ['Primary:20000','RATE:MultiJet', 'BW:Jet'], -1],
+        ['ht700_L1J75',     'L1_J75', [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1], 
+        ['ht1200_L1J100',   'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet', 'BW:Jet'], -1],
+        ['ht1400_L1J100',   'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet', 'BW:Jet'], -1],
+        ['j0_1i2c300m500TLA',               'L1_J100',  [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
+        ['j0_0i1c500m900TLA',               'L1_J100',  [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
+        ['j0_1i2c200m8000TLA',              'L1_J100',  [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
+        ['2j220_j120',                      'L1_J100', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['2j250_j120',                      'L1_J100', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['2j275_j140',                      'L1_J100', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['j80_0eta240_2j60_320eta490',      'L1_J40.0ETA25_2J15.31ETA49', [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
+        ['2j225_gsc250_boffperf_split_0eta240_j85_gsc140_boffperf_split_0eta240',      'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['j80_0eta240_j60_j45_320eta490',   'L1_J40.0ETA25_2J25_J20.31ETA49', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['ht300_2j40_0eta490_invm700_L1HT150-J20s5.ETA31_MJJ-400-CF','L1_HT150-J20s5.ETA31_MJJ-400-CF', [], [PhysicsStream], ['RATE:MultiBJet',  'BW:BJet', 'BW:Jet'],-1,['serial',-1,[  'ht300', '2j40_0eta490_invm700']]],
+        ['j85_cleanL',          'L1_J20',  [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j85_cleanT',          'L1_J20',  [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j85_cleanLLP',        'L1_J20',  [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j70_j50_0eta490_invm1100j70_dphi20_deta45_L1MJJ-500-NFF', 'L1_MJJ-500-NFF',[], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
+        # Large-R jets with jet moment cuts - for testing JetAttrs hypo (Aug. 2018, AS)
+        ['j0_a10t_lcw_jes_subj360Iwidth',            'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j0_a10t_lcw_jes_subj360I0width5',          'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j0_a10t_lcw_jes_subj360I0ktdr5',           'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j0_a10t_lcw_jes_subj360Iktdr',             'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j0_a10t_lcw_jes_subj360Iktdr3Iwidth2',     'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1], #inclusive trigger
+        ['j0_a10t_lcw_jes_subj360IktdrI9width',      'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+
+        #ATR-19271
+        ['j0_perf_L1RD0_FILLED',   'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j15',                         'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j175',                        'L1_J50',  [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j380',                        'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j110_320eta490',              'L1_J30.31ETA49', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j260_a10_lcw_subjes_L1J75',       'L1_J75', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j420_a10t_lcw_jes_30smcINF_L1SC111',              'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j440_a10t_lcw_jes_30smcINF_L1SC111',              'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['2j330_a10t_lcw_jes_30smcINF_L1SC111',             'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['6j45_0eta240_L14J150ETA25',   'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j45_0eta240_L14J20',         'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j35_gsc45_boffperf_split_0eta240_L14J20',        'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['ht700_L1HT150-J20.ETA31',     'L1_HT150-J20.ETA31', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['ht700_L1HT150-J20s5.ETA31',   'L1_HT150-J20s5.ETA31', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['ht1000_L1HT190-J15.ETA21',    'L1_HT190-J15.ETA21', [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
+        ['ht1000_L1HT190-J15s5.ETA21',  'L1_HT190-J15s5.ETA21', [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
+			 ]
+
+
+    if TriggerFlags.doFTK():
+        TriggerFlags.JetSlice.signatures = TriggerFlags.JetSlice.signatures() + [
+        ['j0_perf_L1RD0_FILLED',   'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j0_perf_ftk_L1RD0_FILLED',   'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j0_perf_ftkrefit_L1RD0_FILLED',   'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j0_gsc0_boffperf_split_L1RD0_FILLED', 'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j0_gsc0_boffperf_split_FTK_L1RD0_FILLED', 'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j0_gsc0_boffperf_split_FTKRefit_L1RD0_FILLED', 'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ] 
+
+    TriggerFlags.BjetSlice.signatures = TriggerFlags.BjetSlice.signatures() + [
+        ['j35_boffperf_split_L1J15',  'L1_J15', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j55_boffperf_split',  'L1_J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j150_boffperf_split_L1J40', 'L1_J40', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j320_boffperf_split', 'L1_J85', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j45_gsc55_boffperf_split', 'L1_J15', [], [PhysicsStream,'express'], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j35_gsc45_boffperf_split_L1J15', 'L1_J15', [], [PhysicsStream,'express'], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j85_gsc110_boffperf_split', 'L1_J20', [], [PhysicsStream,'express'], ['RATE:SingleBJet', 'BW:BJet'], -1], 
+        ['j175_gsc225_boffperf_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j225_gsc275_boffperf_split', 'L1_J75', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j225_boffperf_split_L1J100', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j225_bmv2c1050_split_L1J100', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j225_gsc300_boffperf_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j225_gsc360_boffperf_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j225_gsc275_bmv2c1070_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j225_gsc300_bmv2c1077_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j225_gsc360_bmv2c1085_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],          
+        ['j225_gsc275_bhmv2c1070_split',        'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j225_gsc300_bhmv2c1077_split',        'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],         
+        ['j225_gsc360_bhmv2c1085_split',        'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],         
+        ['j50_gsc65_boffperf_split_3j50_gsc65_boffperf_split',      'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+        ['j50_gsc65_bmv2c1040_split_3j50_gsc65_boffperf_split',      'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+        ['j55_gsc75_boffperf_split_3j55_gsc75_boffperf_split',        'L1_4J20',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j60_gsc85_boffperf_split_3j60_gsc85_boffperf_split',        'L1_4J20',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j150_gsc175_boffperf_split_j45_gsc60_boffperf_split',   'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j150_gsc175_bmv2c1070_split_j45_gsc60_bmv2c1070_split', 'L1_J100', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['j150_boffperf_split_j50_boffperf_split_L1J100', 'L1_J100', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['j150_bmv2c1050_split_j50_bmv2c1050_split_L1J100', 'L1_J100', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+
+        ['j110_gsc150_boffperf_split_2j45_gsc55_bmv2c1077_split_L1J85_3J30', 'L1_J85_3J30', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['j110_gsc150_boffperf_split_2j45_gsc55_boffperf_split_L1J85_3J30', 'L1_J85_3J30', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['2j55_gsc75_bmv2c1050_split_j55_gsc75_boffperf_split',        'L1_3J25.0ETA23', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['2j55_gsc75_bmv2c1060_split_j55_gsc75_boffperf_split',        'L1_3J25.0ETA23', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['2j60_gsc85_bmv2c1070_split_j60_gsc85_boffperf_split',        'L1_3J25.0ETA23', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['2j60_gsc85_bmv2c1077_split_j60_gsc85_boffperf_split',        'L1_3J25.0ETA23', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['2j35_boffperf_split_2j35_L14J15.0ETA25',            'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet',  'BW:BJet'], -1],
+        ['2j35_bmv2c1040_split_2j35_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiBJet', 'BW:BJet'], -1],
+        ['2j35_bmv2c1050_split_2j35_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiBJet', 'BW:BJet'], -1],
+        ['2j35_gsc45_bmv2c1060_split_2j35_gsc45_boffperf_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['2j45_gsc55_bmv2c1070_split_2j45_gsc55_boffperf_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['2j35_bmv2c1050_split_3j35', 'L1_5J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiBJet', 'BW:BJet'], -1],
+        ['2j35_gsc45_bmv2c1070_split_3j35_gsc45_boffperf_split',                 'L1_5J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['3j65_boffperf_split_L13J35.0ETA23',        'L1_3J35.0ETA23', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['3j50_gsc65_boffperf_split_L13J35.0ETA23',  'L1_3J35.0ETA23', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+
+			 ]
+
+    if TriggerFlags.doFTK():
+        TriggerFlags.BjetSlice.signatures = TriggerFlags.BjetSlice.signatures() + [
+           ['j35_boffperf_split_FTK_L1J15_FTK', 'L1_J15_FTK', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+           ['j35_boffperf_split_FTKVtx_L1J15_FTK', 'L1_J15_FTK', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+           ['j35_boffperf_split_FTKRefit_L1J15_FTK', 'L1_J15_FTK', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+
+           ['j150_boffperf_split_FTK_L1J40_FTK', 'L1_J40_FTK', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+           ['j150_boffperf_split_FTKVtx_L1J40_FTK', 'L1_J40_FTK', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+           ['j150_boffperf_split_FTKRefit_L1J40_FTK', 'L1_J40_FTK', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+
+           ['j225_boffperf_split_FTK_L1J100_FTK',    'L1_J100_FTK', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+           ['j225_boffperf_split_FTKVtx_L1J100_FTK',    'L1_J100_FTK', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+           ['j225_boffperf_split_FTKRefit_L1J100_FTK',    'L1_J100_FTK', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+
+           ['j225_bmv2c1050_split_FTK_L1J100_FTK', 'L1_J100_FTK', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+           ['j225_bmv2c1050_split_FTKVtx_L1J100_FTK', 'L1_J100_FTK', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+           ['j225_bmv2c1050_split_FTKRefit_L1J100_FTK', 'L1_J100_FTK', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+
+           ['j150_boffperf_split_j50_boffperf_split_FTK_L1J100_FTK', 'L1_J100_FTK', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+           ['j150_boffperf_split_j50_boffperf_split_FTKVtx_L1J100_FTK', 'L1_J100_FTK', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+           ['j150_boffperf_split_j50_boffperf_split_FTKRefit_L1J100_FTK', 'L1_J100_FTK', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+
+           ['j150_bmv2c1050_split_j50_bmv2c1050_split_FTK_L1J100_FTK', 'L1_J100_FTK', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+           ['j150_bmv2c1050_split_j50_bmv2c1050_split_FTKVtx_L1J100_FTK', 'L1_J100_FTK', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+           ['j150_bmv2c1050_split_j50_bmv2c1050_split_FTKRefit_L1J100_FTK', 'L1_J100_FTK', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+
+           ['2j35_boffperf_split_FTK_2j35_L14J15.0ETA25_FTK', 'L1_4J15.0ETA25_FTK', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+           ['2j35_boffperf_split_FTKVtx_2j35_L14J15.0ETA25_FTK', 'L1_4J15.0ETA25_FTK', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+           ['2j35_boffperf_split_FTKRefit_2j35_L14J15.0ETA25_FTK', 'L1_4J15.0ETA25_FTK', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+
+           ['2j35_bmv2c1050_split_FTK_2j35_L14J15.0ETA25_FTK', 'L1_4J15.0ETA25_FTK', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+           ['2j35_bmv2c1050_split_FTKVtx_2j35_L14J15.0ETA25_FTK', 'L1_4J15.0ETA25_FTK', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+           ['2j35_bmv2c1050_split_FTKRefit_2j35_L14J15.0ETA25_FTK', 'L1_4J15.0ETA25_FTK', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+
+]
+
+
+    TriggerFlags.METSlice.signatures = TriggerFlags.METSlice.signatures() + [
+        ['xe0noL1_l2fsperf',         '',        [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe0noL1_l2fsperf_tc_lcw',  '',        [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe0noL1_l2fsperf_tc_em',   '',        [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe0noL1_l2fsperf_mht',     '',        [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe0noL1_l2fsperf_mht_em',     '',        [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe0noL1_l2fsperf_pufit',   '',        [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe50', 'L1_XE35',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe110_pufit_xe70_L1XE50', 'L1_XE50', ['L1_XE50','L1_XE50'], [PhysicsStream], ['Primary:20000','RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe110_pufit','x70_L1XE50'] ]],
+        ['xe110_pufit_xe75_L1XE50', 'L1_XE50', ['L1_XE50','L1_XE50'], [PhysicsStream], ['Primary:20000','RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe110_pufit','x75_L1XE50'] ]],
+        ['xe110_pufit_xe65_L1XE55', 'L1_XE55', ['L1_XE55','L1_XE55'], [PhysicsStream], ['Primary:20000','RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe110_pufit','x65_L1XE55'] ]],
+        ['xe110_pufit_xe70_L1XE55', 'L1_XE55', ['L1_XE55','L1_XE55'], [PhysicsStream], ['Primary:20000','RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe110_pufit','x70_L1XE55'] ]],
+        ['xe110_pufit_xe75_L1XE55', 'L1_XE55', ['L1_XE55','L1_XE55'], [PhysicsStream], ['Primary:20000','RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe110_pufit','x75_L1XE55'] ]],
+        ['xe110_pufit_xe65_L1XE60', 'L1_XE60', ['L1_XE60','L1_XE60'], [PhysicsStream], ['Primary:20000','RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe110_pufit','x65_L1XE60'] ]],
+        ['xe110_pufit_xe70_L1XE60', 'L1_XE60', ['L1_XE60','L1_XE60'], [PhysicsStream], ['Primary:20000','RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe110_pufit','x70_L1XE60'] ]],
+        ['xe110_pufit_xe75_L1XE60', 'L1_XE60', ['L1_XE60','L1_XE60'], [PhysicsStream], ['Primary:20000','RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe110_pufit','x75_L1XE60'] ]],
+
+        #ATR-19270
+        ['xe100_trktc_lcw_L1XE50', 'L1_XE50',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe110_trktc_lcw_L1XE50', 'L1_XE50',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe120_trktc_lcw_L1XE50', 'L1_XE50',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe0noL1_l2fsperf_trktc_lcw', '', [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe90_pufittrack_lcw_nojcalib_xe105_pufit_xe65_L1XE50', 'L1_XE50', [], [PhysicsStream], ['RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe105_pufit_xe65_L1XE50','xe90_pufittrack_lcw_nojcalib']]],
+        #['xe0noL1_pufittrack_lcw_nojcalib_xe100_pufit_xe65',   '',        [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1, ['serial',-1,['xe100_pufit','xe65','xe0noL1_pufittrack_lcw_nojcalib']]],
+        ['xe0noL1_l2fsperf_pufittrack_lcw_nojcalib', '', [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe110_trkmht_L1XE50', 'L1_XE50', [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe0noL1_l2fsperf_trkmht', '', [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+
+]
+
+    if TriggerFlags.doFTK():
+        TriggerFlags.METSlice.signatures = TriggerFlags.METSlice.signatures() + [
+            ['xe0noL1_l2fsperf_trkmht_FTK', '', [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+            ['xe0noL1_l2fsperf_trktc_lcw_FTK', '', [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+            ['xe100_trkmht_FTK_L1XE50', 'L1_XE50', [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+            ['xe110_trkmht_FTK_L1XE50', 'L1_XE50', [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+            ['xe120_trkmht_FTK_L1XE50', 'L1_XE50', [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+            ['xe100_trktc_lcw_FTK_L1XE50', 'L1_XE50', [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+            ['xe110_trktc_lcw_FTK_L1XE50', 'L1_XE50', [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+            ['xe120_trktc_lcw_FTK_L1XE50', 'L1_XE50', [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+]
+
+       
+
+    TriggerFlags.TauSlice.signatures = TriggerFlags.TauSlice.signatures() + [
+        ['tau25_idperf_track',                     'L1_TAU12IM', [], [PhysicsStream, 'express'], ['RATE:IDMonitoring', 'BW:Tau', 'BW:ID'], -1],
+        ['tau25_idperf_tracktwo',                  'L1_TAU12IM', [], [PhysicsStream, 'express'], ['RATE:IDMonitoring', 'BW:Tau', 'BW:ID'], -1],
+        ['tau25_perf_tracktwo',                    'L1_TAU12IM', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_perf_tracktwo_L1TAU12',            'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_loose1_tracktwo',                  'L1_TAU12IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_medium1_tracktwo',                 'L1_TAU12IM', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_tight1_tracktwo',                  'L1_TAU12IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_medium1_tracktwo_L1TAU12',         'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_idperf_tracktwoEF',                      'L1_TAU12IM', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_perf_tracktwoEF',                        'L1_TAU12IM', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_medium1_tracktwoEF',                     'L1_TAU12IM', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_idperf_tracktwoEFmvaTES',                'L1_TAU12IM', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_perf_tracktwoEFmvaTES',                  'L1_TAU12IM', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_medium1NoPt_tracktwoEFmvaTES',           'L1_TAU12IM', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_medium1_tracktwoEFmvaTES',           'L1_TAU12IM', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_idperf_tracktwoMVA',                      'L1_TAU12IM', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_perf_tracktwoMVA',                        'L1_TAU12IM', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_medium1_tracktwoMVA',                        'L1_TAU12IM', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_verylooseRNN_tracktwoMVA',                'L1_TAU12IM', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_looseRNN_tracktwoMVA',                    'L1_TAU12IM', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_mediumRNN_tracktwoMVA',                   'L1_TAU12IM', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_tightRNN_tracktwoMVA',                    'L1_TAU12IM', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_verylooseRNN_tracktwo',         'L1_TAU12IM', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_looseRNN_tracktwo',             'L1_TAU12IM', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_mediumRNN_tracktwo',            'L1_TAU12IM', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_tightRNN_tracktwo',             'L1_TAU12IM', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau35_medium1_tracktwoMVA_L1TAU12IM',                        'L1_TAU12IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau35_medium1_tracktwoMVA',                        'L1_TAU20IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau60_medium1_tracktwoMVA',                        'L1_TAU40', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau80_medium1_tracktwoMVA_L1TAU60',                        'L1_TAU60', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau35_mediumRNN_tracktwoMVA_L1TAU12IM',                        'L1_TAU12IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau35_mediumRNN_tracktwoMVA',                        'L1_TAU20IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau60_mediumRNN_tracktwoMVA',                        'L1_TAU40', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau80_mediumRNN_tracktwoMVA_L1TAU60',                        'L1_TAU60', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau35_loose1_tracktwo',                  'L1_TAU20IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau35_medium1_tracktwo',                 'L1_TAU20IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau50_medium1_tracktwo_L1TAU12',         'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau60_medium1_tracktwo',                 'L1_TAU40', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau80_medium1_tracktwo',                 'L1_TAU40', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau80_medium1_tracktwo_L1TAU60',         'L1_TAU60', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau125_medium1_tracktwo',                'L1_TAU60', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau160_medium1_tracktwo',                'L1_TAU60', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau160_idperf_track_L1TAU100',           'L1_TAU100', [], [PhysicsStream, 'express'], ['RATE:IDMonitoring', 'BW:Tau', 'BW:ID'], -1],
+        ['tau200_medium1_tracktwo_L1TAU100',       'L1_TAU100', [], [PhysicsStream], ['Primary:20000','RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau200_medium1_tracktwoEF_L1TAU100',       'L1_TAU100', [], [PhysicsStream], ['Primary:20000','RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau200_mediumRNN_tracktwoMVA_L1TAU100',       'L1_TAU100', [], [PhysicsStream], ['Primary:20000','RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau160_idperf_tracktwo_L1TAU100',       'L1_TAU100', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau160_perf_tracktwo_L1TAU100',       'L1_TAU100', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau160_idperf_tracktwoEF_L1TAU100',       'L1_TAU100', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau160_perf_tracktwoEF_L1TAU100',       'L1_TAU100', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau160_idperf_tracktwoMVA_L1TAU100',       'L1_TAU100', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau160_perf_tracktwoMVA_L1TAU100',       'L1_TAU100', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau35_perf_tracktwo_tau25_perf_tracktwo', 'L1_TAU20IM_2TAU12IM' , ['L1_TAU20IM','L1_TAU12IM'],[PhysicsStream, 'express'], ['RATE:MultiTau','BW:Tau'], -1],
+        ['tau35_loose1_tracktwo_tau25_loose1_tracktwo',   'L1_TAU20IM_2TAU12IM_J25_2J20_3J12',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_loose1_tracktwo","tau25_loose1_tracktwo"]]],
+        ['tau35_medium1_tracktwo_tau25_medium1_tracktwo',   'L1_TAU20IM_2TAU12IM_J25_2J20_3J12',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream, 'express'], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo","tau25_medium1_tracktwo"]]],
+        ['tau35_medium1_tracktwoEF_tau25_medium1_tracktwoEF',   'L1_TAU20IM_2TAU12IM_J25_2J20_3J12',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwoEF","tau25_medium1_tracktwoEF"]]],
+        ['tau35_mediumRNN_tracktwoMVA_tau25_mediumRNN_tracktwoMVA',   'L1_TAU20IM_2TAU12IM_J25_2J20_3J12',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_mediumRNN_tracktwoMVA","tau25_mediumRNN_tracktwoMVA"]]],
+        ['tau35_tight1_tracktwo_tau25_tight1_tracktwo',   'L1_TAU20IM_2TAU12IM_J25_2J20_3J12',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_tight1_tracktwo","tau25_tight1_tracktwo"]]],
+        ['tau35_medium1_tracktwo_tau25_medium1_tracktwo_L1TAU20IM_2TAU12IM',   'L1_TAU20IM_2TAU12IM',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo","tau25_medium1_tracktwo"]]],
+        ['tau35_tight1_tracktwo_tau25_tight1_tracktwo_L1DR-TAU20ITAU12I-J25',   'L1_DR-TAU20ITAU12I-J25',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream], ['Primary:20000','RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_tight1_tracktwo","tau25_tight1_tracktwo"]]],
+        ['tau35_tight1_tracktwo_tau25_tight1_tracktwo_03dR30',   'L1_TAU20IM_2TAU12IM_J25_2J20_3J12',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream, 'express'], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_tight1_tracktwo","tau25_tight1_tracktwo"]]],
+        ['tau35_tight1_tracktwo_tau25_tight1_tracktwo_03dR30_L1DR-TAU20ITAU12I-J25',   'L1_DR-TAU20ITAU12I-J25',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream], ['Primary:20000','RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_tight1_tracktwo","tau25_tight1_tracktwo"]]],
+        ['tau80_medium1_tracktwo_L1TAU60_tau50_medium1_tracktwo_L1TAU12', 'L1_TAU60',['L1_TAU60','L1_TAU12'], [PhysicsStream], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau80_medium1_tracktwo_L1TAU60","tau50_medium1_tracktwo_L1TAU12"]]],
+        ['tau125_medium1_tracktwo_tau50_medium1_tracktwo_L1TAU12', 'L1_TAU60',['L1_TAU60','L1_TAU12'], [PhysicsStream], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau125_medium1_tracktwo","tau50_medium1_tracktwo_L1TAU12"]]],
+        ['tau35_perf_tracktwo_tau25_perf_tracktwo_ditauM', 'L1_TAU20IM_2TAU12IM' , ['L1_TAU20IM','L1_TAU12IM'],[PhysicsStream, 'express'], ['RATE:MultiTau','BW:Tau'], -1],
+        ['tau25_singlepion_tracktwo',                    'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_dikaonmass_tracktwo',                    'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_dipion1_tracktwo',               'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_dipion2_tracktwo',               'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_kaonpi1_tracktwo',               'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_kaonpi2_tracktwo',               'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau35_medium1_tracktwo_L1TAU12IM',                  'L1_TAU12IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau35_medium1_tracktwoEF_L1TAU12IM',                  'L1_TAU12IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau35_medium1_tracktwoEF',                  'L1_TAU20IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau60_medium1_tracktwoEF',                  'L1_TAU40', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau80_medium1_tracktwoEF_L1TAU60',                  'L1_TAU60', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau80_tightRNN_tracktwoMVA_L1TAU60',                  'L1_TAU60', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau60_tightRNN_tracktwoMVA',                  'L1_TAU40', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau40_tightRNN_tracktwoMVA',                  'L1_TAU20IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau35_tightRNN_tracktwoMVA',                  'L1_TAU20IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau35_tightRNN_tracktwoMVA_L1TAU12IM',                  'L1_TAU12IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_tightRNN_tracktwoMVA_L1TAU12',                  'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau35_tight1_tracktwoEF_tau25_tight1_tracktwoEF_03dR30_L1DR-TAU20ITAU12I-J25',   'L1_DR-TAU20ITAU12I-J25',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream], ['Primary:20000','RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_tight1_tracktwoEF","tau25_tight1_tracktwoEF"]]],
+        ['tau35_tight1_tracktwoEF_tau25_tight1_tracktwoEF_L1DR-TAU20ITAU12I-J25',   'L1_DR-TAU20ITAU12I-J25',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream], ['Primary:20000','RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_tight1_tracktwoEF","tau25_tight1_tracktwoEF"]]],
+
+        #ATR-19269
+        ['tau0_perf_ptonly_L1TAU12',               'L1_TAU12', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau0_perf_ptonly_L1TAU12IM', 'L1_TAU12IM', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau0_perf_ptonly_L1TAU8', 'L1_TAU8', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
+			 ]
+
+    if TriggerFlags.doFTK():
+            TriggerFlags.TauSlice.signatures = TriggerFlags.TauSlice.signatures() + []
+
+
+    TriggerFlags.EgammaSlice.signatures = TriggerFlags.EgammaSlice.signatures() + [
+        ['e26_lhtight_idperf',        'L1_EM22VHI',    [], [PhysicsStream], ['RATE:IDMonitoring', 'BW:Egamma', 'BW:ID'],-1],
+        ['e28_lhtight_idperf',        'L1_EM24VHI',    [], [PhysicsStream, 'express'], ['RATE:IDMonitoring', 'BW:Egamma', 'BW:ID'],-1],
+        ['e28_lhtight_idperf_L1EM24VHIM',        'L1_EM24VHIM',    [], [PhysicsStream, 'express'], ['RATE:IDMonitoring', 'BW:Egamma', 'BW:ID'],-1],
+        ['g10_loose',                            'L1_EM7',  [], [PhysicsStream,'express'], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g20_loose_L1EM15',                     'L1_EM15', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g10_etcut',                     'L1_EM7',   [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g20_etcut_L1EM12',              'L1_EM12',  [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g200_etcut',                    'L1_EM22VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1], 
+        ['g250_etcut',                    'L1_EM22VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1], 
+        ['g300_etcut_L1EM24VHI',          'L1_EM24VHI', [], [PhysicsStream], ['Primary:20000','RATE:SinglePhoton', 'BW:Egamma'],-1], 
+        ['g300_etcut_L1EM24VHIM',          'L1_EM24VHIM', [], [PhysicsStream], ['Primary:20000','RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g22_tight',                             'L1_EM15VH', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g25_medium_L1EM22VHI', 'L1_EM22VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g25_medium_L1EM24VHI', 'L1_EM24VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g25_medium_L1EM24VHIM', 'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g35_medium_L1EM24VHI', 'L1_EM24VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g35_loose_L1EM22VHI', 'L1_EM22VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g45_tight_L1EM22VHI', 'L1_EM22VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g35_loose_L1EM24VHI', 'L1_EM24VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['e140_etcut',  'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e140_etcut_L1EM24VHIM',  'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e140_lhvloose_nod0', 'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+	['e160_etcut',  'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e160_etcut_L1EM24VHIM',  'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e180_etcut',  'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e180_etcut_L1EM24VHIM',  'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['g0_hiptrt_L1EM24VHI',                 'L1_EM24VHI', [], [PhysicsStream], ['Primary:20000','RATE:SinglePhoton', 'BW:Egamma'], -1],
+        ['g0_hiptrt_L1EM24VHIM',                'L1_EM24VHIM', [], [PhysicsStream], ['Primary:20000','RATE:SinglePhoton', 'BW:Egamma'], -1],
+        ['g15_loose_L1EM7',               'L1_EM7',   [], [PhysicsStream,'express'], ['RATE:SinglePhoton', 'BW:Egamma'], -1], 
+        ['g20_loose_L1EM12',              'L1_EM12',  [], [PhysicsStream,'express'], ['RATE:SinglePhoton', 'BW:Egamma'], -1], # pass through
+        ['g40_loose_L1EM15',              'L1_EM15',  [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'], -1], 
+        ['g45_loose_L1EM15',              'L1_EM15',  [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'], -1], 
+        ['g50_loose_L1EM15',              'L1_EM15',  [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'], -1], 
+        ['g80_loose',                     'L1_EM24VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'], -1], 
+        ['g100_loose',                    'L1_EM24VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'], -1], 
+        ['g25_loose_L1EM15',              'L1_EM15',  [], [PhysicsStream,'express'], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g35_loose_L1EM15',              'L1_EM15',  [], [PhysicsStream,'express'], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g60_loose',                     'L1_EM24VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g70_loose',                     'L1_EM24VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g6_tight_icalotight',                            'L1_EM3',  [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g10_medium',                    'L1_EM7',   [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g15_loose_L1EM3',               'L1_EM3',   [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g20_loose',                     'L1_EM15VH',[], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g40_tight',                     'L1_EM20VH', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g45_tight',                     'L1_EM20VHI',[], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g50_loose',                     'L1_EM15VH', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g60_loose_L1EM15VH',            'L1_EM15VH', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+	['g25_tight_L1EM20VH',            'L1_EM20VH',[], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+	['g15_loose_L1EM8VH',             'L1_EM8VH', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['2g20_tight_icalotight_L12EM15VHI',            'L1_2EM15VHI', [], [PhysicsStream], ['Primary:20000','RATE:MultiPhoton', 'BW:Egamma'],-1],
+        ['2g22_tight_icalovloose_L12EM15VHI',           'L1_2EM15VHI', [], [PhysicsStream], ['Primary:20000','RATE:MultiPhoton', 'BW:Egamma'],-1],
+        ['2g22_tight_icalovloose',           'L1_2EM15VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1],
+        ['2g22_tight_icalotight_L12EM15VHI',            'L1_2EM15VHI', [], [PhysicsStream], ['Primary:20000','RATE:MultiPhoton', 'BW:Egamma'],-1],
+        ['2g22_tight_icalotight',            'L1_2EM15VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1],
+        ['2g50_loose',                              'L1_2EM15VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1], 
+        ['2g60_loose_L12EM15VH',                    'L1_2EM15VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1],  
+        ['2g60_loose_L12EM20VH',                    'L1_2EM20VH', [], [PhysicsStream], ['Primary:20000','RATE:MultiPhoton', 'BW:Egamma'],-1], 
+        ['g50_loose_L1EM20VH',                     'L1_EM20VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1], 
+        ['g60_loose_L1EM20VH',                     'L1_EM20VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1], 
+        ['2g22_tight',                              'L1_2EM15VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1],
+        ['3g20_loose',                              'L1_2EM15VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1], 
+        ['2g25_loose_g20_loose',                    'L1_2EM20VH', [], [PhysicsStream], ['Primary:20000','RATE:MultiPhoton', 'BW:Egamma'],-1], 
+        ['3g25_loose',                    'L1_2EM20VH', [], [PhysicsStream], ['Primary:20000','RATE:MultiPhoton', 'BW:Egamma'],-1],
+        ['2g20_loose_L12EM15',                      'L1_2EM15', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1], 
+        ['2g20_loose',                   'L1_2EM15VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1], 
+        ['2g10_loose',                           'L1_2EM7', [], [PhysicsStream,'express'], ['RATE:MultiPhoton', 'BW:Egamma'],-1],
+        ['e17_lhloose_cutd0dphideta_L1EM15',     'L1_EM15', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e17_lhloose_nod0_L1EM15',              'L1_EM15', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e17_lhloose_nodeta_L1EM15',            'L1_EM15', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e17_lhloose_nodphires_L1EM15',         'L1_EM15', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e26_lhvloose_nod0_L1EM22VH',                'L1_EM22VH',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e28_lhvloose_nod0_L1EM22VH',                'L1_EM22VH',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e26_lhmedium_nod0_L1EM22VH',                'L1_EM22VH',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e28_lhmedium_nod0_L1EM22VH',                'L1_EM22VH',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e9_lhvloose_nod0',                          'L1_EM3',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e9_lhvloose_nod0_L1EM7',                    'L1_EM7',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e9_lhvloose_nod0_L1EM8VH',                  'L1_EM8VH',  [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e28_lhtight_nod0_L1EM24VHIM_e15_etcut_L1EM7_Zee', 'L1_EM24VHIM',  ['L1_EM24VHIM','L1_EM7'], [PhysicsStream], ['Primary:20000','RATE:MultiElectron', 'BW:Egamma'],-1],
+        ['e5_lhtight_nod0_e4_etcut',         'L1_2EM3',      [], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1],
+        ['e5_lhtight_nod0_e4_etcut_Jpsiee',  'L1_2EM3',      [], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1],
+        ['e9_lhtight_nod0_e4_etcut_Jpsiee_L1JPSI-1M5-EM7',   'L1_JPSI-1M5-EM7',  ['L1_EM7','L1_EM3'],  [PhysicsStream, 'express'], ['RATE:MultiElectron', 'BW:Egamma'],-1, True],
+        ['e5_lhtight_nod0_e9_etcut_Jpsiee_L1JPSI-1M5-EM7',   'L1_JPSI-1M5-EM7',  ['L1_EM3','L1_EM7'],  [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1, True],
+        ['e14_lhtight_nod0_e4_etcut_Jpsiee_L1JPSI-1M5-EM12', 'L1_JPSI-1M5-EM12', ['L1_EM12','L1_EM3'], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1, True],
+        ['e5_lhtight_nod0_e14_etcut_Jpsiee_L1JPSI-1M5-EM12', 'L1_JPSI-1M5-EM12', ['L1_EM3','L1_EM12'], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1, True],
+        ['e5_lhloose_idperf',                   'L1_EM3',       [], [PhysicsStream], ['RATE:IDMonitoring', 'BW:Egamma', 'BW:ID'],-1],
+        ['e5_lhmedium_nod0',  'L1_EM3', ['L1_EM3','',''], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e5_lhtight_idperf',                     'L1_EM3',       [], [PhysicsStream], ['RATE:IDMonitoring', 'BW:Egamma', 'BW:ID'],-1],
+        ['e10_lhtight_idperf',                     'L1_EM7',       [], [PhysicsStream], ['RATE:IDMonitoring', 'BW:Egamma', 'BW:ID'],-1],
+        ['e24_lhmedium_idperf_L1EM20VH',        'L1_EM20VH',    [], [PhysicsStream], ['RATE:IDMonitoring', 'BW:Egamma', 'BW:ID'],-1],
+        ['e17_lhmedium_nod0_L1EM15',                    'L1_EM15',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e24_lhmedium_L1EM18VHI',                'L1_EM18VHI',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['g140_tight',        'L1_EM24VHI', [], [PhysicsStream], ['Primary:20000','RATE:SinglePhoton','BW:Egamma'],-1],
+        ['g140_tight_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['Primary:20000','RATE:SinglePhoton','BW:Egamma'],-1],
+        ['g160_loose',        'L1_EM24VHI', [], [PhysicsStream], ['Primary:17000','RATE:SinglePhoton','BW:Egamma'],-1],
+        ['g180_loose',        'L1_EM24VHI', [], [PhysicsStream], ['Primary:17000','RATE:SinglePhoton','BW:Egamma'],-1],
+        ['g200_loose',        'L1_EM24VHI', [], [PhysicsStream, 'express'], ['Primary:20000','RATE:SinglePhoton','BW:Egamma'],-1],
+        ['g200_loose_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['Primary:20000','RATE:SinglePhoton','BW:Egamma'],-1],
+        ['2e17_lhloose_nod0_L12EM15',    									'L1_2EM15',     [], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1 ],
+        ['e5_lhloose_nod0',             									'L1_EM3',       [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1 ],
+        ['e5_lhloose_nod0_idperf',       									'L1_EM3',       [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1 ],
+        ['e10_lhvloose_nod0_L1EM7',       								'L1_EM7',       [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1 ],
+        ['e15_lhvloose_nod0_L1EM7',       								'L1_EM7',       [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1 ],
+        ['e20_lhvloose_nod0_L1EM12',       								'L1_EM12',      [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1 ],
+        ['e25_lhvloose_nod0_L1EM15',  										'L1_EM15',	    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1 ],
+        ['e30_lhvloose_nod0_L1EM15',  										'L1_EM15',	    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1 ],
+        ['e40_lhvloose_nod0_L1EM15',  										'L1_EM15',	    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1 ],
+        ['e50_lhvloose_nod0_L1EM15',  										'L1_EM15',	    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1 ],
+        ['e70_lhvloose_nod0',  														'L1_EM24VHI',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1 ],
+        ['e80_lhvloose_nod0',  														'L1_EM24VHI',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1 ],
+        ['e100_lhvloose_nod0', 														'L1_EM24VHI',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1 ],
+        ['e120_lhvloose_nod0', 														'L1_EM24VHI',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1 ],
+        ['e80_lhmedium_nod0',              'L1_EM22VHI',   [], [PhysicsStream], ['Primary:17000','RATE:SingleElectron', 'BW:Egamma'],-1 ],
+        ['e80_lhmedium_nod0_L1EM24VHI',    'L1_EM24VHI',   [], [PhysicsStream], ['Primary:20000','RATE:SingleElectron', 'BW:Egamma'],-1 ],
+        ['e5_etcut',                             'L1_EM3',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
+        ['e10_etcut_L1EM7',                      'L1_EM7',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
+        ['e15_etcut_L1EM7',                      'L1_EM7',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
+        ['e20_etcut_L1EM12',                     'L1_EM12',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],         
+        ['e25_etcut_L1EM15',                     'L1_EM15',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
+        ['e30_etcut_L1EM15',                     'L1_EM15',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
+        ['e40_etcut_L1EM15',                     'L1_EM15',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
+        ['e50_etcut_L1EM15',                     'L1_EM15',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
+        ['e60_etcut',                            'L1_EM24VHI',  [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
+        ['e70_etcut',                            'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e80_etcut',                            'L1_EM24VHI',  [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
+        ['e100_etcut',                           'L1_EM24VHI',  [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
+        ['e120_etcut',                           'L1_EM24VHI',  [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
+        ['e200_etcut',                           'L1_EM24VHI',  [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
+	['e5_lhvloose_nod0',                         'L1_EM3',       [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
+        ['e12_lhvloose_nod0_L1EM10VH',               'L1_EM10VH',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
+        ['e17_lhvloose_nod0',                        'L1_EM15VH',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
+	['e20_lhvloose_nod0',                        'L1_EM15VH',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
+        ['e40_lhvloose_nod0',                       'L1_EM20VH',      [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
+        ['e60_lhvloose_nod0',                        'L1_EM22VHI',     [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
+        ['e24_lhmedium_nod0_L1EM18VHI',            'L1_EM18VHI',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e24_lhtight_nod0_L1EM20VH',                 'L1_EM20VH',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
+	['e7_lhmedium_nod0',                           'L1_EM3',     [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],        
+	['e9_lhloose_nod0',                           'L1_EM7',     [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+	['e9_lhmedium_nod0',                          'L1_EM7',     [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e12_lhmedium_nod0',                        'L1_EM8VH',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e17_lhmedium_nod0',                         'L1_EM15VH',  [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e17_lhmedium_nod0_ivarloose_L1EM15VHI',     'L1_EM15VHI',  [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
+        ['e20_lhmedium_nod0',                         'L1_EM15VH',  [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e24_lhmedium_nod0_L1EM15VH',                'L1_EM15VH',  [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e60_lhloose_nod0',                          'L1_EM22VHI',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e70_lhloose_nod0',                          'L1_EM22VHI',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e80_lhloose_nod0',                          'L1_EM22VHI',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e80_lhloose_nod0_L1EM24VHI',                          'L1_EM24VHI',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e5_lhtight_nod0',                           'L1_EM3',     [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+				['e5_lhtight_nod0_e4_etcut_Jpsiee_L1RD0_FILLED',       'L1_RD0_FILLED',      ['L1_EM3','L1_EM3'],  [PhysicsStream, 'express'], ['RATE:MultiElectron', 'BW:Egamma'],-1, True],
+        ['e9_lhtight_nod0',                           'L1_EM7',     [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e14_lhtight_nod0',                          'L1_EM12',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e26_lhmedium_nod0',              'L1_EM22VHI',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e12_lhloose_cutd0dphideta_L1EM10VH',   'L1_EM10VH',  [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e12_lhloose_nod0_L1EM10VH',                 'L1_EM10VH',  [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e12_lhloose_nodeta_L1EM10VH',          'L1_EM10VH',  [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e12_lhloose_nodphires_L1EM10VH',       'L1_EM10VH',  [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e12_lhloose_nod0',                          'L1_EM8VH',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e17_lhloose_cutd0dphideta',            'L1_EM15VH',  [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['g25_loose',                     'L1_EM15VH',[], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g25_medium',                    'L1_EM15VH',[], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g35_loose',                     'L1_EM15VH',[], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g35_medium',                    'L1_EM15VH',[], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g24_loose',                     'L1_EM20VH',[], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['2e19_lhvloose_nod0',         'L1_2EM15VHI', [], [PhysicsStream], ['Primary:20000','RATE:MultiElectron', 'BW:Egamma'],-1],
+        ['e24_lhloose_nod0_2e12_lhloose_nod0_L1EM20VH_3EM10VH',   'L1_EM20VH_3EM10VH', ['L1_EM20VH','L1_3EM10VH'], [PhysicsStream], ['Primary:20000','RATE:MultiElectron', 'BW:Egamma'],-1],
+        ['e24_lhmedium_nod0_2g12_medium',                         'L1_EM20VH_3EM10VH', ['L1_EM20VH','L1_3EM10VH'], [PhysicsStream], ['Primary:20000','RATE:ElectronPhoton', 'BW:Egamma'],-1,['parallel',-1,[] ]],
+        ['g25_medium_L1EM20VH',           'L1_EM20VH',  [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g35_medium_L1EM20VH',                  'L1_EM20VH', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g35_loose_L1EM20VH',            'L1_EM20VH',  [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['e24_lhmedium_nod0_L1EM15VH_g25_medium',  'L1_2EM15VH', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]], 
+        ['e20_lhmedium_nod0_g35_loose',            'L1_2EM15VH', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]], 
+        ['g35_loose_g25_loose_L12EM20VH',            'L1_2EM20VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1],
+        ['e24_lhmedium_nod0_L1EM20VH',           'L1_EM20VH', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e28_lhtight_nod0',                  'L1_EM24VHI', [], [PhysicsStream], ['Primary:17000','RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e28_lhtight_nod0_ivarloose',        'L1_EM24VHI', [], [PhysicsStream,'express'], ['Primary:20000','RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e28_lhtight_nod0_ivarloose_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['Primary:20000','RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e28_lhtight_nod0_ivarloose_L1EM22VHI',  'L1_EM22VHI', [], [PhysicsStream], ['Primary:17000','RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e250_etcut',                           'L1_EM24VHI',  [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e300_etcut_L1EM24VHIM',                 'L1_EM24VHIM',  [], [PhysicsStream], ['Primary:20000','RATE:SingleElectron', 'BW:Egamma'],-1], 
+        ['e60_lhmedium_nod0_L1EM24VHI', 'L1_EM24VHI', [], [PhysicsStream], ['Primary:20000','RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e60_lhmedium_nod0_L1EM24VHIM', 'L1_EM24VHIM', [], [PhysicsStream], ['Primary:20000','RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e140_lhloose_nod0_L1EM24VHI', 'L1_EM24VHI', [], [PhysicsStream], ['Primary:20000','RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e140_lhloose_nod0_L1EM24VHIM', 'L1_EM24VHIM', [], [PhysicsStream], ['Primary:20000','RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e32_lhtight_nod0_ivarloose',        'L1_EM24VHI', [], [PhysicsStream], ['Primary:20000','RATE:SingleElectron', 'BW:Egamma'],-1],  
+        ['e24_lhvloose_nod0_L1EM20VH',                'L1_EM20VH',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e26_lhvloose_nod0',        'L1_EM22VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e28_lhmedium_nod0_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e80_lhmedium_nod0_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['Primary:20000','RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e17_lhvloose_nod0_L1EM15VHI',        'L1_EM15VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e19_lhvloose_nod0',        'L1_EM15VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['g20_tight_L1EM15VHI',                     'L1_EM15VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g20_tight_icalovloose_L1EM15VHI',                     'L1_EM15VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g20_tight_icalotight_L1EM15VHI',                     'L1_EM15VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g22_tight_L1EM15VHI',                     'L1_EM15VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g22_tight_icalovloose_L1EM15VHI',                     'L1_EM15VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g22_tight_icalovloose',            'L1_EM15VH', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g22_tight_icalotight_L1EM15VHI',                     'L1_EM15VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g22_tight_icalotight',             'L1_EM15VH', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g25_loose_L1EM20VH',                     'L1_EM20VH', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['e24_lhloose_nod0_L1EM20VH',        'L1_EM20VH', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['g12_loose',                     'L1_EM10VH', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g12_medium',                     'L1_EM10VH', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['e60_lhloose_nod0_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e70_lhloose_nod0_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e80_lhloose_nod0_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['g70_loose_L1EM24VHIM',                     'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g80_loose_L1EM24VHIM',                     'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g80_loose_icalovloose_L1EM24VHIM',                     'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['e60_etcut_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e70_etcut_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e80_etcut_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e100_etcut_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e120_etcut_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e200_etcut_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e250_etcut_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e70_lhvloose_nod0_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e80_lhvloose_nod0_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e100_lhvloose_nod0_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e120_lhvloose_nod0_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e140_lhvloose_nod0_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e160_lhvloose_nod0_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e160_lhvloose_nod0',        'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['g60_loose_L1EM24VHIM',                     'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g100_loose_L1EM24VHIM',                     'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g120_loose_L1EM24VHIM',                     'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g140_loose_L1EM24VHIM',                     'L1_EM24VHIM', [], [PhysicsStream], ['Primary:17000','RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g160_loose_L1EM24VHIM',                     'L1_EM24VHIM', [], [PhysicsStream], ['Primary:17000','RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g180_loose_L1EM24VHIM',                     'L1_EM24VHIM', [], [PhysicsStream], ['Primary:17000','RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['e20_lhmedium_nod0_L1EM18VHI',        'L1_EM18VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e20_lhtight_nod0_ivarloose_L1EM18VHI',        'L1_EM18VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['g35_loose_L1EM24VHIM',                     'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g35_tight_icalotight_L1EM24VHIM',                     'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g35_tight_icalotight_L1EM24VHI',                     'L1_EM24VHI',  [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g40_tight_icalotight_L1EM24VHIM',                     'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g40_tight_icalotight_L1EM24VHI',                      'L1_EM24VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g85_tight_L1EM24VHIM',                     'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g85_tight_icalovloose_L1EM24VHIM',                     'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g85_tight_icalovloose_L1EM24VHI', 'L1_EM24VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'], -1],
+        ['g100_tight_L1EM24VHIM',                     'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g100_tight_icalovloose_L1EM24VHIM',                     'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g100_tight_icalovloose_L1EM24VHI',                     'L1_EM24VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['e25_mergedtight_ivarloose',           'L1_EM20VH', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e25_mergedtight',                      'L1_EM20VH', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'], -1],
+        ['e30_mergedtight',                      'L1_EM20VH', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'], -1],
+        ['g35_medium_icalovloose',           'L1_EM20VH', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['g35_medium_icalotight',           'L1_EM20VH', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e5_lhvloose_nod0_bBeexM6000t',  '',   ['L1_EM3'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag],-1],
+        ['2e5_lhvloose_nod0_bBeexM6000t',  '',   ['L1_EM3','L1_EM3'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag],-1],
+
+        #ATR-19268
+        ['g20_tight_icaloloose',             'L1_EM18VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['e10_lhmedium_nod0_ivarloose', 'L1_EM8VH', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e5_lhvloose_nod0_j70_j50_0eta490_invm1000j50_dphi28_xe50_pufit_L1MJJ-500-NFF', 'L1_MJJ-500-NFF', ['L1_EM3', '', '',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["e5_lhvloose_nod0","j70","j50_0eta490","xe50_pufit"]]],
+        ['e5_lhvloose_nod0_j70_j50_0eta490_invm1000j50_xe50_pufit_L1MJJ-700', 'L1_MJJ-700', ['L1_EM3', '', '',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["e5_lhvloose_nod0","j70","j50_0eta490","xe50_pufit"]]],
+        ['e5_lhvloose_nod0_j70_j50_0eta490_invm1000j50_dphi28_xe50_pufit_L1MJJ-700', 'L1_MJJ-700', ['L1_EM3', '', '',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["e5_lhvloose_nod0","j70","j50_0eta490","xe50_pufit"]]],
+        ['g27_medium_L1EM24VHI', 'L1_EM24VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g45_loose_L1EM15VH', 'L1_EM15VH', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['e17_lhmedium_nod0_L1EM15VHI', 'L1_EM15VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e24_lhmedium_nod0_ivarloose', 'L1_EM20VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+			 ]
+
+
+    ###########################################################################################################
+    #   Bphysics
+    ###########################################################################################################
+    TriggerFlags.BphysicsSlice.signatures = TriggerFlags.BphysicsSlice.signatures() + [
+        ['mu11_mu6_bNocut_L1LFV-MU11',                'L1_LFV-MU11', ['L1_MU11','L1_MU6'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
+        ['mu11_mu6_bDimu_noinvm_novtx_ss_L1LFV-MU11', 'L1_LFV-MU11', ['L1_MU11','L1_MU6'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
+        ['mu11_mu6_bDimu_novtx_noos_L1LFV-MU11',      'L1_LFV-MU11', ['L1_MU11','L1_MU6'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
+        ['3mu4_bDimu2700',                'L1_3MU4', [], [BPhysicsStream],             [RATE_BphysTag,BW_BphysTag], -1],
+        ['mu6_mu4_bDimu',                 'L1_MU6_2MU4', ['L1_MU6','L1_MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
+        ['2mu6_bDimu',                    'L1_2MU6', [], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1], 
+        ['mu10_bJpsi_TrkPEBmon',        'L1_MU10',  [], [BPhysicsStream,'express'], [RATE_BphysTag,BW_BphysTag], -1],
+        ['3mu6_bJpsi',                   'L1_3MU6', [], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
+        ['3mu6_bTau',                    'L1_3MU6', [], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
+        ['3mu6_bUpsi',                   'L1_3MU6', [], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
+        ['mu6_2mu4_bDimu6000', 'L1_MU6_3MU4', ['L1_MU6','L1_3MU4'], [BPhysicsStream], [RATE_BphysTag, BW_BphysTag], -1],
+        ['mu4_mu4_idperf_bJpsimumu_noid',  'L1_2MU4', [], [PhysicsStream, 'express'], ['RATE:IDMonitoring',BW_BphysTag, 'BW:ID'], -1],  
+        ['2mu6_bBmumuxv2_L1LFV-MU6',              'L1_LFV-MU6',     ['L1_2MU6'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
+        ['2mu6_bPhi_L1LFV-MU6',                   'L1_LFV-MU6',     ['L1_2MU6'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
+        ['2mu6_bDimu_L1LFV-MU6',                  'L1_LFV-MU6',     ['L1_2MU6'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
+        ['2mu6_bDimu_novtx_noos_L1LFV-MU6',       'L1_LFV-MU6',     ['L1_2MU6'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
+        ['2mu4_bBmumu_L1BPH-2M9-2MU4_BPH-0DR15-2MU4',         'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4', ['L1_2MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
+        ['2mu4_bBmumu_Lxy0_L1BPH-2M9-2MU4_BPH-0DR15-2MU4',    'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4', ['L1_2MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
+        ['2mu4_bJpsimumu_Lxy0_L1BPH-2M9-2MU4_BPH-0DR15-2MU4', 'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4', ['L1_2MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
+        ['2mu4_bBmumux_BsmumuPhi_L1BPH-2M9-2MU4_BPH-0DR15-2MU4', 'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4', ['L1_2MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
+        ['2mu4_bBmumux_BpmumuKp_L1BPH-2M9-2MU4_BPH-0DR15-2MU4', 'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4', ['L1_2MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
+        ['mu6_mu4_bBmumu_L1BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4','L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4', ['L1_MU6','L1_MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
+        ['mu6_mu4_bBmumu_Lxy0_L1BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4','L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4', ['L1_MU6','L1_MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
+        ['mu6_mu4_bJpsimumu_L1BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4','L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4', ['L1_MU6','L1_MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
+        ['mu6_mu4_bJpsimumu_Lxy0_L1BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4','L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4', ['L1_MU6','L1_MU4'], [BPhysicsStream, 'express'], [RATE_BphysTag,BW_BphysTag], -1, False],
+        ['mu6_mu4_bBmumux_BsmumuPhi_L1BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4','L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4', ['L1_MU6','L1_MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
+        ['mu6_mu4_bBmumux_BpmumuKp_L1BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4','L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4', ['L1_MU6','L1_MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
+        ['mu6_mu4_bDimu_L1BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4','L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4', ['L1_MU6','L1_MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
+        ['mu6_mu4_bDimu_novtx_noos_L1BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4','L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4', ['L1_MU6','L1_MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
+        ['mu20_mu6noL1_bNocut',             'L1_MU20MU21',      ['L1_MU20','L2_mu20'],        [BPhysicsStream], [RATE_BphysTag,'BW:Muon'], -1,['serial',-1,['mu20','mu6noL1']]],  
+        ['2mu6_bDimu_L1BPH-2M9-2MU6_BPH-2DR15-2MU6',      'L1_BPH-2M9-2MU6_BPH-2DR15-2MU6',     ['L1_2MU6'], [BPhysicsStream, 'express'], [RATE_BphysTag,BW_BphysTag], -1, False],
+        ['2mu6_bDimu_novtx_noos_L1BPH-2M9-2MU6_BPH-2DR15-2MU6',      'L1_BPH-2M9-2MU6_BPH-2DR15-2MU6',     ['L1_2MU6'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
+        ['2mu6_bBmumu_L1BPH-2M9-2MU6_BPH-2DR15-2MU6',     'L1_BPH-2M9-2MU6_BPH-2DR15-2MU6',     ['L1_2MU6'], [BPhysicsStream, 'express'], [RATE_BphysTag,BW_BphysTag], -1, False],
+        ['mu6_mu4_bUpsimumu_L1BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-BO', 'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-BO',     ['L1_MU6','L1_MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
+        ['mu11_mu6_bDimu_noinvm_novtx_ss', 'L1_MU11_2MU6', ['L1_MU11','L1_MU6'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
+        ['mu11_mu6_bDimu_novtx_noos',      'L1_MU11_2MU6', ['L1_MU11','L1_MU6'], [BPhysicsStream, 'express'], [RATE_BphysTag,BW_BphysTag], -1],
+        ['mu11_mu6_bNocut',                 'L1_MU11_2MU6', ['L1_MU11','L1_MU6'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
+        ['mu11_mu6noL1_bNocut_L1MU11_2MU6',  'L1_MU11_2MU6', ['L1_MU11','L2_mu6'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1,['serial',-1,['mu11','mu6noL1']]],
+	
+        ]
+
+    if TriggerFlags.doFTK():
+        TriggerFlags.BphysicsSlice.signatures = TriggerFlags.BphysicsSlice.signatures() + [
+            ['2mu4_bBmumuxv2_Ftk',                'L1_2MU4', [], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
+
+]
+
+
+
+    TriggerFlags.CombinedSlice.signatures = TriggerFlags.CombinedSlice.signatures() + [
+        ['2j45_gsc55_boffperf_split_ht300_L1HT190-J15s5.ETA21',  'L1_HT190-J15s5.ETA21', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet_combined'], -1,['serial',-1,[ 'ht300', '2j45_gsc55_boffperf_split'  ]]], 
+        ['2j45_gsc55_bmv2c1060_split_ht300_L1HT190-J15s5.ETA21', 'L1_HT190-J15s5.ETA21', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet_combined'], -1,['serial',-1,[ 'ht300', '2j45_gsc55_bmv2c1060_split' ]]], 
+        ['mu4_j45_gsc55_boffperf_split_dr05_dz02', 'L1_MU4',     ['L1_MU4', ''], [PhysicsStream, 'express'], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu4', 'j45_gsc55_boffperf_split'] ]],
+        ['e5_lhvloose_j70_j50_0eta490_invm1000j50_xe50_pufit_L1MJJ-500-NFF', 'L1_MJJ-500-NFF', ['L1_EM3','','',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial', -1,["e5_lhvloose","j70","j50_0eta490","xe50_pufit"]]],
+        ['e5_lhloose_j70_j50_0eta490_invm1000j50_xe50_pufit_L1MJJ-500-NFF', 'L1_MJJ-500-NFF', ['L1_EM3','','',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial', -1,["e5_lhloose","j70","j50_0eta490","xe50_pufit"]]],
+        ['j70_0eta490_j50_0eta490_2j35_0eta490_invm1200j50_L1MJJ-500-NFF_AND_2j35_bmv2c1070_split', 'L1_MJJ-500-NFF', [], [PhysicsStream], ['RATE:JetMET', 'BW:Jet'], -1, ['serial', -1,["j70_0eta490","j50_0eta490","2j35_0eta490_invm1200j50_L1MJJ-500-NFF_AND","2j35_bmv2c1070_split"]]],
+        ['j70_0eta490_j50_0eta490_2j35_0eta490_invm1000j50_L1MJJ-500-NFF_AND_2j35_bmv2c1060_split', 'L1_MJJ-500-NFF', [], [PhysicsStream], ['RATE:JetMET', 'BW:Jet'], -1, ['serial', -1,["j70_0eta490","j50_0eta490","2j35_0eta490_invm1000j50_L1MJJ-500-NFF_AND","2j35_bmv2c1060_split"]]],
+        ['e5_lhloose_j70_j50_0eta490_invm1000j50_xe50_pufit_L1MJJ-700', 'L1_MJJ-700', ['L1_EM3','','',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial', -1,["e5_lhloose","j70","j50_0eta490","xe50_pufit"]]],
+        ['j70_0eta490_j50_0eta490_2j35_0eta490_invm1200j50_L1MJJ-700_AND_2j35_bmv2c1070_split', 'L1_MJJ-700', [], [PhysicsStream], ['RATE:JetMET', 'BW:Jet'], -1, ['serial', -1,["j70_0eta490","j50_0eta490","2j35_0eta490_invm1200j50_L1MJJ-700_AND","2j35_bmv2c1070_split"]]],
+        ['j70_0eta490_j50_0eta490_2j35_0eta490_invm1000j50_L1MJJ-700_AND_2j35_bmv2c1060_split', 'L1_MJJ-700', [], [PhysicsStream], ['RATE:JetMET', 'BW:Jet'], -1, ['serial', -1,["j70_0eta490","j50_0eta490","2j35_0eta490_invm1000j50_L1MJJ-700_AND","2j35_bmv2c1060_split"]]],
+        ['e13_etcut_trkcut_xs30_xe30_mt35', 'L1_EM12_XS20', ['L1_EM12','',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma'], -1, ['serial',-1,["e13_etcut_trkcut","xs30","xe30"]]],
+        ['e13_etcut_trkcut_xs30_j15_perf_xe30_6dphi05_mt35', 'L1_EM12_XS20', ['L1_EM12','','',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma'], -1, ['serial',-1,["e13_etcut_trkcut","xs30","j15_perf","xe30"]]],
+        ['e13_etcut_trkcut_xs30_j15_perf_xe30_6dphi15_mt35', 'L1_EM12_XS20', ['L1_EM12','','',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma'], -1, ['serial',-1,["e13_etcut_trkcut","xs30","j15_perf","xe30"]]],
+        ['e13_etcut_trkcut_xs30_j15_perf_xe30_2dphi05_mt35', 'L1_EM12_XS20', ['L1_EM12','','',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma'], -1, ['serial',-1,["e13_etcut_trkcut","xs30","j15_perf","xe30"]]],
+        ['e13_etcut_trkcut_xs30_j15_perf_xe30_2dphi15_mt35', 'L1_EM12_XS20', ['L1_EM12','','',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma'], -1, ['serial',-1,["e13_etcut_trkcut","xs30","j15_perf","xe30"]]],
+        ['e18_etcut_trkcut_xs30_xe30_mt35', 'L1_EM15_XS30', ['L1_EM15','',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma'], -1, ['serial',-1,["e18_etcut_trkcut","xs30","xe30"]]],
+        ['e18_etcut_trkcut_xs30_j15_perf_xe30_6dphi05_mt35', 'L1_EM15_XS30', ['L1_EM15','','',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma'], -1, ['serial',-1,["e18_etcut_trkcut","xs30","j15_perf","xe30"]]],
+        ['e18_etcut_trkcut_xs30_j15_perf_xe30_6dphi15_mt35', 'L1_EM15_XS30', ['L1_EM15','','',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma'], -1, ['serial',-1,["e18_etcut_trkcut","xs30","j15_perf","xe30"]]],
+        ['e18_etcut_trkcut_xs30_j15_perf_xe30_2dphi05_mt35', 'L1_EM15_XS30', ['L1_EM15','','',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma'], -1, ['serial',-1,["e18_etcut_trkcut","xs30","j15_perf","xe30"]]],
+        ['e18_etcut_trkcut_xs30_j15_perf_xe30_2dphi15_mt35', 'L1_EM15_XS30', ['L1_EM15','','',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma'], -1, ['serial',-1,["e18_etcut_trkcut","xs30","j15_perf","xe30"]]],
+        ['e18_etcut_trkcut_xs20_j20_perf_xe20_6dphi15_mt35', 'L1_EM15_XS30', ['L1_EM15','','',''],[PhysicsStream],['RATE:EgammaMET','BW:Egamma'],-1,['serial',-1,["e18_etcut_trkcut","xs20","j20_perf","xe20"]]],
+        ['e18_etcut_trkcut_j20_perf_xe20_6dphi15_mt35',      'L1_EM15_XS30', ['L1_EM15','',''],[PhysicsStream],['RATE:EgammaMET','BW:Egamma'],-1,['serial',-1,["e18_etcut_trkcut","j20_perf","xe20"]]],
+        ['2e12_lhmedium_nod0_mu10', 'L1_2EM8VH_MU10', ['L1_2EM8VH', 'L1_MU10'], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1,['parallel',-1,[] ]],
+        ['e12_lhmedium_nod0_2mu10', 'L1_2MU10', ['L1_EM8VH', 'L1_2MU10'], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1,['parallel',-1,[] ]],
+        ['e28_lhmedium_nod0_mu8noL1', 'L1_EM24VHI', ['L1_EM24VHI', ''], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['e28_lhmedium_nod0','mu8noL1'] ]],
+        ['e28_lhmedium_nod0_L1EM24VHIM_mu8noL1', 'L1_EM24VHIM', ['L1_EM24VHIM', ''], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['e28_lhmedium_nod0_L1EM24VHIM','mu8noL1'] ]],
+        ['e28_lhmedium_nod0', 'L1_EM24VHI', [], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1],
+        ['e70_lhloose_nod0_L1EM24VHIM_xe70noL1',    'L1_EM24VHIM',['L1_EM24VHIM',''], [PhysicsStream], ['Primary:20000','RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["e70_lhloose_nod0_L1EM24VHIM","xe70noL1"]]],
+        ['e80_lhloose_nod0_xe80noL1',    'L1_EM22VHI',['L1_EM22VHI',''], [PhysicsStream], ['Primary:17000','RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["e80_lhloose_nod0","xe80noL1"]]],
+        ['e80_lhloose_nod0_L1EM24VHI_xe80noL1',    'L1_EM24VHI',['L1_EM24VHI',''], [PhysicsStream], ['Primary:20000','RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["e80_lhloose_nod0_L1EM24VHI","xe80noL1"]]],
+        ['e80_lhloose_nod0_L1EM24VHIM_xe80noL1',    'L1_EM24VHIM',['L1_EM24VHIM',''], [PhysicsStream], ['Primary:20000','RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["e80_lhloose_nod0_L1EM24VHIM","xe80noL1"]]],
+        ['g45_tight_L1EM22VHI_xe45noL1', 'L1_EM22VHI', ['L1_EM22VHI',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g45_tight_L1EM22VHI","xe45noL1"]]],
+        ['g45_tight_L1EM24VHI_xe45noL1', 'L1_EM24VHI', ['L1_EM24VHI',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g45_tight_L1EM24VHI","xe45noL1"]]],
+        ['g45_tight_L1EM24VHIM_xe45noL1', 'L1_EM24VHIM', ['L1_EM24VHIM',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g45_tight_L1EM24VHIM","xe45noL1"]]],
+        ['g45_tight_icalovloose_L1EM24VHIM_xe45noL1', 'L1_EM24VHIM', ['L1_EM24VHIM',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g45_tight_icalovloose_L1EM24VHIM","xe45noL1"]]],
+        ['g80_loose_L1EM24VHI_xe80noL1',           'L1_EM24VHI', ['L1_EM24VHI',''], [PhysicsStream], ['Primary:17000','RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g80_loose_L1EM24VHI","xe80noL1"]]],
+        ['g80_loose_L1EM24VHIM_xe80noL1',           'L1_EM24VHIM', ['L1_EM24VHIM',''], [PhysicsStream], ['Primary:17000','RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g80_loose_L1EM24VHIM","xe80noL1"]]],
+        ['g80_loose_icalovloose_L1EM24VHIM_xe80noL1',           'L1_EM24VHIM', ['L1_EM24VHIM',''], [PhysicsStream], ['Primary:20000','RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g80_loose_icalovloose_L1EM24VHIM","xe80noL1"]]],
+        ['g45_tight_L1EM24VHI', 'L1_EM24VHI', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1],
+        ['g45_tight_icalovloose_L1EM22VHI_xe45noL1', 'L1_EM22VHI', ['L1_EM22VHI',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g45_tight_icalovloose_L1EM22VHI","xe45noL1"]]],
+        ['g45_tight_icalovloose_L1EM24VHI_xe45noL1', 'L1_EM24VHI', ['L1_EM24VHI',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g45_tight_icalovloose_L1EM24VHI","xe45noL1"]]],
+        ['g80_loose_icalovloose_L1EM24VHI_xe80noL1', 'L1_EM24VHI', ['L1_EM24VHI',''], [PhysicsStream], ['Primary:20000','RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g80_loose_icalovloose_L1EM24VHI","xe80noL1"]]],
+        ['g100_tight_icalovloose_L1EM22VHI_3j50noL1', 'L1_EM22VHI', ['L1_EM22VHI',''], [PhysicsStream], ['Primary:17000','RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g100_tight_icalovloose_L1EM22VHI","3j50noL1"]]],
+        ['g85_tight_icalovloose_L1EM24VHI_3j50noL1', 'L1_EM24VHI', ['L1_EM24VHI',''], [PhysicsStream], ['Primary:20000','RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g85_tight_icalovloose_L1EM24VHI","3j50noL1"]]],
+        ['g100_tight_icalovloose_L1EM24VHI_3j50noL1', 'L1_EM24VHI', ['L1_EM24VHI',''], [PhysicsStream], ['Primary:20000','RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g100_tight_icalovloose_L1EM24VHI","3j50noL1"]]],
+        ['2mu4_invm1_j20_xe60_pufit_2dphi10_L12MU4_J20_XE30_DPHI-J20s2XE30',  'L1_2MU4_J20_XE30_DPHI-J20s2XE30', [], [PhysicsStream], ['Primary:20000','RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["2mu4_invm1","j20","xe60_pufit"] ]],
+        ['e5_lhloose_nod0_mu4_j30_xe40_pufit_2dphi10_L1MU4_J30_XE40_DPHI-J20s2XE30',  'L1_MU4_J30_XE40_DPHI-J20s2XE30', ['L1_EM3','','',''], [PhysicsStream], ['Primary:20000','RATE:MuonJetMET', 'BW:Egamma', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["e5_lhloose_nod0","mu4","j30","xe40_pufit"] ]],
+        ['e5_lhmedium_nod0_j50_xe80_pufit_2dphi10_L1J40_XE50_DPHI-J20s2XE50',  'L1_J40_XE50_DPHI-J20s2XE50', ['L1_EM3','',''], [PhysicsStream], ['Primary:20000','RATE:EgammaJetMET', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e5_lhmedium_nod0","j50","xe80_pufit"] ]],
+        ['e60_etcut_trkcut_j15_perf_xe60_6dphi05_mt35','L1_EM24VHIM', ['L1_EM24VHIM','',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma'], -1, ['serial',-1,["e60_etcut_trkcut","j15_perf","xe60"]]],
+        ['mu4_j15_boffperf_split_dr05_dz02', 'L1_MU4',     ['L1_MU4', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu4', 'j15_boffperf_split'] ]],
+        ['mu4_j25_boffperf_split_dr05_dz02', 'L1_MU4',     ['L1_MU4', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu4', 'j25_boffperf_split'] ]],
+        ['mu4_j35_boffperf_split_dr05_dz99', 'L1_MU4',     ['L1_MU4', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu4', 'j35_boffperf_split'] ]],
+        ['mu6_j110_gsc150_boffperf_split_dr05_dz99', 'L1_MU6_J40',     ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu6', 'j110_gsc150_boffperf_split'] ]],
+        ['mu6_j225_gsc320_boffperf_split_dr05_dz99', 'L1_MU6_J75',     ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu6', 'j225_gsc320_boffperf_split'] ]],
+        ['mu4_j35_boffperf_split', 'L1_MU4',     ['L1_MU4', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu4', 'j35_boffperf_split'] ]],
+        ['mu4_j35_boffperf_split_dr05_dz02', 'L1_MU4',     ['L1_MU4', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu4', 'j35_boffperf_split'] ]],
+        ['mu6_j60_gsc85_boffperf_split_dr05_dz02',  'L1_MU6_J20', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu6', 'j60_gsc85_boffperf_split'] ]],
+        ['mu6_j85_gsc110_boffperf_split_dr05_dz02', 'L1_MU6_J20', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu6', 'j85_gsc110_boffperf_split'] ]],
+        ['mu6_j110_gsc150_boffperf_split_dr05_dz02', 'L1_MU6_J40', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu6', 'j110_gsc150_boffperf_split'] ]],
+        ['mu6_j110_gsc150_boffperf_split', 'L1_MU6_J40',     ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu6', 'j110_gsc150_boffperf_split'] ]],
+        ['mu6_j150_gsc175_boffperf_split_dr05_dz02', 'L1_MU6_J40', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu6', 'j150_gsc175_boffperf_split']]],
+        ['mu6_j175_gsc260_boffperf_split_dr05_dz02', 'L1_MU6_J75', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu6', 'j175_gsc260_boffperf_split'] ]],
+        ['mu6_j225_gsc320_boffperf_split_dr05_dz02', 'L1_MU6_J75', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu6', 'j225_gsc320_boffperf_split'] ]],
+        ['mu6_j225_gsc320_boffperf_split', 'L1_MU6_J75',     ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu6', 'j225_gsc320_boffperf_split'] ]],
+        ['mu6_j225_gsc400_boffperf_split_dr05_dz02', 'L1_MU6_J75', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu6', 'j225_gsc400_boffperf_split'] ]],
+        ['mu4_j35_boffperf_split_dr05_dz02_L1BTAG-MU4J15', 'L1_BTAG-MU4J15', ['L1_MU4', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu4', 'j35_boffperf_split'] ], False],
+        ['mu6_j60_gsc85_boffperf_split_dr05_dz02_L1BTAG-MU6J20', 'L1_BTAG-MU6J20', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu6', 'j60_gsc85_boffperf_split'] ], False],
+        ['mu26_ivarmedium_2j35_boffperf_split', 'L1_MU20MU21',    ['L1_MU20',    '', ''], [PhysicsStream], ['RATE:MuonBJet',  'BW:BJet_combined'],  -1, ['serial',-1,['mu26_ivarmedium', '2j35_boffperf_split']]],
+        ['e28_lhtight_nod0_ivarloose_L1EM24VHIM_2j35_boffperf_split',        'L1_EM24VHIM', ['L1_EM24VHIM', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet_combined'],  -1, ['serial',-1,['e28_lhtight_nod0_ivarloose_L1EM24VHIM', '2j35_boffperf_split']]],
+        ['2g10_medium_mu20',         'L1_MU20MU21',    ['L1_2EM7', 'L1_MU20'],  [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['2g10_medium','mu20'] ]],
+        ['j30_jes_PS_llp_L1TAU60',             'L1_TAU60',             [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j30_jes_PS_llp_noiso_L1TAU60',       'L1_TAU60',             [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j30_jes_cleanLLP_PS_llp_L1TAU60',             'L1_TAU60',             [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j30_jes_cleanLLP_PS_llp_pufix_L1TAU60',       'L1_TAU60',             [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j30_jes_cleanLLP_PS_llp_pufix_noiso_L1TAU60',       'L1_TAU60',             [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j30_jes_cleanLLP_PS_llp_noiso_L1TAU60',       'L1_TAU60',             [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j250_jes_cleanLLP_PS_revllp_L1TAU60',             'L1_TAU60',             [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['g35_tight_icalotight_L1EM24VHIM_mu18noL1',        'L1_EM24VHIM', ['L1_EM24VHIM', ''], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g35_tight_icalotight_L1EM24VHIM','mu18noL1'] ]],
+        ['g40_tight_icalotight_L1EM24VHIM_mu18noL1',        'L1_EM24VHIM', ['L1_EM24VHIM', ''], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g40_tight_icalotight_L1EM24VHIM','mu18noL1'] ]],
+        ['g35_tight_icalotight_L1EM24VHIM_mu15noL1_mu2noL1', 'L1_EM24VHIM', ['L1_EM24VHIM', '',''], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g35_tight_icalotight_L1EM24VHIM','mu15noL1','mu2noL1']]],
+        ['g40_tight_icalotight_L1EM24VHIM_mu15noL1_mu2noL1', 'L1_EM24VHIM', ['L1_EM24VHIM', '',''], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g40_tight_icalotight_L1EM24VHIM','mu15noL1','mu2noL1']]],
+        ['g40_tight_icalotight_L1EM24VHI_mu18noL1',        'L1_EM24VHI', ['L1_EM24VHI', ''], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g40_tight_icalotight_L1EM24VHI','mu18noL1'] ]],
+        ['g40_tight_icalotight_L1EM24VHI_mu15noL1_mu2noL1', 'L1_EM24VHI', ['L1_EM24VHI', '',''], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g40_tight_icalotight_L1EM24VHI','mu15noL1','mu2noL1']]],
+        ['g35_loose_L1EM24VHIM_mu18',        'L1_EM24VHIM', ['L1_EM24VHIM', 'L1_MU11'], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g35_loose_L1EM24VHIM','mu18'] ]],
+        ['g35_loose_L1EM24VHIM_mu15_mu2noL1', 'L1_EM24VHIM', ['L1_EM24VHIM', 'L1_MU11',''], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g35_loose_L1EM24VHIM','mu15','mu2noL1']]],
+        ['e30_mergedtight_g35_medium_Heg',       'L1_2EM20VH', [], [PhysicsStream], ['Primary:20000','RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]],
+        ['e17_lhmedium_nod0_tau80_medium1_tracktwo',   'L1_EM15VHI_TAU40_2TAU15',['L1_EM15VHI','L1_TAU40'], [PhysicsStream], ['RATE:ElectronTau', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,["e17_lhmedium_nod0","tau80_medium1_tracktwo"]]],
+        ['e17_lhmedium_nod0_ivarloose_tau25_medium1_tracktwo_L1EM15VHI_2TAU12IM',  'L1_EM15VHI_2TAU12IM',['L1_EM15VHI','L1_TAU12IM'], [PhysicsStream], ['RATE:ElectronTau', 'BW:Tau'], -1,['serial',-1,["e17_lhmedium_nod0_ivarloose","tau25_medium1_tracktwo"]]],
+        ['mu14_ivarloose_tau35_medium1_tracktwo_L1MU10_TAU20IM_J25_2J20',      'L1_MU10_TAU20IM_J25_2J20',['L1_MU10','L1_TAU20IM'], [PhysicsStream], ['Primary:20000','RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu14_ivarloose","tau35_medium1_tracktwo"]]],   
+        ['mu14_iloose_tau25_perf_tracktwo', 'L1_MU10_TAU12IM',['L1_MU10','L1_TAU12IM'], [PhysicsStream, 'express'], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu14_iloose","tau25_perf_tracktwo"]]],
+        ['mu14_ivarloose_tau25_medium1_tracktwo_L1MU10_TAU12IM',  'L1_MU10_TAU12IM',['L1_MU10','L1_TAU12IM'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau'], -1,['serial',-1,["mu14_ivarloose","tau25_medium1_tracktwo"]]],
+        ['tau35_medium1_tracktwo_tau25_medium1_tracktwo_xe50', 'L1_TAU20IM_2TAU12IM_XE35',['L1_TAU20IM','L1_TAU12IM','L1_XE35'], [PhysicsStream], ['RATE:TauMET', 'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo","tau25_medium1_tracktwo","xe50"]]],
+        ['mu14_ivarloose_tau35_medium1_tracktwoEF_L1MU10_TAU20IM_J25_2J20',      'L1_MU10_TAU20IM_J25_2J20',['L1_MU10','L1_TAU20IM'], [PhysicsStream], ['Primary:20000','RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu14_ivarloose","tau35_medium1_tracktwoEF"]]],   
+        ['mu14_ivarloose_tau35_mediumRNN_tracktwoMVA_L1MU10_TAU20IM_J25_2J20',      'L1_MU10_TAU20IM_J25_2J20',['L1_MU10','L1_TAU20IM'], [PhysicsStream], ['Primary:20000','RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu14_ivarloose","tau35_mediumRNN_tracktwoMVA"]]],   
+        ['g25_medium_L1EM24VHI_tau25_kaonpi2_tracktwoEF_50mVis10000','L1_EM24VHI', ['L1_EM24VHI','L1_TAU12'], [PhysicsStream], ['Primary:20000','RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium_L1EM24VHI','tau25_kaonpi2_tracktwoEF'],False] ],
+	    ['g35_medium_L1EM24VHI_tau25_dipion3_tracktwoEF_60mVis10000','L1_EM24VHI', ['L1_EM24VHI','L1_TAU12'], [PhysicsStream], ['Primary:20000','RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g35_medium_L1EM24VHI','tau25_dipion3_tracktwoEF'],False] ],
+        ['g25_medium_L1EM24VHI_tau25_kaonpi2_tracktwoMVA_50mVis10000','L1_EM24VHI', ['L1_EM24VHI','L1_TAU12'], [PhysicsStream], ['Primary:20000','RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium_L1EM24VHI','tau25_kaonpi2_tracktwoMVA'],False] ],
+        ['g35_medium_L1EM24VHI_tau25_dipion3_tracktwoMVA_60mVis10000','L1_EM24VHI', ['L1_EM24VHI','L1_TAU12'], [PhysicsStream], ['Primary:20000','RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g35_medium_L1EM24VHI','tau25_dipion3_tracktwoMVA'],False] ],
+        ['j80_xe80',               'L1_J40_XE50',['',''], [PhysicsStream], ['RATE:JetMET', 'BW:Jet', 'BW:MET'], -1,['serial',-1,["j80","xe80"]]], 
+        ['e20_lhtight_nod0_3j20_L1EM18VHI_3J20',      'L1_EM18VHI_3J20',    ['L1_EM18VHI',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'],-1, ['serial',-1,["e20_lhtight_nod0","3j20"] ]],
+        ['e20_lhmedium_nod0_3j20_L1EM18VHI_3J20', 'L1_EM18VHI_3J20',    ['L1_EM18VHI',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'],-1, ['serial',-1,["e20_lhmedium_nod0","3j20"] ]],
+        ['e28_lhvloose_nod0_L1EM22VH_3j20noL1',  'L1_EM22VH', ['L1_EM22VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e28_lhvloose_nod0_L1EM22VH","3j20noL1"] ]],
+        ['e28_lhvloose_nod0_L1EM22VH_4j20noL1',  'L1_EM22VH', ['L1_EM22VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e28_lhvloose_nod0_L1EM22VH","4j20noL1"] ]],
+        ['e28_lhvloose_nod0_L1EM22VH_5j15noL1',  'L1_EM22VH', ['L1_EM22VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e28_lhvloose_nod0_L1EM22VH","5j15noL1"] ]],
+        ['e28_lhvloose_nod0_L1EM22VH_6j15noL1',  'L1_EM22VH', ['L1_EM22VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e28_lhvloose_nod0_L1EM22VH","6j15noL1"] ]],
+        ['e26_lhvloose_nod0_L1EM22VH_3j20noL1',  'L1_EM22VH', ['L1_EM22VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e26_lhvloose_nod0_L1EM22VH","3j20noL1"] ]],
+        ['e26_lhvloose_nod0_L1EM22VH_4j20noL1',  'L1_EM22VH', ['L1_EM22VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e26_lhvloose_nod0_L1EM22VH","4j20noL1"] ]],
+        ['e26_lhvloose_nod0_L1EM22VH_5j15noL1',  'L1_EM22VH', ['L1_EM22VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e26_lhvloose_nod0_L1EM22VH","5j15noL1"] ]],
+        ['e26_lhvloose_nod0_L1EM22VH_6j15noL1',  'L1_EM22VH', ['L1_EM22VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e26_lhvloose_nod0_L1EM22VH","6j15noL1"] ]],
+        ['e28_lhmedium_nod0_L1EM22VH_3j20noL1',  'L1_EM22VH', ['L1_EM22VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e28_lhmedium_nod0_L1EM22VH","3j20noL1"] ]],
+        ['e28_lhmedium_nod0_L1EM22VH_4j20noL1',  'L1_EM22VH', ['L1_EM22VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e28_lhmedium_nod0_L1EM22VH","4j20noL1"] ]],
+        ['e28_lhmedium_nod0_L1EM22VH_5j15noL1',  'L1_EM22VH', ['L1_EM22VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e28_lhmedium_nod0_L1EM22VH","5j15noL1"] ]],
+        ['e28_lhmedium_nod0_L1EM22VH_6j15noL1',  'L1_EM22VH', ['L1_EM22VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e28_lhmedium_nod0_L1EM22VH","6j15noL1"] ]],
+        ['e26_lhmedium_nod0_L1EM22VH_3j20noL1',  'L1_EM22VH', ['L1_EM22VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e26_lhmedium_nod0_L1EM22VH","3j20noL1"] ]],
+        ['e26_lhmedium_nod0_L1EM22VH_4j20noL1',  'L1_EM22VH', ['L1_EM22VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e26_lhmedium_nod0_L1EM22VH","4j20noL1"] ]],
+        ['e26_lhmedium_nod0_L1EM22VH_5j15noL1',  'L1_EM22VH', ['L1_EM22VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e26_lhmedium_nod0_L1EM22VH","5j15noL1"] ]],
+        ['e26_lhmedium_nod0_L1EM22VH_6j15noL1',  'L1_EM22VH', ['L1_EM22VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e26_lhmedium_nod0_L1EM22VH","6j15noL1"] ]],
+        ['mu26_2j20noL1',  'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu26","2j20noL1"] ]],
+        ['mu26_3j20noL1',  'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu26","3j20noL1"] ]],
+        ['mu26_4j15noL1',  'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu26","4j15noL1"] ]],
+        ['mu26_5j15noL1',  'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu26","5j15noL1"] ]],
+        ['g25_medium_L1EM22VHI_4j35_0eta490_invm700', 'L1_EM22VHI', ['L1_EM22VHI',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma'], -1,['serial',-1,["g25_medium_L1EM22VHI","4j35_0eta490_invm700"]]],
+        ['g25_loose_L1EM20VH_4j35_0eta490', 'L1_EM20VH', ['L1_EM20VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma'], -1,['serial',-1,["g25_loose_L1EM20VH","4j35_0eta490"]]],
+	['j55_0eta240_2j45_320eta490_L1J25.0ETA23_2J15.31ETA49','L1_J25.0ETA23_2J15.31ETA49',['',''], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet_combined' ], -1, ['serial',-1,['j55_0eta240','2j45_320eta490_L1J25.0ETA23_2J15.31ETA49'] ]],
+        ['g25_medium_L1EM24VHIM_tau25_dikaonmass_tracktwo_50mVis10000','L1_EM24VHIM', ['L1_EM24VHIM','L1_TAU12'], [PhysicsStream], ['Primary:20000','RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium_L1EM24VHIM','tau25_dikaonmass_tracktwo'],False]],
+        ['g25_medium_L1EM24VHIM_tau25_singlepion_tracktwo_50mVis10000','L1_EM24VHIM', ['L1_EM24VHIM','L1_TAU12'], [PhysicsStream], ['Primary:20000','RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium_L1EM24VHIM','tau25_singlepion_tracktwo'],False]],
+        ['g25_medium_L1EM24VHIM_tau25_dipion1loose_tracktwo_50mVis10000','L1_EM24VHIM', ['L1_EM24VHIM','L1_TAU12'], [PhysicsStream], ['Primary:20000','RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium_L1EM24VHIM','tau25_dipion1loose_tracktwo'],False]],
+        ['g25_medium_L1EM24VHIM_tau25_dipion2_tracktwo_50mVis10000','L1_EM24VHIM', ['L1_EM24VHIM','L1_TAU12'], [PhysicsStream], ['Primary:20000','RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium_L1EM24VHIM','tau25_dipion2_tracktwo'],False]],
+        ['g25_medium_L1EM24VHIM_tau25_kaonpi1_tracktwo_50mVis10000','L1_EM24VHIM', ['L1_EM24VHIM','L1_TAU12'], [PhysicsStream], ['Primary:20000','RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium_L1EM24VHIM','tau25_kaonpi1_tracktwo'],False]],
+        ['g25_medium_L1EM24VHIM_tau25_kaonpi2_tracktwo_50mVis10000','L1_EM24VHIM', ['L1_EM24VHIM','L1_TAU12'], [PhysicsStream], ['Primary:20000','RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium_L1EM24VHIM','tau25_kaonpi2_tracktwo'],False]],
+        ['g25_medium_L1EM24VHI_tau25_kaonpi2_tracktwo_50mVis10000','L1_EM24VHI', ['L1_EM24VHI','L1_TAU12'], [PhysicsStream], ['Primary:20000','RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium_L1EM24VHI','tau25_kaonpi2_tracktwo'],False]],	
+        ['g25_medium_tau25_dikaonmass_tracktwo_50mVis10000_L130M-EM20ITAU12','L1_30M-EM20ITAU12', ['L1_EM20VHI','L1_TAU12'], [PhysicsStream], ['RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium','tau25_dikaonmass_tracktwo'],False]],
+        ['g25_medium_tau25_singlepion_tracktwo_50mVis10000_L130M-EM20ITAU12','L1_30M-EM20ITAU12', ['L1_EM20VHI','L1_TAU12'], [PhysicsStream], ['RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium','tau25_singlepion_tracktwo'],False]],
+        ['g25_medium_tau25_dipion1loose_tracktwo_50mVis10000_L130M-EM20ITAU12','L1_30M-EM20ITAU12', ['L1_EM20VHI','L1_TAU12'], [PhysicsStream], ['RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium','tau25_dipion1loose_tracktwo'],False]],
+        ['g25_medium_tau25_dipion2_tracktwo_50mVis10000_L130M-EM20ITAU12','L1_30M-EM20ITAU12', ['L1_EM20VHI','L1_TAU12'], [PhysicsStream], ['RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium','tau25_dipion2_tracktwo'],False]],
+        ['g25_medium_tau25_kaonpi1_tracktwo_50mVis10000_L130M-EM20ITAU12','L1_30M-EM20ITAU12', ['L1_EM20VHI','L1_TAU12'], [PhysicsStream], ['RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium','tau25_kaonpi1_tracktwo'],False]],
+        ['g25_medium_tau25_kaonpi2_tracktwo_50mVis10000_L130M-EM20ITAU12','L1_30M-EM20ITAU12', ['L1_EM20VHI','L1_TAU12'], [PhysicsStream], ['RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium','tau25_kaonpi2_tracktwo'],False]],
+        ['g85_tight_L1EM24VHIM_3j50noL1', 'L1_EM24VHIM', ['L1_EM24VHIM',''], [PhysicsStream], ['Primary:17000','RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g85_tight_L1EM24VHIM","3j50noL1"]]],
+        ['g85_tight_icalovloose_L1EM24VHIM_3j50noL1', 'L1_EM24VHIM', ['L1_EM24VHIM',''], [PhysicsStream], ['Primary:20000','RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g85_tight_icalovloose_L1EM24VHIM","3j50noL1"]]],
+        ['g100_tight_L1EM24VHIM_3j50noL1', 'L1_EM24VHIM', ['L1_EM24VHIM',''], [PhysicsStream], ['Primary:20000','RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g100_tight_L1EM24VHIM","3j50noL1"]]],
+        ['g100_tight_icalovloose_L1EM24VHIM_3j50noL1', 'L1_EM24VHIM', ['L1_EM24VHIM',''], [PhysicsStream], ['Primary:20000','RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g100_tight_icalovloose_L1EM24VHIM","3j50noL1"]]],
+        ['g85_tight_L1EM24VHI_3j50noL1', 'L1_EM24VHI', ['L1_EM24VHI',''], [PhysicsStream], ['Primary:17000','RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g85_tight_L1EM24VHI","3j50noL1"]]],
+        ['g100_tight_L1EM22VHI_3j50noL1', 'L1_EM22VHI', ['L1_EM22VHI',''], [PhysicsStream], ['Primary:17000','RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g100_tight_L1EM22VHI","3j50noL1"]]],
+        ['g100_tight_L1EM24VHI_3j50noL1', 'L1_EM24VHI', ['L1_EM24VHI',''], [PhysicsStream], ['Primary:20000','RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g100_tight_L1EM24VHI","3j50noL1"]]],
+        ['g85_tight', 'L1_EM22VHI', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1],
+        ['g85_tight_L1EM24VHI', 'L1_EM24VHI', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1],
+        ['g100_tight', 'L1_EM22VHI', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1],
+        ['g100_tight_L1EM24VHI', 'L1_EM24VHI', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1],
+        ['j40_cleanT_xe85_tc_lcw_2dphi05_L1XE50',         'L1_XE50', ['',''], [PhysicsStream], ['RATE:JetMET', 'BW:Jet'], -1, ['serial',-1,["j40_cleanT","xe85_tc_lcw_L1XE50"]]],
+        ['mu14_3j20_L1MU10_3J20', 'L1_MU10_3J20', ['L1_MU10_3J20', ''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon','BW:Jet'], -1,['serial',-1,['mu14', '3j20'] ],True],
+        ['mu6_ivarloose_2j40_0eta490_invm1000_L1MU6_J30.0ETA49_2J20.0ETA49', 'L1_MU6_J30.0ETA49_2J20.0ETA49', ['L1_MU6',''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu6_ivarloose","2j40_0eta490_invm1000"]]],
+        ['g35_medium_L1EM24VHI_tau25_dipion3_tracktwo_60mVis10000','L1_EM24VHI', ['L1_EM24VHI','L1_TAU12'], [PhysicsStream], ['Primary:20000','RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g35_medium_L1EM24VHI','tau25_dipion3_tracktwo'],False]],
+        ['e26_lhmedium_nod0_5j30_0eta240_L1EM20VH_3J20',    	'L1_EM20VH_3J20',    ['L1_EM20VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'],-1, ['serial',-1,["e26_lhmedium_nod0","5j30_0eta240"] ]],
+        ['mu26_5j30_0eta240_L1MU10_3J20',    	'L1_MU10_3J20',    ['L1_MU10',''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon', 'BW:Jet'],-1, ['serial',-1,["mu26","5j30_0eta240"] ]],
+        ['e9_lhvloose_nod0_mu20_mu8noL1_L1EM8VH_MU20',  'L1_EM8VH_MU20',['L1_EM8VH','L1_MU20',''], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1,['serial',-1,['mu20','mu8noL1','e9_lhvloose_nod0'] ]],
+        ['2g6_loose_L1J100', 'L1_J100', ['L1_2EM3'],  [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'],-1],
+        ['2g6_tight_icalotight_L1J50', 'L1_J50', ['L1_2EM3','L1_J50'], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'],-1],
+        ['2g6_loose_L1J50', 'L1_J50', ['L1_2EM3','L1_J50'], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'],-1],
+        ['2g6_tight_icalotight_L1J40', 'L1_J40', ['L1_2EM3','L1_J40'], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'],-1],
+        ['2g6_loose_L1J40', 'L1_J40', ['L1_2EM3','L1_J40'], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'],-1],
+        ['g45_loose_5j45_0eta240', 'L1_4J15.0ETA25', ['L1_EM15VH','L1_4J15.0ETA25'], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g45_loose","5j45_0eta240"]]],
+        ['e9_lhvloose_nod0_e5_lhvloose_nod0_bBeexM6000t_mu6_nomucomb_L1BPH-0M9-EM7-EM5_MU6',  'L1_BPH-0M9-EM7-EM5_MU6',   ['L1_EM7','L1_EM3','L1_MU6'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag],-1,['parallel',-1,[] ]],
+        ['e5_lhvloose_nod0_bBeexM6000t_mu6_nomucomb_L1BPH-0DR3-EM7J15_MU6',  'L1_BPH-0DR3-EM7J15_MU6',   ['L1_EM7','L1_MU6'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag],-1,['parallel',-1,[] ]],
+        ['e5_lhvloose_nod0_bBeexM6000t_2mu4_nomucomb_L1BPH-0DR3-EM7J15_2MU4',  'L1_BPH-0DR3-EM7J15_2MU4',   ['L1_EM7','L1_2MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag],-1,['parallel',-1,[] ]],
+
+			 ]
+
+
+    TriggerFlags.MinBiasSlice.signatures = TriggerFlags.MinBiasSlice.signatures() + []
+    TriggerFlags.BeamspotSlice.signatures = TriggerFlags.BeamspotSlice.signatures()+ []
+    TriggerFlags.CalibSlice.signatures   = TriggerFlags.CalibSlice.signatures() + []
+    TriggerFlags.CosmicSlice.signatures  = TriggerFlags.CosmicSlice.signatures() + []
+    TriggerFlags.StreamingSlice.signatures = TriggerFlags.StreamingSlice.signatures() + []
+    TriggerFlags.EnhancedBiasSlice.signatures = TriggerFlags.EnhancedBiasSlice.signatures() + []
+
+    #get list of all signatures
+    signatureList=[]
+    for prop in dir(TriggerFlags):
+        if prop[-5:]=='Slice':
+            sliceName=prop
+            slice=getattr(TriggerFlags,sliceName)
+            if slice.signatures():
+                signatureList.extend(slice.signatures())
+            else:
+                log.debug('SKIPPING '+str(sliceName))
+    #print 'FOUND',len(signatureList),signatureList
+    disablePatterns=[#re.compile('beamspot'),  #all beamspot chains                     
+                     ]
+    disableEFPatterns=[]                                          
+    toDisable=[]
+    toDisableEF=[]
+    for signature in signatureList:
+        for pattern in disableEFPatterns+disablePatterns:
+            if re.search(pattern,signature):
+                if pattern in disableEFPatterns:
+                    toDisableEF.append(signature)
+                else:
+                    toDisable.append(signature)
+                break
+    log.debug('DISABLE The following chains are disabled in the v4 upgrade menu: '+str(toDisable))
+    for signature in toDisable:
+        Prescales.HLTPrescales_upgrade_mc_prescale[signature]=[   -1,    -1,    0,    0,  -1]
+    for signature in toDisableEF:
+        Prescales.HLTPrescales_upgrade_mc_prescale[signature]=[    1,    -1,    0,    0,  -1]
+
+
+######################################################
+Prescales = physics_menu.Prescales
+#StreamConfig = physics_menu.StreamConfig
+
+######################################################
+# DEFAULT MC prescales
+######################################################
+Prescales.L1Prescales = dict([(ctpid,1) for ctpid in Prescales.L1Prescales])  # setting all L1 prescales to 1
+
+ps_online_list=[]
+ps_cosmic_list=[]
+ps_calibmon_list=[
+    'idpsl1_L1IDprescaled'
+    ]    
+ps_eb_list=[]
+ps_beamspot_list=[]
+ps_fwdphys_list=[]
+ps_minb_list=[]
+
+ps_rerun_list = []
+
+if TriggerFlags.doFTK():
+    ps_rerun_list = []
+
+ps_larnoiseburst_rerun_list = []
+
+ps_perform_list = [
+    'mu4_j15_dr05' ,
+    'mu4_j35_dr05'  ,
+    'mu6_j85_dr05' ,
+    'e5_lhloose_nod0_idperf'
+    ]
+
+ps_Jpsi_list = []
+
+ps_ftk_list = []
+
+ps_Bphys_list = []
+
+if TriggerFlags.doFTK():
+    ps_ftk_list = []       
+
+ps_streamers_list = []
+
+#-----------------------------------------------------
+
+
+chain_list=ps_online_list+ps_cosmic_list+ps_minb_list
+if not TriggerFlags.doFTK():
+    chain_list+=ps_ftk_list
+
+Prescales.HLTPrescales.update(dict(map(None,chain_list,len(chain_list)*[ [-1, 0, -1] ])))
+
+chain_list=ps_larnoiseburst_rerun_list
+Prescales.HLTPrescales.update(dict(map(None,chain_list,len(chain_list)*[ [0, 0, 1] ])))
+######################################################
+
+######################################################
+# No MC prescales
+######################################################
+Prescales.L1Prescales_no_prescale  = deepcopy(Prescales.L1Prescales)
+Prescales.HLTPrescales_no_prescale = {}
+######################################################
+
+######################################################
+# LOOSE mc prescales
+######################################################
+Prescales.L1Prescales_loose_mc_prescale  = deepcopy(Prescales.L1Prescales)
+Prescales.HLTPrescales_loose_mc_prescale = {}
+
+chain_list=ps_online_list+ps_cosmic_list+ps_calibmon_list+ps_beamspot_list
+if not TriggerFlags.doFTK():
+    chain_list+=ps_ftk_list
+
+Prescales.HLTPrescales_loose_mc_prescale.update(dict(map(None,chain_list,len(chain_list)*[ [-1, 0,-1] ])))
+
+chain_list=ps_rerun_list
+Prescales.HLTPrescales_loose_mc_prescale.update(dict(map(None,chain_list,len(chain_list)*[ [0, 0, 1] ])))
+######################################################
+
+######################################################
+# TIGHTPERF mc prescales for performance
+######################################################
+Prescales.L1Prescales_tightperf_mc_prescale= deepcopy(Prescales.L1Prescales)
+Prescales.HLTPrescales_tightperf_mc_prescale = deepcopy(Prescales.HLTPrescales_loose_mc_prescale)
+
+chain_list=ps_eb_list+ps_fwdphys_list+ps_minb_list+ps_Bphys_list#+ps_Jpsi_list # enabling JPSI ee again ATR-15162
+if not TriggerFlags.doFTK():
+    chain_list+=ps_ftk_list
+
+Prescales.HLTPrescales_tightperf_mc_prescale.update(dict(map(None,chain_list,len(chain_list)*[ [-1, 0,-1] ])))
+Prescales.L1Prescales_TriggerValidation_mc_prescale= deepcopy(Prescales.L1Prescales)
+Prescales.HLTPrescales_TriggerValidation_mc_prescale = deepcopy(Prescales.HLTPrescales_tightperf_mc_prescale)
+######################################################
+# TIGHT mc prescales
+######################################################
+Prescales.L1Prescales_tight_mc_prescale  = deepcopy(Prescales.L1Prescales)
+Prescales.HLTPrescales_tight_mc_prescale = deepcopy(Prescales.HLTPrescales_tightperf_mc_prescale)
+chain_list=ps_streamers_list + ps_perform_list + ps_Bphys_list#+ps_Jpsi_list # enabling JPSI ee again ATR-15162
+
+#Prescales.HLTPrescales_tight_mc_prescale = deepcopy(Prescales.HLTPrescales_loose_mc_prescale)
+#chain_list=ps_eb_list+ps_fwdphys_list+ps_minb_list+ps_ftk_list+ps_perform_list
+Prescales.HLTPrescales_tight_mc_prescale.update(dict(map(None,chain_list,len(chain_list)*[ [-1, 0,-1] ])))
+Prescales.L1Prescales_BulkMCProd_mc_prescale  = deepcopy(Prescales.L1Prescales)
+Prescales.HLTPrescales_BulkMCProd_mc_prescale = deepcopy(Prescales.HLTPrescales_tight_mc_prescale)
+Prescales.L1Prescales_CPSampleProd_mc_prescale  = deepcopy(Prescales.L1Prescales)
+Prescales.HLTPrescales_CPSampleProd_mc_prescale = deepcopy(Prescales.HLTPrescales_tight_mc_prescale)
+######################################################
+
+######################################################
+Prescales.L1Prescales_upgrade_mc_prescale  = deepcopy(Prescales.L1Prescales)
+Prescales.HLTPrescales_upgrade_mc_prescale = deepcopy(Prescales.HLTPrescales_tight_mc_prescale)
+# Note: "upgrade" prescales are set with regular expressions at the end
+#       of the setupMenu() function above 
+######################################################
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/SignatureDicts.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/SignatureDicts.py
index ecafb3edeb6b2608fba0087abd5e00c449935a29..05193311046d990f6603e37a81df3ad05504ba5e 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/menu/SignatureDicts.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/SignatureDicts.py
@@ -115,7 +115,7 @@ JetChainParts = {
                       'cleanLA','cleanTA','cleanLLPA', 'noCleaning'
                       ],
     'recoAlg'      : ["a3","a4", "a10", "a10r", "a10t"],
-    'dataType'     : ['TT', 'tc', 'cc', 'ion'],
+    'dataType'     : ['TT', 'tc', 'cc', 'ion', 'sktc'],
     'calib'        : ["had","lcw","em"],
     'jetCalib'     : ["jes","sub","subjes","subjesIS", "nojcalib"],
     'scan'         : ['FS','PS'],
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py
index 4c47e67a74067a4c1e4877f95eccd6f75168cb2d..bdd64dd97058a9b083d953ee1149bc17022018ba 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py
@@ -2,7 +2,8 @@
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from AthenaCommon.CFElements import seqAND
 from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig import decisionTree_From_Chains, \
-    generateDecisionTree
+    generateDecisionTreeOld
+from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig_newJO import generateDecisionTree
 
 from AthenaCommon.Logging import logging
 from AthenaCommon.Constants import VERBOSE,INFO,DEBUG
@@ -40,10 +41,6 @@ def generateMenu( flags ):
     menuChains = []
     allChainDicts =[]
 
-    menuAcc = ComponentAccumulator()
-    mainSequenceName = 'HLTAllSteps'
-    menuAcc.addSequence( seqAND(mainSequenceName) )
-
     chainAccumulators = []
 
     for name, cfgFlag in list(flags._flagdict.iteritems()):
@@ -80,15 +77,22 @@ def generateMenu( flags ):
 
     _log.info('Obtained Menu Chain objects')
 
-    # pass all menuChain to CF builder    
-
+    # pass all menuChain to CF builder
+    useReworked = True
 
-    chainsAcc = generateDecisionTree(menuAcc.getSequence(mainSequenceName), menuChains, allChainDicts)
-    chainsAcc.printConfig()
+    if useReworked:
+        menuAcc = generateDecisionTree(menuChains, allChainDicts)
+    else:
+        menuAcc = ComponentAccumulator()
+        mainSequenceName = 'HLTAllSteps'
+        menuAcc.addSequence( seqAND(mainSequenceName) )
+        chainsAcc = generateDecisionTreeOld(menuAcc.getSequence(mainSequenceName), menuChains, allChainDicts)
+        menuAcc.merge(chainsAcc)
 
-    menuAcc.merge( chainsAcc )
     menuAcc.printConfig()
 
+    # kaboom
+
     _log.info('CF is built')
 
     return menuAcc
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py
index a58680657daedd0b9700531c9fd00da969d4ddd7..32d650c939522aa800dba327c15c557466312cbb 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py
@@ -6,7 +6,6 @@ from AthenaCommon.Logging import logging
 from AthenaCommon.AlgSequence import dumpSequence
 from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFDot import  stepCF_DataFlow_to_dot, stepCF_ControlFlow_to_dot, all_DataFlow_to_dot
 from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponentsNaming import CFNaming
-from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 
 import sys
 import copy
@@ -65,6 +64,7 @@ def createCFTree(CFseq):
     for menuseq in CFseq.step.sequences:
         ath_sequence = menuseq.sequence.Alg
         name = ath_sequence.name()
+        print('5555555 ATH SEQUENCE NAME ---- ', name)
         if name in already_connected:
             log.debug("AthSequencer %s already in the Tree, not added again",name)
         else:
@@ -330,7 +330,11 @@ def decisionTree_From_Chains(HLTNode, chains, allDicts):
     return finalDecisions
 
 
-def generateDecisionTree(HLTNode, chains, allChainDicts):
+"""
+Not used, kept for reference and testing purposes
+To be removed in future
+"""
+def generateDecisionTreeOld(HLTNode, chains, allChainDicts):
     log.debug("Run decisionTree_From_Chains on %s", HLTNode.name())
     from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
     acc = ComponentAccumulator()
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig_newJO.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig_newJO.py
new file mode 100644
index 0000000000000000000000000000000000000000..707c700706c080c4aad8d9514fd625358d7ca8bc
--- /dev/null
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig_newJO.py
@@ -0,0 +1,117 @@
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+
+from collections import defaultdict
+
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponentsNaming import CFNaming
+from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import CFSequence
+from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig import buildFilter, makeSummary
+from AthenaCommon.CFElements import parOR, seqAND, seqOR, findOwningSequence
+from AthenaCommon.Logging import logging
+from AthenaCommon.Constants import VERBOSE
+
+log = logging.getLogger('HLTCFConfig_newJO')
+log.setLevel( VERBOSE )
+
+
+def connectStepToFilter(chainStep, filterNode):
+    filter_output = filterNode.getOutputList()
+    if len(filter_output) == 0:
+        raise ValueError('ERROR: no filter outputs are set')
+
+    if len(filter_output) != len(chainStep.sequences):
+        msg = 'ERROR: found {} filter outputs and {} MenuSequences in step {}'.format(len(filter_output),
+            len(chainStep.sequences), chainStep.name)
+        raise ValueError(msg)
+
+    for nseq, sequence in enumerate(chainStep.sequences):
+        output = filter_output[nseq]
+        log.debug("Found input %s to sequence::%s from Filter::%s (from seed %s)", output,
+                  sequence.name, filterNode.Alg.name(), sequence.seed)
+        sequence.connectToFilter(output)
+
+
+def generateDecisionTree(chains, allChainDicts):
+    from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+    from collections import defaultdict
+    from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import CFSequence
+    from AthenaCommon.CFElements import findOwningSequence
+
+    acc = ComponentAccumulator()
+    mainSequenceName = 'HLTAllSteps'
+    acc.addSequence( seqAND(mainSequenceName) )
+
+    log.debug('Generating decision tree with main sequence: {}'.format(mainSequenceName))
+
+    chainStepsMatrix = defaultdict(lambda: defaultdict(list))
+
+    ## Fill chain steps matrix
+    for chain in chains:
+        for stepNumber, chainStep in enumerate(chain.steps):
+            chainName = chainStep.name.split('_')[0]
+            chainStepsMatrix[stepNumber][chainName].append(chain)
+
+    allSequences = []
+
+    ## Matrix with steps lists generated. Creating filters for each cell
+    for nstep in chainStepsMatrix:
+        stepDecisions = []
+
+        stepName = 'Step{}'.format(nstep)
+
+        stepFilterNodeName = '{}{}'.format(stepName, CFNaming.FILTER_POSTFIX)
+        filterAcc = ComponentAccumulator()
+        filterAcc.addSequence( parOR(stepFilterNodeName) )
+
+        stepRecoNodeName = '{}_{}'.format(mainSequenceName, stepName)
+        recoAcc = ComponentAccumulator()
+        recoAcc.addSequence( parOR(stepRecoNodeName) )
+
+        for chainName in chainStepsMatrix[nstep]:
+            chainsInCell = chainStepsMatrix[nstep][chainName]
+
+            if not chainsInCell:
+                # If cell is empty, there is nothing to do
+                continue
+
+            firstChain = chainsInCell[0]
+            if nstep == 0:
+                filter_input = firstChain.group_seed
+            else:
+                filter_input = [output for sequence in firstChain.steps[nstep - 1].sequences for output in sequence.outputs]
+
+            # One aggregated filter per chain (one per column in matrix)
+            filterName = 'Filter_{}'.format( firstChain.steps[nstep].name )
+            sfilter = buildFilter(filterName, filter_input)
+            filterAcc.addEventAlgo(sfilter.Alg, sequenceName = stepFilterNodeName)
+
+            chainStep = firstChain.steps[nstep]
+            stepReco = parOR('{}{}'.format(chainStep.name, CFNaming.RECO_POSTFIX))
+            stepView = seqAND('{}{}'.format(chainStep.name, CFNaming.VIEW_POSTFIX), [stepReco])
+            viewWithFilter = seqAND(chainStep.name, [sfilter.Alg, stepView])
+            recoAcc.addSequence(viewWithFilter, parentName = stepRecoNodeName)
+
+            stepsAcc = ComponentAccumulator()
+
+            for chain in chainsInCell:
+                for seq in chain.steps[nstep].sequences:
+                    if seq.ca is None:
+                        raise ValueError('ComponentAccumulator missing in sequence {} in chain {}'.format(seq.name, chain.name))
+                    stepsAcc.merge( seq.ca )
+                    recoAcc.addEventAlgo( seq.hypo.Alg, sequenceName = stepView.getName() )
+                sfilter.setChains(chain.name)
+
+            recoAcc.merge(stepsAcc, sequenceName = stepReco.getName())
+
+            connectStepToFilter(chainStep, sfilter)
+
+            for sequence in chainStep.sequences:
+                stepDecisions += sequence.outputs
+
+        acc.merge(filterAcc, sequenceName = mainSequenceName)
+        acc.merge(recoAcc, sequenceName = mainSequenceName)
+
+        summary = makeSummary('TriggerSummary{}'.format(stepName), stepDecisions)
+        acc.addSequence(summary, parentName = mainSequenceName)
+
+    return acc
\ No newline at end of file
diff --git a/graphics/VP1/VP1Gui/src/VP1ExecutionScheduler.cxx b/graphics/VP1/VP1Gui/src/VP1ExecutionScheduler.cxx
index bac60a9e21fcbb5e4e9f02a37651d12fae81b131..ec8fb3174470386cc27d4ff9cd7dda83650bf4cd 100644
--- a/graphics/VP1/VP1Gui/src/VP1ExecutionScheduler.cxx
+++ b/graphics/VP1/VP1Gui/src/VP1ExecutionScheduler.cxx
@@ -213,10 +213,13 @@ VP1ExecutionScheduler::VP1ExecutionScheduler( QObject * parent,
 	m_d->scheduler = this;
 	m_d->prioritiser = new VP1Prioritiser(this);
 	m_d->mainwindow = new VP1MainWindow(this,availEvents);//mainwindow takes ownership of available events
-	m_d->batchMode = false;
+	
+    m_d->batchMode = false;
 	m_d->batchUtilities = nullptr;
 	m_d->batchModeAllEvents = false;
 	m_d->batchModeNEvents = 0;
+    m_d->batchModeRandomConfig = false;
+
 	m_d->allSystemsRefreshed = false;
 	m_d->goingtonextevent=true;
 	m_d->currentsystemrefreshing=0;
@@ -386,12 +389,15 @@ VP1ExecutionScheduler* VP1ExecutionScheduler::init( StoreGateSvc* eventStore,
 	if (joboptions.empty()) {
 		//scheduler->m_d->mainwindow->tabManager()->addNewTab("My Tab");
 	} else {
+        qDebug() << "config files: " << joboptions; // DEBUG
 		foreach(QString opt,joboptions)
     		  scheduler->m_d->mainwindow->loadConfigurationFromFile(opt);
 
 		if ( scheduler->m_d->batchMode ) {
 			if (scheduler->m_d->batchModeRandomConfig ) {
-				scheduler->m_d->batchUtilities = new VP1BatchUtilities( qstringlistToVecString(joboptions) );
+                if (joboptions.size() != 0 ) {
+				    scheduler->m_d->batchUtilities = new VP1BatchUtilities( qstringlistToVecString(joboptions) );
+                }
 			}
 			QString batchNevents = VP1QtUtils::environmentVariableValue("VP1_BATCHMODE_NEVENTS");
 			if (batchNevents > 0 ) {